PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Mark817
Forum Newbie
Posts: 2 Joined: Tue Jun 03, 2003 2:39 am
Post
by Mark817 » Tue Jun 03, 2003 2:39 am
I have a login system setup using sessions; each user has an html page with information they need displayed. After logging in I'd like for the user to be redirected directly to that page. Can I make location:url a partial variable?
ex:
Code: Select all
<?php
header(location:'http://www.orphanivy.net/users/'.'&user_name.''.html');
?>
How would I parse that so it would work?
[]InTeR[]
Forum Regular
Posts: 416 Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands
Post
by []InTeR[] » Tue Jun 03, 2003 3:01 am
[start correction everything mode]
If you follow the rfc's you need to have a space between location and the url. and it's ucfirst("location");
[end correction everything mode]
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Tue Jun 03, 2003 3:09 am
ok ok
Code: Select all
header('Location: http://www.orphanivy.net/users/'. $user_name . '.html');
Mark817
Forum Newbie
Posts: 2 Joined: Tue Jun 03, 2003 2:39 am
Post
by Mark817 » Tue Jun 03, 2003 3:18 am
Thanks for the help. Ill read up on strings.
Another problem im having is with msql_num_rows();
here is my code
Code: Select all
<?php
$result = MYSQL_QUERY($query, $conn);
$affected_rows = mysql_num_rows($result);
?>
My errors..
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Group\Apache2\htdocs\login.php on line 14
Any ideas?
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Tue Jun 03, 2003 3:46 am
probably your query failed
Code: Select all
$result = mysql_query($query, $conn) or die($query. ': '. mysql_error());