Jump to content

wrong javascript syntax but it work any explanation ?


isaac_cm

Recommended Posts

I use dreamweaver 8.02 and I have to set the variable $_POST['
btn_addtocart_x'] to any value so when the page is post back some php code is executed so I placed the following lines in a javascript script function

this function make few checks if it succeed it submit the form and I set

the
previous variable like that

1   $_REQUEST['btn_addtocart_x'] = 1;
2   document.forms[0].submit();
3   unset($_REQUEST['btn_addtocart_x']);

the very strange thing although ffox and IE give me javascript errors to

line 1, 3 but it work fine and if I deleted these lines my php script did not

work correctly, how this is done ?

and is there any other way to Set the variable $_POST['btn_addtocart_x'] correctly and then unset the same variable after submit , I need it that way

thanks
sorry,
I set the variable $_REQUEST['btn_addtocart_x'] to "1" so my script can work also I need to unset the same variable after I submit the form from a javascirpt function
like that
    $_REQUEST['btn_addtocart_x'] = 1;
    document.forms[0].submit();
    unset($_REQUEST['btn_addtocart_x']);
please tell me what to do, thanks alot


Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.