Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 11-02-2023, 03:01 AM   #1
mopek1
Confirmed User
 
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 2,873
Need some php Help

After switching my site to https one of my php scripts stopped working.

My host's Apache error logs confirmed it was due to an SSL issue.

The script allows surfers to post some text and has a captcha before hitting submit. The captcha image is where I believe the problem lies:

______________________________
<? $code = makeCode(); ?>
<img src="include/code.php?code=<?=$code?>">
______________________________

The script calls on an image somewhere in the include folder, in a file called code.php [header("Content-type: image/png");].

I believe that somehow this image is still being served over http, even though I've checked every link in that script and on those pages with a fine toothed comb.

Of anyone has any knowledge of php or can point me to someone or some business that can help I;d appreciate it.

Thanks
mopek1 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-02-2023, 03:55 AM   #2
redwhiteandblue
Bollocks
 
redwhiteandblue's Avatar
 
Industry Role:
Join Date: Jun 2007
Location: Bollocks
Posts: 2,790
What's in code.php?
redwhiteandblue is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-02-2023, 03:59 AM   #3
Klen
 
Klen's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,234
Sounds like issue where you including http content on https website, make sure you check all your links.
__________________
For GFY administration inquiries- email info at gfy.com or send PM.
For advertising inquiries - email marketing at gfy.com

Inquiries which are not related to administration or advertising on GFY wont be processed.
Klen is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-02-2023, 04:39 AM   #4
mopek1
Confirmed User
 
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 2,873
Quote:
Originally Posted by redwhiteandblue View Post
What's in code.php?
Below is the whole code in that code.php file:


<?php
include("functions.inc.php");

$code = makeStr($_GET['code']);

header("Content-type: image/png");
$im = @imagecreate(75, 30)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 255, 255, 255);
imagestring($im, 7, 10, 7, $code, $text_color);
imagepng($im);
imagedestroy($im);
?>
mopek1 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-02-2023, 04:40 AM   #5
mopek1
Confirmed User
 
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 2,873
Quote:
Originally Posted by Klen View Post
Sounds like issue where you including http content on https website, make sure you check all your links.
Yeah, I did that for 4 hours straight yesterday. Checking every line. Almost went blind
mopek1 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-02-2023, 03:50 PM   #6
NakedWomenTime
Confirmed User
 
NakedWomenTime's Avatar
 
Industry Role:
Join Date: Oct 2015
Posts: 547
Are you able to modify the code to capture the error php is giving?

I would agree it's likely to be related to the change to https, but can't be of much more help ... there will probably be a file path somewhere that is http and should now be https. See also:

https://www.php.net/manual/en/function.imagecreate.php

Stackoverflow is good for php help.
NakedWomenTime is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-02-2023, 04:13 PM   #7
2MuchMark
Videochat Solutions
 
2MuchMark's Avatar
 
Industry Role:
Join Date: Aug 2004
Location: Canada
Posts: 45,956
It is impossible to help without seeing some of the error logs, but you can at least check this: Check for mixed content. If your PHP script is trying to load resources (like images, scripts, or styles) over HTTP your browser will block it. If you are using an AutoSSL certificate, try generating a new one. Also check to see if the version of PHP installed on your server is not some ancient version. Check to see if the GD library is enabled.

You can also try removing the @ operator before imagecreate() to see if there are any errors being suppressed.
__________________

VideoChat Solutions | Custom Software | IT Support
https://www.2much.net | https://www.lcntech.com
2MuchMark is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-04-2023, 09:18 AM   #8
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 54,561
https shouldnt have any effect on that
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


my contact: fris at fris.net
fris is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-05-2023, 02:06 PM   #9
mopek1
Confirmed User
 
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 2,873
Thanks for everyone's help. I looked through the script this whole weekend and enjoyed every bit of my weekend being spent looking at code trying to figure it out, instead of relaxing

The solution made no sense but it worked.

I went though the script with a fine toothed comb. I copied files from a folder where I kept the original script (15 years ago) and replaced the ones on the domain, doing so one file at at a time, testing, and then continuing on.

The file that finally did it was the functions.php file. It doesn't make sense because I never changed that file during the https switch, or I thought anyway.

Perhaps I opened that file just to look through and hit "break" accidentally, and so with a break line the code wasn't working anymore.

I still don't know what actually happened.* The newer (original) file looks identical to the one I replaced it with.

In any case thanks for all your help.
mopek1 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-06-2023, 01:45 AM   #10
just a punk
So fuckin' bored
 
just a punk's Avatar
 
Industry Role:
Join Date: Jun 2003
Posts: 32,346
Quote:
Originally Posted by mopek1 View Post
After switching my site to https one of my php scripts stopped working.

My host's Apache error logs confirmed it was due to an SSL issue.

The script allows surfers to post some text and has a captcha before hitting submit. The captcha image is where I believe the problem lies:
Just a tip to literally save you a TON of time: in all situations like that, just ask ChatGPT-4, and yes, you can even show it your pieces of code
just a punk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-06-2023, 04:21 AM   #11
mopek1
Confirmed User
 
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 2,873
Quote:
Originally Posted by just a punk View Post
Just a tip to literally save you a TON of time: in all situations like that, just ask ChatGPT-4, and yes, you can even show it your pieces of code
Never thought of that. Thanks for the top
mopek1 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
php, captcha, text, post, surfers, script, submit, lies, hitting, issue, image, due, scripts, stopped, https, site, switching, hosts, confirmed, apache, error, logs, ssl



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.