php from 4 to 5
am 27.09.2007 02:35:40 von tedpottel
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
// CURRTLY ON SERVER ALLTHINGSPHOTO\IMAGES
// connect to databse
if (!($dblink =
mysql_connect("libra.worldispnetwork.com","tedpott_user1","1 23icecream")))
{
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("
could not add your comment");
else
echo "state="+$state
echo "Comment Added, Thank You"
?>
The verbols, $city, $mail are alwyas empty!!!!
Re: php from 4 to 5
am 27.09.2007 02:41:34 von luiheidsgoeroe
On Thu, 27 Sep 2007 02:35:40 +0200, tedpottel@gmail.com
wrote:
> 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
Re: php from 4 to 5
am 27.09.2007 02:55:12 von ragearc
> 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.
Re: php from 4 to 5
am 27.09.2007 03:02:26 von luiheidsgoeroe
On Thu, 27 Sep 2007 02:55:12 +0200, RageARC wrote:
>> 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