Connecting Tech Pros Worldwide Forums | Help | Site Map

php from 4 to 5

tedpottel@gmail.com
Guest
 
Posts: n/a
#1: Sep 27 '07
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

<?php

// CURRTLY ON SERVER ALLTHINGSPHOTO\IMAGES
// connect to databse
if (!($dblink =
mysql_connect("libra.worldispnetwork.com","tedpott _user1","123icecream")))
{
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`
(`first_name`,`last_name`,`email`,`state`,`city`,` commet`)";
$sql=$sql." VALUES ('".$first_name."','".$last_name."','".
$email."','".$state."','".$city."','".$comment."') ";

if (!$results=mysql_query($sql,$dblink))
die("<brcould not add your comment");
else

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




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


Rik Wasmus
Guest
 
Posts: n/a
#2: Sep 27 '07

re: php from 4 to 5


On Thu, 27 Sep 2007 02:35:40 +0200, tedpottel@gmail.com
<tedpottel@gmail.comwrote:
Quote:
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
Check register_globals, why they're bad, and adjust your code accordingly.
--
Rik Wasmus
RageARC
Guest
 
Posts: n/a
#3: Sep 27 '07

re: php from 4 to 5


VALUES ('".$first_name."','".$last_name."','".
Quote:
$email."','".$state."','".$city."','".$comment."') ";
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.

Rik Wasmus
Guest
 
Posts: n/a
#4: Sep 27 '07

re: php from 4 to 5


On Thu, 27 Sep 2007 02:55:12 +0200, RageARC <ragearc@gmail.comwrote:
Quote:
Quote:
>VALUES ('".$first_name."','".$last_name."','".
>$email."','".$state."','".$city."','".$comment."' )";
>
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.
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
Closed Thread