Jump to content

PHP Includes and Notepad


Recommended Posts

I've never bothered to use PHP before, but now.. I am? Anyway, I coded everything in notepad, but when I went to save it, it was still a notepad document. It wasn't a PHP page.

When I saved the file, I typed in "header.php" and it didn't work. But when I type in "header.html" it becomes an html file, so how come it isn't working for the PHP file?

Does it just not work for notepad? Do I need to use a different program? I don't think it would be the case, but you never know. Help anyone?
Link to comment
https://forums.phpfreaks.com/topic/15740-php-includes-and-notepad/
Share on other sites

it's probably because notepad recognizes the HTML extension.  try specifying "All Files" as the file type, and using .php as the extension.  when it doesn't recognize the extension and is set to a ".txt Text File" (or something similar), it will just append the .txt.  you'll find that the file is named header.php.txt for that exact reason.

[b]EDIT:  you and your speedy typing, effigy.[/b]
Thank you very much, I got the php page exttension worked out. ^^ One more question though.

I added the includes, but now I've received a message on the page saying "Parse error: parse error, unexpected ':' in /home/www/ghopen8.freehostia.com/blog.php on line 1"
The link is [url=http://ghopen8.freehostia.com/blog.php]http://ghopen8.freehostia.com/blog.php[/url] ...if that helps any? I don't understand what I did wrong.
[code]<?php include(’http://ghopen8.freehostia.com/header.php’);?>

All work and no play makes for a very dull Ghostie. All work and no play makes for a very dull Ghostie. All work and no play makes for a very dull Ghostie.

<?php include(’http://ghopen8.freehostia.com/footer.php’);?>[/code]

That's the blog page coding.
I got it from peachie.nu and then from another site. Various sites have had the same code. I looked at header.php, but I can't see the problem.

This is the header...
[code]<html><head><title>a thousand paper cranes | desiree</title><LINK

REL=stylesheet HREF="http://ghopen8.freehostia.com/css.css"

TYPE="text/css"></head>

<body><div style="position: absolute; top:0; left:0;"><TABLE BORDER="0"

CELLPADDING="0" CELLSPACING="0" WIDTH="800" HEIGHT="600">

<TR>
<TD ROWSPAN="1" COLSPAN="3" WIDTH="200" HEIGHT="111">
<IMG NAME="desiree0" SRC="desiree_1x1.jpg" WIDTH="200"

HEIGHT="111" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="5" WIDTH="200" HEIGHT="111">
<IMG NAME="desiree1" SRC="desiree_1x2.jpg" WIDTH="200"

HEIGHT="111" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="3" WIDTH="200" HEIGHT="111">
<IMG NAME="desiree2" SRC="desiree_1x3.jpg" WIDTH="200"

HEIGHT="111" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="200" HEIGHT="111">
<IMG NAME="desiree3" SRC="desiree_1x4.jpg" WIDTH="200"

HEIGHT="111" BORDER="0"></TD>
</TR>

<TR>
<TD ROWSPAN="1" COLSPAN="3" WIDTH="200" HEIGHT="111">
<IMG NAME="desiree4" SRC="desiree_2x1.jpg" WIDTH="200"

HEIGHT="111" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="5" WIDTH="200" HEIGHT="111">
<IMG NAME="desiree5" SRC="desiree_2x2.jpg" WIDTH="200"

HEIGHT="111" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="3" WIDTH="200" HEIGHT="111">
<IMG NAME="desiree6" SRC="desiree_2x3.jpg" WIDTH="200"

HEIGHT="111" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="200" HEIGHT="111">
<IMG NAME="desiree7" SRC="desiree_2x4.jpg" WIDTH="200"

HEIGHT="111" BORDER="0"></TD>
</TR>

<TR>
<TD ROWSPAN="1" COLSPAN="3" WIDTH="200" HEIGHT="111">
<IMG NAME="desiree8" SRC="desiree_3x1.jpg" WIDTH="200"

HEIGHT="111" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="5" WIDTH="200" HEIGHT="111">
<IMG NAME="desiree9" SRC="desiree_3x2.jpg" WIDTH="200"

HEIGHT="111" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="3" WIDTH="200" HEIGHT="111">
<IMG NAME="desiree10" SRC="desiree_3x3.jpg" WIDTH="200"

HEIGHT="111" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="200" HEIGHT="111">
<IMG NAME="desiree11" SRC="desiree_3x4.jpg" WIDTH="200"

HEIGHT="111" BORDER="0"></TD>
</TR>

<TR>
<TD ROWSPAN="1" COLSPAN="3" WIDTH="200" HEIGHT="112">
<IMG NAME="desiree12" SRC="desiree_4x1.jpg" WIDTH="200"

HEIGHT="112" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="5" WIDTH="200" HEIGHT="112">
<IMG NAME="desiree13" SRC="desiree_4x2.jpg" WIDTH="200"

HEIGHT="112" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="3" WIDTH="200" HEIGHT="112">
<IMG NAME="desiree14" SRC="desiree_4x3.jpg" WIDTH="200"

HEIGHT="112" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="200" HEIGHT="112">
<IMG NAME="desiree15" SRC="desiree_4x4.jpg" WIDTH="200"

HEIGHT="112" BORDER="0"></TD>
</TR>

<TR>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="108" HEIGHT="16">
<IMG NAME="desiree16" SRC="desiree_5x1.jpg" WIDTH="108"

HEIGHT="16" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="60" HEIGHT="16">
<A HREF="GHOSTIE"><IMG NAME="desiree17" SRC="desiree_5x2.jpg"

WIDTH="60" HEIGHT="16" BORDER="0" ALT="Self-proclaimed Queen"></A></TD>
<TD ROWSPAN="1" COLSPAN="2" WIDTH="58" HEIGHT="16">
<A HREF="VISITOR"><IMG NAME="desiree18" SRC="desiree_5x3.jpg"

WIDTH="58" HEIGHT="16" BORDER="0" ALT="Content for well... the visitor.

A.K.A. you"></A></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="74" HEIGHT="16">
<A HREF="TUTORIALS"><IMG NAME="desiree19"

SRC="desiree_5x4.jpg" WIDTH="74" HEIGHT="16" BORDER="0" ALT="Learn

something!"></A></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="53" HEIGHT="16">
<A HREF="SITE"><IMG NAME="desiree20" SRC="desiree_5x5.jpg"

WIDTH="53" HEIGHT="16" BORDER="0"></A></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="38" HEIGHT="16">
<A HREF="EXITS"><IMG NAME="desiree21" SRC="desiree_5x6.jpg"

WIDTH="38" HEIGHT="16" BORDER="0" ALT="Ready to leave 1000 Paper

Cranes?"></A></TD>
<TD ROWSPAN="1" COLSPAN="2" WIDTH="67" HEIGHT="16">
<A HREF="CONTACT"><IMG NAME="desiree22" SRC="desiree_5x7.jpg"

WIDTH="67" HEIGHT="16" BORDER="0" ALT="Something to say?"></A></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="41" HEIGHT="16">
<A HREF="CLEAR"><IMG NAME="desiree23" SRC="desiree_5x8.jpg"

WIDTH="41" HEIGHT="16" BORDER="0" ALT="Back to the homepage,

dearie."></A></TD>
<TD ROWSPAN="1" COLSPAN="2" WIDTH="301" HEIGHT="16">
<IMG NAME="desiree24" SRC="desiree_5x9.jpg" WIDTH="301"

HEIGHT="16" BORDER="0"></TD>
</TR>

<TR>
<TD ROWSPAN="1" COLSPAN="8" WIDTH="400" HEIGHT="69">
<IMG NAME="desiree25" SRC="desiree_6x1.jpg" WIDTH="400"

HEIGHT="69" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="4" WIDTH="400" HEIGHT="69">
<IMG NAME="desiree26" SRC="desiree_6x2.jpg" WIDTH="400"

HEIGHT="69" BORDER="0"></TD>
</TR>

<TR>
<TD ROWSPAN="1" COLSPAN="8" WIDTH="400" HEIGHT="70">
<IMG NAME="desiree27" SRC="desiree_7x1.jpg" WIDTH="400"

HEIGHT="70" BORDER="0"></TD>
<TD ROWSPAN="1" COLSPAN="4" WIDTH="400" HEIGHT="70">
<IMG NAME="desiree28" SRC="desiree_7x2.jpg" WIDTH="400"

HEIGHT="70" BORDER="0"></TD>
</TR>

<TR>
<TD WIDTH="108" HEIGHT="1">
<IMG NAME="blank" SRC="blank.gif" WIDTH="108" HEIGHT="1"

BORDER="0"></TD>
<TD WIDTH="60" HEIGHT="1">
<IMG NAME="blank" SRC="blank.gif" WIDTH="60" HEIGHT="1"

BORDER="0"></TD>
<TD WIDTH="32" HEIGHT="1">
<IMG NAME="blank" SRC="blank.gif" WIDTH="32" HEIGHT="1"

BORDER="0"></TD>
<TD WIDTH="26" HEIGHT="1">
<IMG NAME="blank" SRC="blank.gif" WIDTH="26" HEIGHT="1"

BORDER="0"></TD>
<TD WIDTH="74" HEIGHT="1">
<IMG NAME="blank" SRC="blank.gif" WIDTH="74" HEIGHT="1"

BORDER="0"></TD>
<TD WIDTH="53" HEIGHT="1">
<IMG NAME="blank" SRC="blank.gif" WIDTH="53" HEIGHT="1"

BORDER="0"></TD>
<TD WIDTH="38" HEIGHT="1">
<IMG NAME="blank" SRC="blank.gif" WIDTH="38" HEIGHT="1"

BORDER="0"></TD>
<TD WIDTH="9" HEIGHT="1">
<IMG NAME="blank" SRC="blank.gif" WIDTH="9" HEIGHT="1"

BORDER="0"></TD>
<TD WIDTH="58" HEIGHT="1">
<IMG NAME="blank" SRC="blank.gif" WIDTH="58" HEIGHT="1"

BORDER="0"></TD>
<TD WIDTH="41" HEIGHT="1">
<IMG NAME="blank" SRC="blank.gif" WIDTH="41" HEIGHT="1"

BORDER="0"></TD>
<TD WIDTH="101" HEIGHT="1">
<IMG NAME="blank" SRC="blank.gif" WIDTH="101" HEIGHT="1"

BORDER="0"></TD>
<TD WIDTH="200" HEIGHT="1">
<IMG NAME="blank" SRC="blank.gif" WIDTH="200" HEIGHT="1"

BORDER="0"></TD>
</TR>
</TABLE></div>

<div id="blog" style="position:absolute; top: 483; left: 68 width: 435; padding:

0px; background-color=96BE92">[/code]

If you don't feel like looking at that, I understand.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.