Redirecting to previous URL

Reply

Join Date: Mar 2009
Posts: 23
Reputation: itsrahulk is an unknown quantity at this point 
Solved Threads: 0
itsrahulk itsrahulk is offline Offline
Newbie Poster

Redirecting to previous URL

 
0
  #1
Jul 30th, 2009
hi,

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

user has come from the url

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

where add data button is placed

to
  1. 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/go...iewimage/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.
Rahul K

They say, its not possible. Well it is, and relatively easy to accomplish!
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 234
Reputation: PoA is an unknown quantity at this point 
Solved Threads: 8
PoA PoA is offline Offline
Posting Whiz in Training

Re: Redirecting to previous URL

 
0
  #2
Jul 30th, 2009
Try this code
  1. header('Location: '.$_SERVER['HTTP_REFERER']);
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 23
Reputation: itsrahulk is an unknown quantity at this point 
Solved Threads: 0
itsrahulk itsrahulk is offline Offline
Newbie Poster

Re: Redirecting to previous URL

 
0
  #3
Jul 30th, 2009
Originally Posted by PoA View Post
Try this code
  1. header('Location: '.$_SERVER['HTTP_REFERER']);


it's not working.
Rahul K

They say, its not possible. Well it is, and relatively easy to accomplish!
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 232
Reputation: samarudge is an unknown quantity at this point 
Solved Threads: 19
samarudge samarudge is offline Offline
Posting Whiz in Training

Re: Redirecting to previous URL

 
0
  #4
Jul 30th, 2009
  1. header('Location: '."http://".$_SERVER['HTTP_REFERER']);
Try that one out
My Blog, Life and everything that matters to me - SamRudge.co.uk

2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC