Form Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ojsimon
    New Member
    • May 2007
    • 59

    Form Problem

    Hi
    I am making a search form that returns the word that the user searched as an experiment, this is the code i am using on index.html
    Code:
    <html>
    <body>
    
    
    <center><form action="welcome.php" method="post">
    <input type="text" size="40"  name="name" /></center>
    
    <center><input type="submit" value="Search" /></center>
    </form>
    
    </html>
    Then for the second page welcome.php i am using
    Code:
    <?php echo $_POST["name"]; ?>
    What i want is firstly for what the user searches to be in the url for example in a google search for php http://www.google.co.uk/search?hl=en...e+Search&meta= php is in the url how can i make mine so it is /search?PHP for example?

    Also how can i make it so on the second page the search box is there?

    Thanks
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    use get instead of post

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Originally posted by hsriat
      use get instead of post
      Moreso, change
      method="post"
      to
      method="get"
      Then on the server side catching script
      $_GET['name']

      Comment

      Working...