Re: Passing variable with slashes in URL

From: Date: Wed, 16 May 2001 20:46:22 +0000
Subject: Re: Passing variable with slashes in URL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-53114@lists.php.net to get a copy of this message
cant say for sure, but I dont play around with rawencode and addslasses for urls, just use urlencode() echo " <a href='index.php?test=". urlencode($text) ."&test2=". urlencode($test2) ."'>test</a> "; -- Chris Lee lee@mediawaveonline.com ""Claudia Smith"" <claudia@friendlysoftware.com> wrote in message news:9duqke$9g1$1@toye.p.sourceforge.net... Currently I have a problem with IE. The IE browser will not bring up my encoded url. When clicking on the link I either receive a script error or nothing happens. The issue is with the double quotes. IE does not recognized the encoded character %22 for quotes. IE does seem to process single quotes (%27) OK. Here is my code to encode the string variable and create the link The string I am having problems with = "All Inclusive" Casa De Campo Golf = $headline $url_title = rawurlencode( $headline ); print "<tr><td align = 'left'><font face='arial' size='2'><a href='javascript:openQuote(\"$main_url/miniquote_form.inc.php3?site=$site&ad =$ad&header=$url_title\", \"helpWin\");'>Contact us for information</a></font>"; Here is what the url looks like in the Netscape browser window header=%22All%20Inclusive%22%20Casa%20De%20Campo%20Golf If I include this code: $headline = addslashes ($headline); before the: $url_title = rawurlencode( $headline ); IE now processes the url link and the string displays correctly for me in my popup window. Here is the IE url: header="All%20Inclusive"%20Casa%20De%20Campo%20Golf However -- NS now displays the string with backslahes. Here is the comparable NS url: header=%5C%22All%20Inclusive%5C%22%20Casa%20De%20Campo%20Golf Here is the code in my form to display the header variable (which I thought would strip out the slashes) <?php $headertitle = stripslashes( $header ); print "$headertitle"; ?> I have tried htmlentities as: $url_title = htmlentites( $headline ); and neither IE nor Netscape would work -- the url link would not work. perhaps my syntax is incorrect for this function? Claudia -- 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 (#53114) next »