| | |
help how to add a data or insert a data
Please support our Graphics and Multimedia advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2008
Posts: 161
Reputation:
Solved Threads: 1
this is my code im using dreamweaver but i dont know how to add a data. . 
the name of the table i use is user,
inside the table of user is:
id
username
password
emailaddress
please help. . thanks. .

Graphics and Multimedia Syntax (Toggle Plain Text)
<table width="98%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="75%" valign="top" class="body"> <table cellpadding="3" cellspacing="0" border="0" width="100%"> <tr> <td width="40%"> <b>Choose username:</b></td> <td> <input type="text" name="user" size="20" tabindex="1" maxlength="25" /> </td> </tr><tr> <td width="40%"> <b>Email:</b></td> <td> <input type="text" name="email" size="30" tabindex="2" /> <label for="hideEmail"></label></td> </tr><tr> <td width="40%"> <b>Choose password:</b> </td> <td> <input type="password" name="passwrd1" size="30" tabindex="3" /> </td> </tr><tr> <td width="40%"> <b>Verify password:</b> </td> <td> <input type="password" name="passwrd2" size="30" tabindex="4" /> </td> </tr> <tr valign="top"> </tr> <tr> </tr> </table> <div align="center"> <input type="submit" name="regSubmit" value="Register" /> </div> <p align="center" class="style4"><br /> <a href="content.html"></a></p></td> </tr> </table>
the name of the table i use is user,
inside the table of user is:
id
username
password
emailaddress
please help. . thanks. .
•
•
Join Date: Jan 2007
Posts: 164
Reputation:
Solved Threads: 10
•
•
•
•
this is my code im using dreamweaver but i dont know how to add a data. .
Graphics and Multimedia Syntax (Toggle Plain Text)
<table width="98%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="75%" valign="top" class="body"> <table cellpadding="3" cellspacing="0" border="0" width="100%"> <tr> <td width="40%"> <b>Choose username:</b></td> <td> <input type="text" name="user" size="20" tabindex="1" maxlength="25" /> </td> </tr><tr> <td width="40%"> <b>Email:</b></td> <td> <input type="text" name="email" size="30" tabindex="2" /> <label for="hideEmail"></label></td> </tr><tr> <td width="40%"> <b>Choose password:</b> </td> <td> <input type="password" name="passwrd1" size="30" tabindex="3" /> </td> </tr><tr> <td width="40%"> <b>Verify password:</b> </td> <td> <input type="password" name="passwrd2" size="30" tabindex="4" /> </td> </tr> <tr valign="top"> </tr> <tr> </tr> </table> <div align="center"> <input type="submit" name="regSubmit" value="Register" /> </div> <p align="center" class="style4"><br /> <a href="content.html"></a></p></td> </tr> </table>
the name of the table i use is user,
inside the table of user is:
id
username
password
emailaddress
please help. . thanks. .
This are PHP codes.
if(isset($_POST['regSubmit'])) {
//get your post variables
$a=$_POST['user'];
$b=$_POST['email'];
$c=$_POST['passwrd1'];
$d=$_POST['passwrd2'];
//verify the password if the same
if($c != $d) { die('password mismatch'); };
//encrypt your password
$e = md5($c);
//Connect to your database
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mydb");
//make sure you have the same column number in inserting values
$result = mysql_query("INSERT INTO USER VALUES('$a', '$c', '$b'");
if(!$result) $_SESSION['success'] = '1';
mysql_close($conn);
}
if($_SESSION['success'] == '1') {
echo "Failed!";
//or HTML put here
} else {
//or HTML put here
echo "Success!";
}•
•
•
•
NOTE: read addslashes, stripslashes and !get_magic_quotes_gpc if you want to use them.
if(!get_magic_quotes_gpc()){
$username = addslashes($username);
}
INSERT command here...
if you want to get it those value use stripslashes.
if you want good form validation:
visit this link: http://www.javascript-coder.com/html...lidation.phtml
or you download this .. http://sourceforge.net/projects/phploginsystemw/
if you want OBJECT ORIENTED....
Last edited by rm_daniweb; Apr 6th, 2009 at 4:59 am.
![]() |
Similar Threads
- insert and update data in two different database (JSP)
- a blank form to insert data???? (Visual Basic 4 / 5 / 6)
- Please help(Problem in insertion data to database) (JSP)
- MSFlexGrid Search Loop (Visual Basic 4 / 5 / 6)
- Unable to insert data into SQL Database (ASP)
- Any way to combine two datasources into one recordset? (ASP)
- Using a class to add/delete/show numbers in a Link List (C++)
Other Threads in the Graphics and Multimedia Forum
- Previous Thread: Two tone background
- Next Thread: Showing Enlarged Area of Image
| Thread Tools | Search this Thread |
3d 10 actionscript3 adobe adobeacrobat adobereader air ajax amazon amf apple button cart childprotection cloud dashboard dell design dojofoundation dreamweaver ebay eclipse ecommerce elasticcomputecloud embed endorsement extra family flash flash-develop flashlite flex free harddrive iamthwee ibm illustrator imflash intel interactivemap javafx javascript laptop legal map micron microsoft mobile monitoringsoftware moonlight multimedia myspace nand news novell panorama pdf pedophiles photoshop photosynth php safety sandisk security shopping silverlight solidstatedrive sproutcore ssd streaming swf table ukmap unload unwanted video vulnerability web white.space xml zend zephyr zeroday






