<?php
if(isset($_POST['save']))
{
$name = $_POST['name'];
$c/o = $_POST['c/o'];
$address = $_POST['address'];
$city = $_POST['city'];
$phone = $_POST['phone'];
$fax = $_POST['fax'];
$email = $_POST['email'];
$web = $_POST['web'];
include("scripts/connect_db.php");
$query = "INSERT INTO members (name, c/o, address, city, phone, fax, email, web) ".
"VALUES ('$name', '$c/o', '$address', '$city', '$phone', '$fax', '$mail', '$web')";
mysql_query($query) or die('Error ,query failed');
include("scripts/close_db.php");
echo "'$name' er tilføjet i databasen";
}
?>
<form method="post"><p>
<table width="500" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="150" align="right" valign="top">Navn:</td>
<td width="350" align="left" valign="top"><input type="text" name="name" size="50"></td>
</tr>
<tr>
<td width="150" align="right" valign="top">c/o:</td>
<td width="350" align="left" valign="top"><input type="text" name="c/o" size="50"></td>
</tr>
<tr>
<td width="150" align="right" valign="top">Adresse:</td>
<td width="350" align="left" valign="top"><input type="text" name="address" size="40"></td>
</tr>
<tr>
<td width="150" align="right" valign="top">By:</td>
<td width="350" align="left" valign="top"><input type="text" name="city" size="30"></td>
</tr>
<tr>
<td width="150" align="right" valign="top">Telefon:</td>
<td width="350" align="left" valign="top"><input type="text" name="phone" size="20"></td>
</tr>
<tr>
<td width="150" align="right" valign="top">Telefax:</td>
<td width="350" align="left" valign="top"><input type="text" name="fax" size="20"></td>
</tr>
<tr>
<td width="150" align="right" valign="top">E-mail:</td>
<td width="350" align="left" valign="top"><input type="text" name="email" size="30"></td>
</tr>
<tr>
<td width="150" align="right" valign="top">Website:</td>
<td width="350" align="left" valign="top"><input type="text" name="web" size="30"></td>
</tr>
<tr>
<td width="150" align="right" valign="top"> </td>
<td width="350" align="left" valign="top"><input type="reset" value="Slet alle felter"><input name="save" type="submit" value="Gem medlem"></td>
</tr>
</table>
</p></form>
Jeg får en:
Parse error: parse error in /Users/gunnar/Sites/add_member.php on line 4
Hvorfor dælen lige det? :-o
Mvh
Gunnar