Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    New Coder
    Join Date
    Jun 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problems with includes ()

    Hi all, this is my first post so first of all HI.

    You may be seeing a lot more of me over the coming weeks / months as im really trying to get to grips with the whole PHP thing lol.

    Anyway my problem is regarding the includes() function.

    Senario:

    I have a website called mysite.co.uk and my ROOT looks like this:

    [ROOT]-----------[carparts]---------[themes]---------[choosen_theme]/files to include

    All the files from within the carparts directory all work using the includes () for files found in thr choosen theme directory i.e. header.php, footer.php

    I am trying to call these same header and footer.php files from the choosen theme directory to an index.php which will be located in the ROOT directory.

    am i making sense so far?

    There is also a config file found in ROOT/carparts/config/ which needs to be included also.

    i have tried
    PHP Code:
    include ("../subdirectory/themes/".$setts['default_theme']."/header.php"); 
    and
    PHP Code:
    include("../path/to/file.php"
    but all im getting is loads of errors. i realize that there are mysql strings on the page aswell but even so the simple includes () should still be able to call the header and footer.php shuoldnt it?

    I have really roughly put together something which may help you understand what i mean by clicking here----->HERE<--------

    I hope you can help me as im pulling my hair out

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Can you show your errors?

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    New Coder
    Join Date
    Jun 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is tho original code from the file i am using,

    PHP Code:
    <?
    ## v5.24 -> apr. 05, 2006
    session_start();

    if (!
    file_exists("config/config.php")) echo "<script>document.location.href='install.php'</script>";

    $option = (!empty($_GET['option'])) ? $_GET['option'] : "";

    if (
    $option=="logout") {
            
    session_destroy();
            echo 
    "<script>document.location.href='index.php'</script>";
    }

    include_once (
    "config/config.php");


    ### do the cron job if selected to run from mywebpage
    if ($setts['cron_job']==2) {
            
    $manualCron TRUE;
            include_once (
    "cron/cron1.php");
    }

    $getFeatItems=mysql_query("SELECT id, itemname, picpath, maxbid, enddate, currency FROM probid_auctions WHERE
    hpfeat='Y' AND active=1 AND closed=0 AND deleted!=1 AND listin!='store' ORDER BY rand() LIMIT 0,"
    .$layout['max_feat_hp']." ");
    $nbFeatItems=mysql_num_rows($getFeatItems);
    if (
    $layout['nb_feat_hp']>0) {
            
    $j=floor($nbFeatItems/$layout['nb_feat_hp']);
            
    $j++;
    } else 
    $notfeat="Y";
    $fct=0;

    $id = array();
    $name = array();
    $pic = array();
    $maxbid = array();
    $enddate = array();
    $currency = array();

    while (
    $hpFeatured=mysql_fetch_array($getFeatItems)) {
            
    $id[$fct] = $hpFeatured['id'];
            
    $name[$fct] = $hpFeatured['itemname'];
            
    $pic[$fct] = $hpFeatured['picpath'];
            
    $maxbid = array ($fct => $hpFeatured['maxbid']);
            
    $enddate = array ($fct => $hpFeatured['enddate']);
            
    $currency[$fct] = $hpFeatured['currency'];
            
    $fct++;
    }
    include (
    "themes/".$setts['default_theme']."/header.php");
    include (
    "themes/".$setts['default_theme']."/mainpage.php");
    include (
    "themes/".$setts['default_theme']."/footer.php");
    ?>
    This all works fine from within the carparts directory. I wish for this to work from one level up that is the main ROOT directory.

    I have tried adding the extra step in the includes path as shown below but it just doesnt like it.
    PHP Code:
    include ("carparts/themes/".$setts['default_theme']."/header.php");
    include (
    "carparts/themes/".$setts['default_theme']."/mainpage.php");
    include (
    "carparts/themes/".$setts['default_theme']."/footer.php");
    ?> 
    even when i try just the includes nothing else i.e.:
    PHP Code:
    <?
    include ("carparts/themes/".$setts['default_theme']."/header.php");
    include (
    "carparts/themes/".$setts['default_theme']."/mainpage.php");
    include (
    "carparts/themes/".$setts['default_theme']."/footer.php");
    ?>
    im getting all these errors.... by the way im sorry bout this but i really wanna learn but i am completly new to this........

    Warning: main(carparts/themes//header.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 2

    Warning: main(carparts/themes//header.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 2

    Warning: main(carparts/themes//header.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 2

    are some of the errors im getting but while typing this reply i had an idea but after trying it i got a new error and only 1 error this time and that was "Access Denied"
    this error was after just using this peice of code

    PHP Code:
    <?
    include ("carparts/themes/v524/header.php");
    include (
    "carparts/themes/v524/mainpage.php");
    include (
    "carparts/themes/v524/footer.php");
    ?>
    so its like there is some kind of protection maybe or i may be missing something out of the code above which needs to e put in this new file i just dont know

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You have to go back 3 directories.
    PHP Code:
    <?php
    include ("../../../../header.php");
    include (
    "../../../../mainpage.php");
    include (
    "../../../../footer.php");
    ?>
    Go back one directory and you will be b in v524, go back another you'll be in themes, then another, you'll be in carparts, now you need to get back to the root. Something like this might be a little more efficient though
    PHP Code:
    <?php
    include ($_SERVER['DOCUMENT_ROOT']."/header.php");
    include (
    $_SERVER['DOCUMENT_ROOT']."/mainpage.php");
    include (
    $_SERVER['DOCUMENT_ROOT']."/footer.php");
    ?>
    That should give you something like this
    PHP Code:
    <?php
    include ("/home/username/public_html/header.php");
    include (
    "/home/username/public_html/mainpage.php");
    include (
    "/home/username/public_html/footer.php");
    ?>
    Also don't use <? instead use <?php using <? is lazy and can cause problems when using xml.
    Last edited by _Aerospace_Eng_; 06-09-2007 at 09:00 PM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New Coder
    Join Date
    Jun 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for reply, however im getting errors again now as shown below:

    Warning: main() [function.main]: open_basedir restriction in effect. File(/home/username/public_html/header.php) is not within the allowed path(s): (/home/bmobm/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/bmobm/public_html/indextest1.php on line 2

    Warning: main(/home/username/public_html/header.php) [function.main]: failed to open stream: Operation not permitted in /home/bmobm/public_html/indextest1.php on line 2

    Warning: main() [function.main]: open_basedir restriction in effect. File(/home/username/public_html/header.php) is not within the allowed path(s): (/home/bmobm/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/bmobm/public_html/indextest1.php on line 2

    Warning: main(/home/username/public_html/header.php) [function.main]: failed to open stream: Operation not permitted in /home/bmobm/public_html/indextest1.php on line 2

    Warning: main() [function.include]: Failed opening '/home/username/public_html/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 2

    Warning: main() [function.main]: open_basedir restriction in effect. File(/home/username/public_html/mainpage.php) is not within the allowed path(s): (/home/bmobm/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/bmobm/public_html/indextest1.php on line 3

    Warning: main(/home/username/public_html/mainpage.php) [function.main]: failed to open stream: Operation not permitted in /home/bmobm/public_html/indextest1.php on line 3

    Warning: main() [function.main]: open_basedir restriction in effect. File(/home/username/public_html/mainpage.php) is not within the allowed path(s): (/home/bmobm/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/bmobm/public_html/indextest1.php on line 3

    Warning: main(/home/username/public_html/mainpage.php) [function.main]: failed to open stream: Operation not permitted in /home/bmobm/public_html/indextest1.php on line 3

    Warning: main() [function.include]: Failed opening '/home/username/public_html/mainpage.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 3

    Warning: main() [function.main]: open_basedir restriction in effect. File(/home/username/public_html/footer.php) is not within the allowed path(s): (/home/bmobm/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/bmobm/public_html/indextest1.php on line 4

    Warning: main(/home/username/public_html/footer.php) [function.main]: failed to open stream: Operation not permitted in /home/bmobm/public_html/indextest1.php on line 4

    Warning: main() [function.main]: open_basedir restriction in effect. File(/home/username/public_html/footer.php) is not within the allowed path(s): (/home/bmobm/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/bmobm/public_html/indextest1.php on line 4

    Warning: main(/home/username/public_html/footer.php) [function.main]: failed to open stream: Operation not permitted in /home/bmobm/public_html/indextest1.php on line 4

    Warning: main() [function.include]: Failed opening '/home/username/public_html/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 4

    this was using the
    PHP Code:
    <?php
    include ("/home/username/public_html/header.php");
    include (
    "/home/username/public_html/mainpage.php");
    include (
    "/home/username/public_html/footer.php");
    ?>
    suggestion.

    what does "open_basedir restriction in effect" mean?

  • #6
    Regular Coder
    Join Date
    Apr 2007
    Posts
    295
    Thanks
    0
    Thanked 19 Times in 19 Posts
    Look at the errors, notice there's a path in there that looks a lot like the one you're trying to include, only with a different user name? You want to use this user name, not literally "username".
    Warning: main() [function.include]: Failed opening '/home/username/public_html/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 4
    So you would want
    PHP Code:
    include ("/home/bmobm/public_html/footer.php"); 
    Or as was said earlier
    PHP Code:
    // $_SERVER['DOCUMENT_ROOT'] evaluates to /home/bmobm/public_html

    include ($_SERVER['DOCUMENT_ROOT']."/footer.php"); 
    Last edited by mr e; 06-09-2007 at 11:00 PM.

  • #7
    New Coder
    Join Date
    Jun 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok ive just tried this code:
    PHP Code:
    <?php
    include ($_SERVER['DOCUMENT_ROOT']."/carparts/themes/v525/header.php");
    include (
    $_SERVER['DOCUMENT_ROOT']."/carparts/themes/v524/mainpage.php");
    include (
    $_SERVER['DOCUMENT_ROOT']."/carparts/themes/v524/footer.php");
    ?>
    and im getting these errors:
    Warning: main(/home/bmobm/public_html/carparts/themes/v525/header.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 2

    Warning: main(/home/bmobm/public_html/carparts/themes/v525/header.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 2

    Warning: main() [function.include]: Failed opening '/home/bmobm/public_html/carparts/themes/v525/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 2
    Access Denied
    the carparts/themes/v525 is the path to the files i want but its still not working AAGGGHHHHHHH!!!! lol this is really doing my head in. ive been fiddeling round with the code for ages now trying different things lol but im still no closer to where i wanna be.

  • #8
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Sighs. I suggest you follow the suggestions given rather than make up your own. Use this as is, DON'T change it
    PHP Code:
    <?php
    include ($_SERVER['DOCUMENT_ROOT']."/header.php");
    include (
    $_SERVER['DOCUMENT_ROOT']."/mainpage.php");
    include (
    $_SERVER['DOCUMENT_ROOT']."/footer.php");
    ?>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #9
    New Coder
    Join Date
    Jun 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry _Aerospace_Eng_,

    i did try as you suggested also but i got this result:

    Warning: main(/home/bmobm/public_html/header.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 2

    Warning: main(/home/bmobm/public_html/header.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 2

    Warning: main() [function.include]: Failed opening '/home/bmobm/public_html/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 2

    Warning: main(/home/bmobm/public_html/mainpage.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 3

    Warning: main(/home/bmobm/public_html/mainpage.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 3

    Warning: main() [function.include]: Failed opening '/home/bmobm/public_html/mainpage.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 3

    Warning: main(/home/bmobm/public_html/footer.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 4

    Warning: main(/home/bmobm/public_html/footer.php) [function.main]: failed to open stream: No such file or directory in /home/bmobm/public_html/indextest1.php on line 4

    Warning: main() [function.include]: Failed opening '/home/bmobm/public_html/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bmobm/public_html/indextest1.php on line 4

  • #10
    Regular Coder
    Join Date
    Apr 2007
    Posts
    295
    Thanks
    0
    Thanked 19 Times in 19 Posts
    If your main file is in your /www (or /public_html, both go to the same place) folder, then any of these should work, do they all not?
    PHP Code:
    include('./carparts/themes/v524/header.php');

    include(
    '/home/bmobm/public_html/carparts/themes/v524/header.php');

    include(
    $_SERVER['DOCUMENT_ROOT'] .'/carparts/themes/v524/header.php'); 

  • #11
    New Coder
    Join Date
    Jun 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, with this access denied with ALL three of those examples

    the index i want to use as entry point to the site is in the ROOT the files i want to call upon are in ROOT----carparts-----themes-----v524/
    Last edited by danelliott; 06-09-2007 at 11:51 PM.

  • #12
    Regular Coder
    Join Date
    Apr 2007
    Posts
    295
    Thanks
    0
    Thanked 19 Times in 19 Posts
    Ok, I think it has to do with the header/footer, not the include() itself

    Try this, I bet it works
    PHP Code:
    include($_SERVER['DOCUMENT_ROOT'] .'/carparts/themes/v524/main.js');

    // Or try

    include($_SERVER['DOCUMENT_ROOT'] .'/carparts/themes/v524/index.php'); 

  • #13
    New Coder
    Join Date
    Jun 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    when i use
    PHP Code:
    include($_SERVER['DOCUMENT_ROOT'] .'/carparts/themes/v524/index.php'); 
    do i use it on its own? or should i replace the index.php with header.php, footer.php ect? because on its own i get a blank page

    and if i use
    PHP Code:
    include($_SERVER['DOCUMENT_ROOT'] .'/carparts/themes/v524/main.js'); 
    i get a load of weird code like this
    Code:
    function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var

  • #14
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Post the code for header.php and footer.php

    Going to them directly I get access denied. Whatever is in those files is also denying access for inclusion.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #15
    New Coder
    Join Date
    Jun 2007
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It wont allow me to post the whole code in one go im afraid ill have to do it in bits the first bit of the header code looks like this.
    [PHP]Ok, before you read this code, would i get access denied if there is MySQL queiries in the code im trying to call? if so then please dont bother reading the code unless it will help someone explain to me what i need to do for the page to work.

    header.php looks like this:
    PHP Code:
    <?
    ## v5.24 -> apr. 05, 2006
    if ( !defined('INCLUDED') ) { die("Access Denied"); }
    ### enter hit into stats table
    if ($setts['maintenance_mode']==1&&$_SESSION['adminarea']!="Active") { 
        include_once (
    "maintenance_splash_page.php");
        die();
    }

    function 
    getmicrotime() 

       list(
    $usec$sec) = explode(" "microtime()); 
       return ((float)
    $usec + (float)$sec); 
    }

    $time_start getmicrotime();
    $currentTime time();
    ### Site Stats currently disabled 
    /* $refererSite=getenv("HTTP_REFERER");
    $enterhit = mysql_query("INSERT INTO probid_stats (userip,userbrowser,clickdate,referralsite) 
    VALUES ('".$_SERVER['REMOTE_ADDR']."','".$_SERVER['HTTP_USER_AGENT']."','".$currentTime."','".$refererSite."')") or die(mysql_error());
    */
    ### session language settings
    if(!$_SESSION['sess_lang']) {
        include_once (
    "config/lang/".$setts['default_lang']."/site.lang");
        
    $_SESSION['sess_lang']="".$setts['default_lang']."";
        include_once (
    "config/lang/".$setts['default_lang']."/category.lang");
    }else{
        include_once (
    "config/lang/".$_SESSION['sess_lang']."/site.lang");
        include_once (
    "config/lang/".$_SESSION['sess_lang']."/category.lang");
    }

    ## modification regarding the SSL - only the registration and login page will be in SSL.
    $path $setts['siteurl'];
    $path_ssl = ($setts['is_ssl']==1) ? $setts['ssl_address'] : $setts['siteurl'];

    ## show sell button
    if ($setts['private_site']=="Y"$showSell $_SESSION['is_seller'];
    else 
    $showSell="Y";

    if (
    $_SESSION['membersarea']=="Active"||$_SESSION['accsusp']==2) {
        
    $btn2_link=$path."sellitem.php";
        
    $btn3_caption=$lang[Cap_members];
        
    $btn3_link=$path."membersarea.php";
        
    $btn4_caption=$lang[Cap_logout];
        
    $btn4_link=$path."index.php?option=logout";
    } else {
        
    $btn2_link=$path_ssl."login.php?redirect=sell";
        
    $btn3_caption=$lang['Cap_register'];
        
    $btn3_link=$path_ssl."register.php";
        
    $btn4_caption=$lang['Cap_login'];
        
    $btn4_link=$path_ssl."login.php";
    }
    include (
    "themes/".$setts['default_theme']."/title.php");
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>
    <? 
    if (eregi("auctiondetails.php",$_SERVER['PHP_SELF'])) echo getSqlField("SELECT itemname FROM probid_auctions WHERE id='".$_GET['id']."'","itemname")." - ";
    if (
    eregi("wanted.details.php",$_SERVER['PHP_SELF'])) echo getSqlField("SELECT itemname FROM probid_wanted_ads WHERE id='".$_GET['id']."'","itemname")." - ";
    else if (
    eregi("categories.php",$_SERVER['PHP_SELF'])) { 
        
    $cat_title getSqlField("SELECT name FROM probid_categories WHERE id='".$_REQUEST['parent']."'","name");
        if (
    $cat_title!=""&&$cat_title!="n/a") echo $cat_title." - ";
    }
    echo 
    $setts['sitename'];
    ?>
    </title>
    <?
    if (eregi("categories.php",$_SERVER['PHP_SELF'])) {
        
    $meta_cat getMainCat($_REQUEST['parent']);
        
    $meta_details getSqlRow("SELECT meta_description, meta_keywords FROM probid_categories WHERE id='".$meta_cat."'");
    }    
    ?>
    <meta http-equiv="Content-Type" content="text/html; charset=<?=$lang[codepage];?>">
    <? 
    if ($meta_details['meta_description']!=""||$meta_details['meta_keywords']!="") {
        echo 
    "<meta name=\"description\" content=\"".$meta_details['meta_description']."\"> \n";
        echo 
    "<meta name=\"keywords\" content=\"".$meta_details['meta_keywords']."\"> \n";
    } else {
        echo 
    addSpecialChars(getSqlField ("SELECT metatags FROM probid_gen_setts","metatags"));
    }

    if (
    eregi("shop"$_SERVER['PHP_SELF'])) {
        
    $store_metatags getSqlField("SELECT store_metatags FROM probid_users WHERE id='".$_REQUEST['userid']."'""store_metatags");
        if (!empty(
    $store_metatags)) echo "<meta name=\"keywords\" content=\"".$store_metatags."\"> \n";
    }
    ?>
    <link href="themes/<?=$setts['default_theme'];?>/style.css" rel="stylesheet" type="text/css">
    <style type="text/css">
    <!--
    .lb {
        background-image:  url(themes/<?=$setts['default_theme'];?>/img/lb_bg.gif);
    }
    .db {
        background-image:  url(themes/<?=$setts['default_theme'];?>/img/db_bg.gif);
    }
    -->
    </style>
    <script language="javascript" src="themes/<?=$setts['default_theme'];?>/main.js" type="text/javascript"></script>
    <script language=JavaScript src='scripts/innovaeditor.js'></script>
    <script type="text/javascript">
    <? $diff=getSqlField("SELECT * FROM probid_timesettings WHERE active='selected'","value"); ?>
    var currenttime = '<? print date("F d, Y H:i:s"time()+$diff*3600)?>';
    var serverdate=new Date(currenttime);

    function padlength(what){
        var output=(what.toString().length==1)? "0"+what : what;
        return output;
    }

    function displaytime(){
        serverdate.setSeconds(serverdate.getSeconds()+1)
        var timestring=padlength(serverdate.getHours())+":"+padlength(serverdate.getMinutes())+":"+padlength(serverdate.getSeconds());
        document.getElementById("servertime").innerHTML=timestring;
    }

    window.onload=function(){
        setInterval("displaytime()", 1000);
    }

    </script>
    </head>
    <body bgcolor="#ffffff" leftmargin="5" topmargin="5" marginwidth="5" marginheight="5" <? if (eregi("index.php",$_SERVER['PHP_SELF'])) { ?>onLoad="loadScroller()"<? ?>>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
       <td width="100%"><table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-bottom: 4px solid #0f3f79;">
             <tr valign="bottom">
                <td><img src="images/probidlogo.gif?<?=rand(2,9999);?>" alt="Bmobm Carparts Online Vehicle Related Auction Site" vspace="4"></td>
                <td width="100%" valign="bottom" style="padding-left: 30px;"><div class="toplink" align="right" style="padding: 10px;"> <a href="<?=$path;?>index.php">
                      <?=$lang[Cap_home];?>
                      </a> | 
                      &nbsp;<a href="<?=$path;?>faq.php">
                      <?=$lang[Cap_faq];?>
                      </a>
                      <? if ($layout['is_about']=="Y") { ?>
                      | <a href="<?=$path;?>aboutus.php">
                      <?=$lang[Cap_about];?>
                      </a>
                      <? ?>
                      <? if ($layout['is_contact']=="Y") { ?>
                      | <a href="<?=$path;?>contactus.php">
                      <?=$lang[Cap_contact];?>
                      </a>
                      <? ?>
                   </div>
                   <? ## calculate width
                        
    $headerCells 3;
                        if (
    $showSell == "Y"$headerCells ++;
                        if (
    $setts['enable_wantedads'] == "Y"$headerCells ++;
                        if (
    $setts['stores_enabled'] == "Y"$headerCells++;
                        if (
    $layout['is_about'] == "Y"$headerCells ++;
                        if (
    $layout['is_contact'] == "Y"$headerCells ++;
                        
    $headBtnWidth 100/$headerCells."%";
                        
    ?>
                   <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr height="31" align="center">
                         <? if (eregi("index.php",$_SERVER['PHP_SELF'])) { ?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
                         <td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>index.php">
                            <?=$lang[Cap_home];?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
                         <? } else {?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
                         <td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>index.php">
                            <?=$lang[Cap_home];?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
                         <? ?>
                         <? if ($showSell=="Y") { 
                                    if (
    eregi("sellitem.php",$_SERVER['PHP_SELF'])) { ?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
                         <td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$btn2_link;?>">
                            <?=$lang[Cap_sell];?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
                         <? } else {?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
                         <td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$btn2_link;?>">
                            <?=$lang[Cap_sell];?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
                         <? } } 
                             if (
    eregi("membersarea.php",$_SERVER['PHP_SELF'])||eregi("register.php",$_SERVER['PHP_SELF'])) { ?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
                         <td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$btn3_link;?>">
                            <?=$btn3_caption;?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
                         <? } else { ?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
                         <td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$btn3_link;?>">
                            <?=$btn3_caption;?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
                         <? } if (eregi("login.php",$_SERVER['PHP_SELF'])) { ?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
                         <td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$btn4_link;?>">
                            <?=$btn4_caption;?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
                         <? } else {?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
                         <td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$btn4_link;?>">
                            <?=$btn4_caption;?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
                         <? 
                                if (
    $setts['stores_enabled']=="Y") { 
                                    if (
    eregi("stores.php",$_SERVER['PHP_SELF'])) { ?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
                         <td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>stores.php">
                            <?=$lang[Cap_stores];?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
                         <? } else {?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
                         <td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>stores.php">
                            <?=$lang[Cap_stores];?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
                         <? } } 
                                if (
    $setts['enable_wantedads']=="Y") { 
                                    if (
    eregi("wanted.categories.php",$_SERVER['PHP_SELF'])) { ?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
                         <td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>wanted.categories.php">
                            <?=$lang[Cap_wantedads];?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
                         <? } else {?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
                         <td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>wanted.categories.php">
                            <?=$lang[Cap_wantedads];?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
                         <? }  } 
                                if (
    eregi("help.php",$_SERVER['PHP_SELF'])) { ?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
                         <td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>help.php">
                            <?=$lang[Cap_help];?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
                         <? } else {?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
                         <td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>help.php">
                            <?=$lang[Cap_help];?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
                         <? 
                             if (
    eregi("sitefees.php",$_SERVER['PHP_SELF'])) { ?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/db_s.gif" width="6" height="31"></td>
                         <td nowrap class="db mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>sitefees.php">
                            <?=$lang[Cap_fees];?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/db_e.gif" width="8" height="31"></td>
                         <? } else { ?>
                         <td width="6"><img src="themes/<?=$setts['default_theme'];?>/img/lb_s.gif" width="6" height="31"></td>
                         <td nowrap class="lb mainmenu" width="<?=$headBtnWidth;?>">&nbsp;<a href="<?=$path;?>sitefees.php">
                            <?=$lang[Cap_fees];?>
                            </a>&nbsp;</td>
                         <td width="8"><img src="themes/<?=$setts['default_theme'];?>/img/lb_e.gif" width="8" height="31"></td>
                         <? ?>
                      </tr>
                   </table></td>
             </tr>
          </table>
          <table width="100%" height="29" border="0" cellpadding="0" cellspacing="0" bgcolor="#efefef" style="border: 1px solid #a6a6a6; border-top: 2px solid #a6a6a6;">
             <tr height="31">
                <td width="194" nowrap align="center" class="search">&nbsp;&nbsp;&nbsp;
                   <?php 
                        $diff
    =getSqlField("SELECT * FROM probid_timesettings WHERE active='selected'","value");
                        echo 
    date(substr($setts['date_format'],0,7),time()+($diff*3600)) ?>
                   <span id="servertime"></span>&nbsp;&nbsp;&nbsp;</td>
                <form action="auctionsearch.php" method="post">
                   <td class="search" nowrap style="border-left: 1px solid #dddddd;">&nbsp;&nbsp;&nbsp;<a href="<?=$path;?>search.php">
                      <?=$lang[Cap_search];?>
                      </a>&nbsp;&nbsp;&nbsp;</td>
                   <td class="search" nowrap><INPUT size=25 name="basicsearch">
                      &nbsp;&nbsp;&nbsp;</td>
                   <td class="search" nowrap><input name="searchok" type="submit" value="<?=$lang[search]?>">
                      &nbsp;&nbsp;&nbsp;</td>
                </form>
                <td class="search" nowrap style="border-left: 1px solid #dddddd;">&nbsp;&nbsp;&nbsp;
                   <?=$lang[browse];?>
                   &nbsp;&nbsp;</td>
                <form name="catbrowse" method="post" action="<?=$path;?>categories.php">
                   <input type="hidden" name="show" value="subcats">
                   <? $getCategories mysql_query("SELECT id,name FROM probid_categories WHERE parent=0 AND hidden=0 AND userid=0 ORDER BY theorder,name");?>
                   <td width="100%" class="search"><select name="parent" onChange="javascript:catbrowse.submit()">
                         <option value="" selected>
                         <?=$lang[choosecat];?>
                         </option>
                         <? while($category=mysql_fetch_array($getCategories)) { ?>
                         <option value="<?=$category['id'];?><? echo (($category['id']==$_REQUEST['parent'])?"selected":"");?>>
                         <?=$c_lang[$category['id']];?>
                         </option>
                         <? ?>
                         <option value="">------------------------</option>
                         <option value="0">
                         <?=$lang[allcats];?>
                         </option>
                      </select>
                   </td>
                </form>
                <? if ($setts['user_lang']==1) { ?>
                <td nowrap style="border-left: 1px solid #dddddd;"><!-- ADD THE FOLLOWING CODE WHEREEVER YOU WANT YOUR LANGUAGE OPTIONS TO SHOW-->
                   <div align="center"> &nbsp;&nbsp;
                      <? include ("config/lang/list2.php");
                            
    $langlist explode(" "$langlist);
                            
    $sizeofarray count($langlist)-1
                            for (
    $z=0$z $sizeofarray$z++) {
                                echo 
    "<a href=\"lang.php?lang=".$langlist[$z]."\">";
                                echo 
    "<img src=\"themes/".$setts['default_theme']."/img/".$langlist[$z].".gif\" border=\"0\" alt=\"$langlist[$z]\"></a>&nbsp;&nbsp;";
                            } 
    ?>
                   </div>
                   <!-- END ADDITION -->


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •