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

133
Views
Alert Box before PHP action = "newpage.php" gets executed

I am new to php . and i am trying to pop up an alert box before the page action = "newpage.php" gets executed using the header function , but it isn't working and every time without the alert box being popped up, i get redirected to the next page on successful form submissions.

what should i do to pop an alert box on successful submission of data in my database before going to the next page

here's my code snippet that i have used to do so---->

if($conn->query($insertQuery)){
   if($_POST) {
         echo '<script>  alert("Registered");   </script>';
   }
   else{
         echo '<script>  alert("Not");   </script>';
   }
   header("location:login.php");
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

if($conn->query($insertQuery)){
   if($_POST) {
         echo '<script>  alert("Registered");   </script>';
   }
   else{
         echo '<script>  alert("Not");   </script>';
   }
echo '<script> window.location.href = "login.php";   </script>';

Try This

about 4 years ago · Juan Pablo Isaza 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!