so confused.

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

User avatar
nick2
Forum Contributor
Posts: 118
Joined: Fri Jul 25, 2003 2:34 pm

Post by nick2 »

how do I make it work with,

Code: Select all

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

?>
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post 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?
User avatar
nick2
Forum Contributor
Posts: 118
Joined: Fri Jul 25, 2003 2:34 pm

Post 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 :(
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

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 »

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.
User avatar
nick2
Forum Contributor
Posts: 118
Joined: Fri Jul 25, 2003 2:34 pm

Post 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;
}
?>
?>
jmarcv
Forum Contributor
Posts: 131
Joined: Tue Jul 29, 2003 7:17 pm
Location: Colorado

Post 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
User avatar
nick2
Forum Contributor
Posts: 118
Joined: Fri Jul 25, 2003 2:34 pm

Post by nick2 »

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 »

... uh oh!!!!!! ....
Post Reply