Jump to content

PHP Form action works in firefox but not chrome


sabinmash

Recommended Posts

I have this form action that checks for errors, if none are found it should go to the confirmation page.  Works well in Firefox, however Chrome stays perpetually on the register page. 

 

Is there any way to make this work in Chrome as well?  Does anyone have any explanation? 

 

Thank you very much for your time.

 

 

 
<form action="<?php if(!empty($errors)){
echo "confirmation.php";
} else {
echo "register.php";
} ?>" method="POST">

Check your condition in Chrome and other browsers and usee some other way around to make the functionality work.

 

It will depend on what values you are getting in $errors variable, is it a single string error or an array of errors or an error code.

In that way you can check the $error variable value first and then apply the condition.

 

 

The logic - !empty($errors) implies that if there are errors, goto the confirmation.php page. That's backwards. If empty($errors) should goto the confirmation.php page.

 

It's likely that your error checking logic IS working in Chrome and not working in Firefox (assuming the code you did post is the actual logic you are using.) You would need to troubleshoot why your $errors value is not ! empty in Firefox.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.