Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
if / elseif `isset` multiple submit inputs doesn't work

I have several submit inputs (buttons) on a page, with the following issetconditions:

if ( isset( $_POST[ 'noranTelChecks' ] ) ) { // user requested noranTelCheck sheet
    header( 'location: noranTelChecks.php' );

  } elseif ( isset( $_POST[ 'juniperChecks' ] ) ) { // user requested noranTelCheck sheet
    header( 'location: juniperChecks.php' );

  } elseif ( isset( $_POST[ 'mpr95001Checks' ] ) ) { // user requested noranTelCheck sheet
    header( 'location: mpr95001Checks.php' );
} // close IF

But no matter what button is clicked the page is always redirected to the link referred to by the first IF condition. If I change the order of the links referred to, it is always the link in the first condition that the page gets redirected to.

What could be the problem with the above code causing this issue, as I have done this in the past on other pages and it has worked fine?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I guess your buttons have values set for example

<input type="submit" id="noranTelChecks" name="noranTelChecks" value="Button 1"/>

so you could use the value instead of name or id. The code would be as follow

if ( isset( $_POST["Button 1"] ) ) 
{ 
    header( 'location: noranTelChecks.php' );
}
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!