Need some help for Landing page

Discussion in 'General Scripting Chat' started by ferma231, Sep 5, 2012.

  1. ferma231

    ferma231 Elite Member

    Joined:
    Jul 14, 2011
    Messages:
    1,697
    Likes Received:
    3,516
    Location:
    Internet
    Im almost done with 1 website im making, but i need to get 1 thing done

    In 1st page, people need to enter Name and email , how can i get that redirected to next page, so name and email shows in URL
    like this : mydomainname.com/page2.php?name=Name&[email protected] ?

    Its PHP script i made in second page.
    Basically all what they enter on 1st page need to be showed on second page on text where are their name and email



    Also , you could add me on skype who want to help me out: gladiators112
     
  2. Lazlo1967

    Lazlo1967 Junior Member

    Joined:
    Aug 15, 2012
    Messages:
    198
    Likes Received:
    54
    Just use

    Code:
    $name=$_POST['name'];
    to extract the http vars into a new php var.
     
    • Thanks Thanks x 1
  3. SonicSam

    SonicSam Registered Member

    Joined:
    Aug 21, 2012
    Messages:
    57
    Likes Received:
    5
    Location:
    X
    If you specifically want the data to be in the URL, you do not want $_POST as Lazlo mentioned.

    You will want to make a simple GET HTTP form, then with PHP, access it on the next page via $_GET['variable']

    Simple example.

    Page 1:

    Code:
    <FORM METHOD=GET ACTION="page2.php">
    town: <INPUT NAME="town"><BR>
    <INPUT TYPE=SUBMIT>
    </FORM>
    
    Notice "method=get".

    Page 2 (PHP)

    Code:
    //Access the code via $_GET
    echo "The town you selected was " . $_GET['town'];
    
     
    • Thanks Thanks x 1
  4. ferma231

    ferma231 Elite Member

    Joined:
    Jul 14, 2011
    Messages:
    1,697
    Likes Received:
    3,516
    Location:
    Internet
    Okey, 1 sec will try this :)
     
  5. SonicSam

    SonicSam Registered Member

    Joined:
    Aug 21, 2012
    Messages:
    57
    Likes Received:
    5
    Location:
    X
    Solved it in PM by tweaking a little bit of my above code :).