...

View Full Version : Execute a url from a php file (server side)



Philosophaie
02-20-2012, 04:52 PM
How do you execute a url from a php file (server side) and have it come up in the current browser?

Mahdi Eftekhari
02-20-2012, 05:11 PM
How do you execute a url from a php file (server side) and have it come up in the current browser?

You need to use header function. You can use one of the following forms:

header("Refresh: time_to_wait; url=your_url");
or

header("Location: your_url");

If you need more information let me know.
Thanks
Mahdi Eftekhari

Philosophaie
02-20-2012, 07:48 PM
How does this work? Is there a special place in your php code.

I just entered it after the mysql_connect but nothing happened. What is the syntax:


header('Location: http://www.google.com');

I put nothing in front of it. This error:


Warning: Cannot modify header information - headers already sent by (output started at /home/rubeum/public_html/header.php:9) in /home/rubeum/public_html/header.php on line 16

Will this open to the current screen or a new one?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum