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">

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.