sabinmash Posted October 29, 2011 Share Posted October 29, 2011 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"> Quote Link to comment https://forums.phpfreaks.com/topic/250034-php-form-action-works-in-firefox-but-not-chrome/ Share on other sites More sharing options...
harristweed Posted October 29, 2011 Share Posted October 29, 2011 try: <?php if(!empty($errors)){ echo '<form action="confirmation.php" method="POST">'; }else{ echo '<form action="register.php" method="POST">'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/250034-php-form-action-works-in-firefox-but-not-chrome/#findComment-1283199 Share on other sites More sharing options...
sabinmash Posted October 29, 2011 Author Share Posted October 29, 2011 Hmm nope same problem still. Thank you anyways though. Quote Link to comment https://forums.phpfreaks.com/topic/250034-php-form-action-works-in-firefox-but-not-chrome/#findComment-1283203 Share on other sites More sharing options...
uday8486 Posted October 29, 2011 Share Posted October 29, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/250034-php-form-action-works-in-firefox-but-not-chrome/#findComment-1283214 Share on other sites More sharing options...
PFMaBiSmAd Posted October 29, 2011 Share Posted October 29, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/250034-php-form-action-works-in-firefox-but-not-chrome/#findComment-1283251 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.