[RESOLVED] Really new at this
Just started out with PHP.Made a nice little page in DW04,using form to send data to my database created in MYSQL.
So here is my code:
form:
Code:
<form name="form1" method="post" action="insert.php">
ime: <input type="text" name="Ime" />
prezime: <input type="text" name="Prezime" />
email: <input type="text" name="email" />
komentar: <textarea name="komentar"></textarea>
<input type="submit" name="POSALJI" value="POSALJI">
</form>
and my insert.php
Code:
<?php
$con = mysql_connect("localhost","myname","mypass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("korisnik", $con);
$sql="INSERT INTO podaci (ime, prezime,email,komentar)
VALUES
('$_POST[ime]','$_POST[prezime]','$_POST[email]','$_POST[komentar])";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo $sql;
mysql_close($con)
?>
The thing is,nothing happens!No data is inserted,no error.Echo displays nothing.Guess I'm missing something here,so if anyone can help...thank you!