Jump to content

%20 Problem, please help!


Warptweet

Recommended Posts

For my PHP code, this is what I have to return a profile...

 

if ($_GET['cmd'] == 'viewuser'){
$users_name = $_GET['username'];

$con = mysql_connect("localhost","warp_gm","Forest77");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("warp_gm", $con);

$result = mysql_query("SELECT * FROM gm_users WHERE username='$users_name' LIMIT 1");

while($row = mysql_fetch_array($result))
  {
  echo "<center><img src=\"" . $row['profile_header'] . "\"></br></br>
<font size=\"5\">Your are viewing " . $row['username'] . "'s profile.</font></br></br>" . $row['username'] . "'s level is " . $row['userlevel'] . ", and has " . $row['experience'] . " experience.
";
}
}

 

BUT, there is a problem.

Pretend I have a user named 'Cool Guy'.

The space between the two words Cool and Guy are replaced with %20 on the url bar, which makes the php code search for Cool%20Guy, how can I make it so that it makes the %20 act like a space in the query search?

 

Thanks,

-Warptweet

Link to comment
https://forums.phpfreaks.com/topic/44046-20-problem-please-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.