View Full Version : Php?


lovely_sugar102
03-21-2003, 12:59 AM
It wont work! Yes, my domain supports PHP. Here is my code:

Header.php:

<title>***Perfected-dreams.com/delusion: Version 3 - Digital Files</title>
<body background="bg3.gif">
<LINK REL=stylesheet HREF="delusion.css" TYPE="text/css">
<div style="position: absolute; top:0; left:0">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="735" HEIGHT="300">
<TR>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="245" HEIGHT="100">
<IMG NAME="Image10" SRC="Image1_1x1.jpg" WIDTH="245" HEIGHT="100" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="245" HEIGHT="100">
<IMG NAME="Image11" SRC="Image1_1x2.jpg" WIDTH="245" HEIGHT="100" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="245" HEIGHT="100">
<IMG NAME="Image12" SRC="Image1_1x3.jpg" WIDTH="245" HEIGHT="100" BORDER="0"></TD>
</TR>
<TR>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="245" HEIGHT="100">
<IMG NAME="Image13" SRC="Image1_2x1.jpg" WIDTH="245" HEIGHT="100" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="245" HEIGHT="100">
<IMG NAME="Image14" SRC="Image1_2x2.jpg" WIDTH="245" HEIGHT="100" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="245" HEIGHT="100">
<IMG NAME="Image15" SRC="Image1_2x3.jpg" WIDTH="245" HEIGHT="100" BORDER="0"></TD>
</TR>
<TR>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="245" HEIGHT="100">
<IMG NAME="Image16" SRC="Image1_3x1.jpg" WIDTH="245" HEIGHT="100" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="245" HEIGHT="100">
<IMG NAME="Image17" SRC="Image1_3x2.jpg" WIDTH="245" HEIGHT="100" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="245" HEIGHT="100">
<IMG NAME="Image18" SRC="Image1_3x3.jpg" WIDTH="245" HEIGHT="100" BORDER="0"></TD>
</TR>
</TABLE>
</div>
<div style="position: absolute; top:130; left:80; width=128" align="left" class="menu">
<b>Tutorials:</b>
<br><a href="htmltutorials.html">HTML Tutorials</a>
<br><a href="psp7tutorials.html">PSP7 Tutorials</a>

<br><br><b>You:</b>
<br><a href="tips.html">Graphic and Site Tips</a>

<br><br><b>Me:</b>
<br><a href="blog.html">Blog</a>
<br><a href="sites.html">Sites</a>

<br><br><b>Site:</b>
<br><a href="credits.html">Credits</a>
<br><a href="pastlayouts.html">Past Layouts</a>
<br><a href="wallofshame.html">Wall of Shame</a>

<br><br><b>Link Me:</b>
<br><img src="delusionlink1.gif">

<br><br><b>Contact Me:</b>
<br>E-mail: <a href="mailto: ruta@perfected-dreams.com">ruta@perfected-dreams.com</a>
<br>AIM: <a href="aim:goim?screenname=delireis&message=Hi+Ruta!+I+like+your+website.">delireis</a>
<br>Neopets: <a href="http://www.neopets.com/neomessages.phtml?type=send&recipient=cinnamon_candy1020"
target="_new">cinnamon_candy1020</a>
<br><form method="post" enctype="text/plain" action='mailto:ruta@perfected-dreams.com'>
<input type="hidden" name="To" value="Quick Mail Comments (BLOG)">
<input type="text" name="name:" value="Name" size="23" maxlength="50">
<input type="text" name="email:" value="E-mail" size="23" maxlength="100">
<input type="text" name="URL:" value="http://" size="23" maxlength="120">
<input type="text" name="Comments:" value="Comments?" size="23" maxlength="400">
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
</div>
<div style="position: absolute; top:130; left:230; width=497" align="left" class="text">

Footer.php:

</div>

Whatever.html:

<?include("header.php");?>
whatever...text here
<?include("footer.php");?>

What's wrong? THANKS! :)

kittycat
03-21-2003, 01:48 AM
<?php include("header.php"); ?>

do that for the other include thing as well, and it should work.

Dude128
03-21-2003, 03:23 AM
you may want to check with your host on what extension the page should have. depending on the installation of PHP, it may be .php, but it may also be .php3, .php4, or .phtml

lovely_sugar102
03-21-2003, 08:26 PM
Originally posted by kittycat
<?php include("header.php"); ?>

do that for the other include thing as well, and it should work.

Sorry, but what do you mean? Also, I am hosted at netrillium.net (http://www.netrillium.net). I am pretty sure they use .php, but am I wrong? THANKS :)

lefty
03-21-2003, 09:33 PM
your code looks like this:
<?include("header.php");?>

It should be:
<?php include("header.php"); ?>

lovely_sugar102
03-21-2003, 10:21 PM
It didn't work! All that shows up is the text "whatever".

The header and footer remain the same.

Here is whatever.html :

<?php include("header.php"); ?>
Whatever...text here lala
<?php include("footer.php"); ?>

What's the problem? THANKS :)

kittycat
03-22-2003, 01:01 AM
It needs to be with a .php extension to work, so change 'whatever.html' to a 'whatever.php', upload it and it *should* work then

bejayel
03-22-2003, 01:08 AM
umm first off, knoquorer is having problems loading your site.
second <? ?> will give the same results as <?PHP ?>
and third i dont know why that wont work. all i can suggest is try modofying the .htaccess file. you may have php disabled or somehting. maybe cause you are not using space between your <? and include("header... try this out

<? include("header.php"); ?>
again dont forget the spaces. also you may be doing somehting wrong with cases sensativity. or another thing that might be wrong is the php support is really old. try a differant server, it seems to work fine on my server (it isnt up yet though) try http://www.flatface.net or coolfreewebpages.com umm if that even exists, i forget...lol

Dude128
03-22-2003, 01:16 AM
I just realized something. you said you have this:

<?include("header.php");?>
whatever...text here
<?include("footer.php");?>

on Whatever.html?

if that's correct, that's the problem. it has to be a .php (or whatever extension your installation of PHP uses) file in order for the PHP code to be parsed.

bejayel
03-22-2003, 01:31 AM
lol the most obvious thing and we all missed it...lol too funny.

lovely_sugar102
03-22-2003, 11:55 AM
Thanks! It works now, but I have another problem. I try to use the code on files INSIDE folders, but it down't work!

Here is my code for whatever.php if it was in a folder:
<?include("/delusion/header.php");?>
whatever...text here text here
<?include("/delusion/footer.php");?>

But it still doesn't work! Whenever you visit that page, it just says "Error: failed", etc. and it says the file doesn't exist! HELP! :( THANKS :)

so basically, this means that I have to re-upload the header.php, footer.php, and the entire layout in EACh folder for it to work?? *sobs*

kittycat
03-22-2003, 03:13 PM
Where exactly is this folder? If it's at a location like site.com/delusion/other folder, then you're telling that to pull the header.php file from a folder called 'delusion' in 'other folder', which probably isn't correct.

I think the only way you can do that is to type in the full URL to the file, someone else might know another way though :)

lovely_sugar102
03-23-2003, 06:21 PM
Well, now my code is this:

<?php include("http://www.perfected-dreams.com/delusion/header.php");?>
text here
<?php include("http://www.perfected-dreams.com/delusion/footer.php");?>

But when I go to the page, it aligns everything right, but the image(main layout image) wont show up and there is no CSS. Does this mean I have to change every page to use absolute links(the full URL to EVERYTHING including images)?

I really hope not! :(

You can see for yourself here:
my page (http://www.perfected-dreams.com/delusion/psptutorials/dropshadow.php)

THANKS :)

kittycat
03-23-2003, 08:42 PM
Yeah you do, either that or upload the images etc that you need into every folder.

bejayel
03-23-2003, 10:48 PM
in php you dont have a backslash before everything.
<? include("folder/file") ?>
i hope that helps.

Ökii
03-24-2003, 09:18 AM
a few notes:

starting a *nix path with a backslash indicates server root - relative paths would just name the directory like shocker stated.
you can also use ../ to travel one folder up the directory chain

image paths within included files will be relative to the heirarchical top document - so.

if index.php includes folder/blat.php which has an image src as images/jpeg.jpg the images folder would be in the same dir as index.php and not blat.php