just me and php Posted December 5, 2006 Share Posted December 5, 2006 Im New At This Stuff And Have Gotten Alot Of Good Coding Ideas From These Forums , But Im Having A Problem With This, Is There A Code That I Can Insert Some Where In This Code Below So When URL Is Something Like php?id=Who%20Hit%20Fosty%20hohoho It Doesnt See The %20 ?[code]require('include/init.inc.php');pageheader(Fotoindex);$srch = 'filename';$p_id = $_GET['id'];$result = mysql_query("SELECT * from {$CONFIG['TABLE_PICTURES']} , {$CONFIG['TABLE_ALBUMS']} where ".$srch." LIKE '%".$p_id."%' limit 1 ");starttable(""); while ($row = mysql_fetch_array($result)) { echo "<tr><td><a href=\"displayimage.php?pos=-$row[pid]\" filename=\"$row[filename]\">$row[filename]</a></td></tr>\n"; } endtable();pagefooter();[/code] Link to comment https://forums.phpfreaks.com/topic/29462-help-please-with-url-20/ Share on other sites More sharing options...
trq Posted December 5, 2006 Share Posted December 5, 2006 [url=http://php.net/urldecode]urldecode[/url]. Link to comment https://forums.phpfreaks.com/topic/29462-help-please-with-url-20/#findComment-135209 Share on other sites More sharing options...
just me and php Posted December 5, 2006 Author Share Posted December 5, 2006 yes i look at urldecode last nite but could not figure out how to use in my code Link to comment https://forums.phpfreaks.com/topic/29462-help-please-with-url-20/#findComment-135233 Share on other sites More sharing options...
jsladek Posted December 5, 2006 Share Posted December 5, 2006 You should not need to worry about the %20's with $_GET['id']; Are you saying you don't want to see the %20 in the URL?Print out the var to see what it looks like [code]$p_id = $_GET['id'];print("<hr>p_id: $p_id<hr>");[/code]If that looks fine then change this line[code]$result = mysql_query("SELECT * from {$CONFIG['TABLE_PICTURES']} , {$CONFIG['TABLE_ALBUMS']} where ".$srch." LIKE '%".$p_id."%' limit 1 ");[/code]to this[code]$tbl_sql = "SELECT * from {$CONFIG['TABLE_PICTURES']} , {$CONFIG['TABLE_ALBUMS']} where ".$srch." LIKE '%".$p_id."%' limit 1 ";print ("<hr>SQL: $tbl_sql<hr>");$result = mysql_query( $tbl_sql );[/code]If the sql looks good there then just comment out the [b]print ("<hr>SQL: $tbl_sql<hr>");[/b]-John Link to comment https://forums.phpfreaks.com/topic/29462-help-please-with-url-20/#findComment-135253 Share on other sites More sharing options...
just me and php Posted December 5, 2006 Author Share Posted December 5, 2006 Thanks Guys And jsladek You Showed Me Something That I Always Wanted To Know How To Do , Print Url And See The Output,And Your Right The %20's Are Not There.Unfortionly It Looks Like What Im Trying To Do Is In Possible.I Have Over 5000 Diff FileNames In Data Base And They Are All Diff From My URLExample url beeper(db name beeper<--No Problem), url beep beep(db name Beep Beep<--Problem), url beep_beeper(db name BeepBeeper<--Problem),url beepbeepers(db name Beep_Beepers<--Problem)i have to many url names that really dont match db names.Thanks Again For Helping ;) Link to comment https://forums.phpfreaks.com/topic/29462-help-please-with-url-20/#findComment-135279 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.