|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Slow download
Hi,
what are the key elements which might cause our script to download slow. thanks
__________________
Rathaur ====================== Knowledge is Power |
|
#2
|
|||
|
|||
|
What's the code you're using? Also, are you storing the files in a database or are they in a directory? Is the download slow for all users?
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#3
|
|||
|
|||
|
Hi, Generally the system is written with PHP and mysql as its DB.
I really cant determine the 'slowness' of this system, but I did tried to reduced queries as much as I can. Generally , what are the things which will make slow downloading of a website ( apart from low bandwidth, bad connections , and a stone aged PC ) |
|
#4
|
|||
|
|||
|
Quote:
Hehehe... if those are the "specs" you're testing on... Then that's the problem! ![]() Seriously though... How are the files stored on the system? Are they stored in the db as BLOBs or are they stored in a directory? Would you mind posting the code you're using? |
|
#5
|
|||
|
|||
|
include("../lib/lib.inc");
if (! $opt) $opt =1; $trn="<img src='../images/turun.jpg' alt='Sort Desc by title'>"; $trn1="<img src='../images/turun.jpg' alt='Sort Desc by name'>"; $trn2="<img src='../images/turun.jpg' alt='Sort Desc by Position'>"; $trn3="<img src='../images/turun.jpg' alt='Sort Desc by Department'>"; $link1="<a href='vwstaff.php?opt=2'>"; // desc by title $link2="<a href='vwstaff.php?opt=3'>"; // desc by fname $link3="<a href='vwstaff.php?opt=4'>"; // desc by jawatan $link4="<a href='vwstaff.php?opt=5'>"; // desc by jabatan //adminnav(); echo "<center><table width='100%' bgcolor='#000080' border=0>"; echo "<tr width='100%'><td align='center'>"; echo "<font face='verdana,arial,helvetica' color='#ffffff' size='3'>"; echo "Senarai </font></td></tr></table>"; $font="<font face='verdana,arial,helvetica' color='#636563' size='1'><b>"; $tabhead1.="<table width=100% bgcolor='brown' cellspacing=0 border=0>"; $tabhead1.="<tr bgcolor='#dodceo' width=100% heigth=10><td width='5%' align='left'> $font NO. </b></font>"; $tabhead1.="<td width='25%' align='left'>$font $link1 $trn </a> $link2 $trn1 </a> Nama Staff </b></font></td>"; $tabhead1.="<td width='15%' align='left'>$font $link3 $trn2 </a> Jawatan </b></font></td>"; $tabhead1.="<td width='15%' align='left'>$font $link4 $trn3</a> Bahagian </a> </b></font></td>"; $tabhead1.="<td width='10%' align='left'>$font Tel </b></font></td>"; $tabhead1.="</tr>"; // Page Counter $rows_per_page = $perpage; $sql = "SELECT * FROM staff "; $result = mysql_query($sql)or die("DB Fatal Error 1: ".mysql_error()); $total_records = mysql_num_rows($result); $pages = ceil($total_records / $rows_per_page); if (!isset($screen)) $screen = 0; $start = $screen * $rows_per_page; $dis=$screen+1; $j=$start+1; switch ($opt) { case 1: //list the staff by db entry $sql = "SELECT * FROM staff "; $sql .= "LIMIT $start, $rows_per_page"; break; case 2: // sort desc by title $sql = "SELECT * FROM staff ORDER BY Title DESC "; $sql .= "LIMIT $start, $rows_per_page"; break; case 3: // sort desc by first name $sql = "SELECT * FROM staff ORDER BY Fname DESC "; $sql .= "LIMIT $start, $rows_per_page"; break; case 4: // sort desc by first name $sql = "SELECT * FROM staff ORDER BY Jawatan DESC "; $sql .= "LIMIT $start, $rows_per_page"; break; case 5: // sort desc by first name $sql = "SELECT * FROM staff ORDER BY Bagian DESC "; $sql .= "LIMIT $start, $rows_per_page"; break; default: echo"<h2> Please choose your option</h2>"; break; } // end of switch echo " <br><br> <font face='verdana,arial,helvetica' color='#636563'>"; echo "Paparan $dis dari $pages halaman <br></font>"; // print the rable header echo"<br><br>$tabhead1"; $result = mysql_query($sql); $rows = mysql_num_rows($result)or die(" DB fatal error :".mysql_error()); //if (!isset($j)) $j=1; while($row = mysql_fetch_array($result)) { ; $bgcolor = "#ffffff"; $id=$row['id']; $tit=$row['Title']; $fname=$row['Fname']; $sname=$row['Sname']; $stfid=$row['staffNo']; $post=$row['Jawatan']; $dep=$row['Bagian']; $tel=$row[' Tel']; $font="<font face='verdana,arial,helvetica' color='#636563' size='1.5'><b>"; if ($tel == '') $tel='-'; echo"<tr width=100% bgcolor=$bgcolor height=20>"; echo"<td width=5% align='left'>$font $j </font></b></td>"; echo"<td width=25% align='left'>$font $tit $fname $sname </font></b></td>"; echo"<td width=15% align='left'>$font $post </font></b></td>"; echo"<td width=15% align='left'>$font $dep </font></b></td>"; echo"<td width='10%' align='left'>$font $tel </b></font></td>"; echo"</tr><tr bgcolor='#f5f5f5'></tr>"; $j++; } echo"</table><br><br>"; // Pages if ($screen > 0) { $sc= $screen - 1; $url = "vwstaff.php?screen=$sc&j=$j&opt=$opt"; echo "<a href=\"$url\">Previous</a>\n"; } // page numbering links now for ($i = 0; $i < $pages; $i++) { $url = "vwstaff.php?screen=$i&j=$j&opt=$opt"; echo " | <a href=\"$url\">$i</a> | "; } if ($screen < $pages -1) { //$url = "student.php?screen=" . $screen + 1; $scr= $screen + 1; $url = "vwstaff.php?screen=$scr&j=$j&opt=$opt"; echo "<a href=\"$url\">Next</a>\n"; } footer(); ?> |
|
#6
|
|||
|
|||
|
Rathaur,
Are your files being stored in the database as a BLOB or in a directory? |
|
#7
|
|||
|
|||
|
its located in directory and the script simply calls upon database, and display the content of the tables in html
|
|
#8
|
|||
|
|||
|
Rathaur,
Do you have a link where I can test this? I'm curious to see how slow the download is for me... Let me know. |
|
#9
|
|||
|
|||
|
|
|
#10
|
|||
|
|||
|
What section of the site are you experiencing the slow downloads? I don't understand the language, so I'm having a hard time finding the downloads area!
Thanks! ![]() |
|
#11
|
|||
|
|||
|
Click on 'Staff' link on the left navigation menu. Any comments on the design ?
|
|
#12
|
|||
|
|||
|
Rathaur,
I've checked out the site... And I don't see any major speed issues... When you say "downloading", do you mean the actual page loading, or is there a file I should be downloading? I don't see any download links, so I'm assuming you mean the page load. Another thing I would look at is the host itself... If you're on a shared host, you may want to look at that... |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Slow download |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|