-
-
Save dennisdegryse/44c9d00b413bb927fec2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include("mysql_open.php");?> | |
<?php | |
if($_POST['Submit']=="Opdater") { | |
$db = new mysqli('localhost', 'user', 'pass', 'db'); | |
$statement = $db->prepare("UPDATE `fp_text` SET `fp_header`=?,`fp_text`=? WHERE `fp_id`=?"); | |
$statement->bind_param('s', $_POST['value-2']); | |
$statement->bind_param('s', $_POST['value-3']); | |
$statement->bind_param('i', $_POST['value-1']); | |
$result = $statement->execute(); | |
} | |
?> | |
<form action="index.php" name="text_edit1" method="post" enctype="multipart/form-data"> | |
<?php | |
$query = mysql_query("SELECT * FROM `fp_text` WHERE 1"); | |
while($row = mysql_fetch_array($query)){ | |
?> | |
<div style="font-family: 'PT Sans', sans-serif;"> | |
Overskrift<br /> <input name="fp_header<?= $row['id'] ?>" type="text" size="64" maxlength="64" value="<?= $row['fp_header'] ?>" /><br /> | |
<br /> | |
Beskrivelse af Stutteriet:<br /> <textarea name="fp_text<?= $row['id'] ?>" cols="50" rows="16"><?= $row['fp_text'] ?></textarea><br /><br /><br /> | |
</div> | |
<?php | |
} | |
?> | |
<input name="Submit" type="submit" id="Submit" value="Opdater" /> | |
</form> | |
<?php mysql_close($db); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment