Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
nick2
Forum Contributor
Posts: 118 Joined: Fri Jul 25, 2003 2:34 pm
Post
by nick2 » Fri Aug 01, 2003 7:58 pm
how do I make it work with,
Code: Select all
<?php
setcookie("logged_in", $_POST['ID'], 0);
?>
nielsene
DevNet Resident
Posts: 1834 Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA
Post
by nielsene » Fri Aug 01, 2003 8:06 pm
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?
nick2
Forum Contributor
Posts: 118 Joined: Fri Jul 25, 2003 2:34 pm
Post
by nick2 » Fri Aug 01, 2003 8:16 pm
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
nielsene
DevNet Resident
Posts: 1834 Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA
Post
by nielsene » Fri Aug 01, 2003 9:22 pm
And what are lines 19-23? parse errors are often off by 1-2 line numbers.
jmarcv
Forum Contributor
Posts: 131 Joined: Tue Jul 29, 2003 7:17 pm
Location: Colorado
Post
by jmarcv » Fri Aug 01, 2003 11:25 pm
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.
nick2
Forum Contributor
Posts: 118 Joined: Fri Jul 25, 2003 2:34 pm
Post
by nick2 » Sat Aug 02, 2003 9:58 am
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;
}
?>
?>
jmarcv
Forum Contributor
Posts: 131 Joined: Tue Jul 29, 2003 7:17 pm
Location: Colorado
Post
by jmarcv » Sat Aug 02, 2003 10:18 am
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
nick2
Forum Contributor
Posts: 118 Joined: Fri Jul 25, 2003 2:34 pm
Post
by nick2 » Sat Aug 02, 2003 10:33 am
I got it working thanks to everyone of you.. now my next challenge.. *sending mail* :p
jmarcv
Forum Contributor
Posts: 131 Joined: Tue Jul 29, 2003 7:17 pm
Location: Colorado
Post
by jmarcv » Sat Aug 02, 2003 10:43 am
... uh oh!!!!!! ....