I have declared a javascript string but it needs to be converted into a php string.. i have searched around a lot but i can't find the answer i have a string called String in javascript ..... String </script> that string needs to be entered in a database, but therefore it needs to be stored into a php string.... how??
PHP and JavaScript are absolutely different things: PHP is server-side language, while JavaScript is client side. You have to somehow pass this string to PHP script with via GET or POST request.
yes i know... i found something with sessions, but that didn't work for me. get and post are useless for me.. it works a bit like this: if a<2 it needs to add something, else it needs to insert a random name, declared in a 10,000 lines javascript.
As mentioned you'll need to find a different way to pass it.. most common ways are the following: GET POST Session Cookie **EDIT** This Google search should help
before you give up, can you post the ( shortened, but working ) actual javascript, I see nico looking too, never say never ....
http://www.ruimtelink.nl/ruimtelink5/js.txt document.GENFORM.txtName.value = sLine; should be changed of course
you can send any string from javascript to php using get,post etc method. example:request.open("GET", "page.php?string=" + string, true); you just catch it in the page.php using $_GET['string']
yes i tried that and it works. not exactly what i wanted but this way it does what i want also thanks!