Jump to content

Help with $_POST & $_GET!


u214

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.