صفحة 1 من 2
??????? ????? ??? php
مرسل: الخميس أغسطس 26, 2010 2:31 am
بواسطة harede2006
?????? ?????
??? ?? ??????? ?? ??? ?? ????? ????? ??? ????? ???????? ?????? ???? ?? ?????? ???????? ? ????? ?????? ?????
?????? ???? ??????? ???? ?? ??? ???? ??? ??????? ?????? ??? ????? ??????? ????? ??? ???? ?????
????? ????
show.php ???? ???? ????? ??????
كود: تحديد الكل
<?php
include('easytemplate.php');
$con=mysql_connect("localhost","root","="); //SQL??????? ?? .
if(!$con)
{
die('can not connect'.mysql_error());
}
mysql_select_db( site , $con );
$result = mysql_query("select * from post");
$num = mysql_num_rows($result);
$i=0;
while( $i < $num ) {
$post_id = mysql_result( $result , $i , "post_id" );
$title = mysql_result( $result , $i , "title" );
$data = mysql_result( $result , $i , "data" );
++$i;
}
$tmpl = new EasyTemplate('style','cache');
print $tmpl->display('body/showpost_body.html');
mysql_close($con);
?>
??? ?????? ??? ????? ????????
<table border='1' width='100%' id='table1'>
كود: تحديد الكل
<tr>
<td width='5%'>{post_id}</td>
<td width='44%'>{title} </td>
<td width='20%'>{data}</td>
<td width='10%'> <a href='edit.php?id=$post_id'> [Edit] </a> </td>
<td width='10%'> <a href='del.php?id=$post_id'>[delete] </a> </td>
</tr>
</table>
??????? ?? ??? ??? ????? ?? ???? ?? ??? ???????? ?? ???? ????? ?? ????? ???????? ??? ???? ???????? ??????
??? ?? ??? show ???? ????? while ???? ???? ???? ????? ????? while ??? ??? ?????? ??? ??? ???
??????? ????? ??? php
مرسل: السبت أغسطس 28, 2010 7:34 am
بواسطة harede2006
???? ???? ?? ?????? ??? ????????
????:
???? ????? ?????? ?????? ?????? ????? ??? ??????
http://daif.net/easy/?name=loop
?????? ?? ??????? LOOP ????? ???? ???? ????? ??? ?? ??? ????? ???? ?? ????? ??? ???? ??? ??? ????? ???????? ?? ????? ??????? ?? ????? ??????? , ???? ??? ????? ??????? ??? ???????? ?? ??? ???? ??????? SQL ??? ??????? ???? ??????? ????? ???? ??? ???? ????? ?????? ??? ??????? LIMIT ???? ???? ??? ??? ??????? ?? ?????? ??????? ???? ????? ????? ?????? ???? ??????? ?? ??????? NAME ???? ???? _paging ?????? ??? ????? ???? ??????? ???? ??? ?? ????? 1 ??? ??? ??????? .
?????? ?????? ?? ??? ????? ?????? ????? ??? 9 ????? ?? ???? ????? ??? ?????? ???? ??? id ? name ??? ???? ??? html ??? ??????? ??? ???????? ?????? ????? ??? ??? ??????? ??? ?? ????? ?????? ???.?
كود: تحديد الكل
<?
for($i=0;$i<=5;$i++){
$rows[] = array('id'=>$i,'name'=>'name'.$i);
}
?>
كود: تحديد الكل
html
<LOOP NAME="{rows}">
{rows.id} - {rows.name}
</LOOP>
</IF>
كود: تحديد الكل
result
1 - name1
2 - name2
3 - name3
4 - name4
5 - name5
??????? ????? ??? php
مرسل: الأحد أغسطس 29, 2010 2:30 am
بواسطة harede2006
?? ??????? ???? ..
???? ?? ????? ???????? ???? ???? ?? ????? ???? ??? ????? ????? ??
?? ?????? ???????? ?????? ???? ?? ??? ??? ?????? ?? ?? ???
??????? ????? ???? ???????? ??? ???? ??? ????? ???? ????? ?? ???
??? ???? ??? ????? ???????? ????? ??????
كود: تحديد الكل
$post_all = "SELECT forum_id , name,img,des FROM forum WHERE forum_id= ???" ;
??? ???? ?? ????? ??? ?????? ??? ?? ???? ? ???? ???? ?? ?????? ???????? ?????? ?
------
??????? ????? ??? php
مرسل: الاثنين أغسطس 30, 2010 3:31 am
بواسطة developer.mahmoud
??? ???? ???? ??? ???? ??? ?? ??? ??? ????? ?? ???? ??????? ???????? ??? ???? ??? ????? ????? ?? ??? 5
??????? ????? ??? php
مرسل: الاثنين أغسطس 30, 2010 2:17 pm
بواسطة harede2006
?????? ??? ???? ?????? ???? ???????? ????? ???????
?? ????? ???? ????? ????? ????? ?? ???? ???????? ??? ????? ?????
??? ??? ??????? ?? ????? ?? ?????? ????? ????????
??????? ????? ??? php
مرسل: الاثنين أغسطس 30, 2010 5:22 pm
بواسطة developer.mahmoud
????? ????? ??? ???????? ?? ???? ??????? .
???? ???????? ????? ??? ??? ????? ???
???? ???????? ????? ??? ?? ?? ????? , ????? ??????? ????? ??? ?? ?? ???? ????? ?????? ?????
???? ????? ????? ??? ??? ??? ????? ???????? ?? ???? ???????? , ???? ??????? ????? ??? ???????? ??? ?????? ????? ??? .
??????? ????? ??? php
مرسل: الاثنين أغسطس 30, 2010 6:25 pm
بواسطة harede2006
???? ???????? ????? ??? ?? ?? ????? , ????? ??????? ????? ??? ?? ?? ???? ????? ?????? ?????
??? ???? ???? ??? ????? ???? ???? ???????? ????? ??? ???????? ????? ??????? ??? ????? ???? ?? ???
??? ???? ???? ?? ??? ????? ????? ????
???? ??? ????? ?? ?????? ???????? ???? ????? ??????? ?????? ??? ???? ?? ???????? ???? ????
?? ???? ?
??? ????????? ?? ????? ???????? ????? ????? ??????? ??? ????? ???????? ?
???? ????? ???????? ??? ???? ??? ????? ???? ???? ?? ????? ??? ??? ???? ???? ???? ????? ???? ?????? ??????
???? ???????? ???? ?? ?????? ????? ?? ??????? ?
???? ??? ????? ?????? ???? ???? ??????? ???? ?????? ????? ???????? ???????? ????? ????? ?? ????? ???? ????? ????? ?????? ???? ??????? ????? ???????? ????? ?????? ????? ????? ???????? ?? ???? ???????? ??? ??? ???? ??? ?? ????? ????? ????? ????? ?? ????? ??????? ?? ????
??????? ????? ??? php
مرسل: الاثنين أغسطس 30, 2010 10:02 pm
بواسطة developer.mahmoud
harede2006 كتب:???? ???????? ???? ?? ?????? ????? ?? ??????? ?
???? : ??? ?? ???? 3 ??? ??? ?? ??? ???? sql ???? ???????? ????? ??? ,
?? ?? ???? 5 ?????? ?? ?? ??? ???? ???? select ????? ??????? ???? ??? ????? ????? sql ???? ??? ???? ?????? ???? ?????
??? ????? ???? ???? row ?? ??? ????? ???? ?????? ????? LEFT JOIN
http://www.w3schools.com/sql/sql_join_left.asp
???? ?? : ??? ??? ????? ??? ??? ????? ??? ????? ?????? ?? ????? ??? ????? ??? ??????? ?
??????? ????? ??? php
مرسل: الثلاثاء أغسطس 31, 2010 2:03 pm
بواسطة harede2006
?????? ?????
?? ??? ?????? ???? ??? ????? ??? ?????? ?? ?????? ??? ??? ???? ??? ?? ??? ???? ??? ???? ?????? ?? ?????? ????????
?? ??????? ????
???? ???? ?????? ??????? ??????? ????? ???? ?? ??? ??????? ??? ????? ????????
???? ???? ?????? ?? ??? ????? ?????? ???? ???? ????? ????? ??? ????? ??? ????? ?? ?? ??? php ?? ?? html
???????? ??????? ??? ????? ????? ???? ????? ?????? ?? ???? ????? ???
??? ???? ??????? ?? ???? ??? ?????? ???? ?? php
كود: تحديد الكل
<?php
session_start();
if(!$_SESSION['username']){
echo "<font color=\"#FF0000\"><b>please log in <META HTTP-EQUIV=\"refresh\" CONTENT=\"1; URL=login.php\"></b></font>";
exit;
}
include('easytemplate.php');
$con=mysql_connect("localhost","root","");
if(!$con){
die('can not connect'.mysql_error());
}
mysql_select_db( site , $con );
if (isset($_POST['newpost'])){
if($title == "" || $img == "" || $data == "" ) {
die("<b>??? ???? ???/???? ?????</b>");
}
$sql="INSERT INTO post (title, img, data, forum_id) VALUES ('$_POST[title]','$_POST[img]','$_POST[data]','$_POST[forum_id]')";
if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }
$post_id = "SELECT post_id FROM post ORDER BY post_id DESC LIMIT 1" ;
}
if (isset($_POST['edit'])){
if($title == "" || $data == "" || $img_post == "" ) {
die("<b>??? ???? ???/???? ?????</b>");
}
$query_post2 = "update post set title='$title', img='$img_post',data='$data' where post_id='$post_id'";
mysql_query($query_post2);
$query_forum2 = "update forum set name='$name', des='$des', img='$img_forum' where forum_id='$forum_id'";
mysql_query($query_forum2);
}
$tmpl = new EasyTemplate('style','cache');
print $tmpl->display('body/inserted_body.html');
mysql_close($con);
?>
كود: تحديد الكل
<INCLUDE NAME="body/header_body.html">
<table border="0" width="100%" bordercolorlight="#000000" style="border-collapse: collapse" cellpadding="4">
<tr>
<td>
<IF NAME="{newpost}">
<p align="center">?? ????? ??????? ?????</p>
<p align="center"><LOOP NAME="{rows}" SQL="{post_id}" LIMIT="1"><a href="showpost.php?id={rows.post_id}">???? ??? ??????? ???????</a></LOOP></p>
</IF>
<IF NAME="{edit}">
<p align="center">?? ????? ??????? ?????</p><p align="center"><a href="showpost.php?id={post_id}">???? ??? ??????? ???????</a></p>
</IF>
</td>
</tr>
</table>
<INCLUDE NAME="body/footer_body.html">
??????? ????? ??? php
مرسل: الثلاثاء أغسطس 31, 2010 9:11 pm
بواسطة developer.mahmoud
harede2006 كتب:?? ??? ?????? ???? ??? ????? ??? ?????? ?? ?????? ??? ??? ???? ??? ?? ??? ???? ??? ???? ?????? ?? ?????? ????????
?? ????? ?? ????? ??? ?????? ?
?? ??????? ??? ??? ?????? ?? ??? ??????.
????????? ?????? : ???? ?????? ???? ???????????
??????? ????? ??? php
مرسل: الجمعة سبتمبر 03, 2010 1:06 am
بواسطة harede2006
?????? ????? ????? ???? ???????
???? ????? ?????
????? ??? ??? ???????? ?? ?????? ????? ??? ????? ????? ?????? ??????? ?????
???? ??? ??? ???????
?????? ???? ???? ??? ??? ??????? ?????? ???? ??? ?????? ??? ??? ????? ??? ???? ?? ????? ???? ????? ?????
????? ????? ?????? ??????? ?????? ??? ?? ????????? ????
??????? ????? ??? php
مرسل: الجمعة سبتمبر 03, 2010 1:21 am
بواسطة developer.mahmoud
harede2006 كتب:?????? ????? ????? ???? ???????
???? ????? ?????
????? ??? ??? ???????? ?? ?????? ????? ??? ????? ????? ?????? ??????? ?????
???? ??? ??? ???????
?????? ???? ???? ??? ??? ??????? ?????? ???? ??? ?????? ??? ??? ????? ??? ???? ?? ????? ???? ????? ?????
????? ????? ?????? ??????? ?????? ??? ?? ????????? ????
??? ???? ?????? ????? ??? ?? ??? ??? ?? ?????? ???? 
??????? ????? ??? php
مرسل: الجمعة سبتمبر 03, 2010 1:41 am
بواسطة harede2006
?? ?? ???? ??????? ???????
?????? ?????? ???? ???? ?? ???? ???????
????? ??? ??? ????? ??? ??????
??? ???? ??? ????? ????? ???? ???? ?? ?? ??? ?? ?????? ???? ???? ??? ??? ?? ??? ????
??? ????? ????? ???? ?? ??????? ?????? ????? ???? ??? ??? ????? ?? ??? ??????? ???? ???? ?? ???? ?????? ??? ???? ????? ??? ??? ??????? ?? ???? ??? ???? ????? ?? ???? ??????
?????? ???????
????? ????? ??????? ?? ????? ?????? ??? ?????? ???? ??? ????
??? ????? ???? ????? ??? ??????? ?????? ????? ?? ?????
?? ???? ??????
http://harede.0fees.net/a/
http://harede.0fees.net/a/admin
medo
test
?????? ?????? ??? ????? ???? ??????? ?? ???? ????? ??? ???? ????? ???? ??? ?????? ???? ?? ?? ?? ?????? ????? ???

??????? ????? ??? php
مرسل: الجمعة سبتمبر 03, 2010 2:06 am
بواسطة developer.mahmoud
???? ????? ????? 
??????? ????? ??? php
مرسل: الجمعة سبتمبر 03, 2010 4:03 am
بواسطة harede2006
?????? ?????
?? ??? ??????? ??? ???? ?????? ???? ????? ???? ????? ???????? ????? ?? inserted.php
كود: تحديد الكل
<?php
session_start();
if(!$_SESSION['username']){
echo "<font color=\"#FF0000\"><b>please log in <META HTTP-EQUIV=\"refresh\" CONTENT=\"1; URL=login.php\"></b></font>";
exit;
}
include('../config.php');
include('../easytemplate.php');
$con = mysql_connect("$hostname","$user","$pass");
if(!$con){
die('can not connect'.mysql_error());
}
mysql_select_db($db_name,$con);
if (isset($_POST['newpost'])){
if($title == "" || $img == "" || $data == "" ) {
die("<b>??? ???? ???/???? ?????</b>");
}
$sql="INSERT INTO post (title, img, small_data, data, forum_id) VALUES ('$_POST[title]','$_POST[img]','$_POST[small_data]','$_POST[data]','$_POST[forum_id]')";
if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }
$post_id = "SELECT post_id FROM post ORDER BY post_id DESC LIMIT 1" ;
}
if (isset($_POST['edit'])){
if($title == "" || $data == "" || $img == "") {
die("<b>??? ???? ???/???? ?????</b>");
}
$query_post2 = "update post set title='$title', small_data = '$small_data', img='$img',data='$data' ,forum_id='$forum_id' where post_id='$post_id'";
mysql_query($query_post2);
}
$tmpl = new EasyTemplate('style','cache');
print $tmpl->display('body/inserted_body.html');
mysql_close($con);
?>