Re: Truncated output from querysring variable
| From: | Burhan Khalid | Date: | Fri, 16 May 2003 16:22:49 +0000 |
| Subject: | Re: Truncated output from querysring variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147913@lists.php.net to get a copy of this message | ||
Hello Alberto,
Friday, May 16, 2003, 11:17:43 AM, you wrote:
AB> Hi, list. Could you please help me with this:
AB> I have the following string variable "$sql" on page1.php, which I am trying
AB> to print on page2.php. The string and link are as follows:
AB> [PAGE1.PHP]
AB> $sql="SELECT * FROM contacts
AB> WHERE u='$u'
AB> ORDER BY id
AB> DESC LIMIT 10";
AB> print("<td><a target=frame1 href=03frame1.php?u=$u&" .
AB> "inc=updrecord_form&id=$id&sql=$sql" .
AB> "updrecord=contact>upd</a></td>\n");
AB> [PAGE2.PHP]
AB> Now, on this page I validate the variable and try to print it like this:
AB> $sql= $_REQUEST["sql"];
AB> print("Query: " . $sql . "Query ends here<br>");
AB> However, the output is rendered truncated after the first word
AB> ("SELECT").This is the output:
AB> Query: SELECTQuery ends here
Try urlencode()
http://www.php.net/urlencode
and its opposite
http://www.php.net/urldecode
--
Best regards,
Burhan