u214 Posted May 4, 2011 Share Posted May 4, 2011 Hello guys. I'm trying to improve my control panel system. I have this page where you input a player's name and when you hit "Search" it will display that user's information. Ok. This is the code: <form action="ShowStats.php" method="post"> <li><font color="#FF9933"><b>User's Name:</b></font> <input type="text" name="User" /></li> <p> </p> <p> </p> <input type="submit" value="Search" /></form> That's when you input the player's name and the Search button. Once you hit that button, I want the Address bar to display something like this: "www.test.com/ShowStats.php?User=SEARCHED_USER" Here's the $_POST ( and "fetch" user's info ) function inside "ShowStats.php" include("database.php"); if(!$con) { die('Could not connect: ' . mysql_error()); } $user = $_POST["User"]; $escuser = mysql_real_escape_string($user); $result = mysql_query("SELECT * FROM playerinfo WHERE user = '$escuser'"); $username_exist = mysql_num_rows($result); if($username_exist == 0) { echo('<b><font color="#C41F1F">That username does not exist</b></font>'); echo('<p><center><font face="Arial" color="#000080" size="2"><b><a href="http://yu-ki-ko.com/fsns/Stats.php">Go back</a></b></center></font></p>'); die; } $row = mysql_fetch_row($result); All I want is that when a user searches for the player, the address bar will be displayed like: "www.test.com/ShowStats.php?User=SEARCHED_USER" Thanks! If any more info is needed, let me know. Quote Link to comment Share on other sites More sharing options...
requinix Posted May 4, 2011 Share Posted May 4, 2011 Change method=post to method=get and use $_GET instead of $_POST. And please: the font tag was deprecated ages ago. Use CSS. Quote Link to comment Share on other sites More sharing options...
u214 Posted May 5, 2011 Author Share Posted May 5, 2011 Thank you so much requinix. And about the font tag, I'm new to html/css stuff, that tip will help me with that. Thank you once again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.