Chris2k2
February 8th, 2003, 08:58
Hello, Not been on here in ages but i am back again.
I have a problem. Im creating a Admin CP for one of my sites that all runs through a database.
Well i am creating a form to enter info then it will put it into the database.
Here is the code.
<?php
include('config.php');
mysql_query("INSERT INTO cheats VALUES ('$id', '$name', '$content')");
?>
<title>The Cheats Directory Admin CP</title>
<body bgcolor="#006699" link="#000080"><table border="0" cellpadding="0" cellspacing="0" width="100%">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber3">
<tr>
<td><img src="left.gif"></td>
<td width="100%" background="center.gif" align="center"><font size="3" face="Verdana">Admin CP<u></u></font></td>
<td><img src="right.gif"></td>
<p align="center"> </th>
</tr>
<tr>
<td width="100%" bgcolor="#669999" colspan="3"> <center>
ID: <input type="text" name="id" size="20">
<P>
Name: <input type="text" name="name" size="20">
<P>
Cheats: <textarea rows=15 cols=50 name="content"></textarea>
<P>
<P>
<input type="submit" name="">
<P></center></td>
</tr>
</tr>
</table>
Nothing may look wrong with it but it has a bug, it adds a empty row to the database every time the page is loaded.
So any ideas how i can stop this?
thank you,
I have a problem. Im creating a Admin CP for one of my sites that all runs through a database.
Well i am creating a form to enter info then it will put it into the database.
Here is the code.
<?php
include('config.php');
mysql_query("INSERT INTO cheats VALUES ('$id', '$name', '$content')");
?>
<title>The Cheats Directory Admin CP</title>
<body bgcolor="#006699" link="#000080"><table border="0" cellpadding="0" cellspacing="0" width="100%">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber3">
<tr>
<td><img src="left.gif"></td>
<td width="100%" background="center.gif" align="center"><font size="3" face="Verdana">Admin CP<u></u></font></td>
<td><img src="right.gif"></td>
<p align="center"> </th>
</tr>
<tr>
<td width="100%" bgcolor="#669999" colspan="3"> <center>
ID: <input type="text" name="id" size="20">
<P>
Name: <input type="text" name="name" size="20">
<P>
Cheats: <textarea rows=15 cols=50 name="content"></textarea>
<P>
<P>
<input type="submit" name="">
<P></center></td>
</tr>
</tr>
</table>
Nothing may look wrong with it but it has a bug, it adds a empty row to the database every time the page is loaded.
So any ideas how i can stop this?
thank you,