Re: Truncated output from querysring variable

From: Date: Fri, 16 May 2003 16:21:54 +0000
Subject: Re: Truncated output from querysring variable
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-147934@lists.php.net to get a copy of this message
Hi, Saturday, May 17, 2003, 2: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 AB> What could be happening? AB> TIA AB> Alberto Brea You need to urlencode the string before using it in an href (spaces become + from memory) ....&sql=".urlencode($sql) -- regards, Tom

« previous php.general (#147934) next »