...

View Full Version : Help Me Please



The69Pimp
07-01-2002, 08:32 PM
i am starting a gaming website and i am having a bit of a problem with them here is my first pahe index.php

<html>
<head><title>Web Database Sample Index</title>
</head>

<body bgcolor=#ffffff>
<h1>Data from tabletest</h1>
<?
mysql_connect("localhost", "*****", "*****");
$query = "SELECT GameName,
Sub_date,
Dev_email,
Stage,
Genre,
Client,
Platform,
Interface,
Multiplayer,
Prizes,
Last_reviewed,Cost,
ESRBRating,
Game_URL FROM gameform";
$result = mysql_db_query("*****", $query);

if ($result) {
echo "Found these entries in the database:<ul>";
while ($r = mysql_fetch_array($result)) {
$GameName = $r["Game Name"];
$Sub_date = $r["Submission Date"];
$Dev_email = $r["Developers Email"];
$Stage = $r["Development Stage"];
$Genre = $r["Game Genre"];
$Client = $r["Client"];
$Platform = $r["Platform"];
$Interface = $r["Interface"];
$Multiplayer = $r["Multiplayer"];
$Prizes = $r["Prizes"];
$Last_reviewed = $r["Last Reviewed"];
$Cost = $r["Game Cost"];
$ESRBRating = $r["ESRBRating"];
$Game_URL = $r["Game URL"];
echo "<li>$GameName,
$Sub_date,
$Dev_email,
$Stage, $Genre,
$Client,
$Platform,
$Interface,
$Multiplayer,
$Prizes, $Last_reviewed,
$Cost,
$ESRBRating,
$Game_URL";
}
echo "</ul>";
} else {
echo "No data.";
}
mysql_free_result($result);
?>

<form name="form1" method="post" action="add_new_game.php">
<input type="submit" name="Submit" value="Add A New Game">
</form>
<p>&nbsp;
</body>
</html>

The69Pimp
07-01-2002, 08:34 PM
here is the second page were they fillin the game info

<html>
<head><title>Submitting New Game</title>
</head>

<body bgcolor=#ffffff>
<?
if (isset($GameName)
&& isset($Sub_date)
&& isset($Dev_email)
&& isset($Stage)
&& isset($Genre)
&& isset($Client)
&& isset($Platform)
&& isset($Interface)
&& isset($Multiplayer)
&& isset($Prizes)
&& isset($Last_reviewed)
&& isset($Cost)
&& isset($ESRBRating)
&& isset($Game_URL)) {
mysql_connect("localhost", "*****", "*****");
$query = "INSERT INTO gameform VALUES
('$GameName',
'$Sub_date',
'$Dev_email',
'$Stage',
'$Genre',
'$Client',
'$Platform',
'$Interface',
'$Multiplayer',
'$Prizes',
'$Last_reviewed',
'$Cost',
'$ESRBRating',
'$Game_URL')";
$result = mysql_db_query("*****", $query);

if ($result) {
echo "<p>$name was added to the database</p>";
}
}
?>

<h1>Add an entry</h1>
<form>
Game Name: <input type=text name='GameName'><br>
Submission Date: <input type=text name='Sub_date'><br>
Developers Email: <input type=text name='Dev_email'><br>
Development Stage: <input type=text name='Stage'><br>
Game Genre: <input type=text name='Genre'><br>
Client Type: <input type=text name='Client'><br>
Platform: <input type=text name='Platform'><br>
Interface: <input type=text name='Interface'><br>
Multiplayer: <input type=text name='Multiplayer'><br>
Prizes: <input type=text name='Prizes'><br>
Last Reviewed: <input type=text name='Last_reviewed'><br>
Cost: <input type=text name='Cost'><br>
ESRBRating: <input type=text name='ESRBRating'><br>
Game URL: <input type=text name='Game_URL'><br>
<input type=submit>
</form>

<form name="form2" method="post" action="index.php">
<input type="submit" name="Submit" value="Return To Index">
</form>
</body>
</html>
and all it does when i click submit is it puts the info into the address bar please help me

Spookster
07-02-2002, 12:31 AM
Which submit button?

The69Pimp
07-02-2002, 05:23 AM
the submit button after i fill in the info for the game

Spookster
07-02-2002, 06:56 AM
This submit button?

<input type="submit" name="Submit" value="Add A New Game">

The69Pimp
07-02-2002, 07:48 AM
no the submit button got left out i belive the submit button it but here it is


<input type=submit>
that is in there i am new to php and mysql so i have no clue what to do to get it working

Jeewhizz
07-02-2002, 10:47 AM
Its because you haven't specified a form method. change

<form>

to

<form name="form" method="post" action="wherever.php">

Jee



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum