neotask Posted March 4, 2006 Share Posted March 4, 2006 Hi, I am a complete newbie to servers, MySQL and PHP. Don't laugh, you were like me at some point in your e-life. I have spent hours searching for an autosurf script and I found one. Now it doesn't work. I'm sure that there's a simple explanation, but as I say, I am a complete newbie. The errors I'm getting are these:Warning: uheader(//header.php): failed to open stream: No such file or directory in /home/www/neotask.awardspace.com/headfoot.php on line 8Warning: uheader(): Failed opening '//header.php' for inclusion (include_path='.:/usr/local/php4/share/pear') in /home/www/neotask.awardspace.com/headfoot.php on line 8andWarning: ufooter(//footer.php): failed to open stream: No such file or directory in /home/www/neotask.awardspace.com/headfoot.php on line 12Warning: ufooter(): Failed opening '//footer.php' for inclusion (include_path='.:/usr/local/php4/share/pear') in /home/www/neotask.awardspace.com/headfoot.php on line 12The headfoot.php is this:[code]<?phpfunction 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);$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;}?>[/code]And the header.php:[code]<html><head><title>neotask</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><script language="JavaScript" type="text/javascript"><!--defaultStatus = "http://neotask.awardspace.com";//--></script><style type="text/css"><!--a { color: #666666; text-decoration: none;}a:visited { color: #666666; text-decoration: none;}a:hover { color: #666666; text-decoration: underline;}body { font-family: Verdana, Arial, Helvetica, sans-serif}.webforms { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-weight: bold; background-color: #E8E8E8;}.formbutton { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; background-color: #666666;}--></style></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="84%" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" bgcolor="#CCCCCC"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="35%" height="40"> <font size="4"><strong>neotask</strong></font></td> <td width="65%"><div align="center"> <script language="JavaScript" src="/banner.php?style=non_ssi"></script> </div></td> </tr> </table></td> </tr> <tr> <td width="16%" valign="top" bgcolor="#CCCCCC"><table width="130" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="37"> </td> </tr> <tr> <td><div align="right"><strong><font size="2"><a href="/<? if ($ref) {echo("?ref=$ref"); }?>">Home</a></font></strong></div></td> </tr> <tr> <td><div align="right"><strong><font size="2"><a href="/signup.php<? if ($ref) {echo("?ref=$ref"); }?>">Signup</a></font></strong></div></td> </tr> <tr> <td><div align="right"><strong><font size="2"><a href="/signup.php?show=terms<? if ($ref) {echo("&ref=$ref"); }?>">Terms</a></font></strong></div></td> </tr> <tr> <td><div align="right"><strong><font size="2"><a href="/signup.php?show=privacy<? if ($ref) {echo("&ref=$ref"); }?>">Privacy</a></font></strong></div> </td> </tr> <tr> <td><div align="right"><strong><font size="2"><a href="/contact.php<? if ($ref) {echo("?ref=$ref"); }?>">Contact Us</a></font></strong></div></td> </tr> </table></td> <td width="2%" valign="top"> </td> <td width="82%" valign="top">[/code]footer.php:[code]</td> </tr> <tr> <td colspan="3" bgcolor="#CCCCCC"><div align="center"> <center> </center> <center> <font size="1"><strong>© Copyright 2006 http://neotask.awardspace.com</strong></font><strong> </strong><br> <hr color="#CCCCCC" width="680"> </center> </div></td> </tr></table></td></tr></table></body></html>[/code]You can see them for yourself at[a href=\"http://neotask.awardspace.com\" target=\"_blank\"]neotask[/a]I also get a hosting based error ... have a look at[a href=\"http://neotask.awardspace.com/control\" target=\"_blank\"]My Autosurf Control Panel[/a]If you need mor info on any of the script/errors, just ask :)Thanks for your help - and for not laughing at me!Dex Quote Link to comment Share on other sites More sharing options...
michaellunsford Posted March 4, 2006 Share Posted March 4, 2006 I see include($m_header); but I don't see where $m_header is defined.I've never seen two slashes before something in that error before... best guess, take all leading slashes out of your $m_header variable before trying to include it.without knowing what's in that variable, here's a guess:your web-site root is really "/home/www/neotask.awardspace.com". HTML will let you do something like this <img src="/images/image.jpg"> which will really be looking in the /home/www/neotask.awardspace.com/images/ directory.PHP include uses the REAL directory structure to include files. So "/images/image.php" will look in your /images/ folder, not the /home/www/neotask.awardspace.com/images/ folder.think of it like using the "cd" command. "cd images" will take you to the images directory that's located in the directory you're already in (like /home/www/neotask.awardspace.com/) but cd /images will go to the /images directory. Make sense? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.