Page 1 of 1

header (loaction:url);

Posted: Tue Jun 03, 2003 2:39 am
by Mark817
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?

Posted: Tue Jun 03, 2003 2:45 am
by volka
try

Code: Select all

header('location:http://www.orphanivy.net/users/'. $user_name . '.html');
and have a read of http://php.net/language.types.string , http://php.net/language.operators.string

Posted: Tue Jun 03, 2003 3:01 am
by []InTeR[]
[start correction everything mode]
volka wrote:try

Code: Select all

header('location:http://www.orphanivy.net/users/'. $user_name . '.html');
and have a read of http://php.net/language.types.string , http://php.net/language.operators.string
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]
:)

Posted: Tue Jun 03, 2003 3:09 am
by volka
:wink:
ok ok

Code: Select all

header('Location: http://www.orphanivy.net/users/'. $user_name . '.html');

Posted: Tue Jun 03, 2003 3:18 am
by Mark817
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?

Posted: Tue Jun 03, 2003 3:46 am
by volka
probably your query failed

Code: Select all

$result = mysql_query($query, $conn) or die($query. ': '. mysql_error());