PHP Newbie needs your Help

I upgraded our web page to ssl and since than our 3rd party form is not working anymore https://www.underwatermagic.eu/uwm-contact-form.php if i use non https http://www.underwatermagic.eu/uwm-contact-form2.php it works now my real problem on the page for the form i found the following for wordpress:

How to force the form action URL to be SSL
Add the following code to your theme’s functions.php file or to a custom plugin.
Be sure to set the setting in the function to control which forms you want this on.
These filters only work with versions 4.xx and up, not the 3.xx versions or lower.
Note: you must already have a SSL certificate installed for your domain. If you do not already have the SSL certificate, please contact your web host to acquire one.

[php]function my_action_url_ssl($form_action_url, $form_id_num) {

##################################
// control which forms you want this on
$all_forms = false; // set to true for process on all forms, or false to use settings below
$forms = array(‘1’,‘2’); // one or more individual forms
##################################
if ( !in_array($form_id_num, $forms) && $all_forms != true)
return $form_action_url;

// force form action URL to be SSL
$form_action_url = preg_replace( ‘|http://|’, ‘https://’, $form_action_url );

return $form_action_url;

}
//filter hook for form action URL
add_filter(‘si_contact_form_action_url’, ‘my_action_url_ssl’, 1, 2);[/php]

My problem i have no clue how to implement this into my script.

Any suggestions are highly appreciated

Frank

There is no need for any code. Just remove the URL from the form action or leave the action out completely. If the file is called from https it will submit to https.

Set up the server so that it is always https no matter what URL you type.

  • FYI: Your server has several security issues. Your website also has 756 errors.

Hi Kevin,

thank you for your reply, i am working on the errors…

this is how i load the form in an iframe into my html page;

[php]

Untitled Document <?php $contact_form = 1; // set desired form number. $contact_form_path = '/home/underczq/public_html/contact-files/'; // set path to /contact-files/ with slash on end. require $contact_form_path . 'contact-form-run.php'; ?> [/php]

i will ask my provider if they can change my server to automatically load everything as https and than i hope everything will work again.

Thank you again

Frank

Why are you messing with putting the form in an Iframe? No need to complicate a simple thing.
You should also be using HTML5

That was at the time the fastest and simplest solution and ones it runs… And everything worked fine before changing to SSL

At the moment i just need to get it to work and than in the future i will think about changing everything to HTML 5.

Problem solved.

Sponsor our Newsletter | Privacy Policy | Terms of Service