Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-20-2009, 09:08 AM   PM User | #1
jknoxy123
New to the CF scene

 
Join Date: May 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
jknoxy123 is an unknown quantity at this point
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
jknoxy123 is offline   Reply With Quote
Old 05-20-2009, 09:23 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Add one more input element of type="submit", say
Code:
<input type="submit" name="Submit" value="Submit"/>
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 05-20-2009, 09:31 AM   PM User | #3
jknoxy123
New to the CF scene

 
Join Date: May 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
jknoxy123 is an unknown quantity at this point
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
jknoxy123 is offline   Reply With Quote
Old 05-20-2009, 10:14 AM   PM User | #4
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
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)
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

Last edited by abduraooft; 05-20-2009 at 10:29 AM..
abduraooft is offline   Reply With Quote
Old 05-20-2009, 10:25 AM   PM User | #5
jknoxy123
New to the CF scene

 
Join Date: May 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
jknoxy123 is an unknown quantity at this point
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
jknoxy123 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:16 AM.


Advertisement
Log in to turn off these ads.