Hello,
I wrote that code on my website:
HTML Code:
<form action="comments.php" method="post">
<input type="hidden" name="id" value="NULL" />
<input type="hidden" name="data" value="NULL" /></p>
<p>Komentaras: <br />
<input name="Komentarai" height="50px" type="text" value="" size="60" maxlength="5000" />
<br />
<input type="submit" value="Komentuoti"/>
</form>
in another file comments.php i wrote:
PHP Code:
<?
$DBazes_serveris = "xxxxx.xxxxxxx.com";
$DBazes_database = "xxxxxx_xxxx";
$DBazes_vartotojas = "xxxxx_xxxx";
$DBazes_slaptazodis = "xxxxxxx";
$DBazes_lentele = "PHPMySQL";
//////////////////////////////////////////// Prisijungimui
$login = mysql_connect($DBazes_serveris, $DBazes_vartotojas, $DBazes_slaptazodis) or die ('Nepavyko prisijunkti');
//////////////////////////////////////////// LENTELE
@mysql_select_db($DBazes_lentele);
$irasymas_i_db = "INSERT INTO $DBazes_lentele VALUES ( '$id','$Komentarai', '$data') ";
$rezultatas = mysql_query($irasymas_i_db);
mysql_close();
print "
Jusu komentaras: $Komentarai
";
?>
These codes i think have mistakes, so If you could help to fix my problem please tell me ;(
Or if you know another way to post form info to MySQL please tell me, cause I want to learn how to post and get all info to show on php file.
Bookmarks