Forum Moderators: coopster
when i click on a link in my website
(exp. gallery) it directs me to [domain].\/gallery.php ,so i get "server not found" error.
i think the problem is here:
function clean_value($value)
{
$value = str_replace("\\\"", "\"", $value);
$value = str_replace("\\'", "'", $value);
$value = str_replace("\\\\", "\\", $value);
$mmhclass->info->user_session = unserialize(stripslashes(str_replace(""", "\"", urldecode($mmhclass->input->cookie_vars['mmh_user_session']))));
block_id.innerHTML = "<input type=\"text\" id=\"" + id + "_rename\" maxlength=\"25\" style=\"width: 165px;\" class=\"input_field\" value=\"" + block_id.innerHTML + "\" />";
please help !
[edited by: NoviceMaster at 12:03 am (utc) on Feb. 29, 2008]
Not sure where it comes from but I thought I try to give you some coding pointer (please note I am not the greatest coder)
1. It is not usually recommended to modify value entered in a form field. I am saying this because of all the str_replace code you have. If this comes from a form it is usually best to fail the verification rather than 'trying to clean' the data.
2. make your js code cleaner, you could use single quotes for your vars ie.
block_id.innerHTML = "<input type=\"text\" id=\"" + id + "_rename\" maxlength=\"25\" style=\"width: 165px;\" class=\"input_field\" value=\"" + block_id.innerHTML + "\" />";
becomes
block_id.innerHTML = '<input type="text" id="' + id + '"_rename" maxlength="25" style="width: 165px;" class="input_field" value="' + block_id.innerHTML + '" />';