HTML gevorderde |
|
<?php
if(IsSet($_POST['submit']))
{
mysql_query("UPDATE `links` SET `naam` = '".$_POST['naam']."', `link` = '".$_POST['link']."', `beschrijving` = '".$_POST['beschrijving']."' WHERE `id` = '".$_POST['id']'." LIMIT 1") or die mysql_error());
echo "De link is met succes gewijzigd";
}
if($_POST['wijzig']) //LINE 78
{
$query = mysql_query("SELECT * FROM links");
$id = $_POST['id'] -1;
?>
<form method="POST">
<table width="100%" cellspacing="0" cellpadding="1" border="0">
<tr>
<td>Naam link:</td><td><input type="text" name="naam" value="<? echo mysql_result($query, $id, "naam"); ?>"></td>
</tr>
<tr>
<td>Link:</td><td><input type="text" name="link" value="<? echo mysql_result($query, $id, "link"); ?>"></td>
</tr>
<tr>
<td>Bericht:</td><td><textarea rows="8" cols="40" name="beschrijving" value="beschrijving"><? echo mysql_result($query, $id, "beschrijving"); ?></textarea></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="submit" value="Bewerk"> <input type="submit" value="Terug" OnClick="javascript:history.back()"></td>
</tr>
</table>
</form>
<?php
} else {
?>
<form method="POST">
<table width="100%" cellspacing="0" cellpadding="1" border="0">
<tr><td width="5%"><b>#</b></td><td width="45%"><b>Naam link:</b></td><td width="50%"><b>Link:</b></td></tr>
<?php
$query = mysql_query("SELECT * FROM links ORDER BY naam ASC");
while($wijzig = mysql_fetch_object($query))
{
echo "<tr><td><input type=\"radio\" name=\"id\" value=\"".$wijzig->id."\"></td><td>$wijzig->naam</td><td>$wijzig->link</td></tr>";
}
?>
<tr><td colspan="3"><input type="submit" value="Wijzig" name="wijzig"></td></tr>
</table>
</form>
<?php
}
}
?>
<?php if(IsSet($_POST['submit'])) { mysql_query("UPDATE `links` SET `naam` = '".$_POST['naam']."', `link` = '".$_POST['link']."', `beschrijving` = '".$_POST['beschrijving']."' WHERE `id` = '".$_POST['id']'." LIMIT 1") or die mysql_error()); echo "De link is met succes gewijzigd"; } if($_POST['wijzig']) //LINE 78 { $query = mysql_query("SELECT * FROM links"); $id = $_POST['id'] -1; ?> <form method="POST"> <table width="100%" cellspacing="0" cellpadding="1" border="0"> <tr> <td>Naam link:</td><td><input type="text" name="naam" value=" <? echo mysql_result($query, $id, "naam"); ?>"></td> </tr> <tr> <td>Link:</td><td><input type="text" name="link" value=" <? echo mysql_result($query, $id, "link"); ?>"></td> </tr> <tr> <td>Bericht:</td><td><textarea rows="8" cols="40" name="beschrijving" value="beschrijving"> <? echo mysql_result($query, $id, "beschrijving"); ?></textarea></td> </tr> <tr> <td colspan="2" align="center"><input type="submit" name="submit" value="Bewerk"> <input type="submit" value="Terug" OnClick="javascript:history.back()"></td> </tr> </table> </form> <?php } else { ?> <form method="POST"> <table width="100%" cellspacing="0" cellpadding="1" border="0"> <tr><td width="5%"><b>#</b></td><td width="45%"><b>Naam link:</b></td><td width="50%"><b>Link:</b></td></tr> <?php $query = mysql_query("SELECT * FROM links ORDER BY naam ASC"); { echo "<tr><td><input type=\"radio\" name=\"id\" value=\"".$wijzig->id."\"></td><td>$wijzig->naam</td><td>$wijzig->link</td></tr>"; } ?> <tr><td colspan="3"><input type="submit" value="Wijzig" name="wijzig"></td></tr> </table> </form> <?php } } ?>
Ik krijg Citaat: Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /srv/mobiel/www/www.onbelangrijk/onbelangrijk.php on line 78
|