It is currently Wed Dec 02, 2020 10:44 pm

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
 Post subject: any PHP people around
PostPosted: Sat Apr 07, 2007 6:54 am 
Offline

Joined: Tue May 09, 2006 4:22 pm
Posts: 520
Location: relto
Hi I'm trying to use the "include" command to include 4 html files. This is what I have.

Code:

<div class="header"> 
<?php include ("header.html");?>          
</div>
<div id="menu">
<?php include ("menu.html");?>
</div>
<div id="body">
<?php include ("body.html");?>
</div>
<div class="footer">
<?php include ("footer.html"); ?>
</div>


When I try to displaying to make sure things are looking fine. None of the content thats on each file is shown. I've even put it live and it still doesnt show. Its not on my own server. its a hosted server.

What could be the problem and is there an easier way? I'm somewhat thinking its the server. I've checked goggle and everything I have seems to be right, but for some reason nothing shows.

I'm also using CSS which seems to be working fine (still messing with colors)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 07, 2007 12:11 pm 
Offline
Obduction Backer

Joined: Wed Dec 20, 2006 4:19 pm
Posts: 1161
That will work if the files are all in the same folder.

try this :

<div class="header">
<?php require ("header.html");?>
</div>
<div id="menu">
<?php require ("menu.html");?>
</div>
<div id="body">
<?php require ("body.html");?>
</div>
<div class="footer">
<?php require ("footer.html"); ?>

<?php echo "test"; >
</div>

this shall display "test". If not, it means that one the the require function crashed.

Dumb question. is your file's extention .php ?


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 07, 2007 1:12 pm 
Offline

Joined: Wed Jul 05, 2006 2:29 am
Posts: 267
Location: 9201, 604577, 1837
goofy wrote:
Hi I'm trying to use the "include" command to include 4 html files. This is what I have.


Try it without the parentheses, like so:

Code:

<div class="header"> 
<?php include "header.html";?>          
</div>
<div id="menu">
<?php include "menu.html";?>
</div>
<div id="body">
<?php include "body.html";?>
</div>
<div class="footer">
<?php include "footer.html"; ?>
</div>

_________________
Ian Watson
MOULa KI: 00115996

Eyen waxen
3: 7)$]


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 07, 2007 3:39 pm 
Offline

Joined: Tue May 09, 2006 4:22 pm
Posts: 520
Location: relto
hmmm just tried both of those and still nothing. I'm kinda thinking that my hosting service is restricting PHP usage or something.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 07, 2007 3:43 pm 
Offline
Obduction Backer

Joined: Wed Dec 20, 2006 4:19 pm
Posts: 1161
type just this :

<?php
phpinfo();
?>

you should see something if php is installed.

once again, make sure that your files extension's is .php (and not .htm or .html)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 07, 2007 3:57 pm 
Offline

Joined: Tue May 09, 2006 4:22 pm
Posts: 520
Location: relto
EowynCarter wrote:
type just this :

<?php
phpinfo();
?>

you should see something if php is installed.

once again, make sure that your files extension's is .php (and not .htm or .html)


hehe I've already tried that one. it was the first one I tried(got it from goggling and my books) nothing is shown


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 07, 2007 4:14 pm 
Offline
Obduction Backer

Joined: Tue May 09, 2006 12:11 am
Posts: 2633
Sounds like PHP isn't supported on there then. I'd suggest contacting your host and finding out.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 07, 2007 4:34 pm 
Offline

Joined: Tue May 09, 2006 4:22 pm
Posts: 520
Location: relto
hehe you hit the nail on the head tweek. I just got off the phone with the tech support and sure enough with the package I have, I don't have access to cgi-bin. which means no php.

Kinda lame, thats the same as thier free service(well close free service has banner ads and popups mine doesnt


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 07, 2007 4:37 pm 
Offline
Obduction Backer

Joined: Wed Dec 20, 2006 4:19 pm
Posts: 1161
:shock:

you can find some free php web hosting ;)
or a cheap paid one.

isn't the cgi-bin directory mean for cgi / pearl scripts ?

who is you hosting provider ?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 08, 2007 4:40 am 
Offline

Joined: Sat Feb 24, 2007 3:29 pm
Posts: 89
Quote:
isn't the cgi-bin directory mean for cgi / pearl scripts?

There's a cgi version of PHP. It's a little bit more secure to run it that way, but it doesn't have as many features as the Apache module, and it's a lot slower.

An .htaccess file with "AddHandler application/x-httpd-php .php" will force Apache to use the module if it's installed on the server, but it sounds like you just need a different host. There are a lot of lousy deals out there. Watch out for anybody who wants you to pay more for features that don't cost them anything.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Apr 08, 2007 1:01 pm 
Offline
Obduction Backer

Joined: Tue May 09, 2006 12:11 am
Posts: 2633
Yeah in this day in age, support for things like PHP and Ruby on Rails should be standard.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to: