| Guido Speekenbrink 2004-06-28, 8:57 am |
| Please help me with transforming VARS in this script into
superglobals.
I have been trying it for a whole night. I didn't succeed.
This is just a part of one of many scripts I have to tansform
Vars in magis-quotes, vars in updat, vars in fetch array and vars in
table.
Thanks in advance,
Guido Sp enbrink
<?php
if (!get_magic_quotes_gpc()) {
$titel = addslashes($titel);
$link = addslashes($link);
}
if ($id) {
if ($submit) {
$sql = "UPDATE actuanews SET titel='$titel', link='$link',
tonen_n='$tonen_n' WHERE id=$id";
$result = mysql_query($sql);
echo "<p>" . htmlspecialchars(stripslashes($titel)) . " is
gewijzigd.</p>";
} else {
// query the DB
$sql = "SELECT * FROM actuanews WHERE id=$id";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
$_POST['id'] = $myrow ['id'];
$_POST['titel'] = $myrow ["titel"];
$_POST['link'] = $myrow ["link"];
$_POST['tonen_n'] = $myrow ["tonen_n"];
?>
<h2>Bekijk de inhoud van het record of wijzig deze</h2>
<form method="post" action="<?php echo $PHP_SELF?>">
<input type=hidden name="id" value="<?php echo $myrow["id"] ?>">
<table>
<tr><td>De titel?:</td></tr><tr><td><input type="Text" size="80"
name="titel" value="<?php echo $titel ?>"></td></tr>
<tr><td>De link?:</td></tr><tr><td><input type="text" size="80"
name="link" value="<?php echo $link ?>"></td></tr>
<tr><td collspan="2"><input type="checkbox" name="tonen_n" <?php if
($myrow["tonen_n"]==on) print("checked"); ?>>Nieuwsbericht in
rubriek.</td></tr>
</table>
<input type="Submit" name="submit" value="Wijzigen">
</form>
<?php
}
} "$datab_name"
?>
|