CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   MySQL (http://www.codingforums.com/forumdisplay.php?f=7)
-   -   Help Me Please (http://www.codingforums.com/showthread.php?t=1147)

The69Pimp 07-01-2002 07:32 PM

Help Me Please
 
i am starting a gaming website and i am having a bit of a problem with them here is my first pahe index.php
PHP Code:

<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 07:34 PM

and.....
 
here is the second page were they fillin the game info
PHP Code:

<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-01-2002 11:31 PM

Which submit button?

The69Pimp 07-02-2002 04:23 AM

the submit button after i fill in the info for the game

Spookster 07-02-2002 05:56 AM

This submit button?

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

The69Pimp 07-02-2002 06:48 AM

no the submit button got left out i belive the submit button it but here it is

PHP Code:

<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 09:47 AM

Its because you haven't specified a form method. change

<form>

to

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

Jee


All times are GMT +1. The time now is 09:11 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.