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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation How to Transfer form details over to PHP script

    Hey, New to HTML and especially PHP!

    I have been given the PHP file as follows:
    Code:
    Code:
    <body> 
       <?php 
          echo "<pre>"; 
          print_r($_GET);       
          echo "<pre>"; 
       ?> 
    </body>

    I have to create any form elements i want and be able to submit them to this PHP file! How can i do this i have created my form i just need to tranfer the details over! exmaple of a part of the form:
    Code:
    Code:
    <form name = "InvoiceForm" id = "InvoiceForm" action="reflect.php" method="get">
    Please Enter your details in the relavent boxes below:<br/><br/>
    <label for = "UserName">UserName:<br/>
        	<input type="text" name = "UserName" id = "UserName"  class = "FormSelect"/></label><br/><br/>
    <label for ="FirstName">First Name(s):<br/>
            <input type="text" name = "FirstName" id = "FirstName" class = "FormSelect"/></label><br/><br/>
            <label for = "LastName">Last Name:<br/>
            <input type="text" name = "LastName" id = "LastName" class = "FormSelect"/></label><br/><br/>
           	<label for = "Address">Address:<br/>
            <textarea name="Address" id="FormAddress" class = "FormSelect" rows = "5" cols = "2">
            </textarea></label><br/><br/>
            <label for = "Email">E-mail:<br/>
            <input type="text" name = "Email" id = "Email" class = "FormSelect"/></label><br/><br/>
            <label for = "Telephone">Telephone Number:<br/>
            <input type="text" name = "Telephone" id = "Telephone" class = "FormSelect"/></label><br/><br/>
            </form>
    Thanks

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    Add one more input element of type="submit", say
    Code:
    <input type="submit" name="Submit" value="Submit"/>
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    May 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ohh yes i already have one of those, forgot to copy that part of the code over!
    Does the submit button go inside the form or outside? as i have 2 forms that both should submit together with 1 button?

    Thanks

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    You need to add all the input elements inside your form. But you can't submit 2 forms simultaneously with one button. Why do you need two forms, if both of them are to be submitted to the same page? Can't you just combine them and group the related items by fieldset tag ? (see an example at http://www.alistapart.com/articles/p...ccessibleforms)
    Last edited by abduraooft; 05-20-2009 at 10:29 AM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    New to the CF scene
    Join Date
    May 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey, i have made it all into 1 form, but when i click submit, it freezes? :S plus when it does send it still doesnt display anything into the PHP, it just has my selections in the URL at the top of the page!

    could you also explain how to use fieldset tag?

    Also that link came up with a error, page doesnt exist or something!

    Thanks


  •  

    Posting Permissions

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