Jump to a page

Discussion in 'HTML' started by Richard, Feb 20, 2004.

  1. Richard

    Richard Guest

    I'm trying to find a simple way to jump to another page after a user input.

    e.g.

    Enter reference : User inputs 1234 Send

    User sent to www.mypage.com/1234

    Hope this is clear and you may be able to help

    I'd like to be able to do it in just HTML
    If not javascript or PHP

    Many Thanks

    Richard
     
    Richard, Feb 20, 2004
    #1
    1. Advertising

  2. Richard

    toylet Guest

    you have to use javascript.

    > Enter reference : User inputs 1234 Send
    > User sent to www.mypage.com/1234
    > I'd like to be able to do it in just HTML
    > If not javascript or PHP


    --
    .~. Might, Courage, Vision. In Linux We Trust.
    / v \ http://www.linux-sxs.org
    /( _ )\ Linux 2.4.22-xfs
    ^ ^ 1:52am up 2:12 1 user 1.00 1.00
     
    toylet, Feb 20, 2004
    #2
    1. Advertising

  3. Richard

    Paul Furman Guest

    PHP will work even if someone has javascript turned off. Search
    www.php.net for the header function.

    toylet wrote:

    > you have to use javascript.
    >
    >> Enter reference : User inputs 1234 Send
    >> User sent to www.mypage.com/1234
    >> I'd like to be able to do it in just HTML
    >> If not javascript or PHP

    >
    >
     
    Paul Furman, Feb 20, 2004
    #3
  4. "Richard" <> skrev i melding
    news:...
    > I'm trying to find a simple way to jump to another page after a user

    input.
    >
    > e.g.
    >
    > Enter reference : User inputs 1234 Send
    >
    > User sent to www.mypage.com/1234
    >
    > Hope this is clear and you may be able to help
    >
    > I'd like to be able to do it in just HTML
    > If not javascript or PHP
    >
    > Many Thanks
    >
    > Richard


    It's simple using PHP. If your form has GET or POST, and the input is called
    "usr" you can do something like this:
    ----------------------------------------
    import_request_variables("gp","in_");
    if (isset($in_usr)) { header("Location: http://www.mypage.com/".$in_usr); }
    else { header("Location: http://www.mypage.com/"); }
    ----------------------------------------

    http://www.php.net/import_request_variables
    http://www.php.net/header

    --
    Kim André Akerø
    -
    (remove NOSPAM to contact me directly)
     
    Kim André Akerø, Feb 21, 2004
    #4
  5. Richard

    Richard Guest

    Paul Furman <> wrote in message news:<>...
    > PHP will work even if someone has javascript turned off. Search
    > www.php.net for the header function.


    Many thanks Paul you go me on track.

    For all you at home here's how I solved my problem.

    In one html file have a form thus.

    <form name="Goto" method="post" action="redir.php">
    <input type="text" name="url">
    <input type="submit" name="send" value="send">
    </form>

    In a file redir.php

    Have just

    <?php
    $url = "http://www.yourwebsite here.com/"+$_POST["url"];
    header("Location: $url"); /* Redirect browser */

    /* Make sure that code below does not get executed when we redirect. */
    exit;
    ?>

    Other usefull places to get help.

    http://www.lampscripts.net/
    http://www.webmasterworld.com/forum88/749.htm
    http://forums.devarticles.com/archive/t-5907
    and of course
    http://www.php.net/manual/en/function.header.php

    Happy redirecting

    :)

    R
     
    Richard, Mar 6, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VB Programmer
    Replies:
    2
    Views:
    481
    VB Programmer
    Oct 23, 2003
  2. =?Utf-8?B?TWVyZGFhZA==?=

    Edit on Datagrid causes the page to jump on the screen

    =?Utf-8?B?TWVyZGFhZA==?=, Aug 15, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    388
    Teemu Keiski
    Aug 16, 2005
  3. Jim
    Replies:
    3
    Views:
    16,076
    Ron & Beth
    Sep 16, 2003
  4. VanguardLH
    Replies:
    13
    Views:
    1,212
    dorayme
    Mar 2, 2011
  5. Eadwine Rose
    Replies:
    2
    Views:
    221
    Eadwine Rose
    Oct 15, 2006
Loading...

Share This Page