Closed (won't fix)
Project:
PHP Error Report
Version:
5.x-1.3
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
22 Sep 2011 at 19:15 UTC
Updated:
22 Sep 2011 at 20:08 UTC
I'm trying to make a registration form for my project. To create the registration form I use the following code inside "rgform.php:
<html>
<body>
<form method="post" action="rgfvalid.php">
<table>
<tr><td>Username:</td><td><input type=text
input name="user" value=""></td></tr>
<tr><td>Email:</td><td><input type=text
input name="email" value=""></td></tr>
<tr><td>Pass:</td><td><input type=password
input name="pass" value=""></td></tr>
<tr><td>Verify Pass:</td><td><input type=password
name=vpass></td></tr>
<tr><td colspan=2 align=center><input type=submit
value=Register></td></tr>
</table>
</form>
</body>
</html>
For validation & collect data in mysql database use the following code inside "rgfvalid.php"
<html>
<body>
<?php
$user= $_POST["user"];
$email= $_POST["email"];
$pass= $_POST["pass"];
$vpass= $_POST["vpass"];
$con= mysql_connect("localhost","root","joy87");
if(!$con)
{
die('could not connect:' .mysql_error());
}
mysql_select_db("test");
if (!$user || !$email || !$pass || !$vpass)
{
print "You must fill all fields.";
}
$dupe1= mysql_num_rows(mysql_query("select * from table where user='$user' "));
if ($dupe1 > 0)
{
print "Someone already has that username.";
}
$dupe2 = mysql_num_rows(mysql_query("select * from table where email='$email' "));
if ($dupe2 > 0)
{
print "Someone already has that email";
}
if ($pass != $vpass)
{
paint "The password do not match";
}
mysql_query("insert into table (user, email, pass) values('$user','$email','$pass')");
print "You are now register";
?>
</body>
</html>
When I enter "http://localhost/rgform.php" it works fine. But when submit all the field and click to "submit" it shows the following error
"Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\server\www\myserver.dev\public_html\rgfvalid.php on line 30"
Please help me as soon as possible...
Comments
Comment #1
nilanja1987 commentedPLEASE HELP ME AS SOON AS POSSIBLE.
Comment #2
liquidcms commentedlol.. me thinks you have wandered into the wrong website.. this is a drupal.org..