Page 2 of 2

Posted: Fri Aug 01, 2003 7:58 pm
by nick2
how do I make it work with,

Code: Select all

<?php
setcookie("logged_in", $_POST['ID'], 0); 

?>

Posted: Fri Aug 01, 2003 8:06 pm
by nielsene
I don't know. You didn't say why it doesn't work. I see noting obviously wrong with the above line, so its not a parse error.....

Do you have a page that submits to this page? Does that page
a) have a form with method=post
b) have a field named ID

Have you reached this page via the page with the form?

Posted: Fri Aug 01, 2003 8:16 pm
by nick2
a and b, itsgetting the feild name called ID.. but everytime I run script it says:

Parse error: parse error in /home/virtual/site9/fst/var/www/html/tradingsystem/auth_user.php on line 21

erm :(

Posted: Fri Aug 01, 2003 9:22 pm
by nielsene
And what are lines 19-23? parse errors are often off by 1-2 line numbers.

Posted: Fri Aug 01, 2003 11:25 pm
by jmarcv
nick2 , yes, I guess nielsene explained it right. By passing user_id, it it is ANY number, they are logged it, AND you can do a query to find out WHO it is, as you requested.

Posted: Sat Aug 02, 2003 9:58 am
by nick2
nielsene wrote:And what are lines 19-23? parse errors are often off by 1-2 line numbers.

Code: Select all

<?php
#cookies#
setcookie("logged_in", $_POST['ID'],0);
#
echo "<P>You were logged in successfuly</P>";
echo "<a href=index.php>Home</a>";
} else {
header("location: Http://slices.net/tradingsystem/login.php");
exit;
}
?>
?>

Posted: Sat Aug 02, 2003 10:18 am
by jmarcv
19-23 is 4 lines. You show 9 lines of code. You don't tell us which line has the parse error. You can be very unhelpful at times....

My guess would be possibly the incorrect exit; instead of exit();

We will assume you have a proper and corresponding IF statement to your } ELSE {
?

Then again, it is probably a new module of PHP that sees that 'successfuly' is mispelded

Posted: Sat Aug 02, 2003 10:33 am
by nick2
I got it working thanks to everyone of you.. now my next challenge.. *sending mail* :p

Posted: Sat Aug 02, 2003 10:43 am
by jmarcv
... uh oh!!!!!! ....