Warptweet Posted March 23, 2007 Share Posted March 23, 2007 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 More sharing options...
per1os Posted March 23, 2007 Share Posted March 23, 2007 $name = str_replace("%20", " ", $name); Link to comment https://forums.phpfreaks.com/topic/44046-20-problem-please-help/#findComment-213866 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.