?
Solved

GoDaddy Hosting: PHP Include Statements Don't Seem To Work

Posted on 2006-06-21
8
Medium Priority
?
884 Views
Last Modified: 2008-01-09
I have a godaddy account in which I am hosting my website.  I've come to learn that a certain php file can be created and uploaded to my site that will allow me to place a google ad on multiple pages and change it by only changing the php file.  Each page that has the ad will have the statement <?php include("linktophpfile/ads.php");?>  I've tried this multiple times with no success.  I was wondering if it is an issue with the coding or if it is something I need to take up with godaddy.  It seems to me that php is not enabled on godaddy or something of that sort.  I've gone to the ads.php link and the code in there works it is just the include statement that does not seem to be getting through to the php file.

Thanks for your help
Steve
0
Comment
Question by:SteveZz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 30

Accepted Solution

by:
GrandSchtroumpf earned 150 total points
ID: 16950724
> it is just the include statement that does not seem to be getting through
Are your files saved with the ".php" file extension?
There is a good chance the web server only processes php on files that have the ".php" extension.
0
 
LVL 3

Author Comment

by:SteveZz
ID: 16950864
The file I am including is a php file, the file I am calling it from is html. My index.html file is the file that I placed <?php include("linktophpfile/ads.php");?> in.  Is that the problem?  Should I make my index.html file into an index.php file?
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 16950998
Yes, that's probably the problem.  Rename it to "index.php".
0
WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

 
LVL 3

Author Comment

by:SteveZz
ID: 16951057
Alright well I can't test that idea out just yet bc i'm stuck in work and apparently cant edit anything lol.  But thanks for the idea I'll check it out tonight and give you the points if it works.  Thanks
0
 
LVL 3

Author Comment

by:SteveZz
ID: 16954766
I've spent time thinking about what you said with renaming the other files to php files and that's not going to work for me.  I need each page of my site that is already made to be able to call an include statement for a php file.  I need each of those .html files to be able to run a php file on the site.  The reason I need this done is for google ads.  I can place a google ad code on a php file and then from each page of my website I can link to that same file and instead of having the change every html file to change the color of the ads I can change the php file and all of them change.  I think I must just have the code wrong so I guess what I'm asking is what I would have to put onto my html file to include a php files information onto the html file.
Thanks so much if you can help me out
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 16957685
For php to also process ".html" files, you would need to change the configuration of the web server.  And that's impossible if you are using colocated hosting.

Another possible solution is to use url-rewriting (mod_rewrite if you are using Apache) to redirect your requests to a php file that includes the ads and the html file that has been requested.

Apache also has SSI (server-side-includes), but you usually need to use the ".If you a" file extension to be able to use it...  So, that's the same problem.
http://httpd.apache.org/docs/1.3/howto/ssi.html
0
 
LVL 3

Author Comment

by:SteveZz
ID: 16960323
Thanks so much for all of your help.  I've decided to take the easy route and build my websites using .php files rather than .html files.  I don't see any reason not to.  Once I changed them it worked fine.  I appreciate all of your help.
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 16960522
<:°)
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question