Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'connection.php';
- if(!isset($_POST['submit'])){
- $q = "SELECT * FROM kunder WHERE ID = $_GET[id]";
- $result = mysql_query($q);
- $person = mysql_fetch_array($result);
- }
- ?>
- <h1>Du ändrar en användares information</h1>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
- Namn: <input type="text" name="inputName" value="<?php echo $kunder['Name']; ?>"/> <br />
- Problem: <input type="text" name="inputDesc" value="<?php echo $kunder['Description']; ?>"/><br />
- <br />
- <input type="hidden" name="id" value="<?php echo $_GET['id']; ?>" />
- <input type="submit" name="submit" value="Ändra" />
- </form>
- <?php
- if(isset($_POST['submit'])){
- $u ="UPDATE kunder SET `Name`='$_POST[inputName]', `Description`='$_POST[inputDesc]' WHERE ID = $_POST[id]";
- mysql_query($u) or die (mysql_error());
- echo "Användaren har ändrats";
- header("Location: edit.php");
- }
- else{
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement