|
| Newbie - hvad er der galt her med denne fo~ Fra : Thomas G. Larsen |
Dato : 15-06-02 23:05 |
|
Hejsa!
Jeg sidder lige og roder med at comitte den form til min db, men den smider
ikke noget i db'en...er der nogen der kan spotte problemet.
På forhånd tak!
<html>
<body>
Add new post:
<form method="POST" action="">
<table>
<tr>
<td>Title:</td><td> <input type=Text name="title" width=30><br></td>
</tr>
<tr>
<td>Body Text:</td><td> <Textarea name="bodytext" cols='19' rows='5'
wrap></textarea><br></td>
</tr>
<tr>
<td>Date:</td><td><input type=text name="date" width=30 value=>
</td>
</tr>
</table>
<input type='submit' name='submit' value='Submit'>
</form>
<?php
if ($submit) {
$link = mysql_connect("localhost", "root")
or die ("Could not connect");
mysql_select_db ("fisk", $link)
or die ("Could not select database");
// process form
$query = "INSERT INTO pa_post (ptitle,pbody,ptime) VALUES
('$_POST[title]','$_POST[bodytext]','$_POST[date]')";
$result = mysql_query($query)
or die ("Query failed");
mysql_close($link);
echo "\nThank you! Information entered.";
}
?>
</body>
</html>
| |
Christian Joergensen (16-06-2002)
| Kommentar Fra : Christian Joergensen |
Dato : 16-06-02 09:56 |
|
On Sun, 16 Jun 2002 00:04:47 +0200, Thomas G. Larsen wrote:
> if ($submit) {
prøv:
if (isset($_POST['submit'])) {
--
Christian Jørgensen | He who can does.
http://www.razor.dk | He who can't teaches.
| He who can't teach builds learning systems.
| |
Thomas G. Larsen (16-06-2002)
| Kommentar Fra : Thomas G. Larsen |
Dato : 16-06-02 10:12 |
|
Takker, det hjalp!!
"Christian Joergensen" <mail@phpguru.dk> wrote in message
news:pan.2002.06.16.08.55.37.487882.26525@phpguru.dk...
> On Sun, 16 Jun 2002 00:04:47 +0200, Thomas G. Larsen wrote:
>
> > if ($submit) {
>
> prøv:
>
> if (isset($_POST['submit'])) {
>
> --
> Christian Jørgensen | He who can does.
> http://www.razor.dk | He who can't teaches.
> | He who can't teach builds learning systems.
| |
|
|