Php > Complete Programs
This program will take data from a user via a web based form, validate it, show it
This program will take data from a user via a web based form, validate it, show it
Web and Email registration
if (!$namef && !$insertval && !$submit) { echo "
"; echo "
"; echo "
"; echo "
Jap an Communication Inc.
" ; echo "
Your first name
"; echo "
"; echo "
Your last name
";echo "
"; echo "
Your company name
"; echo "
"; echo "
Your email address
"; echo "
"; echo "
td>"; echo "
Your cell phone's number (numbers only please)"; echo ""; echo "
"; echo "
A personal password
"; echo "
"; echo "
"; echo "
A personal password (again)"; echo "
"; echo "
td>"; echo "
Finish and submit data
"; echo "
\">
"; echo "
Copyright 1998
" ; echo "
"; } ?> if($pass != $pass2){ echo "
You mispelled your password
"; echo "Please
go back
to correct this"; die; } if(!$insertval && $namef && $email && $namel && $pass && $coname) { echo "
" ; echo "
You entered these values
"; echo "
First Name
Last Name
Company Name
Email Address
"; echo "Phone Number
Password
"; echo "
$namef
$namel
$coname
$email
mobileset
NOT SHOWN
"; echo ""; echo "
"; echo "
Is all this data Correct?
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; } elseif($insertval == "No") { echo "
If you made a mistake, "; echo "Click
here
to start over
"; } if((!$namef || !$email || !$namel || !$pass || !$coname || $insertval) && $submit) { echo "
"; echo "You
must
enter data in the following fields:
"; echo "First name, Last Name, email, Company Name, and password"; echo "Click
here
to start over"; echo "
"; } if($insertval == "Yes"){ mysql_connect("localhost","root","mypassword") or die("Unable to connect to MySQL server"); mysql_select_db("register") or die("Unable to select database"); $insert = mysql_query("insert into users VALUES( '$namef','$namel','$coname','$email','$mobileset',password ('$pass'),NULL)"); echo "
Your data has been successfully entered."; echo "
"; } ?>
Widget Inc.
company name here
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage