WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-10-2003, 01:37 AM
WebProWorld Member
 

Join Date: Nov 2003
Posts: 93
TheDoctor RepRank 0
Default How do I create a submission form?

I want to create a submission form for things such as signing up for monthly drawings, email lists, and for general feedback. How do I create something like this?
Reply With Quote
  #2 (permalink)  
Old 11-10-2003, 03:01 PM
WebProWorld Member
 

Join Date: Aug 2003
Location: Canada
Posts: 30
AlexBel RepRank 0
Default Re: How do I create a submission form?

You can use Perl or PHP
__________________
<-- AlexBel -->
Reply With Quote
  #3 (permalink)  
Old 11-10-2003, 04:29 PM
compusolver's Avatar
WebProWorld Member
 

Join Date: Sep 2003
Location: Oklahoma
Posts: 94
compusolver RepRank 0
Default

Your form document and the page that reads the answers can be in one page or two seperate pages.

Your form can even be in a standard html page. Just use your form tags:

Code:
<form method='post' action='pagetoreadform.php'>
  <input type="text" name="email" size="40" maxlength="50">
<input type="submit" name="submit" value="Submit">
</form>
Obviously you'd want some type of validation using Javascript and probably want to dress up your form appearance, but you can grab code off of any good site for that.

Now, to do something with the email address your form just captured..

Code:
<?php
  $email = $_POST['email'];
  $tablename = "your_db_tablename";
  if(!empty($email)) {
    $sql = "INSERT INTO $tablename  (email) VALUES('$email')";

    if (!mysql_select_db($dbname)) {
      echo "<h3>No Connection!</h3>";
      exit;
    }

    $result = mysql_query($sql)
		or die("ack! query failed");
  }
This, by necessity, leaves out the rather important steps of creating the database and table, connection and exception handling, etc., etc.

There are really no adequate short cuts to learning server side code. It tends to be a bit deeper and with more layers than client-side coding.

Now I'm not saying that client-side programming doesn't require plenty of studying - its just that you can copy and paste CSS/Javascript code and, if it works, forget about it. Not quite so with server-side. But its enjoyable and worth the study-time.
__________________
- Hank Castello
www.CompuSolver.com
www.SmBizHosting.com
Hosting, eCommerce Gateways & affordable subcontract programming/consulting
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0