[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2006-06-21
8
Medium Priority
?
886 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

649 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