Problem between 2 versions of PHP, code works with one version but not the other |
Problem between 2 versions of PHP, code works with one version but not the other |
CharlesEF |
Nov 12 2013, 06:55 PM
Post
#1
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
Hi All,
I'm new to PHP and have run into a problem I can't seem to find/fix. I'm hoping someone here can point me in the right direction. I have a contact form that works fine when run with PHP v5.2.17 When I update PHP to v5.3.13 the form no longer works (my hosting site allows me to switch). The validation of the 'Captcha image' always fails. I have looked at the code but I can't see anything wrong, but I am real new to PHP. I have a test site for this contact form here. My site is set to use PHP v5.3.13 so anyone will get the same error I get. I hope someone can point me in the right direction to fix this problem. Thank you for any help, Charles PS: I have used ini_set('display_errors', 'On'); and error_reporting(E_ALL); but I can't see any error related to 'Captcha image'. I do see other errors like undefined variables. Attached is the zip file of the contact form: image_captcha_1.zip ( 38.19k ) Number of downloads: 362 This post has been edited by CharlesEF: Nov 12 2013, 07:34 PM |
Christian J |
Nov 12 2013, 07:35 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,668 Joined: 10-August 06 Member No.: 7 |
I get a captcha validation failure already in the javascript, AFAICS the form is never submitted --or is the captcha value sent with Ajax? Try to make the PHP script print out in clear text which captcha value it's expecting, and what it actually gets.
There are quite a few changes between your two PHP versions: http://www.php.net/ChangeLog-5.php Personally I think captchas are an annoyance. I'd try javascript "encryption" of the server-side script's URL instead, or adding a hidden honeypot form field (that only spambots but not real users will fill in). This post has been edited by Christian J: Nov 12 2013, 07:47 PM |
CharlesEF |
Nov 12 2013, 09:19 PM
Post
#3
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
Since the problem shows up only when I change PHP versions I never looked at any javascript code. I will see what I can find.
Thanks for the input, Charles |
CharlesEF |
Jun 15 2014, 06:02 PM
Post
#4
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
I found the problem and just want to report the fix.
After wracking my brain going over the code the fix turned out to be simple. The problem was the 'session.save_path' setting in the php.ini file. The web host path was wrong and I just put in a valid path and the contact form now works as it should, under both versions of PHP. Hope this helps someone else. |
Lo-Fi Version | Time is now: 21st May 2024 - 07:10 PM |