hi,

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

user has come from the url

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

where add 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);

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


Thanks.

Recommended Answers

All 3 Replies

Try this code

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

Try this code

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

it's not working.

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

Try that one out

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.