Jump to content

[SOLVED] I am new what am I doing wrong?


themuffin

Recommended Posts

Try taking off the:

 

$_SERVER['DOCUMENT_ROOT'] . 

 

so it looks like:

 

include_once('../fab/includes/template.php');

 

Yeah, sorry I didn't know you still had the DOCUMENT_ROOT in there still.  Do what matt suggested, it should work.

Link to comment
Share on other sites

ok so I did that and now get this..

Warning: main(../fab/header.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 7

 

Warning: main() [function.include]: Failed opening '../fab/header.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 7

 

Warning: main(../fab/main_menu.php) [function.main]: failed to open stream: No such file or directory in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 8

 

Warning: main() [function.include]: Failed opening '../fab/main_menu.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/s/c/t/sctfaery/html/fab/goal.php on line 8

 

Parse error: syntax error, unexpected '>' in /home/content/s/c/t/sctfaery/html/fab/includes/footer.php on line 4

 

HUH???? I am about ready to give up..I bet you guys are WAY PAST THAT!!!

Link to comment
Share on other sites

Well, we have one success on the bottom of the page: the footer.php page got included. Your footer page also contains coding errors, but you're other pages are not including. Did you change them to ../fab/includes/*.php?

 

Oh, and by the way, my name aint Matt :P

 

EDIT: Change the includes path's from '/fab/includes/*.php' to 'includes/*.php'

Link to comment
Share on other sites

ok..

so

here is the header.php file

<?php

$header .= $page_title;

$header .= "<img src="/images/fab/mini_logor.gif" alt=" Feeling Absolutely Fabulous Logo" />";

?>

 

---

and here is what i get now..

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/s/c/t/sctfaery/html/fab/includes/header.php on line 3

Link to comment
Share on other sites

ok..better..so look at this

http://feelingabsolutelyfabulous.com/matt.php

 

ok so I messed around a bit more..

 

can I ask one last q?

 

if I want to use that (fixed properly) as a template and want to create the content for the main area..

what is the php statement? to get the files into it?

I hope I worded that right

 

and you freakin' ROCK!!

Link to comment
Share on other sites

template.php:

<?php

include("includes/header.php");
include("includes/main_menu.php");
echo $content;
include("includes/footer.php");
include("includes/template.php");

?>

 

index.php:

<?php

$content = "Your content";

include("includes/template.php");

?>

 

Try that.

 

Link to comment
Share on other sites

thanks so much.. so you know I'm not using a database and wanted to have the content files? I don't know where..

can I save them as _filename_bdy.php or should it be html

 

or how does it know to change the content..

I sound like a dunce..

I did make a set of files for another site using all includes

 

without the template file and then had to make a filename.php and a filenamebody.html

to be included..

 

I am so thankful for all your help...

Link to comment
Share on other sites

template.php:

<?php

include("includes/header.php");
include("includes/main_menu.php");
echo $content;
include("includes/footer.php");
include("includes/template.php");

?>

 

 

I think you just divided by zero ;-)

 

Should be:

 

<?php

include("includes/header.php");
include("includes/main_menu.php");
echo $content;
include("includes/footer.php");

?>

 

Link to comment
Share on other sites

template.php:

<?php

include("includes/header.php");
include("includes/main_menu.php");
echo $content;
include("includes/footer.php");
include("includes/template.php");

?>

 

 

I think you just divided by zero ;-)

 

Should be:

 

<?php

include("includes/header.php");
include("includes/main_menu.php");
echo $content;
include("includes/footer.php");

?>

It seems I may have just created a black hole...

 

Thanks for pointing that out! Would have wrecked the whole page.

Link to comment
Share on other sites

If I have your question correct, then this should work:

 

template.php:

<?php

include("includes/header.php");
include("includes/main_menu.php");
echo $content;
include("includes/footer.php");

?>

 

index.php:

<?php

$action = $_GET['action'];
if($action == "home") { // Check for the page (in this case, page=home)
$content = file_get_contents("pages/home.php"); // Include the page in the directory 'pages/'
} else {
$content = file_get_contents("pages/home.php");
}

include("includes/template.php");

?>

Link to comment
Share on other sites

very last q I PROMISE!!

and by the way you are a PHP GOD!!!

 

which of those pages gets all the metatags, and css style sheet include link,

 

I directed the page to get content1 info and voila!! check it out:

http://feelingabsolutelyfabulous.com/index.php

 

I have to add the rest of my design but you have aided me greatly!

 

I really thank you for all your time and patience..

you must be a great guy!!

Link to comment
Share on other sites

have a look at your css, and your find this is what you want, on the first page.

 

<link href="scripts/faf2.css" rel="stylesheet" type="text/css" />

 

 

sorry what are you asking , just rename the home.php to index,php

 

your done arnt you?

 

what have you done are you using mod_rewrite there?

 

Link to comment
Share on other sites

what are you doing you got .php and .html what going on lol.

 

if your using php, should be .php ,unless added as html seen as a php pagem, in the php.ini?

 

redarrow please don't jump into the middle of a thread when you obviously haven't read the previous posts, you're just confusing everyone.

Link to comment
Share on other sites

Maq i got a privet post, from the user so i do understand mate?

 

lets all get this write, you got a web site, and you wanted to add php, so now your using php $_GET[], on the first page to get the html pages, am i correct.

 

if i am correct, then you need to rename all the html pages to .php pages.

 

your index.html should be index.php.

 

because your going to do that, then re name all the included pages with the correct . ext  .php

 

make sure that the first page is index.php

 

if you just rename all the .html to .php and change the links to .php it will all work no other code needed.

 

php can use html as a .php ext name.

 

you can break in and out of php and html any time you want.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.