/    Sign up×
Community /Pin to ProfileBookmark

isset not working with submit button

Can somebody please help me, I think I am going crazy! When I run my page I cannot get the isset function to work with submit buttons. It workes fine for other form post items like input text, radio or checkboxes. In my project I have a lot of checks like this to see what submit button was pressed and I was sure that they were working last week when I last tested my application, but yesterday when I sat down to do more development the isset function just won’t work on my buttons. I generated a simple test file to demostrate what I trying to accomplish. When I run this php file and click on the submit button I get “Not pressed” everytime.

Thanks

Scott

<?php
if (isset($_POST[‘btnLogin’])){
print “Button was pressed”;
}else{
print “Not pressed”;
}

?>
<html>
<head>
<title>Test</title>
</head>
<body>
<form method=”POST” action=<?php print $PHP_SELF; ?> >
<button type=”submit” name”btnLogin” value=”0″>Push Me</button>
</form>
</body>
</html>

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogAug 15.2006 — <i>
</i>&lt;button type="submit" name[color=red]=[/color]"btnLogin" value="0"&gt;Push Me&lt;/button&gt;
Copy linkTweet thisAlerts:
@bilysauthorAug 15.2006 — Ohh Dear. Thanks alot. I must have looked at this 100 times over the past couple of days and kept missing something so simple. I used to think I was a seasoned programmer, I must really be going crazy.

Thanks for the fresh set of eyes.
×

Success!

Help @bilys spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...