![]() |
|
#1
|
|||
|
|||
button from code to dbHi I have a guest area where I want people to sign up on a page and have completed the fundamentals, but not the button. I want once the button is clicked on it to take the personal information into the database from the page? Any ideas
|
|
#2
|
|||
|
|||
Re: button from code to db?????
So if I have a form completed say if you were signing up as a member how would this information be taken into the db and submitt |
|
#3
|
||||
|
||||
Re: button from code to dbWhen the form is submitted (e.g. via the post method), the target script will receive the user submitted data inside the $_POST variable/array.
To understand how this works, look at the sample documents below... For example, the web page with the form is test_form.htm: HTML Code:
Looking at the form, you will see that all the data is destined for test_save.php. When the user fills in her data and submits the form, the data she submitted will be passed to this script. The test_save.php script can look something like this: PHP Code:
The $_POST array would look like this: $_POST['inputUsername'] = 'Data submitted by the user appears here'; $_POST['inputEmail'] = 'Data submitted by the user appears here'; $_POST['inputSave'] = 'Save'; Once you figure out how to handle user submitted data from within a PHP script, you can ask us about getting it all into a MySQL database table. I hope I have not misunderstood your question. |
|
#4
|
|||
|
|||
Re: button from code to dbhi the first part i adapted and appears to work the second is not, think am prob doing wrong can u take a look at this for me please?
<html> <head> <body bgcolor="#99CCCC"> <link rel="stylesheet" type="text/css" href="cssformat.php" /> <h2>Please enter your personal details</h2> <hr> <form name="formTest" id="guest" method="post" action="update.php"> <p>First name: <input type="text" name="inputfirstName" id="inputUsername" value="" /></p> <p>Last name: <input type="text" name="inputlastName" id="inputEmail" value="" /></p> <p>Gender: <select> <option>Male</option> <option>Female</option> </select></p> <p>Country: <select> <option>Australia</option> <option>Canada</option> <option>France</option> <option>India</option> <option>New Zealand</option> <option>United Kingdom</option> <option>United Stated</option> <option>Other</option> </select></P> <p>County: <input type="text" name="inputcounty" id="inputUsername" value="" /></p> <p>Email: <input type="text" name="inputemail" id="inputUsername" value="" /></p> <p><input type="submit" name="inputSave" id="inputSave" value="Save" /></p> </form> </body> </html># --------------------------------------------------------------------------part two <?php if($_POST) { echo'<pre>'; print_r( $_POST ); die( '</pre>' ); } else { die( "<p>Sorry, please fill-in your data in this <a href='test_form.htm'>form</a>.</p>" ); } $_POST['fistName'] = 'Data submitted by user appears here'; $_POST['lastName'] = 'Data submitted by user appears here'; $_POST['gender'] = 'gender selction appears here'; $_POST['country'] = 'country selection appears here'; $_POST['county'] = 'Data submitted by user appears here'; $_POST['email'] = 'Data submitted by user appears here'; ?> |
|
#5
|
|||
|
|||
Re: button from code to db???????????????/
|
Recent GIDBlog
Toyota - 2008 July Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to sort random access file? | wmmccoy0910 | C Programming Language | 12 | 04-Sep-2006 03:40 |
| Here it is again! 35% - 40% off For Life! | my-e-space | Web Hosting Advertisements & Offers | 0 | 20-Apr-2006 14:48 |
| User defined headers | davis | Miscellaneous Programming Forum | 6 | 16-Feb-2006 18:40 |
| Problem with int mixed with char,... | leitz | CPP / C++ Forum | 17 | 07-Dec-2004 20:56 |
| Help! Some basal questions about MFC | xutingnjupt | MS Visual C++ / MFC Forum | 1 | 05-Dec-2004 03:38 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The