/    Sign up×
Community /Pin to ProfileBookmark

Why Submit Button Gets Auto Clicked WHen Page Refreshed ?

Hi,

Should not following get triggered only if a button is pressed such as submit button ?

[code]
if($_SERVER[‘REQUEST_METHOD’] = ‘POST’)
{
echo __LINE__; echo ‘<br>’; //LINE 62
[/code]

It gets triggered, the IF condition, when I press ENTER in my browser and reload the page.
Since I did not press the SUBMIT button then the browser did not use the POST method. So, why the IF gets triggered here ?
Same gets triggered if I refresh the page: CTRL+R.
Why ?
Guessing the submit button gets auto clicked when page is reloaded. But this should not happen.
I get echoed:
**62.**

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@novice2022authorJun 10.2022 — ISSUE SOLVED.

My mistake.

Error was here:
<i>
</i>if($_SERVER['REQUEST_METHOD'] = 'POST')


Switched it to these and they work.

**==

===**


I think in the past, I read on tutorials to use the 3 equal sign.

What you say ?

Thread maybe closed after an accurate answer.
Copy linkTweet thisAlerts:
@novice2022authorJun 10.2022 — Thread maybe closed.
Copy linkTweet thisAlerts:
@sibertJun 11.2022 — {"locked":true}
×

Success!

Help @novice2022 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.25,
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,
)...