RE: [PHP] framing search results

From: Date: Tue, 06 Feb 2001 06:50:11 +0000
Subject: RE: [PHP] framing search results
Groups: php.general 
Request: Send a blank email to php-general+get-38359@lists.php.net to get a copy of this message
You can encode URLs with urlencode() and decode them by using urldecode()... try read here: www.php.net/urlencode www.php.net/urldecode ### my way: ### you pass $url: $url = www.maxim.cx/get.php?this=variables&as=many&as=you&what=want echo "<a href=\"$PHP_SELF?url=".urlencode($url)."\">"; ### and you catch it with: <? switch($x){ case "frame": ?> <frameset framespacing="0" border="0" frameborder="NO" rows="135,*"> <frame name="top" src="header.shtml" marginwidth="0" marginheight="0" scrolling="NO" noresize> <frame name="textarea" src="<? echo urldecode($url); ?>"> <? break; } ?> Cheers, Maxim Maletsky -----Original Message----- From: Jason Dulberg [mailto:jdulberg@nas.net] Sent: Tuesday, February 06, 2001 3:09 PM To: php-general@lists.php.net Subject: [PHP] framing search results I'd like to create a script that will frame search results made by various databases. I will be hardcoding these links into an HTML page. Since there will be alot of these links and I will be using the script across several virtual hosts, I can't have the links built by a db as they link to offsite stuff. My problem so far is that if I try to link to a search result (which is obviously built by a database), I get a bunch of errors because the &, =, ? etc. fields are dropped. So basically, I need to escape the ?,&'s etc. in the url. I can do this in perl (cgi::escape) but I'm not quite sure how to do it in php. Couldn't get it to work properly in perl so I'm crossing over to PHP to see if its doable. Here's what I got from a code example from zend.com. Basically, I just need to add the %3A etc onto $url. <? switch($x){ case "frame": ?> <frameset framespacing="0" border="0" frameborder="NO" rows="135,*"> <frame name="top" src="header.shtml" marginwidth="0" marginheight="0" scrolling="NO" noresize> <frame name="textarea" src="<? echo $url; ?>"> <? break; } ?> Now one thing that I noticed is that often when the url is encoded and I try the link, I get a 404 error. What am I doing wrong? So the links that I hardcode into the html is something like xyz.com/frame.php?page=searchresults.php or something like that. I'm really new to php so sorry if this is kinda vague. If there's a better way of doing what I'm trying to above, please let me know! Thanks in advance for your help! __________________ Jason Dulberg Extreme MTB http://extreme.nas.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#38359) next »