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 6 of 6
  1. #1
    Regular Coder
    Join Date
    Feb 2003
    Location
    California
    Posts
    925
    Thanks
    0
    Thanked 0 Times in 0 Posts

    possible URL redirect?

    Ok, is it possible to do a redirect of the URL using PHP or do I have to use JavaScript?

    Jason

  • #2
    New Coder
    Join Date
    Jun 2002
    Location
    hamilton,ontario
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow

    You should be more specific. What exactly are you trying to do?
    The reason I say is that you can just use a meta tag to forward a page to a new one.


    http-equiv="refresh" content="5;URL=http://www.yoursite.com"


    Where 5 is the time in seconds you wish the page to be displayed.
    whittys.com
    Nomsane?
    That is all

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    This little Earth.
    Posts
    383
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <?php
    header("Location: http://www.whatever_site.com");
    ?>
    'If you don't stand for something, you'll fall for anything.'

  • #4
    Regular Coder
    Join Date
    Feb 2003
    Location
    California
    Posts
    925
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well, I asked a similar question in the JavaScript section but here goes. I have a link you my page which is dynamic so its something like www.codingforums.com?date=20020310 for example. Where the int $date changes based on a date the user chooses. Well, the user gets to the page and is given some options. They click the appropriate check boxes and then the submit button. After the submit button I want to take the values from the check boxes and insert them into a DB with the date. However the date in the URL is erased and the page refreshes so its not there after the submit button is hit. So I want the URL to be unchanged. or go back to its original state with the ....date=20020310 at the end. So I thought a redirect would be appropriate.

    Jason

  • #5
    Regular Coder
    Join Date
    Jul 2002
    Location
    This little Earth.
    Posts
    383
    Thanks
    0
    Thanked 0 Times in 0 Posts
    how about using hidden input?
    like u can put something like this on the form with the checkboxes:
    Code:
    <?php
    echo("<input type='hidden' name='vanishingdate' value='".$_GET['date_from_prev_page']."'>");
    ?>
    <input type='submit' value='go get it!'>
    then when the form is submitted, vanishingdate=20030310 will be appended to the query string, and the on the next page you can access the date like so:

    $thedate=$_GET['vanishingdate'];

    might help might not, not sure i got ur question.
    g'luck
    'If you don't stand for something, you'll fall for anything.'

  • #6
    Regular Coder
    Join Date
    Feb 2003
    Location
    California
    Posts
    925
    Thanks
    0
    Thanked 0 Times in 0 Posts

    reply to ASAAKI

    thanks, that worked...I didn't really want to do it that way, but it works.

    oh btw, it wasn't $_GET it was $_POST to get the variable name.


    Jason


  •  

    Posting Permissions

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