View Full Version : please help me it should only take a second
The69Pimp
08-02-2002, 06:26 AM
ok i am new to this all and i am trying to make a regester script so they can just regester for my game before it opens all i need is a page were they insert the info and hit submit and it puts it into the database i already have a database made for it i just cant make the page :confused: if somebody could just really quick make it i would SOOOOOOO much appricate it
Spookster
08-02-2002, 06:38 AM
Well what server-side language are you planning on doing this in? What data? Where is your form?
The69Pimp
08-02-2002, 06:48 AM
sry bout that i should have explained better ok i would like to know if there is any way that some one could show me how to make a regester script in php launage
<html>
<head>
</head>
<body bgcolor=#ffffff>
<?
if (isset($UserName) && isset($password) && isset($hometown) && isset($age) && isset($email) && isset($start_city)) {
mysql_connect("localhost", "*****", "******");
$query = "INSERT INTO pregame VALUES ('$UserName','$password','$hometown','$age','$email','$start_city')";
$result = mysql_db_query("*****", $query);
if ($result) {
echo "<p>$name was added to the database</p>";
}
}
?>
<h1>regester</h1>
<form>
User Name: <input type=text name='UserName'><br>
Password: <input type=text name='password'><br>
Email: <input type=text name='email'><br>
Hometown: <input type=text name='hometown'><br>
Age: <input type=text name='age'><br>
Starting City: <input type=text name='start_city'><br>
<input type=submit>
</form>
<form name="form2" method="post" action="">
</form>
</body>
</html>
ok thats what i have so far and when i click submit it does not work and also on starting city these are the citys they are supposed to be able to chose from
Vancouver
Atlanta
Los_Angeles
Washington
New_York
Las_Vegas
New_Orleans
Atlantic_City
Honolulu
Philadelphia
i am just so lost i am not the programmer but he is out of town and is not around to do this and i have like no clue how and these people are starting to get mad at me because i promised that the game would be open soon like i said i have no clue how to do any of this please help me
Spookster
08-02-2002, 07:46 AM
No problem. Gimme a minute and i'll have it ready. Your main problem is the form itself. I'm also cleaning up some of the other code as well.
Spookster
08-02-2002, 07:58 AM
Ok here is the cleaned up working version:
<html>
<head>
</head>
<body bgcolor=#ffffff>
<?
if(isset($UserName) && isset($password) && isset($hometown) && isset($age) && isset($email) && isset($start_city)) {
$dbhandle = @mysql_connect("localhost", "dbusername", "dbpassword") or die("Unable to connect to database at this time");
mysql_select_db("databasenamegoeshere", $dbhandle);
$query = "INSERT INTO pregame VALUES ('$UserName','$password','$hometown','$age','$email','$start_city')";
if (mysql_query($query)){
echo "<p>$UserName was added to the database</p>";
}
}
?>
<h1>regester</h1>
<form method="post" action="<?=$PHP_SELF?>">
User Name: <input type="text" name="UserName"><br>
Password: <input type=text name="password"><br>
Email: <input type="text" name="email"><br>
Hometown: <input type="text" name="hometown"><br>
Age: <input type="text" name="age"><br>
Starting City: <input type="text" name="start_city"><br>
<input type="submit">
</form>
</body>
</html>
The69Pimp
08-02-2002, 09:46 AM
i did this EXACTLY as you said to but when i click submit all that happenes is this say i put the
username as the69pimp and the
password as mypassword
email as blah@umm.com
hometown as cleveland
age as 22
and start city as chiago
this is what happens... is only changes the url like this:
blahblah.com/prereg.php?
UserName=the69pimp&
password=mypassword&
email=blah@umm.com&
hometown=cleveland&
age=22&
start_city=chiago
and is does not insert it into the db i wish some one could just throw me togeather a small table script to make the tables and a small script so they can fill in the info and have it so it actually works PLEASE awnser me back asap thanx
SYP}{ER
08-02-2002, 04:43 PM
Are you absolutely positive that it's not inserting anything into the DB? Have you checked? It really should be :)
Spookster
08-02-2002, 05:14 PM
Originally posted by The69Pimp
i did this EXACTLY as you said to but when i click submit all that happenes is this say i put the
username as the69pimp and the
password as mypassword
email as blah@umm.com
hometown as cleveland
age as 22
and start city as chiago
this is what happens... is only changes the url like this:
blahblah.com/prereg.php?
UserName=the69pimp&
password=mypassword&
email=blah@umm.com&
hometown=cleveland&
age=22&
start_city=chiago
and is does not insert it into the db i wish some one could just throw me togeather a small table script to make the tables and a small script so they can fill in the info and have it so it actually works PLEASE awnser me back asap thanx
What I posted works just fine. You said you already have the database set up. Did you not already create the table for it?
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.