Cooper94 Posted February 20, 2009 Share Posted February 20, 2009 <?php include 'data.php' ?> <?php // coonnect to database if (isset($_GET['id'])) { $sql = "SELECT username FROM pilots WHERE id='{$_GET['id']}'"; if ($result = mysql_query($sql)) { $row = mysql_fetch_assoc($result); } else { echo "query failed ".mysql_error(); } } else { } ?> <?php $username = $_POST['username']; $username = mysql_real_escape_string($username); if(isset($_POST['submit'])) { mysql_query("UPDATE pilots SET username = '$username' WHERE id ='{$_GET['id']}'"); Header ('Location: acceptapp.php?id={$_GET['id']}'); } ?> <?php $sql="SELECT * FROM pilots ORDER BY id DESC LIMIT 1"; $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($result); $a = $row['username']; echo "Last User: " . $a; ?> <form action="set.php?id=<?php echo $_GET['id'] ?>" method="post"> <input type="text" name="username" value="RPA"><br> <input type="submit" name="submit"> </form> How would I make it echo out the id becuase I after I assign them a username than I want it to continue with the accept pilot proccess. Link to comment https://forums.phpfreaks.com/topic/146163-_get-into-header/ Share on other sites More sharing options...
rhodesa Posted February 20, 2009 Share Posted February 20, 2009 variables aren't evaluated inside single quotes...use double quotes: Header ("Location: acceptapp.php?id={$_GET['id']}"); or concatenate: Header ('Location: acceptapp.php?id='.$_GET['id']); Link to comment https://forums.phpfreaks.com/topic/146163-_get-into-header/#findComment-767381 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.