Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
here the code..

for homepage
XML
<html>
<head>
<h3>
College fest Organising Group
</h3></head>
<body>
<h5>Register, n be a part of the group!</h5>
<a href="registration.php"> Register </a></br>
<h5>Login, as a member</h5>
<a href="login.php"> Login </a></br>
</body>
</html>



for registration page...
XML
<html>
<head><title> Registration Form</title></head>
<body>
<h3> Register here!</h3>
<form name="registration" method="POST" action="">
<table>
<tr>
<td>Name:</td>
<td><input type="text" name="Name" ></td>
</tr>
<tr>
<td>Department:</td>
<td><input type="text" name="Department" ></td>
</tr>
<tr>
<td>Roll_No:</td>
<td><input type="text" name="Roll_No" ></td>
</tr>
<tr>
<td>Telephone_No:</td>
<td><input type="text" name="Telephone_No" ></td>
</tr>
<tr>
<td>CGPA:</td>
<td><input type="text" name="CGPA" ></td>
</tr>
<tr>
<td>Committee(Choose only 1):</td>
<td><select name="Committee">
<option value="D"> Dance--D </option>
<option value="DR"> Drama--DR </option>
<option value="M"> Music--M </option>
<option value="H"> Hospitality--H </option>
<option value="S"> Stage--S </option>
</select>
</td>
</tr>
<tr>
<td>Password:</td> <td><input type="Password" name="Password" ></td>
</tr>
</table>
<input type="submit" value="Submit">
</form>
<p> Thank you! </p>
</body>
</html>



for connecting the page to database....
PHP
<?php
$name=$_POST['Name'];
$department=$_POST['Department'];
$roll_No=$_POST['Roll_No'];
$telephone_No=$_POST['Telephone_No'];
$CGPA=$_POST['CGPA'];
$committee=$_POST['Committee'];
$password=$_POST['Password'];
mysql_connect("localhost", "root", "mysql11") or die(mysql_error());
echo "Connected to MySQL<br/>";
mysql_select_db("test") or die(mysql_error());
echo "Connected to Database";
$result=mysql_query("Insert into committee Values(\"$name\",\"$department\",\"$roll_No\",\"$telephone_No\",\"$CGPA\",\"$committee\",\"$password\")");
echo "Thankyou!";
?>



please go through the code...and tell me what's the mistake?
Posted
Comments
StianSandberg 23-Jul-12 6:21am    
is there any errors or exceptions?
Sebastian T Xavier 23-Jul-12 6:44am    
This is just a code dump
[no name] 23-Jul-12 9:11am    
"please go through the code"... no thanks I have my own job to do. It is up to you to debug your own code.
ZurdoDev 23-Jul-12 10:31am    
What's the problem?
Sandeep Mewara 23-Jul-12 12:06pm    
A guess game?

1 solution

h3 tag does not belong in the head. The form tag requires the action attribute I believe. There is painfully obvious SQL injection going on here. The attribute type Password is invalid, it should be password. You spelled organizing wrong. Use of mysql_connect is discouraged. Use of mysql_select_db is discouraged. Use of mysql_query is discouraged. Should be <br /> not </br>. Thank you is two words. n isn't a word. I wont even get into validation or the fact that your form response isn't a web page.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900