[ create a new paste ] login | about

Link: http://codepad.org/xFg7BmDV    [ raw code | output | fork ]

PHP, pasted on Sep 12:
<?php

require"setting.php";
require_once"_np_config/Config.php";



class tmp{


public function head(){

      echo '

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <title>  '.$fetch->title.'  </title>
  <meta name="description" content="'.$fetch['description'].'" />
		  <meta name="keywords" content="'.$fetch->keywords .'" />
		  <meta name="author" content="'.$fetch->author .'" />
  <meta charset="utf-8">
    <link rel="stylesheet" href="themes/styles.css">

</head>';

}


public function index(){
       $this->head();
         echo '

<body>
<div class="Jamalindex">
<div id="Jamalheader">
<h1>نيووز بـريـــز</h1>
</div>
<div id="NavBar">
<ul>
 <li><a href="#">الــرئيــسية</a></li>
 <li><a href="#">الــرئيــسية</a></li>
 <li><a href="#">الــرئيــسية</a></li>
 <li><a href="#">الــرئيــسية</a></li>
 </ul>
</div>
<div id="Jamalbody">


<div id="lblock">
<div class="head">القائمة الرئيسية</div>
<div class="bodypanel">محتوى القائمة</div>

<div class="head2">القائمة الرئيسية</div>
<div class="bodypanel">محتوى القائمة</div>
</div>



<div id="rblock">
<div class="head">القائمة الرئيسية</div>
<div class="bodypanel">
<a href="index.php" > الـرئـيسية</a>  ';

$select=mysql_query("select * from cats where cid_cat=0 limit 0,6") or die(mysql_error());


 while($fetch=@mysql_fetch_assoc($select)){
  $id=$fetch['cid'];
  $names=$fetch['cat_name'];
  echo "<a href='cat.php?cid=$id'> $names </a>";
   }

         echo '

</div>

</div>



<div id="cblock">
<div class="head">القائمة الرئيسية</div>
<div class="bodypanel">محتوى القائمة</div>
<div class="head2">القائمة الرئيسية</div>
<div class="bodypanel">محتوى القائمة</div>
</div>

</div>';




}



public function index2(){
       $this->head();
         echo '

<body>
<div class="Jamalindex">
<div id="Jamalheader">
<h1>نيووز بـريـــز</h1>
</div>
<div id="NavBar">
<ul>
 <li><a href="#">الــرئيــسية</a></li>
 <li><a href="#">الــرئيــسية</a></li>
 <li><a href="#">الــرئيــسية</a></li>
 <li><a href="#">الــرئيــسية</a></li>
 </ul>
</div>
<div id="Jamalbody">


<div id="lblock">
<div class="head">القائمة الرئيسية</div>
<div class="bodypanel">محتوى القائمة</div>

<div class="head2">القائمة الرئيسية</div>
<div class="bodypanel">محتوى القائمة</div>
</div>



<div id="rblock">
<div class="head">القائمة الرئيسية</div>
<div class="bodypanel">
<a href="index.php" > الـرئـيسية</a>  ';
}






public function footer(){
echo '

<br>
<div id="jamalclear"></div><br>
<div id="JamalFooter">كل الحقوق محفوظة</div>

</div>
</body>

</html>


';

}


   public $sql;

	public function post($post) {
		return @mysql_real_escape_string(trim(strip_tags($post)));
	}

	public function get($id) {
		$id    = intval(abs($id));
		$array = array("-",":","'",'"',";","=",",","+","*","/",".","'","\"","\\","/",">","<",")","(","}","{","#",",",";",":","%","£","^","¨","`","°","²","&","=","*","×","§");
		$id    = str_replace($array,"************",$id);
		return $id;
	}

	public function pass($post) {
		return md5(sha1(md5(sha1($post))));
	}

	public function check_email($email){
		$address = strtolower(trim($email));
		return (preg_match("/^[a-zA-Z0-9_.-]{1,40}+@([a-zA-Z0-9_-]){2,30}+\.([a-zA-Z0-9]){2,20}$/i",$address));
	}

 }

















?>

<div id="cblock">
<?php


 $getid=intval($_GET['cid']);
$se=@mysql_query("select * from cats where cid='$getid'") or die(mysql_error());  // الاقسام الريئسية
$num=mysql_num_rows($se);
$rows=mysql_fetch_assoc($se);
$name=$rows['cat_name'];

if($num ==0 or $num <0){
echo "القسم المطلوب غير موجود";
}else{

$se2=@mysql_query("select * from cats where cid_cat='$getid' ") or die(mysql_error()); // الاقسام الفرعية
$num2=mysql_num_rows($se2);
if($num2 !=0){

while($rows2=mysql_fetch_assoc($se2)){
$name=$rows2['cat_name'];
$nid=$rows2['cid'];



echo "<div class='head'>الاقسام الفرعيى</div>";
echo '
<div class="bodypanel">

<a href="cat.php?cid=$id">$name2</a>


</div>';
}


echo "<div class='head'>$name</div>";


echo '
<div class="bodypanel">
</div>';
}

}
?>


Output:
1
2
3
4

Warning: require(setting.php): failed to open stream: No such file or directory on line 3

Fatal error: require(): Failed opening required 'setting.php' (include_path='.:/usr/lib/php') on line 3


Create a new paste based on this one


Comments: