Re: Passing string variable gets cut off

From: Date: Sun, 11 Mar 2001 15:41:24 +0000
Subject: Re: Passing string variable gets cut off
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-43393@lists.php.net to get a copy of this message
on 11.03.2001 16:16 Uhr, Fates at fateswarning@home.com wrote: > My strings are getting cut off when I pass to destination web page > > Example: > > Assign variable from database > $subcategory = mysql_result($result,$i,"subcategory"); > > Variable $subcategory is assigned "Graphic Editors" from database > (notice two words) > > Next I make a link and pass the variables to new page when person clicks > link > <? echo "<a > href='addupdate.php?category=$category&subcategory=$subcategory > > New page appears > The value of $subcategory is: Graphic It cut off everything after > Graphic, How do I fix that? > > > Yes, because there is a space in the word you want to submit over the URL. What you would need to do is: $subcategory = urlencode($subcategory); <a href='addupdate.php?category=$category&subcategory=$subcategory By this way the space is converted to the equivalent ascii-char -> %20 and then it should not get cut of anymore. regards, Jens Nedal

« previous php.general (#43393) next »