![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 3,056
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Bollocks
Industry Role:
Join Date: Jun 2007
Location: Bollocks
Posts: 2,792
|
What's in code.php?
__________________
Interserver unmanaged AMD Ryzen servers from $73.00 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
|
Sounds like issue where you including http content on https website, make sure you check all your links.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 3,056
|
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); ?> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 3,056
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Oct 2015
Posts: 560
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Videochat Solutions
Industry Role:
Join Date: Aug 2004
Location: Canada
Posts: 48,523
|
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.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 3,056
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
So fuckin' bored
Industry Role:
Join Date: Jun 2003
Posts: 32,381
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 3,056
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |