Jump to content

Code incompatible with php 5.5 and above


stupeur

Recommended Posts

Hi everybody, I have some code that is incompatible with php 5.5 and above, so I found myself stuck to php 5.4 which causes come other trouble an some other incompatibilities i my site 

 

here is the problematic code :

 

    <section class="full-width-bg gray-bg normal-padding get-in-touch-overlay">
        <div class="row">
            <div class="col-lg-6 col-md-6 col-sm-8 col-lg-push-3 col-md-push-3 col-sm-push-2">
<h2><span style="color: #ffffff;"><?php _e('Contact Form', 'marine'); ?></span></h2>
 
                <form class="get-in-touch contact-form" method="post">                    <?php wp_nonce_field('contact_form_submission', 'contact_nonce', true,
                        true); ?>                    <input type="hidden" name="contact-form-value" value="1" id=""/>
 
                    <div class="iconic-input"><input type="text" name="name" placeholder="<?php _e('Name*', 'marine'); ?>"> <i class="icons icon-user-1"></i></div>
                    <div class="iconic-input"><input type="text" name="email" placeholder="<?php _e('E-mail*', 'marine'); ?>"> <i class="icons icon-mail-4"></i></div>
                    <textarea name="msg" placeholder="<?php _e('Message', 'marine'); ?>"></textarea> <input type="submit"
                                                                                                            value="<?php _e('Send Message', 'marine'); ?>">
 
                    <div class="iconic-button"><input type="reset" value="<?php _e('Clear', 'marine'); ?>"> <i class="icons icon-cancel-circle-1"></i></div>
                </form>
                <div id="msg"></div>
            </div>
        </div>
    </section>
 
 
please help 
thanks 
 
Link to comment
Share on other sites

Thanks for your reply, and sorry 

Yes the debug is on and actually I have no error message but the form submit button remains on sending message and the form is not submitted 

when I turn back to php 5.4 / 5.3 everything works fine 

Link to comment
Share on other sites

I believe the problem is somewhere else in your code. The only PHP code snippet in your submit button is a basic function that displays title for submit button, so if it's displayed properly, you can safely eliminate it from debug list. If you view POSt headers (you can do that using a plugin like http live headers if your browser doesn't support this feature), does data actually get posted?

 

Also, it looks you run WP. Is it the latest version (including plugins)? I somehow have a feeling the issue might be related to some antispam plugin, which might be out-of-date and cause problems with new versions of PHP.

Link to comment
Share on other sites

What plugin are you using to send your email? WordPress recommends version 7 or greater, but very much works with 5.5 and up. Also, if the plugin you're using does ajax submissions open your console and check the networking. I know there were a couple issues with Ninja Forms until a recent update that would cause behavior that sounds like what's you're describing.

Link to comment
Share on other sites

Thank you all

Actually I am quite a newbie to all this, 

the contact form is featured with the template and not really customisable. 

I am running the latest version of wp and everything works fine, either with php mail or wp mail smtp ( for the other contact forms from CF7) 

I think I will get rid of this contact form once and for all 

Thanks 

Link to comment
Share on other sites

the problem is likely in the form processing code, it's probably relying on register globals and is expecting program variables to be set that aren't. the php version change the OP made is probably, correctly, turning off register globals and the badly written code is no longer detecting that anything was submitted.

Link to comment
Share on other sites

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.