Soaku Soaku - 1 year ago 87
PHP Question

POST data isn't being sent. GET forced?

My problem is more html problem than php. I haven't studied HTML very well, I'm more a php developer and I use w3css to style my site.

In one screen there is a menu with all items you own. Each one has a checkbox next to it. On the bottom of screen there is a sell all button. The whole menu is in a form. When I click the button the page gets only refreshed.

I made a debugger that echoes the

, but after submitting the form it looks like this:

Array ( )

Looks like something is preventing use of POST method. When I tried using GET it all worked right.

Here is part of the output code:

<form method="POST" action="/automaty?menu=col">
<ul class="w3-navbar w3-hover-yellow">
<li class="w3-navitem uncommon">
<input type="checkbox" name="var89" value="89" class="w3-check" style="height: 16px"> <b>116x Juice in a bottle 1</b>
<li class="w3-navitem">(...)</li>
<li class="w3-right"><a href="/automaty?menu=col&amp;sell=89">Sell now for 1.25$</a></li>

Question: Can anyone tell me what can break HTTP POST connection? A link in form? Or something else? If you can share what can force GET or what may be the problem, I would really appreciate it.

EDIT: I also tried removing the get data from action url. Nothing. Also, looks like nobody is interested in this question... Or its too hard? I don't own enough rep to create a bounty, but any new notification from SE app will make me happy.

Question still active, please help if you can.

Answer Source

Wow. That was the most nonsensical bug I ever saw. Do you even see a difference?


<form method="POST" action="/automaty">


 <form method="POST" action="/automaty/">

The Chrome network debugger showed me.

First connected to /automaty thru post - error 301 (moved permamently) and automatically redirected to /automaty/ thru GET. That's why form data wasn't being sent.

Really weird glitch, but real.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download