
31-12-2009, 23:43
|
|
|
|
חבר מתאריך: 19.02.05
הודעות: 67
|
|
|
עזרה איך לשלב בתוך טבלה מערך?
היי שלום
אני ראיתי את הפונקציה ב-PHP של התחברות לFTP
עכשיו בניתי התחברות והצגה של קבצים אבל יש לי בעיה אני לא מצליח לשלב את זה בתוך טבלה
עשיתי את הקוד הבא:
מה לא טוב בו?
קוד PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="" />
<style type="text/css">
table {
font: 11px/24px Verdana, Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 500px;
}
th {
padding: 0 0.5em;
text-align: left;
}
tr.yellow td {
border-top: 1px solid #FB7A31;
border-bottom: 1px solid #FB7A31;
background: #FFC;
}
td {
border-bottom: 1px solid #CCC;
padding: 0 0.5em;
}
td:first-child {
width: 250px;
}
td+td {
border-left: 1px solid #CCC;
text-align: center;
}
</style>
<title>Untitled 3</title>
</head>
<body>
<?php
/**
* @author
* @copyright 2009
*/
$ftp_server = "ftp.freehost.co.il";
$ftp_user = "*******";
$ftp_pass = "*******";
$dir = 'public_html';
$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
$login_result = ftp_login($conn_id, $ftp_user, $ftp_pass);
$contents = ftp_nlist($conn_id, "$dir");
foreach($contents as $file)
<table>
<tr class="yellow">
<td>Name of Manual</td>
<td>Format</td>
<td>Size</td>
</tr>
<tr>
<td><a href="">$file</a></td>
<td>pdf</td>
<td>2.5 MB</td>
</tr>
</table>
ftp_close($conn_id);
?>
</body>
</html>
תודה לעוזרים
_____________________________________
חתימתכם הוסרה כיוון שלא עמדה בחוקי האתר. לפרטים נוספים לחצו כאן. תוכלו לקבל עזרה להתאמת החתימה לחוקים בפורום חתימות וצלמיות.
|