Select
By: Xmoo | Date: May 7 2009 15:02 | Format: PHP | Expires: never | Size: 2.25 KB | Hits: 1039
- <?php
- $eid = $_GET['id'];
- echo "<font color='2d6fbb' size='+1''><b>Edit Exercise</b></font><br><br>";
- $sql = "UPDATE my_training SET cat = '".$_POST["cat"]."', diff = '".$_POST["diff"]."', titel = '".$_POST["titel"]."', author = '".$author."', training = '".$_POST["training"]."', time = '".$timenow."', date = '".$datenow."' WHERE id = '".$eid."' AND author = '".$_SESSION['id']."'";
- echo "<br><br><br>
- <center><b><font face=verdana size=2 color=green>Training succesfully edited!</font></b></center>
- <br><br><br>";
- echo "<meta http-equiv='refresh' content='2;url=?p=training&sec=view&id=$eid'>";
- } else {
- $abc=mysql_query("SELECT * FROM my_training WHERE id = '".$_GET['id']."' AND author = '".$_SESSION['id']."'") or die(mysql_error());
- { $aid = $info->id;
- $cat = $info->cat;
- $diff = $info->diff;
- $titel = $info->titel;
- $training = $info->training;
- echo "<form action='' method='post'>";
- echo "Title: <input type='text' name='titel' size='30' value='".$titel."' /><br><br>";
- echo "Difficulty: <select name='diff'>";
- { $id = $info->id;
- $difficulty = $info->difficulty;
- echo "<option value='".$id."' SELECTED>".$difficulty."</option>"; } else {
- echo "<option value='".$id."'>".$difficulty."</option>";
- } }
- echo "</select><br><br>";
- echo "Category: <select name='cat'>";
- { $id = $info->id;
- $category = $info->category;
- echo "<option value='".$id."'>".$category."</option>"; }
- echo "</select><br><br>";
- echo "Training:<br><textarea name='training' cols='55' rows='10'>".$training."</textarea>";
- echo "<center><input type='submit' name='submit' value='Edit Training!'></center></form>";
- } }
- ?>
Latest pastes
1 days ago
2 days ago
5 days ago
6 days ago
6 days ago