Author Topic: PHP Newbie needs your Help  (Read 107 times)

LSDESIGN

  • New Member
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  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'12);



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

Any suggestions are highly appreciated

Frank


PHP Help Forum

PHP Newbie needs your Help
« on: August 08, 2017, 03:06:32 pm »


Kevin Rubio

  • Professional PHP Helper
  • Senior Member
  • *
  • Posts: 1829
  • Karma: 108
  • Programmer Available for hire
    • View Profile
    • Galaxy Internet
« Last Edit: August 08, 2017, 03:44:00 pm by Kevin Rubio »
PDO Bumpstart Database

The XY Problem
The XY problem is asking about your attempted solution (X) rather than your actual problem (Y). This leads to enormous amounts of wasted time and energy, both on the part of people asking for help, and on the part of those providing help. http://xyproblem.info/

PHP Help Forum

Re: PHP Newbie needs your Help
« Reply #1 on: August 08, 2017, 03:37:57 pm »


LSDESIGN

  • New Member
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
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;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <
html xmlns="http://www.w3.org/1999/xhtml">
  <
head>
  <
meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <
title>Untitled Document</title>
  <
script type="text/javascript" src="https://www.underwatermagic.eu/contact-files/contact-form.js"></script>
  
</head>
  
  <body>
 <?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';
 
?>
 
</body>
 </html>



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


PHP Help Forum

Re: PHP Newbie needs your Help
« Reply #2 on: August 08, 2017, 04:16:18 pm »


Kevin Rubio

  • Professional PHP Helper
  • Senior Member
  • *
  • Posts: 1829
  • Karma: 108
  • Programmer Available for hire
    • View Profile
    • Galaxy Internet
PDO Bumpstart Database

The XY Problem
The XY problem is asking about your attempted solution (X) rather than your actual problem (Y). This leads to enormous amounts of wasted time and energy, both on the part of people asking for help, and on the part of those providing help. http://xyproblem.info/

PHP Help Forum

Re: PHP Newbie needs your Help
« Reply #3 on: August 08, 2017, 04:24:16 pm »



PHP Help Forum

Re: PHP Newbie needs your Help
« Reply #4 on: August 08, 2017, 04:30:41 pm »



PHP Help Forum

Re: PHP Newbie needs your Help
« Reply #5 on: August 09, 2017, 04:52:17 am »