- Joined
- Jul 26, 2006
- Messages
- 3,626
- Reaction score
- 1,006
So, I got this:
Yes, I've tried <?php echo $shop_name; ?> instead of the quick tags.
unc() (the reverse of mysql_real_escape_string)
I know some stuff can be done more efficient but that's not my question here.
The weird thing is, that if I just echo the $shop_name, it prints it out neatly, without any backslashes still in it, etc.
Now, when I put the $shop_name in the value="" of my input tag, it only prints out this:
I have tried several things but I can't get my head around it.
Thanks,
~Elite.
EDIT:
Even making it a type="hidden" works. Something fishy is going on :S
I've now changed it to a <textarea> that matches the size of just one text line. This is my desperate solution lol.
PHP:
<?php
if($row['shop_name'] == "N/A")
{
$the_shop_name = unc($row['ign'] ."'s Shop");
}
else
{
$the_shop_name = unc($row['shop_name']);
}
?>
<form action="<?=$_SERVER['PHP_SELF'];?>" method="post">
<input type="text" value="<?=$shop_name;?>" name="shop_name" class="bigbox text" maxlength="40" /> //no worky
unc() (the reverse of mysql_real_escape_string)
PHP:
function unc($string)
{
$cms = array("\\\"", "\\'");
$rms = array("\"", "'");
$tstring = $string;
for($i = 0; $i < count($cms); $i++)
{
if(strstr($tstring, $cms[$i]))
{
$tstring = str_replace($cms[$i], $rms[$i], $tstring);
}
}
return $tstring;
}
I know some stuff can be done more efficient but that's not my question here.
The weird thing is, that if I just echo the $shop_name, it prints it out neatly, without any backslashes still in it, etc.
Now, when I put the $shop_name in the value="" of my input tag, it only prints out this:
Code:
X 00 X's //note the extra space!
//of what has to say:
X 00 X's "Donator & Others" Shop
I have tried several things but I can't get my head around it.
Thanks,
~Elite.
EDIT:
Even making it a type="hidden" works. Something fishy is going on :S
I've now changed it to a <textarea> that matches the size of just one text line. This is my desperate solution lol.
Last edited:

