how to pass strings containing the character "&" in GET
Posted: Sun Aug 24, 2008 9:46 pm
i am relatively new to php and i have a form that uses GET as its method of submitting (to a php file).
now since the character
GET variables), if a string containing the & character is submitted as a value to one of my GET variables the program totally does not work.
here is a sample code:
in here for example,
my GET variable name is origin_type
the value to be submitted is whatever the value of $default_type
the program does not work if $default_type contains the string &
how can i make the program work even if the & is present and to be submitted as
i don't want to restrict my users not to include the & in their form inputs?
thanks a lot...
now since the character
is a reserved character when using GET (used to concatenate&
GET variables), if a string containing the & character is submitted as a value to one of my GET variables the program totally does not work.
here is a sample code:
Code: Select all
<a href=\"#\" onClick=\"window.open('http://".$_SERVER['SERVER_NAME'].$DIR_MAIN_FOLDER."/pages/forms/com_communication.form.php?title=".addslashes($uvalue['title'])."&origin_type=".addslashes($default_type)."&datetime_encoded=".addslashes($uvalue['datetime_encoded'])."&operation=update', 'myWin', 'toolbar=0,status,resizable=0,scrollbars,width=750,height=600,screenX=400,screenY=200');\">
<img src=\"".$DIR_IMAGES."/edit4.gif\" title = 'edit'>
</a>Code: Select all
origin_type=".addslashes($default_type)."the value to be submitted is whatever the value of $default_type
the program does not work if $default_type contains the string &
how can i make the program work even if the & is present and to be submitted as
i don't want to restrict my users not to include the & in their form inputs?
thanks a lot...