php - $_POST not finding a "name" value -
php - $_POST not finding a "name" value -
i trying submit form, should send forth name, know i'm messing silly , can't see (3 hours of sleep lastly night + new coding project @ work != smart idea)
here's form on 1 page:
<form action="add.php" method="post"> <button type="submit" name="exportcult">export all</button> </form>
and here's code on other page, meant process post:
if (!isset($_post["name"]) || $_post["name"] == '') { header('location: '.$criteria."?error=data"); die(); }
i getting error message sends back, know isn't registering name - why be?
i think you're confused how form info gets submitted. "name" attribute, not key value found in post data. need specify name element, key value nowadays in post data. have specified name="exportcult"
in post data, variable @ $_post['exportcult']
. however, value empty string since have not indicated value
attribute button.
keep in mind when dealing submit buttons, only value of button used submit form included along rest of form data. seek using this:
<button type="submit" name="exportcult" value="export">export all</button>
if specific button used submit form, $_post['exportcult']
should equal 'export'
.
for of unsure: buttons do submitted form, still have have value attribute.
php html post
Comments
Post a Comment