solarcom
03-28-2008, 07:39 AM
:confused: :mad: This worked in php4 ,but it doesn't work in Php5, the 'id' and 'active' are inserted but the variable values aren't. i get empty fields
I tried without the
$na=$_POST[$name];
$em=$_POST[$email];
lines and got the same result, using (NULL,'$name','$email','active')"; instead of (NULL,'$na','$em','active')";
Also get the same result with no "`" around the column names. I also tried single quotes after the = sign and at the end instead of double and got a T_varible error message. This is part of a larger script and everything else works, just this rather neccessary part, there are no repeated varible names, and I've tried exactly as shown in its own little script and keep getting no data inserted in the varible fields
before everything was inserted
id name email status
20 Debbie notrealemail@com.ca active
now I get
id name email status
21 blankspace blankspace active
<?php
include("connect.php");
include("header.php");
?>
<FORM METHOD="post" ACTION="insertdatav.php">
<p>Name <INPUT TYPE="text" NAME="name" SIZE="30"><br><br>
<p>Email <INPUT TYPE="text" NAME="email" SIZE="30"><br><br>
<INPUT TYPE="submit" NAME="submit" VALUE="Join"></FORM>
<?php
include("footer.php");
?>
insertdatav.php :
<?php
include("connect.php");
$na=$_POST[$name];
$em=$_POST[$email];
$sql="INSERT INTO list (`id`,`name`,`email`,`status`) VALUES (NULL,'$na','$em','active')";
mysql_query($sql);
include("test.php");
?>
And is there a way around the VERY ANNOYING fact that you can't use a full path name with include? Seriously, if the decision was mine that alone would be enough reason roll back to php 4. I got 15 folders for some websites, more being added, and copying the header, footer and connect files in every folder is RIDICULOUS
I tried without the
$na=$_POST[$name];
$em=$_POST[$email];
lines and got the same result, using (NULL,'$name','$email','active')"; instead of (NULL,'$na','$em','active')";
Also get the same result with no "`" around the column names. I also tried single quotes after the = sign and at the end instead of double and got a T_varible error message. This is part of a larger script and everything else works, just this rather neccessary part, there are no repeated varible names, and I've tried exactly as shown in its own little script and keep getting no data inserted in the varible fields
before everything was inserted
id name email status
20 Debbie notrealemail@com.ca active
now I get
id name email status
21 blankspace blankspace active
<?php
include("connect.php");
include("header.php");
?>
<FORM METHOD="post" ACTION="insertdatav.php">
<p>Name <INPUT TYPE="text" NAME="name" SIZE="30"><br><br>
<p>Email <INPUT TYPE="text" NAME="email" SIZE="30"><br><br>
<INPUT TYPE="submit" NAME="submit" VALUE="Join"></FORM>
<?php
include("footer.php");
?>
insertdatav.php :
<?php
include("connect.php");
$na=$_POST[$name];
$em=$_POST[$email];
$sql="INSERT INTO list (`id`,`name`,`email`,`status`) VALUES (NULL,'$na','$em','active')";
mysql_query($sql);
include("test.php");
?>
And is there a way around the VERY ANNOYING fact that you can't use a full path name with include? Seriously, if the decision was mine that alone would be enough reason roll back to php 4. I got 15 folders for some websites, more being added, and copying the header, footer and connect files in every folder is RIDICULOUS