#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Norcross, GA
    Posts
    458
    Rep Power
    15
    Is there a way to do this in my php script, or is this something the server folks have to do?

    Thanks,
    Mike
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Norcross, GA
    Posts
    458
    Rep Power
    15
    My hosting company wasn't much help.

    The problem I had was that certain chracters entered on a form were killinig my script.

    I solved this by using:


    $data = addslashes($data);

    prior to adding it to the database, and:


    $data = stripslashes($data);

    after pulling the data out, before printing it to the screen.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    32
    Rep Power
    15
    I'm curious about this too. I set up phpMyAdmin and I got an error because magic quotes weren't set. When I contacted the host provider, they said that you should be able to set this up in the script so it's not their problem. How do you mess with those types of variables in a php script (specially magic quotes)?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Norcross, GA
    Posts
    458
    Rep Power
    15
    The way I understand it, magic quotes are specified in the php.ini file. Some servers(hosting co's) use them, some don't. My hosting company does not make changes to thier php.ini file based on one clients request, and I gather that is how all of them operate.

    If your server doesn't have them enabled, you can do the same thing (manually) with the examples above.

    Feel free to correct as needed.

    - Mike
  8. #5
  9. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    62
    If you look at http://www.php.net/manual/configuration.php, it seems that PHP configuration directives can be specified on a per-directory level using Apache's .htaccess files (Assuming PHP is configured as an Apache module). I haven't played with this yet, but it should be quite easy, assuming you are using Apache.

Similar Threads

  1. problem with magic quotes
    By summercom in forum PHP Development
    Replies: 2
    Last Post: June 8th, 2003, 10:08 PM
  2. problem with magic quotes removing wanted \\
    By Lucent in forum PHP Development
    Replies: 4
    Last Post: May 22nd, 2003, 04:28 PM
  3. PHP3 magic quotes gpc/runtime detect/emulate blah blah
    By JeffCT in forum PHP Development
    Replies: 7
    Last Post: September 29th, 2001, 07:39 PM
  4. howto enable magic quotes
    By themadman in forum MySQL Help
    Replies: 1
    Last Post: September 19th, 2001, 11:24 PM
  5. Help storing uploaded files in DB with magic quotes!
    By MaRaNzA in forum PHP Development
    Replies: 0
    Last Post: August 19th, 2001, 04:20 PM

IMN logo majestic logo threadwatch logo seochat tools logo