Why so many backslashes??
Posted: Mon Dec 12, 2005 2:45 pm
I am making a directory administration panel for my site, and the description line always somes up like this if there are apostrophies and I have to submit, and fix errors a bunch of times. I think it has something to do with the urlencode function because every time you submit it, it adds more backslashes. here is the code where it is printed:
and the php function that encodes the url
and here is what I get
Code: Select all
<tr>
<td>Description of Business</td>
<td><textarea type="text" class="<?php echo $_GET['e_desc'] ?>_text" name="desc" rows="4" cols="20" /><?php echo stripslashes($_GET['desc']) ?></textarea></td>
</tr>Code: Select all
function make_query($array, $negate="NONE"){
$query_string = "&";
foreach($array as $key => $val){
if($key != $negate && is_array($val)){
foreach($val as $k => $v){
$query_string .= urlencode($key) . $k . "=" . $v . "&";
}
}
elseif($key != $negate){
$query_string .= urlencode($key)."=".urlencode($val)."&";
}
}
$query_string = substr($query_string, 0, -1);
return $query_string;
}I can't really explain it any better than that... so sorry if it is confusingasd df \\\\\\\'asd\\\\\\\'fa\\\\\\\' sdf \\\\\\\'asdf\\\\\\\' asd\\\\\\\'f asd\\\\\\\'f a\\\\\\\'sdf