473,288 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,288 software developers and data experts.

Require() & GD Library

I have 2 files... one that is very simple and only contains (for right
now):

<?php
$fontcolor = "0,0,0";
require("/home/rbrooks4/public_html/ticker/image.php");
?>

image.php is a simple image creation via GD library. When I go to the
first page, i get the generic image cannot be displayed because of
errors. However if I go to image.php and paste the $fontcolor =
"0,0,0"; line into the top of that file, the image displays. This says
I have some funkiness with my require(). Is this just not possible to
do? I don't understand what the difference is between the file pasted
above, and pasting the one line on top of image.php.

And yes, i took out the <? ?> tags of image.php when i used it as the
require.

Jul 17 '05 #1
4 1409
Then put the <?php ?> tags back in the require()d script because that's
why it doesn't work. PHP scripts must always be delimited by <?php ?>
tags even when they are require()d by another PHP script.

Jul 17 '05 #2
errr yeah, yer right. I gotta start posting mid-day. That still didn't
fix my problem tho... i'm getting the same error.

Jul 17 '05 #3
Are you able to find out whether your PHP installation is running in
safe_mode or an open_basedir restriction is in effect?

If so it can sometimes help to use a relative rather than absolute path
to the included file, like:

<?php
require('../ticker/image.php');
?>

Or whatever the actual path is to your included file.

Jul 17 '05 #4
Jasper Bryant-Greene wrote:
Are you able to find out whether your PHP installation is running in
safe_mode or an open_basedir restriction is in effect?


Yeah, and no to both. Pretty sure that isn't it - I have other
require/includes on other pages that use absolute path.

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Michael | last post by:
Guten Morgen, I am implementing a script that my client wants on their website. Within the script there are several "require" statements. Any time one of these "require" statements is...
5
by: Qazz | last post by:
Yesterday morning, all the ASP Reference Pages were there, and then yesterday afternoon they were all gone!!! For example:...
1
by: st | last post by:
Hi, I'm using xmlDocument.Save(xmlTextWriter) to create an Excel-readable file. All works well, except where I've replaced the carriage return chars in the .innertext to XML-compliant " "; It...
3
by: Zürcher See | last post by:
I've wrote an application that use internet explorer to download some html page, to get the document I use the Microsoft.mshtml library. mshtml.IHTMLDocument3...
6
by: Frank V. | last post by:
Hello, I'm new to VB.net, moving from VB6 to VB.net. My question is "In VB.net what is the equivalent of the App.major (and others) VB6 property. I, like a lot of people I imaging, display the...
0
by: Victor | last post by:
I have a XML webservice on IIS 5.1 with self-issued certificate. My ActiveX tryes to invoke a webservice method using class CSecureEvtSyncSocket from msdn sample...
2
by: misower | last post by:
var c = document.getElementById("PanelTree"); // PanelTree is a <div> element! var n = document.createElement("div"); n.setAttribute('id', 'nu'); n.setAttribute('style',...
3
by: davis | last post by:
Hi, I'm wrapping a 3rd party .NET 2.0 CF library which mandates Dispose be called. So, I mandate Dispose be called on my library...I follow the Disposable pattern described on MSDN...and I...
42
by: coder_lol | last post by:
Thanks everyone again for contributing to helping me clear C++ confusions. I did some serious reading on copy constructors and assignments and I think I've got a good handle on the memory stuff. ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.