php from 4 to 5

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
My hosting ptovider ugraded to php 5.0 and my form no longer works.

The form calls a hp file that stores all the infomrtion in a datbase.
The verbols are all blank now. This is the php code the form calls


// connect to databse
if (!($dblink =
  die(" could not connect to mysal");

if (!$dbconn = mysql_select_db("tedpott_chamber",$dblink))
  die(" Could not connect to databse ");
 // veribols to be stored in databse

  $sql="INSERT INTO `tedpott_chamber`.`ratings`
  $sql=$sql." VALUES ('".$first_name."','".$last_name."','".

  if (!$results=mysql_query($sql,$dblink))
   die("<br> could not add your comment");

   echo "state="+$state
   echo "Comment Added, Thank You"

The verbols, $city, $mail are alwyas empty!!!!

Re: php from 4 to 5

On Thu, 27 Sep 2007 02:35:40 +0200,  

Quoted text here. Click to load it

Check register_globals, why they're bad, and adjust your code accordingly.
Rik Wasmus

Re: php from 4 to 5

Quoted text here. Click to load it

This should be $_POST['first_name'] and such ;), because that's the
information that comes from the form. And wow... people still use
register_globals? I mean, no offense, but it's awkward, when one NEVER
used them.

Re: php from 4 to 5

Quoted text here. Click to load it

Well, I did, years and years ago, when I just started fiddling about in  
PHP. Still, more then half the jobs I get hired for to adjust existing  
code depend on it some way or another. Old habits, and old code, die hard  
I suppose.
Rik Wasmus

Site Timeline