Jump to content

Archived

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

time turn fragile

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?

Share this post


Link to post
Share on other sites
Notepad usually adds ".txt" extensions to file names. To prevent this add quotes around the file name when saving, i.e.,  "header.php".

P.S. Take a look at [url=http://notepad-plus.sourceforge.net/uk/site.htm]Notepad++[/url].

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites
Sorry if you have done this,
It's also possible that you haven't installed Apache/PHP etc. so that your files aren't doing anything at all. If you'd like an easy set-up to get you started try: http://easyphp.org/?lang=en

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
What does the code look like? Did you mean ; instead?

Share this post


Link to post
Share on other sites
[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.

Share this post


Link to post
Share on other sites
The funky quotes may be an issue--did you copy this from Word? Fix these. If that doesn't solve the problem, there could be something incorrect in header.php.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Try deleting the funky quotes and replacing them with normal apostrophes/single quotes (').

Share this post


Link to post
Share on other sites
I think [b]effigy[/b]'s right, PHP uses single [b]'[/b] and double [b]"[/b] quotes, not the backticks as far as I know.

Share this post


Link to post
Share on other sites
Which files are you referring to, in header.php or blog.php? Or both. And in every single part of the code?

It's just that I've always used quotes in codes and it always worked. But I don't recall using backticks.

Share this post


Link to post
Share on other sites
Backticks are valid in PHP; they run system commands. Your quotes are not single, double, or even backticks--without getting too technical, they're odd. Replace the quotes that are in your include statements from ’ to '.

Share this post


Link to post
Share on other sites
Problem was solved. Thanks for your help everyone. ^^ Now I just need to figure out why my div layer isn't working. Sheesh. But it works! Thanks again.

By the way, effigy, I like the quote underneath your avatar.

Share this post


Link to post
Share on other sites
Thanks :) In case you don't know, it's accredited to [url=http://en.wikipedia.org/wiki/Mahatma_Gandhi]this guy[/url]--a favorite of mine.

Share this post


Link to post
Share on other sites

×

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.