Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Please can somone help me? I'm having a PHP Include problem!
Old 06-29-2010, 10:41 AM Please can somone help me? I'm having a PHP Include problem!
Average Talker

Posts: 25
Location: Somehwere in the U.S.A
Trades: 0
Hello,

So, I'm a beginner programmer. I'm more into graphic design than coding. At first, I used dream weaver, but now i've decided to use PHP include to design my websites. But my website only brings everything up when its on the first level...I also have javascript on the page, Im thinking this may have something to do with it...

the problem is that my page isn't loading up the background on the right navigation menu, and its putting the footer into the body/content page...and everything is basically all messed up in the sub dictionaries...

I've also tried linking to my include files using the following:

Quote:
<?php include($_SERVER['DOCUMENT_ROOT']."/includes/footer.php"); ?>

and

<a href="../includes/footer.php">
Please help! I'll post my code on here if I need to...It is driving me insane!
__________________
Have a beautiful day =)
Please visit my site:
Please login or register to view this content. Registration is FREE
shanterenee is offline
Reply With Quote
View Public Profile Visit shanterenee's homepage!
 
 
Register now for full access!
Old 06-29-2010, 11:03 AM Re: Please can somone help me? I'm having a PHP Include problem!
vectorialpx's Avatar
Extreme Talker

Posts: 249
Name: octavian
Location: Bucharest
Trades: 0
If you need to cut your layout, you need xHTML. To split your project in pieces, you can use some other pages, like "header.php" or "menu.php" but you have to carefully add them in your code [you can mark them with comments].

So, post here your code after output. I think this is more a HTML problem.

use something like
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" lang="en">
<head> <title> ... and others ... </title>
<?php require 'elm_meta.php' ?>
</head>

<body>
<div id="menu">
<!-- my PHP menu starts here -->
<?php require 'elm_menu.php' ?>
<!-- ==== end of menu ==== -->
</div>
.... and others ... 
</body>
</html>
so, with your comments you'll know where the include starts and when it ends

// edit //
you don't have to use document_root
To make a debug, just echo the required path (before require it)
__________________
you can
Please login or register to view this content. Registration is FREE

Last edited by vectorialpx; 06-29-2010 at 11:04 AM..
vectorialpx is offline
Reply With Quote
View Public Profile Visit vectorialpx's homepage!
 
Old 06-29-2010, 01:15 PM Re: Please can somone help me? I'm having a PHP Include problem!
Average Talker

Posts: 25
Location: Somehwere in the U.S.A
Trades: 0
That is how I have it set it up...

I'll post my code here. ..
[please excuse the invalidness of it. I know it's not correct by W3C Standards. I'll work on that later. ]

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

      <?php include($_SERVER['DOCUMENT_ROOT']."/includes/head.php"); ?>

</head>
<body>

      <center>
          <!-- PUT THIS TAG IN DESIRED LOCATION OF Google Slot -->

 GOOGLE AD WILL GO HERE.
    
      <!-- END OF TAG FOR Google slot -->
      </center>

<div id="container">

<div id="header"></div>

<div id="nav">

          <?php include($_SERVER['DOCUMENT_ROOT']."/includes/topnav.php"); ?>

</div>


<div id="sidebar">

          <?php include($_SERVER['DOCUMENT_ROOT']."/includes/nav.php"); ?>
          <BR>
          <?php include($_SERVER['DOCUMENT_ROOT']."/includes/topmenu.php"); ?>
         

<BR /><BR />
 </div>

<div id="content">

      <div class="pagename"> Hey. Hi. Hello. Hola. Bonjour. Welcome! &hearts; </div>
          <BR>
          <?php 
          $cat[] = 'General';
          include($_SERVER['DOCUMENT_ROOT']."/news/index.php"); ?>
</div> 

<div id="footer">
          <?php include($_SERVER['DOCUMENT_ROOT']."/includes/footer.php"); ?>


</div>

</div>
</body>
Each of included files have html...and they all work on the main page. but in the SUBPAGES, is where I have a problem. Here's my main page:

http://talented-dreamer.flaunt.nu

and then, here's a subpage...

http://talented-dreamer.flaunt.nu/portfolio
__________________
Have a beautiful day =)
Please visit my site:
Please login or register to view this content. Registration is FREE
shanterenee is offline
Reply With Quote
View Public Profile Visit shanterenee's homepage!
 
Old 06-29-2010, 04:43 PM Re: Please can somone help me? I'm having a PHP Include problem!
vectorialpx's Avatar
Extreme Talker

Posts: 249
Name: octavian
Location: Bucharest
Trades: 0
in this moments the w3c validation is very helpful.
You have some missing DIVs there... you have to recheck tour code AND make it valid
__________________
you can
Please login or register to view this content. Registration is FREE
vectorialpx is offline
Reply With Quote
View Public Profile Visit vectorialpx's homepage!
 
Old 09-07-2010, 12:19 AM Re: Please can somone help me? I'm having a PHP Include problem!
Experienced Talker

Posts: 34
Trades: 0
take the help of some developer expert in the website developing in the same field of PHP who can resolve the problem
__________________

Please login or register to view this content. Registration is FREE
asbharmal is offline
Reply With Quote
View Public Profile
 
Old 09-07-2010, 07:32 PM Re: Please can somone help me? I'm having a PHP Include problem!
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Everything is related to the original script document path
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 09-08-2010, 09:55 AM Re: Please can somone help me? I'm having a PHP Include problem!
Banned

Posts: 408
Name: mushget
Trades: 0
<?php include "filepath\file"
?>
mushget is offline
Reply With Quote
View Public Profile Visit mushget's homepage!
 
Reply     « Reply to Please can somone help me? I'm having a PHP Include problem!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24811 seconds with 12 queries