GIDForums  

Go Back   GIDForums > Webmaster Forums > Web Design Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 03-Apr-2004, 05:12
gangster-20 gangster-20 is offline
New Member
 
Join Date: Dec 2003
Location: London
Posts: 12
gangster-20 is an unknown quantity at this point

How to handle user submitted data from a form? [was: How]


On dreamweaver how can you make a form submit and send you the info that people have enterd
Last edited by JdS : 03-Apr-2004 at 05:27. Reason: Please use a better title in your thread
  #2  
Old 03-Apr-2004, 05:13
gangster-20 gangster-20 is offline
New Member
 
Join Date: Dec 2003
Location: London
Posts: 12
gangster-20 is an unknown quantity at this point
an example

HTML Code:
<html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body class="sub"> <form name="form1" method="post" action=""> <table width="90%" border="0" cellpadding="8"> <tr> <td colspan="3" class="HeaderColor"> <h4>Register</h4></td> </tr> <tr style="vertical-align: top"> <td style="text-align: right" class="LabelColor" nowrap><label for="username"> User Name*</label></td> <td colspan="2" class="TitleColor"> <input type="text" id="username" name="textfield"> <br> <span class="small">*Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</span></td> </tr> <tr style="vertical-align: top"> <td style="text-align: right" class="LabelColor"><label for="password"> Password</label></td> <td colspan="2" class="TitleColor"> <input type="text" id="password" name="textfield2"> </td> </tr> <tr style="vertical-align: top"> <td style="text-align: right" class="LabelColor"><label for="confirmpassword"> Confirm<br> Password*</label></td> <td colspan="2" class="TitleColor"> <input type="text" id="confirmpassword" name="textfield3"> <br> <span class="small">* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</span></td> </tr> <tr style="vertical-align: top"> <td height="41" class="LabelColor" style="text-align: right"> Name</td> <td width="43%" class="TitleColor"> <label for="first">First: </label> <input name="textfield4" type="text" id="first" value=""> </td> <td width="46%" class="TitleColor"> <label for="last">Last: </label> <input type="text" id="last" name="textfield5"> </td> </tr> <tr style="vertical-align: top"> <td style="text-align: right" class="LabelColor"><label for="email"> Email</label></td> <td colspan="2" class="TitleColor"> <input type="text" id="email" name="textfield6" size="50"> </td> </tr> <tr style="vertical-align: top"> <td style="text-align: right" class="LabelColor"> Gender</td> <td colspan="2"> <p class="TitleColor"> <label for="male">Male </label><input type="radio" id="male" name="radiobutton1" value="radiobutton"> <label for="female">Female </label><input type="radio" id="female" name="radiobutton1" value="radiobutton"> </p></td> </tr> <tr style="vertical-align: top"> <td style="text-align: right" class="LabelColor"> Birth Date</td> <td colspan="2"> <table border="0" cellspacing="2" cellpadding="0"> <tr style="text-align: left"> <td class="TitleColor"><label for="month">MM </label><input type="text" id="month" name="textfield7" size="2"></td> <td class="TitleColor"><label for="day">DD </label><input type="text" id="day" name="textfield8" size="2"></td> <td class="TitleColor"><label for="year">YYYY </label><input type="text" id="year" name="textfield9" size="4"></td> </tr> </table></td> </tr> <tr style="vertical-align: top"> <td colspan="3"> <p class="StoryContentColor">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.<br> <label for="yes1">Yes </label><input type="radio" id="yes1" name="radiobutton2" value="radiobutton" checked> <br> <label for="no1">&nbsp;No </label><input type="radio" id="no1" name="radiobutton2" value="radiobutton"> </p> <p class="StoryContentColor">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. <br> <label for="yes2">Yes </label><input type="radio" id="yes2" name="radiobutton3" value="radiobutton" checked> <br> <label for="no2">&nbsp;No </label><input type="radio" id="no2" name="radiobutton3" value="radiobutton"> </p></td> </tr> <tr style="vertical-align: top" class="FooterColor"> <td colspan="3"><input name="SubmitName" type="submit" dir="rtl" lang="el" value="Submit"></td> </tr> </table> </form> </body> </html>
Last edited by JdS : 03-Apr-2004 at 05:26. Reason: Please enclose html code in [html] & [/html] for syntax highlighting
  #3  
Old 03-Apr-2004, 05:24
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
You need to have some server-side script to handle the data submitted from a form. Usually this is simply a sript on your web server that's referred in the form's action attribute.

So an example <form> could look like this:

HTML Code:
<form action="/this_is_the_script_2_handle_the_form_data.php"> <!-- other form objects --> </form>

Please, please... use a more descriptive title in your threads, "How" for a title is usually ignored or even edited if not deleted.

Also use syntax highlighting when including HTML codes in your posts / mesages.
  #4  
Old 03-Apr-2004, 05:40
gangster-20 gangster-20 is offline
New Member
 
Join Date: Dec 2003
Location: London
Posts: 12
gangster-20 is an unknown quantity at this point
i need to know how to make it submit so i can resive the ditails.

ok and i will use a better header title next time
  #5  
Old 03-Apr-2004, 06:07
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
gangster-20, let's assume you have a web form page named: whats-your-name.html, inside it your HTML looks like this -

HTML Code:
<html> <head></head> <body> <!-- the action attribute below is pointing to a script filenamed: "process-data.php" --> <form method="post" name="testform" action="/process-data.php"> <p>Name: <input type="text" name="firstname" maxlength="32" style="width:150px" value="" /></p> <p>Surname: <input type="text" name="lastname" maxlength="64" style="width:150px" value="" /></p> <p><input type="submit" name="submit" value="Send me your name!" /></p> </form> </body> </html>

Once a user fills in his name & surname and hits the Submit button, the POST data is sent to your script process-data.php and this is how your script could probably look like -

PHP Code:

<?php
// FILENAME: process-data.php


// grab the values submitted...  
$users_firstname = $_POST['firstname'];
$users_lastname  = $_POST['lastname'];
// if you had a form object named 'age', then you access that data in this script
// by getting the super global array $_POST['age']

// usually, you would write your code to screen user submitted data e.g. strip_tags( $_POST['firstname'] ) etc.
// but in this example I am skipping all that...

echo "<p>Thank you <strong>$users_firstname</strong>, your data is recorded!</p>";
?>

  #6  
Old 03-Apr-2004, 07:00
gangster-20 gangster-20 is offline
New Member
 
Join Date: Dec 2003
Location: London
Posts: 12
gangster-20 is an unknown quantity at this point
do you know any wer that i could get a script for that
  #7  
Old 03-Apr-2004, 07:07
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
You can try the search results for "form processing script +php"
  #8  
Old 03-Apr-2004, 12:12
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,335
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by JdS
You can try the search results for "form processing script +php"
This is assuming your server can handle php, which is not guaranteed.

Another option:
Talk to the people that host your website -- ask them what they have available. It may be a PERL script if they have something. If they don't, ask them if they could install FORMMAIL.PL from Matt's archive, available at http://www.scriptarchive.com/formmail.html

You used to be able to simply add "mailto:email@addr" in the action but the newer browsers have removed that option.
__________________

During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence?
  #9  
Old 04-Apr-2004, 16:42
BobbyDouglas's Avatar
BobbyDouglas BobbyDouglas is offline
Regular Member
 
Join Date: Aug 2003
Posts: 789
BobbyDouglas has a spectacular aura aboutBobbyDouglas has a spectacular aura about
Maybe DreamWeaver will catch up on FrontPage on this issue and use their forms.
FP allows you to have a form created, e-mailed, saved to a file, in less than 1 minute.
__________________
Mr. Bob's Web Design - Tirelessly looking for ways to enhance the customer base of your business.
  #10  
Old 21-Apr-2004, 17:50
demtro demtro is offline
Awaiting Email Confirmation
 
Join Date: Feb 2003
Location: Florida
Posts: 28
demtro is on a distinguished road
That is using Front Page Extensions, If your hosting company does not support front page extensions you will not have that option.
 
 

Recent GIDBlogProblems with the Navy (Chiefs) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 22:07.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.