943,696 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1545
  • PHP RSS
Jul 30th, 2009
0

Redirecting to previous URL

Expand Post »
hi,

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

user has come from the url

PHP Syntax (Toggle Plain Text)
  1. http://localhost/goaweb/admin/viewimage/54400

where add data button is placed

to
PHP Syntax (Toggle Plain Text)
  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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
itsrahulk is offline Offline
23 posts
since Mar 2009
Jul 30th, 2009
0

Re: Redirecting to previous URL

Try this code
php Syntax (Toggle Plain Text)
  1. header('Location: '.$_SERVER['HTTP_REFERER']);
PoA
Reputation Points: 19
Solved Threads: 9
Posting Whiz in Training
PoA is offline Offline
234 posts
since Jul 2004
Jul 30th, 2009
0

Re: Redirecting to previous URL

Click to Expand / Collapse  Quote originally posted by PoA ...
Try this code
php Syntax (Toggle Plain Text)
  1. header('Location: '.$_SERVER['HTTP_REFERER']);


it's not working.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
itsrahulk is offline Offline
23 posts
since Mar 2009
Jul 30th, 2009
0

Re: Redirecting to previous URL

php Syntax (Toggle Plain Text)
  1. header('Location: '."http://".$_SERVER['HTTP_REFERER']);
Try that one out
Reputation Points: 26
Solved Threads: 31
Posting Whiz
samarudge is offline Offline
354 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Help with Dynamic Forms
Next Thread in PHP Forum Timeline: Netbeans problem with form





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC