Jump to content
fantas

site não instala e está cheio de erros

Recommended Posts

fantas

Boas Malta, tenho um script que comprei desde 2006 +- e na altura funcionava as mil maravilhas, e resolvi pegar nele ontem e tenho andado aqui ás voltas e sozinho não consigo, não sei o que se passa, mas dá erros por todo o lado...

Warning: include(include/config.php): failed to open stream: No such file or directory in C:\xampp\htdocs\lol\index.php on line 2
Warning: include(): Failed opening 'include/config.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\lol\index.php on line 2
Warning: include(include/function.php): failed to open stream: No such file or directory in C:\xampp\htdocs\lol\index.php on line 3
Warning: include(): Failed opening 'include/function.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\lol\index.php on line 3
Notice: Undefined index: que_subject in C:\xampp\htdocs\lol\index.php on line 13
Notice: Undefined index: que_subject in C:\xampp\htdocs\lol\index.php on line 14
Notice: Undefined index: que_details in C:\xampp\htdocs\lol\index.php on line 17
Notice: Undefined index: que_details in C:\xampp\htdocs\lol\index.php on line 18
Notice: Undefined index: que_cat in C:\xampp\htdocs\lol\index.php on line 21
Notice: Undefined index: que_cat in C:\xampp\htdocs\lol\index.php on line 22
Notice: Undefined index: que_offer in C:\xampp\htdocs\lol\index.php on line 25
Notice: Undefined index: que_offer in C:\xampp\htdocs\lol\index.php on line 26
Notice: Undefined index: send_que in C:\xampp\htdocs\lol\index.php on line 30
Fatal error: Class 'STemplate' not found in C:\xampp\htdocs\lol\index.php on line 123

alguém me pode ajudar ? nem na página de instalar consigo ir ele acede mas depois não consigo carregar em seguinte

abraço

Share this post


Link to post
Share on other sites
Sr Inovação

mostra o codigo, penso que falta verificar se muitas variaveis existem, faz-se isso com a funçao isset();

erros de include estão aí porque nao encontrado nenhum ficheiro ou nao consegue abrir no caminho indicado na funçao include();

PS:Isto tudo deduzo eu porque li que todos erros que apresentaste, senao sabes o que um erro significa,copia e adapta o conteudo e depois coloca no google,é só um conselho porque o php é bastante descritivo no que aos erros diz respeito,mas de todas as formas estamos aqui para ajudar mas parece falta de leitura daquilo que está escrito nas mensagens de erro

Edited by Sr Inovação

Share this post


Link to post
Share on other sites
fantas

Já pesquisei, e não percebo os erros, vou colocar aqui a página do index

<?php
 include("include/config.php");
 include("include/function.php");
/*	 if(strpos($_POST['que_details'], ".")!=0)
		 $que_subject = substr($_POST['que_details'], 0, strpos($_POST['que_details'], ".")+1);
 else
		 $que_subject = $_POST['que_details'];
 if(strpos($que_subject, "?")!=0)
		 $que_subject = substr($que_subject, 0, strpos($que_subject, "?")+1);
*/
	 if($_POST['que_subject']=="")
		 $que_subject = $_GET['que_subject'];
	 else
		 $que_subject = $_POST['que_subject'];
	 if($_POST['que_details']=="")
		 $que_details = $_GET['que_details'];
	 else
			 $que_details = $_POST['que_details'];
	 if($_POST['que_cat']=="")
		 $que_cat = $_GET['que_cat'];
	 else
		 $que_cat = $_POST['que_cat'];
	 if($_POST['que_offer']=="")
		 $que_offer = $_GET['que_offer'];
	 else
		 $que_offer = $_POST['que_offer'];
 if($_POST['send_que'] or $que_details)
 {
//			 if($que_subject==null)
//					 $err = "Enter Subject of your question.";
		 if($password)
				 header("Location: login.php?login=Login&username=$username&password=$password&que_subject=".stripslashes($que_subject)."&que_details=".stripslashes($que_details)."&que_cat=$que_cat&que_offer=$que_offer&send_que=$send_que");
		 elseif($rusername)
				 header("Location: register.php?register=create&username=$rusername&password=$rpassword&email=$email&que_subject=".stripslashes($que_subject)."&que_details=".stripslashes($que_details)."&que_cat=$que_cat&que_offer=$que_offer");
		 if($que_subject==null)
				 $err = "Enter your question please.";
		 elseif($que_details==null)
				 $err = "Enter details about your question.";
		 elseif($que_cat<0)
				 $err = "";
		 elseif($que_cat==0)
				 $err = "Select a subcategory, not a top-level category.";
		 elseif($que_offer<$config['min_que_value'])
				 $err = "Enter minimum $$config[min_que_value] to make offer against your question.";
		 elseif(is_float($que_offer+0))
				 $err = "Enter integer value to make offer against your question.";
		 elseif($_SESSION['id']=="")
		 {
				 $login_form = true;
		 }
		 elseif($confirm == "") {
				 $rs = $conn->execute("select * from category where cat_id=$que_cat");
				 STemplate::assign('que_subject', stripslashes($que_subject));
				 STemplate::assign('que_details', stripslashes($que_details));
				 STemplate::assign("que_cat_title", $rs->fields['cat_title']);
				 STemplate::display("header.tpl");
				 STemplate::display("confirm.tpl");
				 STemplate::display("footer.tpl");
				 exit;
		 }
		 elseif($confirm!="false")
		 {
				 $rs_cat = $conn->execute("select cat_type_id from category where cat_id=$que_cat");
				 $sql = "INSERT INTO `question` ( `que_id` , `userid` , `que_subject` , `que_details` , `cat_id` , `cat_type_id`, `offer_id` , `time_asked` )
								 VALUES (
								 '', '$_SESSION[id]', '".htmlspecialchars($que_subject)."', '".htmlspecialchars($que_details)."', '$que_cat', '".$rs_cat->fields['cat_type_id']."', '$que_offer', '".date("Y-m-d H:i:s")."'
								 )";
				 $conn->execute($sql);
				 $conn->execute("insert offer set offer_id='$que_offer', offer_value='$que_offer'");
				 $rs_p = $conn->execute("select max(posts) as posts_count from expert where userid=$_SESSION[id]");

				 $posts = $rs_p->fields['posts_count'] + 1;
				 $conn->execute("Update expert set
								 posts=$posts
								 where userid=$_SESSION[id]
						 ");

				 /* Send email to subscribed expert */
				 $keywords = implode(array_unique(explode(" ", $_POST['que_subject'])), "%' or keyword like '%");
				 $rs = $conn->execute("select distinct * from subscribe where cat_id like '%,$que_cat,%' or keyword like '%$keywords%'");
				 while(!$rs->EOF)
				 {
						 $s_userid[] = $rs->fields['userid'];
						 $rs->movenext();
				 }
				 $rs_q = $conn->execute("select que_id from question where que_subject='$que_subject'");
				 $rs_o = $conn->execute("select offer_value from offer where offer_id=$que_offer");
				 $rs_c = $conn->execute("select cat_title from category where cat_id = $que_cat");
				 for($i=0; $i<count($s_userid); $i++)
				 {
						 $rs_u = $conn->execute("select username, email from expert where userid=$s_userid[$i]");
						 STemplate::assign('user_id', $_SESSION['id']);
						 STemplate::assign('expert_name', $rs_u->fields['username']);
						 STemplate::assign('cat_title', $rs_c->fields['cat_title']);
						 STemplate::assign('que_id', $rs_q->fields['que_id']);
						 STemplate::assign('que_subject', stripslashes($que_subject));
						 STemplate::assign('que_details', stripslashes($que_details));
						 STemplate::assign('offer_value', $rs_o->fields['offer_value']);
						 STemplate::assign('time_asked', date("Y-m-d H:i:s"));
						 STemplate::assign('posted_by', $_SESSION['username']);
						 $to = $rs_u->fields['email'];
						 $name = $config['admin_name'];
						 $from = $config['admin_email'];
						 $subj = $config['site_name']." - New ".$rs_c->fields['cat_title']." Question: $que_subject";
						 $body = STemplate::fetch("mail/notify_new_question.tpl");
						 mailing($to,$name,$from,$subj,$body);
				 }
//					 header("Location: pay_deposit.php?que_id=".$rs_q->fields['que_id']);
					 header("Location: search.php?id=$_SESSION[id]");
		 }
 }
 STemplate::assign('que_subject',stripslashes($que_subject));
 STemplate::assign('que_details',stripslashes($que_details));
 STemplate::assign('que_cat',$que_cat);
 STemplate::assign('que_offer',$que_offer);


 $cat_type[] = "---";
 $offer[] = "---";
/*
 $rs = $conn->execute("select * from category order by cat_title");
 while(!$rs->EOF)
 {
		 $cat_type[ $rs->fields['cat_id'] ] = $rs->fields['cat_title']." Specialists";
		 $rs->movenext();
 }
 STemplate::assign("cat_type", $cat_type);
*/

 $cat_ops.="<option value='0' $sel>---</option>\n";
 $rs = $conn->execute("select * from category_type order by cat_type");
 while(!$rs->EOF)
 {
		 $cat_id = "0";
		 $cat_type = $rs->fields['cat_type'];
		 $cat_ops.="<option value='$cat_id'>$cat_type</option>\n";
		 $rs_cat = $conn->execute("select * from category where cat_type_id=".$rs->fields['cat_type_id']." order by cat_title");
		 while(!$rs_cat->EOF)
		 {
				 $cat_id = $rs_cat->fields['cat_id'];
				 $cat_type = "  -".$rs_cat->fields['cat_title']." Specialists";
				 if($_POST['que_cat']==$rs_cat->fields['cat_id']) $sel="Selected"; else $sel="";
						 $cat_ops.="<option value='$cat_id' $sel>$cat_type</option>\n";
				 $rs_cat->movenext();
		 }
		 $rs->movenext();
 }
		 STemplate::assign("cat_ops", $cat_ops);

 $rs = $conn->execute("select * from offer");
 while(!$rs->EOF)
 {
		 $offer[ $rs->fields['offer_id'] ] = $rs->fields['offer_value'];
		 $rs->movenext();
 }
 STemplate::assign("offer", $offer);


 /* Display New Question */
 if($config['show_recent_que'] == "yes")
 {
		 $today = date('d');
		 $sql = "select * from question where que_status='Open' order by que_id desc limit $config[recent_que_limit]";
		 $rs = $conn->execute($sql);
		 while(!$rs->EOF)
		 {
				 $rs_u = $conn->execute("select username from expert where userid=".$rs->fields['userid']);
				 $d_que_id[] = $rs->fields['que_id'];
				 $d_que_details[] = $rs->fields['que_details'];
				 $d_offer[] = $rs->fields['offer_id'];
				 $d_user_name[] = $rs_u->fields['username'];
				 $d_private[] = $rs->fields['private'];
				 $rs->movenext();
		 }
		 STemplate::assign('d_que_id', $d_que_id);
		 STemplate::assign('d_que_details', $d_que_details);
		 STemplate::assign('d_offer', $d_offer);
		 STemplate::assign('d_user_name', $d_user_name);
		 STemplate::assign('d_private', $d_private);
 }
 STemplate::assign('send_que',$_REQUEST[send_que]);
 STemplate::assign('err',$err);
 STemplate::display("header.tpl");
 STemplate::display("index.tpl");
 STemplate::display("footer.tpl");
?>

Share this post


Link to post
Share on other sites
fantas

existem !

eu posso passar o script se alguém conseguir meter a funcionar ficava mesmo muito grato

Share this post


Link to post
Share on other sites
Sr Inovação

não tens nenhuma pasta chamada include com os ficheiros pois não? se os ficheiros que queres incluir estao no mesmo sitio da pagina index basta:

include("config.php");
include("function.php");

PS:Ops o user rui carlos antecipou-se,é que sou lento a digitar

Edited by Sr Inovação

Share this post


Link to post
Share on other sites
fantas

tenho, tenho a pasta include com esses dois ficheiros sim senhor !

é estranho é !

Edited by fantas

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. 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.