אשכול: עזרה בקוד PHP
View Single Post
ישן 30-10-07, 23:20   # 6
DanielS
הוסטסניון
 
מיני פרופיל
תאריך הצטרפות: Jan 2007
מיקום: ישראל
הודעות: 2,429

DanielS לא מחובר  

PHP קוד:
<?php  
$link 
mysql_connect("localhost","instforums_dfs","114477")or die(mysql_error());     
mysql_select_db("instforums_dfs",$link);   

if (isset(
$_GET['id'])){  
    
$myid intval($_GET['id']); 
    
$query "SELECT * FROM gui WHERE id={$myid}";   
    
$result mysql_query($query $link);  

    while(
$row mysql_fetch_array($result)) {  
$content =<<<EOF
<table border='1' width='527' height='482'>  
    <tr>   
        <td height='23' width='131' valign='top'>
{$row['name']}</td>  
        <td height='48' width='380' rowspan='2' valign='top'>
{$row['gname']}</td>   
    </tr>  
    <tr>  
        <td height='23' width='131'>
{$row['date']}</td>  
    </tr> 
    <tr>  
        <td height='426' width='527' colspan='2'>
{$row['msg']}</td>   
    </tr> 
</table>  
EOF;
    echo 
$content 
    }  
}else{ 
    echo 
"main page";  
}  
?>
תהנה =]
להבא תעשה גם קוד יותר מסודר ויעיל ומאובטח. מומלץ !
וגם אחי
כאשר אתה שם משתנה בתוך echo יש כללים.
__________________
Daniel
Email : daniel [AT] smartwd [DOT] com


Last edited by DanielS; 31-10-07 at 00:08..
  Reply With Quote