can someone fix my error?

Discussion in 'PHP' started by ankifreeze, Dec 4, 2010.

  1. #1
    hello,I need help on how to get rid of thes 3 error messages..thanks...
    Warning: include() [function.include]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/header.php) is not within the allowed path(s): (/home/:/usr/lib/php:/tmp) in /home/a2140946/public_html/headfoot.php on line 8

    Warning: include(/usr/local/apache/htdocs/header.php) [function.include]: failed to open stream: Operation not permitted in /home/a2140946/public_html/headfoot.php on line

    Warning: include() [function.include]: Failed opening '/usr/local/apache/htdocs/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a2140946/public_html/headfoot.php on line 8
     
    ankifreeze, Dec 4, 2010 IP
  2. KingOle

    KingOle Peon

    Messages:
    69
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can you post the code for headfoot.php?
     
    KingOle, Dec 4, 2010 IP
  3. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
    #3
    ThePHPMaster, Dec 4, 2010 IP
  4. ankifreeze

    ankifreeze Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    here is content of headfoot.php

    <?php
    function get_main_content() {
    $mncontent = mysql_result(mysql_query("select content from html where type='1page'"), 0);
    echo($mncontent);
    }
    function uheader() {
    global $m_header, $ref;
    include($m_header);
    }
    function ufooter() {
    global $m_footer, $ref;
    include($m_footer);
    }
    function secheader() {
    global $mem_header, $usrid;
    include($mem_header);
    }
    function members_main_menu() {
    global $title, $fontface, $server_clock, $usrid;
    $s_vals = file_reader("/memlinks.html");
    $s_vals = str_replace('[show_server_time]', $server_clock, $s_vals);
    echo($s_vals);
    }
    function secfooter() {
    global $mem_footer, $usrid;
    include($mem_footer);
    }
    function file_reader($fileurl) {
    global $_SERVER;
    $fileurl = $_SERVER['DOCUMENT_ROOT'] . $fileurl;
    $file=fopen($fileurl,'r') or die("File Doesn't Exist");
    $contents=fread($file,filesize($fileurl));
    fclose($file);
    return $contents;
    }
    function checkPTCdata($dateis) {
    $qres = mysql_query("UPDATE ptc_orders SET date_done='$dateis' WHERE clicks_remain=0 && date_done='0000-00-00'");
    return;
    }
    function text() {
    $res = mysql_query("select text from tads order by rand() limit 1");
    if (mysql_num_rows($res) > 0) {
    $text = mysql_result($res, 0);
    echo("<p align=center>$text</p>");
    }
    }
    function get_referral($vid) {
    $query = "select ref_id from member_refs where mem_id=$vid";
    if($res = mysql_query($query)) {
    if($res1 = mysql_fetch_array($res)) {
    return $res1[0];
    }
    }
    }
    function credit_ref_bonuses($par_id) {
    for ($i=0; $i < count($par_id); $i++) {
    $get_ref_data = mysql_query("SELECT acctype FROM user WHERE id=$par_id[$i] && status='Active'");
    if (mysql_num_rows($get_ref_data) != 0) {
    $refacc = mysql_result($get_ref_data, 0);
    $get_bonuses = mysql_result(mysql_query("SELECT rbonuses FROM acctype WHERE id=$refacc"), 0);
    $bonuses = explode(",", $get_bonuses);
    $givebonus = $bonuses[$i];
    if (!is_numeric($givebonus)) {$givebonus = 0; }
    $upd_ref_acc = mysql_query("UPDATE user SET credits=credits+$givebonus, rbon_credits=rbon_credits+$givebonus, lifetime_credits=lifetime_credits+$givebonus WHERE id=$par_id[$i]");
    $surpres = mysql_query("update adminprops set value=value-$givebonus where field='surplu'");
    }
    }
    }
    function get_ref_levels($mid,$z) {
    global $tier;
    $squery = "select count(*),mem_id from member_refs where ref_id in ($mid) group by mem_id";
    if ($res = mysql_query($squery)) {
    $tier[$z] = mysql_num_rows($res);
    $res = mysql_fetch_array($res);
    $mquery = "select mem_id from member_refs where ref_id in ($mid)";
    if ($resultx = mysql_query($mquery)) {
    $z = 1;
    while ($rsvz = mysql_fetch_array($resultx)){
    $rr_id[$z] = $rsvz[0];
    $z++;
    }
    }
    return $rr_id;
    }
    }
    function credit_r_bonuses($par_id,$type,$ammt) {
    $zzz = 0;
    for ($i=0; $i < count($par_id); $i++) {
    $zzz++;
    $get_ref_data = mysql_query("SELECT acctype FROM user WHERE id=$par_id[$i] && status='Active'");
    if (mysql_num_rows($get_ref_data) != 0) {
    $refacc = mysql_result($get_ref_data, 0);
    if ($type == 'credits') {
    $get_bonuses = mysql_result(mysql_query("SELECT levels FROM acctype WHERE id=$refacc"), 0);
    } else {
    $get_bonuses = mysql_result(mysql_query("SELECT ptc_levels FROM acctype WHERE id=$refacc"), 0);
    }
    $bonuses = explode(",", $get_bonuses);
    $givebonus = $bonuses[$i] / 100;
    $givebonus = round($givebonus, 2);
    $givebonus = $givebonus * $ammt;
    if ($zzz == 1) {
    $return_val = $givebonus;
    }
    if (!is_numeric($givebonus)) {$givebonus = 0; }
    if ($type == 'credits') {
    $upd_ref_acc = mysql_query("UPDATE user SET credits=credits+$givebonus, crdsfrmallrefs=crdsfrmallrefs+$givebonus, lifetime_credits=lifetime_credits+$givebonus WHERE id=$par_id[$i]");
    $surpres = mysql_query("update adminprops set value=value-$givebonus where field='surplu'");
    } else {
    $update_ref_earnings = mysql_query("UPDATE user SET cshfrmallrefs=cshfrmallrefs+$givebonus, roi_cash=roi_cash+$givebonus, lifetime_cash=lifetime_cash+$givebonus WHERE id=$par_id[$i]");
    $surpres = mysql_query("update adminprops set value=value-$givebonus where field='csurpl'");
    $get_refstats = mysql_query("SELECT * FROM monthly_stats WHERE usrid=$par_id[$i] && yearis=" . date("Y") . " && monthis=" . date("m"));
    if (mysql_num_rows($get_refstats) == 0) {
    $ins_upd = mysql_query("INSERT INTO monthly_stats (usrid, refptc_cash, tot_owed, monthis, yearis) VALUES ($par_id[$i], $givebonus, $givebonus, " . date("m") . ", " . date("Y") . ")") or die (mysql_error());
    } else {
    $ins_upd = mysql_query("UPDATE monthly_stats SET refptc_cash=refptc_cash+$givebonus, tot_owed=tot_owed+$givebonus WHERE usrid=$par_id[$i] && yearis=" . date("Y") . " && monthis=" . date("m")) or die (mysql_error());
    }
    }
    }
    }
    return $return_val;
    }
    function ref_shunt($memb_id) {
    //$par_id=member_referral($memb_id);
    $par_id=get_referral($memb_id);
    $query="SELECT mem_id FROM member_refs WHERE ref_id=$memb_id";
    $chv_id=Array();
    $i=0;
    if ($res=mysql_query($query)) {
    while($id=mysql_fetch_array($res)) {
    $chv_id[$i] = $id[0];
    $i++;
    }
    $queryv="UPDATE member_refs SET ref_id=$par_id WHERE mem_id=";
    for($i=0;$i<count($chv_id);$i++) {
    mysql_query($queryv.$chv_id[$i]);
    }
    }
    return 1;
    }
    ?>
     
    ankifreeze, Dec 4, 2010 IP
  5. digiklan

    digiklan Member

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #5
    Check chmod values of the files and directories. Seems like include function can't reach the file or folder to include.
     
    digiklan, Dec 5, 2010 IP
  6. w47w47

    w47w47 Peon

    Messages:
    255
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    ye you have to chmod them. folders to 777 and files to 666.
     
    w47w47, Dec 5, 2010 IP
  7. ankifreeze

    ankifreeze Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I have checked chmod but still got error........
    someone in other forum give me advice like this...

    Okay now look at this
    /home/a2140946/public_html/headfoot.php
    You have access to /usr/local/apache/htdocs so you can't run files from it. Wherever you have this
    $_SERVER['DOCUMENT_ROOT']
    change it to '/home/a2140946/public_html/'


    but appear another error....

    Warning: include() [function.include]: Failed opening '/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a7484646/public_html/headfoot.php on line 8

    Warning: include() [function.include]: Failed opening '/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a7484646/public_html/headfoot.php on line 12
    ankifreeze is offline Add to ankifreeze's Reputation Report Post Edit/Delete Message
     
    ankifreeze, Dec 5, 2010 IP