Don't know if this is what you mean (remember I'm a newbie S) but here it comes:
<?require ("./inc/settings.php");
$conn_gb = mysql_connect("$server", "$anvandare", "$losen");
$action = $_GET['action'];
if ($action == "add"){
$namn = $POST["namn"];
$mail = $POST["mail"];
$url = $POST["url"];
If ($url){
If (substr(strtolower($url),0,7) == "http://"){
$url = $url;
}else{
$url = "http://".$url;
}
}
$rubrik = $POST["rubrik"];
$msg = $_POST["msg"];
$msg = str_replace('"', """, $msg);
$msg = nl2br($msg);
$ip = $HTTP_SERVER_VARS['REMOTE_ADDR'];
$datum = time();
$sql = "Insert Into gastbok(namn,mail,url,rubrik,msg,ip,datum) Values('$namn','$mail','$url','$rubrik','$msg','$ip','$datum')";
//echo "SQL: $sql <br>";
mysql_db_query($databas,$sql) or die(mysql_error());?>
<script>location.href='gastbok.php';</script>
<?}else{?>
And this is the post action in the form field:
<form method="post" action="../Gastbok/gastbok.php?action=add" name="gastbok" onSubmit="return Gb()">
Originally posted by planetsim
Send the code that associates with the guest entry being added.