0

I have form:

echo "
<form action='http://domain.com/' method='get'>
<input type='hidden' name='order_id' value='".$_SESSION['shoppingcart_id']."' />
<input type='hidden' name='account_id' value='".$account_id."' />
<input type='hidden' name='action' value='add' />
<input type='submit' class='form-button' value='Buy' />
</form>
";

and get don't get any results.

http://domain.com/

If I set value of action to empty like:

<input type='hidden' name='action' value='' />

the result is:

http://domain.com/?order_id=xxxxxxxx&acount_id=xxxxxxxxx$action=

I'm confused why with empty action get results, but with action don't get anything!?

p.s. With "post" is the same.

  • check out what variables are being sent first. try web inspector/firebug in your browser, or on your receiving page, do a var_dump($_GET); die("Show variables"); or var_dump($_POST); die("Show variables"); and look at your results. – Josh Brody Feb 02 '14 at 20:50
  • You should also avoid echoing HTML, for the record :) It's difficult to read, and more difficult to edit. – Josh Brody Feb 02 '14 at 20:51
  • When set value of action result is nothing, but when set empty value result is: ["action"]=> string(0) and the values of varaibles. – Bobi Reshovski Feb 02 '14 at 21:12
  • Is order_id and account_id being sent, and are the values of them correct? To debug, try changing the name of the action input to something like qwerty1 and seeing if that's sent. – Josh Brody Feb 02 '14 at 21:23
  • I turned off all javascripts and start working, now I'm looking for what script makes problems. – Bobi Reshovski Feb 02 '14 at 21:28

0 Answers0