|
|
#1 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Sep 2005
6 posts
Gave thanks: 2
Thanked 0 times
|
URL query string help
I might not be looking in the right place, but I can't seem to fiind what I need anywhere. I have a php script that looks up user information from a ldap database from information that is taken from a login form. Right now I just have the information to display on the screen and that part works fine ( the display is just for testing) What I am needing to do is to take some of the strings and put them into a url something like http://www.page.html?username=xxxxxx...tion=xxxxxxxxx. I have the data in $username and $location. I have done this before with a A href, but that required clicking on a link. This php script needs to redirect to the next page as soon as the information is located. When I tried to do this with header("location:www.page.html?username=$username& location=$location") the url did not have the data in it. I just got: www.page.html?username=$username&location=$locatio n. What command do I need to use?
I tried to search every way that I could think of and am not making any progress at all. If it can be done I know that one of the good experts here will know how to do it. Thanks |
|
|
|
|
|
#2 (permalink) |
|
Surpass Developer
On a golden path...
Joined in Jan 2004
Lives in Florida
Hosted on decc.surpasshosting.com
|
Check to make sure the string inside your header function is wrapped in double quotes, not single quotes.
Also, are you sure you are populating $username and $password? Try echoing them first to see if they contain any actual data
__________________
Mark Surpass Hosting Developer sɹnoʎ uɐɥʇ ɹǝʇʇǝq sı bıs ʎɯ |
|
|
|
| This user thanks Mark for this great post! | jonest454 (November 5th, 2007) |
|
|
#3 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Sep 2004
8 posts
Gave thanks: 1
Thanked 1 Time in 1 Post
|
Give the following a try:
<?php //code to resolve username / and location here $newUrl = "www.page.html?username=".$username."&location=".$ location; header("location:".$newUrl); ?> |
|
|
|
| This user thanks Zedd for this great post! | jonest454 (November 5th, 2007) |
|
|
#4 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Sep 2005
6 posts
Gave thanks: 2
Thanked 0 times
|
Thanks
Thanks a lot for the help. I had tried what Zedd had suggested already, but I had used single quotes and it did not work. It was the double quotes. Again thanks for the help.
|
|
|
|