Click here to Skip to main content
11,930,069 members (44,197 online)
Rate this:
Please Sign up or sign in to vote.
See more: PHP MySQL
here the code..

for homepage
College fest Organising Group
<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>

for registration page...
<head><title> Registration Form</title></head>
<h3> Register here!</h3>
<form name="registration" method="POST" action="">
<td><input type="text" name="Name" ></td>
<td><input type="text" name="Department" ></td>
<td><input type="text" name="Roll_No" ></td>
<td><input type="text" name="Telephone_No" ></td>
<td><input type="text" name="CGPA" ></td>
<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>
<td>Password:</td> <td><input type="Password" name="Password" ></td>
<input type="submit" value="Submit">
<p> Thank you! </p>

for connecting the page to database....
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 23-Jul-12 1:07am
AlluvialDeposit 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
Wes Aday 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.
ryanb31 23-Jul-12 10:31am
What's the problem?
Sandeep Mewara 23-Jul-12 12:06pm
A guess game?
Smrng 7-Aug-12 1:09am
Wes Aday If it wasn't your job why did you even reply.
I am a beginner and can't to this on my own.That's why asked for your help.
Thanks anyway!!

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.1 | Last Updated 27 Jul 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100