Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2010
    Posts
    46
    Thanks
    1
    Thanked 1 Time in 1 Post

    Execute a url from a php file (server side)

    How do you execute a url from a php file (server side) and have it come up in the current browser?

  • #2
    New Coder
    Join Date
    Feb 2012
    Posts
    18
    Thanks
    0
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Philosophaie View Post
    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:
    Code:
    header("Refresh: time_to_wait; url=your_url");
    or
    Code:
    header("Location: your_url");
    If you need more information let me know.
    Thanks
    Mahdi Eftekhari

  • #3
    New Coder
    Join Date
    Sep 2010
    Posts
    46
    Thanks
    1
    Thanked 1 Time in 1 Post
    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:

    Code:
    header('Location: http://www.google.com');
    I put nothing in front of it. This error:

    Code:
    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?
    Last edited by Philosophaie; 02-20-2012 at 07:13 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •