hi peoples, Im going insane here, I have this script working great except
two things ...
for one , the sql query returns an error that couldnt run the query...
and the second is that the variable $user_reg[2] holds nothing even though
I cheked the html form and also checked the cookie variable and all are set
except [2] .
heres my script snippet:
--
...
$user_reg[0] = $user_name;
$user_reg[1] = $pass_w;
$user_reg[2] = $full_name;
$user_reg[3] = $email;
$user_reg[4] = $age;
$user_reg[5] = $icq;
$user_reg[6] = $aim;
function add_newuser() {
$date = gmdate ( "M d Y H:i:s" );
$sql = "INSERT INTO mytable (user_name, pass_w, full_name, email,
age, icq, aim, date) VALUES ('$user_reg[0]', '$user_reg[1]', '$user_reg[2]',
'$user_reg[3]', '$user_reg[4]', '$user_reg[5]', '$user_reg[6]', '$date')";
$connection = mysql_connect("localhost", "mylog", "mypass") or die
("Could not connect to database");
$db = mysql_select_db("mydb",$connection);
$sql_result = mysql_query($sql, $connection) or die ("Couldnt run
query");
}
?>
<?
if (isset($newuse) AND $newuse == "yes") {
$lifetime = time() + 180 * 86400;
setcookie ("user_reg[0]" , "$user_name", $lifetime, "/",
".mydotcom.com");
setcookie ("user_reg[1]" , "$pass_w", $lifetime, "/", ".mydotcom.com");
setcookie ("user_reg[2]" , "$full_name", $lifetime, ".mydotcom.com");
setcookie ("user_reg[3]" , "$email", $lifetime, "/", ".mydotcom.com");
setcookie ("user_reg[4]" , "$age", $lifetime, "/", ".mydotcom.com");
setcookie ("user_reg[5]" , "$icq", $lifetime, "/", ".mydotcom.com");
setcookie ("user_reg[6]" , "$aim", $lifetime, "/", ".mydotcom.com");
add_newuser();
--
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]