Curious PHP issue

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
obrienj
 
 
Posts: 12
Joined: Thu Sep 03, 2020 11:42 pm

Curious PHP issue

Post by obrienj »

I have the following PHP snippet generated by one the the extensions:

Code: Select all

<?php
session_start();

$success_page = 'https://<a valid URL>';
$error_page = './page1.html';
$mysql_server = 'localhost';
$mysql_username = 'xxxxxxxxx';
$mysql_password = 'xxxxxxxx';
$mysql_database = 'xxxxxxxx';
$mysql_table = 'xxxxxxx';
$crypt_pass = md5($_POST['password']);    <=============== Unknown Index
$found = false;
$fullname = '';
$role = '';
$avatar = '';
$session_timeout = 600;
$error_message = "";
I have two Apache based servers, one running PHP 7.3.6 and the other 7.4.9

On PHP 7.3.6, the code runs fine

On PHP 7.4.9, the code raises an "Unknown index" error and several others later on relative to the variable "password".

Any thoughts on why, I am baffled.

Jim
User avatar
Pablo
 
Posts: 23451
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Curious PHP issue

Post by Pablo »

Is this code generated by one of the built-in objects?
Or did you remove code manually?
obrienj
 
 
Posts: 12
Joined: Thu Sep 03, 2020 11:42 pm

Re: Curious PHP issue

Post by obrienj »

I apologize Pablo, this snippet is part of a combined piece of code that I forgot that I did,

Clearly, the variable password is not defined at the point that "$crypt_pass is defined.

That said, I still don't under stand why it would run on one server and not the other.

Was there some increase in error detection between 7.3.4 and 7.4.9? Or is it "php.in"i or php settings issue?

Either way, I will fix my error.

Sorry to disturb you.

Jim
User avatar
Pablo
 
Posts: 23451
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Curious PHP issue

Post by Pablo »

I think newer versions of PHP are stricter, so if the $_POST variable is not set then it will trigger an error.
obrienj
 
 
Posts: 12
Joined: Thu Sep 03, 2020 11:42 pm

Re: Curious PHP issue

Post by obrienj »

Besides stricter PHP rules, Google has been messing around with "localhost" as a domain for ReCaptcha. Which may also have something to do with it working on my web hosting site but not on my laptop with WAMP. That makes testing locally a bit of a problem.

Thanks for the help.

Jim
Post Reply