954,576 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Redirecting to previous URL

hi,

i am redirecting user to previous page after adding the data.

user has come from the url

http://localhost/goaweb/admin/viewimage/54400


whereadd data button is placed

to

http://localhost/goaweb/admin/addpic/NTQ0MDA=


for adding the data (add data page)

now i am rediirecting the browser to preview URL from where he came to add data page.

i am using header('Location:'.$_SERVER['HTTP_REFERER']);

but it's giving me URL like http://localhost/http://localhost/goaweb/admin/viewimage/54400

which is incorrect redirection

could anybody please tell me how can i make it woking like this URL
http://localhost/goaweb/admin/viewimage/54400 with $_SERVER['HTTP_REFERER']


Thanks.

itsrahulk
Newbie Poster
23 posts since Mar 2009
Reputation Points: 10
Solved Threads: 0
 

Try this code

header('Location: '.$_SERVER['HTTP_REFERER']);
PoA
Posting Whiz in Training
237 posts since Jul 2004
Reputation Points: 26
Solved Threads: 9
 

Try this code

header('Location: '.$_SERVER['HTTP_REFERER']);

it's not working.

itsrahulk
Newbie Poster
23 posts since Mar 2009
Reputation Points: 10
Solved Threads: 0
 
header('Location: '."http://".$_SERVER['HTTP_REFERER']);

Try that one out

samarudge
Posting Whiz
359 posts since May 2008
Reputation Points: 26
Solved Threads: 31
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You