Announcement

Collapse
No announcement yet.

Blank Entries in MySQL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Blank Entries in MySQL

    I'm running phpdev4 on my Win2K machine which is using:

    - Apache 1.3.27
    - PHP 4.2.3

    When I try to do something simple like create a page with this:
    Code:
    <a href="welcome.php?name=Keith">Welcome</a>
    and then the welcome.php page is:
    PHP Code:
    echo("Welcome to our website, $name!"); 
    it doesn't display my name.

    Even if I setup a form to insert data into a mysql database, the form works, but the entries into the db are blank. I uploaded the script on my server and tried it again and it works fine. Anyone have any ideas? I'm guessing it's to do with my php.ini file or one of those files. I tried reinstalling phpdev, but that didn't help. I'm stumped


  • #2
    enable register globals lol
    it's off by default since php 4.2.x afaik.
    you've got 3 possiblities to write your scripts now:
    a) turn register globals on
    b) use the superglobals $_GET, $_POST etc. ($_GET["name"] would be your $name) (which is the most secure way you can do it and the way it's meant to be)
    c) use @extract($_GET); @extract($_POST); etc. at the beginning of your script, though it's basically as risky as just turning register globals on.

    Comment


    • #3
      register_globals is already on. I turned it on myself.

      I'll try option b you mentioned and see if that works. Thanks

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X