e se li devo inserire? io ho fdatto cosi:
form:
Codice PHP:
<form action="wiev.php" method="post" width="160" >
<table border="0" cellpadding="1" cellspacing="0" align="center" width="147" >
<tr >
<td width="90" valign="top">
<input name="name" type="text" size="15" maxlength="100" value="Nome sito" onfocus=\"this.value=''\">
</td></tr>
<tr>
<td width="90" valign="top">
<input name="url" type="text" size="15" maxlength="80" value="http://" onfocus="this.value=''">
</td></tr>
<tr>
<td valign="top"><select name="cat"><option>scegli la categoria</option><option name="portali" >Portali</option><option name="other">Other</option></select></td>
</tr>
<tr>
<td valign=\"top\"><input name="webmaster" type=\"text\" size=\"15\" maxlength=\"255\" value="webMaster"></td>
</tr>
<tr> <td>
<input name=\"banner\" type=\"text\" size=\"15\" maxlength=\"300\" value="Url Banner">
</td>
</tr>
<tr>
<td height=\"26\" valign=\"top\">
<a href=\"#\" onClick=\"winpiccola('smiles.php','Smiles','width=210,height=210,scrollbars=1')\" target=\"_self\" title=\"Apri la finestra con cli smiles\"><img src=\"smiles/cinesino.gif\" border=\"0\" alt=\"Apri la finestra con cli smiles\"></a> - <a href=\"#\" onClick=\"winpiccola('test.php','Smiles','width=245,height=50,scrollbars=1')\" target=\"_self\" title=\"Formattazione Testo\"><span class=\"tag2\">BBcode</span></a> - <input type="submit" value="GO" >
</td>
</tr>
</table>
</form>
insert:
Codice PHP:
<?php
include "connect.php";
{if ($name == "Nome sito") {
echo "<span class=\"copy\">Riempi il campo NICK.</span>
";
}
else
{
mysql_query("INSERT INTO $cat VALUES (NULL,'".$name."','".$url."','".$webmaster."','".$banner."')") or die (mysql_error());
echo "Sei stato inserito con successo!
";
} ?>
nel tabele create nel mysql sono other e portali e tutti è due hanno questi valori: id` INT(11) NOT NULL AUTO_INCREMENT,
`name` CHAR(80) NOT NULL,
`url` CHAR(100) NOT NULL,
`webmaster` CHAR(50),
`banner` CHAR(150)
pero facendo cosi nn va.. HELP ME