Speed expectations of PHP driven web page
Moderator: General Moderators
Speed expectations of PHP driven web page
I am relatively new to programming in php and have been working on developing a search routine for the on-line shop of my wife's small business web site.
Got it working to my general satisfaction except that a page loads very slowly. The page contains about eight product items and takes from five to eight seconds before the page is completely loaded. The page build up isn't particularly complex, consisting of a number of product related loops (1 to 10) with an another inner loop for each outer product loop that is typically 3 to 10 loops long. Within the whole page code I only query the database two times. The page build uses CSS only.
My gut feeling is that this is slow and doesn't look particularly good but I don't have any experience to know what to expect. Can anyone say what should be my expectation and is there a way to program php that makes it faster or to keep the page blank until the whole page code is available from the server?
Thanks
Ron
Got it working to my general satisfaction except that a page loads very slowly. The page contains about eight product items and takes from five to eight seconds before the page is completely loaded. The page build up isn't particularly complex, consisting of a number of product related loops (1 to 10) with an another inner loop for each outer product loop that is typically 3 to 10 loops long. Within the whole page code I only query the database two times. The page build uses CSS only.
My gut feeling is that this is slow and doesn't look particularly good but I don't have any experience to know what to expect. Can anyone say what should be my expectation and is there a way to program php that makes it faster or to keep the page blank until the whole page code is available from the server?
Thanks
Ron
Re: Speed expectations of PHP driven web page
The thing to remember is that PHP executes on the server and is completely finished by the time the server sends the page to the browser. So it could theoretically be responsible for delays before a page begins to be displayed, but cannot possibly be responsible for "progressive" delays once any part of the page begins to be rendered in the browser. It sounds to me like your problem is more likely to be caused by unnecessarily large image files than any programming activity. Either that or your server is seriously overloaded.
Re: Speed expectations of PHP driven web page
Ron, you've either got some poorly written code or you aren't using MySQL effectively. Care to post the code?
Re: Speed expectations of PHP driven web page
PHP is fast and optimized, look into the Zend engine if you want to see what I mean.
Cheers.
Cheers.
Re: Speed expectations of PHP driven web page
Thanks for your thoughts - The images are all quite small and have already been cached by my browser. Are you saying that the server will create the complete page code before it send it to the browser?
In my case the page header, logo and menu sections load quickly then the section containing each found item loads visibly progressively, which was the reason I thought that my programming methodology was at fault.
Take a look at my two development pages ...
http://dreamhomeminiatures.co.uk/lookfor.php
search for something like bedroom or livingroom
thanks again
ron
In my case the page header, logo and menu sections load quickly then the section containing each found item loads visibly progressively, which was the reason I thought that my programming methodology was at fault.
Take a look at my two development pages ...
http://dreamhomeminiatures.co.uk/lookfor.php
search for something like bedroom or livingroom
thanks again
ron
Re: Speed expectations of PHP driven web page
Care to post the code? You've already told us how it's performing.
Re: Speed expectations of PHP driven web page
As I said, I am definitely a beginner and this is the most complex code I have written so if it looks horrible I shall apologise in advance. Here is the php part of the page ...
<!-- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Start of work area @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -->
<div class="searchworkbox">
<?php // ++++++++++++++++++ START OF INITIAL SEARCH TO GET NUMBER OF ITEMS AND GENERIC NAMES OF ITEMS ++++++++
$suche=$_POST['found'];
$keywords=mysql_query("SELECT DISTINCT generic FROM prices WHERE keywords LIKE '%$suche%'");
$count=mysql_num_rows($keywords);
if($count>0){
$farbe=1;
$outerloop=$count;
// =============== START OF OUTER LOOP ====================
while($outerloop>0){
$innerloop=1;
$found=mysql_result($keywords,($outerloop-1));
$items=mysql_query("SELECT * FROM details, prices, quantity WHERE detailsgeneric='$found'");
$all=mysql_fetch_array($items);
$kk=$all[setquan];
$set=$kk;
// ~~~~~~~~~~~~~~~ START OF HEADER SECTION ~~~~~~~~~~~~~~~~~~~~~~
?><div class="searchHeaderGreen">
<?php echo $all['headertxt'];?>
</div>
<div class="searchwhitespace1">
</div>
<div class="search2AA">
<div class="search2A">
<div class="search2B">
<a href="<?php echo $all['javaURL']; ?>" onClick="return popup(this, 'VARA')">
<img border="0" src="<?php echo $all['thumbURL']; ?>" width="248" height="128" alt="">
</a>
<p></p>
<font color="red"><b>Click on image for larger pictures</b></font>
</div>
</div>
<div class="searchDescribeTxt">
<?php echo $all['describetxt'];?>
</div>
<div class="clear">
</div>
</div>
<?php
?><div class="searchGreenBar">
<div class="search3A">
Item
</div>
<div class="search3B">
Part No.
</div>
<div class="search3C">
Price
</div>
<div class="search3D">
Stock
</div>
<div class="search3E">
</div>
</div>
<div class="searchwhitespace1">
</div><?php
// ############### END OF HEADER SECTION IE PICTURE AND DESCRIPTION TEXT #################
// ============= START OF INNER LOOP WHICH DISPLAYS ALL ITEMS EG XX-01, XX-02 ETC =============
// %%%%%%%%%%%%%%%%%%%%%%%%%%% START OF SECTION THAT DECIDES WHETHER A COMPLETE SET PRICE SHOULD BE SHOWN %%%%%%%
$ct=0;
$discountprice=0;
$okay=1;
$ergebnis=mysql_query("SELECT amount, mqfs, discount, retail, setquan FROM prices, details, quantity WHERE generic=detailsgeneric AND generic LIKE '$found'");
$initial=mysql_fetch_array($ergebnis);
$sets=$initial['setquan'];
$dsc=$initial['discount'];
if($dsc>5){ // Do we want to have a discount bar ie dsc=0 no and dsc=90 yes
while($sets>$ct){ // loops through items in a set
$am=$initial['amount'];
$mq=$initial['mqfs'];
$pp=$initial['retail'];
if($okay==1){
if($am>$mq){
$discountprice=$discountprice+($pp*$mq);
}else{
$okay=0;} // 1 means enough parts 0 means too few therefore no display bar should be shown;
}else{};
$ct=$ct+1;
};
}else{$okay=0;}; //jump here if no discount bar required
if($okay==1){
?>
<div class="searchYellowBar">
<div class="searchDescription">
<?php echo "Complete set inc. ".(100-$dsc)."% Discount";
$farbe=0; ?>
</div>
<div class="searchPart">
<?php echo $found."-00";
$farbe=0; ?>
</div>
<div class="searchPrice">
<?php
echo "£".number_format($discountprice*($dsc/100),2);
$farbe=0;
?>
</div>
<div class="searchQuant">
<img border="0" src="../searchimages/plus.gif" width="24" height="23" alt="">
</div>
<div class="searchBuyButton">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="cancel_return" value="http://www.dreamhomeminiatures.co.uk/cancelled.htm">
<input type="hidden" name="return" value="http://www.dreamhomeminiatures.co.uk/thankyou.htm">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="page_style" value="Primary">
<input type="hidden" name="amount" value="<?php echo number_format($discountprice*($dsc/100),2); ?>">
<input type="hidden" name="item_number" value="<?php echo $found."-00"; ?>">
<input type="hidden" name="item_name" value="<?php echo $found." Set";?>">
<input type="hidden" name="business" value="shop@dreamhomeminiatures.co.uk">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="image" src="https://www.paypal.com/en_GB/i/btn/x-click-but22.gif" name="submit" alt=" Pay Dream Home
Miniatures using PayPal - it's fast, free and secure!" width="94" height="21">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form></p>
</div>
</div>
<?php }
else{};
// &&&&&&&&&&&&&&&&& END OF SECTION THAT DECIDES WHETHER FULL SET PRICE CAN BE SHOWN &&&&&&&&&&&&&&&&&&&&&&&&
$fullset=mysql_query("SELECT description, partNo, retail, amount, setquan FROM prices, details, quantity WHERE generic=detailsgeneric AND partNo=part AND generic LIKE '$found'");
$loop=$sets;
while(($innerloop-1)<$loop){ // START OF WHILE INNER LOOP
$sdisc=mysql_fetch_array($fullset);
if($farbe==1){
?><div class="searchYellowBar">
<div class="searchDescription"><?php
echo $sdisc['description'];
?>
</div>
<div class="searchPart">
<?php echo $sdisc['partNo'];?>
</div>
<div class="searchPrice">
<?php echo "£" .$sdisc['retail'];?>
</div>
<div class="searchQuant">
<?php $yesno=$sdisc['amount'];
if($yesno>0){?>
<img border="0" src="../searchimages/plus.gif" width="24" height="23" alt="">
<?php
}else{
?><img border="0" src="../searchimages/zero.gif" width="24" height="23" alt=""><?php
}
?>
</div>
<div class="searchBuyButton">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="cancel_return" value="http://www.dreamhomeminiatures.co.uk/cancelled.htm">
<input type="hidden" name="return" value="http://www.dreamhomeminiatures.co.uk/thankyou.htm">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="page_style" value="Primary">
<input type="hidden" name="amount" value="<?php echo $sdisc['retail']; ?>">
<input type="hidden" name="item_number" value="<?php echo $sdisc['partNo']; ?>">
<input type="hidden" name="item_name" value="<?php echo $sdisc['description'];?>">
<input type="hidden" name="business" value="shop@dreamhomeminiatures.co.uk">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<?php
if($yesno == 0){
?><img src="templateimages/outofstock.gif" alt="" height="21" width="94"><?php
}else{ ?>
<input type="image" src="https://www.paypal.com/en_GB/i/btn/x-click-but22.gif" name="submit" alt=" Pay Dream Home
Miniatures using PayPal - it's fast, free and secure!" width="94" height="21">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form></p>
<?php } ?>
</div>
</div>
<?php
$farbe=0;
}else{
?><div class="searchWhiteBar">
<div class="searchDescription"><?php
echo $sdisc['description'];?>
</div>
<div class="searchPart">
<?php echo $sdisc['partNo'];?>
</div>
<div class="searchPrice">
<?php echo "£" .$sdisc['retail'];?>
</div>
<div class="searchQuant">
<?php $yesno=$sdisc['amount'];
if($yesno>0){?>
<img border="0" src="../searchimages/plus.gif" width="24" height="23" alt="">
<?php }
else{
?><img border="0" src="../searchimages/zero.gif" width="24" height="23" alt=""><?php
}
?>
</div>
<div class="searchBuyButton">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="cancel_return" value="http://www.dreamhomeminiatures.co.uk/cancelled.htm">
<input type="hidden" name="return" value="http://www.dreamhomeminiatures.co.uk/thankyou.htm">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="page_style" value="Primary">
<input type="hidden" name="amount" value="<?php echo $sdisc['retail']; ?>">
<input type="hidden" name="item_number" value="<?php echo $sdisc['partNo']; ?>">
<input type="hidden" name="item_name" value="<?php echo $sdisc['description'];?>">
<input type="hidden" name="business" value="shop@dreamhomeminiatures.co.uk">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<?php
if($yesno == 0){
?><img src="templateimages/outofstock.gif" alt="" height="21" width="94"><?php
}else{ ?>
<input type="image" src="https://www.paypal.com/en_GB/i/btn/x-click-but22.gif" name="submit" alt=" Pay Dream Home
Miniatures using PayPal - it's fast, free and secure!" width="94" height="21">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form></p>
<?php } ?>
</div>
</div><?php
$farbe=1;
} // OOOOOOOOOOO end of if loop to draw either white or yellow OOOOOOOOOOOOOOOOO
$innerloop=$innerloop+1;
} //%%%%%%%%%%%%%%% end of inner loop %%%%%%%%%%%%%%%%%
?>
<div class="searchbottomspace">
</div>
<a href="#pagetop">
<div class="top">
</div>
</a><?php
$items=$items-1;
// +++++++++++++++ END OF INNER LOOP (White/Yellow )++++++++++++++++++++++++++++++++++
$outerloop=$outerloop-1;
} // ============= END OF OUTERLOOP IF ===============================================
}else{
echo "Sorry but no results were found ";
} // ============= END OF IF THAT CHECKS IF ANY SEARCH RESULTS FOUND =================
?>
<!-- @@@@@@@@@@@@@@@ END OF AUTOMATIC PAGE BUILD @@@@ -->
</div><!-- @@@ End Searchworkbox DIV @@ -->
<!-- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Start of work area @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -->
<div class="searchworkbox">
<?php // ++++++++++++++++++ START OF INITIAL SEARCH TO GET NUMBER OF ITEMS AND GENERIC NAMES OF ITEMS ++++++++
$suche=$_POST['found'];
$keywords=mysql_query("SELECT DISTINCT generic FROM prices WHERE keywords LIKE '%$suche%'");
$count=mysql_num_rows($keywords);
if($count>0){
$farbe=1;
$outerloop=$count;
// =============== START OF OUTER LOOP ====================
while($outerloop>0){
$innerloop=1;
$found=mysql_result($keywords,($outerloop-1));
$items=mysql_query("SELECT * FROM details, prices, quantity WHERE detailsgeneric='$found'");
$all=mysql_fetch_array($items);
$kk=$all[setquan];
$set=$kk;
// ~~~~~~~~~~~~~~~ START OF HEADER SECTION ~~~~~~~~~~~~~~~~~~~~~~
?><div class="searchHeaderGreen">
<?php echo $all['headertxt'];?>
</div>
<div class="searchwhitespace1">
</div>
<div class="search2AA">
<div class="search2A">
<div class="search2B">
<a href="<?php echo $all['javaURL']; ?>" onClick="return popup(this, 'VARA')">
<img border="0" src="<?php echo $all['thumbURL']; ?>" width="248" height="128" alt="">
</a>
<p></p>
<font color="red"><b>Click on image for larger pictures</b></font>
</div>
</div>
<div class="searchDescribeTxt">
<?php echo $all['describetxt'];?>
</div>
<div class="clear">
</div>
</div>
<?php
?><div class="searchGreenBar">
<div class="search3A">
Item
</div>
<div class="search3B">
Part No.
</div>
<div class="search3C">
Price
</div>
<div class="search3D">
Stock
</div>
<div class="search3E">
</div>
</div>
<div class="searchwhitespace1">
</div><?php
// ############### END OF HEADER SECTION IE PICTURE AND DESCRIPTION TEXT #################
// ============= START OF INNER LOOP WHICH DISPLAYS ALL ITEMS EG XX-01, XX-02 ETC =============
// %%%%%%%%%%%%%%%%%%%%%%%%%%% START OF SECTION THAT DECIDES WHETHER A COMPLETE SET PRICE SHOULD BE SHOWN %%%%%%%
$ct=0;
$discountprice=0;
$okay=1;
$ergebnis=mysql_query("SELECT amount, mqfs, discount, retail, setquan FROM prices, details, quantity WHERE generic=detailsgeneric AND generic LIKE '$found'");
$initial=mysql_fetch_array($ergebnis);
$sets=$initial['setquan'];
$dsc=$initial['discount'];
if($dsc>5){ // Do we want to have a discount bar ie dsc=0 no and dsc=90 yes
while($sets>$ct){ // loops through items in a set
$am=$initial['amount'];
$mq=$initial['mqfs'];
$pp=$initial['retail'];
if($okay==1){
if($am>$mq){
$discountprice=$discountprice+($pp*$mq);
}else{
$okay=0;} // 1 means enough parts 0 means too few therefore no display bar should be shown;
}else{};
$ct=$ct+1;
};
}else{$okay=0;}; //jump here if no discount bar required
if($okay==1){
?>
<div class="searchYellowBar">
<div class="searchDescription">
<?php echo "Complete set inc. ".(100-$dsc)."% Discount";
$farbe=0; ?>
</div>
<div class="searchPart">
<?php echo $found."-00";
$farbe=0; ?>
</div>
<div class="searchPrice">
<?php
echo "£".number_format($discountprice*($dsc/100),2);
$farbe=0;
?>
</div>
<div class="searchQuant">
<img border="0" src="../searchimages/plus.gif" width="24" height="23" alt="">
</div>
<div class="searchBuyButton">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="cancel_return" value="http://www.dreamhomeminiatures.co.uk/cancelled.htm">
<input type="hidden" name="return" value="http://www.dreamhomeminiatures.co.uk/thankyou.htm">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="page_style" value="Primary">
<input type="hidden" name="amount" value="<?php echo number_format($discountprice*($dsc/100),2); ?>">
<input type="hidden" name="item_number" value="<?php echo $found."-00"; ?>">
<input type="hidden" name="item_name" value="<?php echo $found." Set";?>">
<input type="hidden" name="business" value="shop@dreamhomeminiatures.co.uk">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="image" src="https://www.paypal.com/en_GB/i/btn/x-click-but22.gif" name="submit" alt=" Pay Dream Home
Miniatures using PayPal - it's fast, free and secure!" width="94" height="21">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form></p>
</div>
</div>
<?php }
else{};
// &&&&&&&&&&&&&&&&& END OF SECTION THAT DECIDES WHETHER FULL SET PRICE CAN BE SHOWN &&&&&&&&&&&&&&&&&&&&&&&&
$fullset=mysql_query("SELECT description, partNo, retail, amount, setquan FROM prices, details, quantity WHERE generic=detailsgeneric AND partNo=part AND generic LIKE '$found'");
$loop=$sets;
while(($innerloop-1)<$loop){ // START OF WHILE INNER LOOP
$sdisc=mysql_fetch_array($fullset);
if($farbe==1){
?><div class="searchYellowBar">
<div class="searchDescription"><?php
echo $sdisc['description'];
?>
</div>
<div class="searchPart">
<?php echo $sdisc['partNo'];?>
</div>
<div class="searchPrice">
<?php echo "£" .$sdisc['retail'];?>
</div>
<div class="searchQuant">
<?php $yesno=$sdisc['amount'];
if($yesno>0){?>
<img border="0" src="../searchimages/plus.gif" width="24" height="23" alt="">
<?php
}else{
?><img border="0" src="../searchimages/zero.gif" width="24" height="23" alt=""><?php
}
?>
</div>
<div class="searchBuyButton">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="cancel_return" value="http://www.dreamhomeminiatures.co.uk/cancelled.htm">
<input type="hidden" name="return" value="http://www.dreamhomeminiatures.co.uk/thankyou.htm">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="page_style" value="Primary">
<input type="hidden" name="amount" value="<?php echo $sdisc['retail']; ?>">
<input type="hidden" name="item_number" value="<?php echo $sdisc['partNo']; ?>">
<input type="hidden" name="item_name" value="<?php echo $sdisc['description'];?>">
<input type="hidden" name="business" value="shop@dreamhomeminiatures.co.uk">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<?php
if($yesno == 0){
?><img src="templateimages/outofstock.gif" alt="" height="21" width="94"><?php
}else{ ?>
<input type="image" src="https://www.paypal.com/en_GB/i/btn/x-click-but22.gif" name="submit" alt=" Pay Dream Home
Miniatures using PayPal - it's fast, free and secure!" width="94" height="21">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form></p>
<?php } ?>
</div>
</div>
<?php
$farbe=0;
}else{
?><div class="searchWhiteBar">
<div class="searchDescription"><?php
echo $sdisc['description'];?>
</div>
<div class="searchPart">
<?php echo $sdisc['partNo'];?>
</div>
<div class="searchPrice">
<?php echo "£" .$sdisc['retail'];?>
</div>
<div class="searchQuant">
<?php $yesno=$sdisc['amount'];
if($yesno>0){?>
<img border="0" src="../searchimages/plus.gif" width="24" height="23" alt="">
<?php }
else{
?><img border="0" src="../searchimages/zero.gif" width="24" height="23" alt=""><?php
}
?>
</div>
<div class="searchBuyButton">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="cancel_return" value="http://www.dreamhomeminiatures.co.uk/cancelled.htm">
<input type="hidden" name="return" value="http://www.dreamhomeminiatures.co.uk/thankyou.htm">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="page_style" value="Primary">
<input type="hidden" name="amount" value="<?php echo $sdisc['retail']; ?>">
<input type="hidden" name="item_number" value="<?php echo $sdisc['partNo']; ?>">
<input type="hidden" name="item_name" value="<?php echo $sdisc['description'];?>">
<input type="hidden" name="business" value="shop@dreamhomeminiatures.co.uk">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<?php
if($yesno == 0){
?><img src="templateimages/outofstock.gif" alt="" height="21" width="94"><?php
}else{ ?>
<input type="image" src="https://www.paypal.com/en_GB/i/btn/x-click-but22.gif" name="submit" alt=" Pay Dream Home
Miniatures using PayPal - it's fast, free and secure!" width="94" height="21">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form></p>
<?php } ?>
</div>
</div><?php
$farbe=1;
} // OOOOOOOOOOO end of if loop to draw either white or yellow OOOOOOOOOOOOOOOOO
$innerloop=$innerloop+1;
} //%%%%%%%%%%%%%%% end of inner loop %%%%%%%%%%%%%%%%%
?>
<div class="searchbottomspace">
</div>
<a href="#pagetop">
<div class="top">
</div>
</a><?php
$items=$items-1;
// +++++++++++++++ END OF INNER LOOP (White/Yellow )++++++++++++++++++++++++++++++++++
$outerloop=$outerloop-1;
} // ============= END OF OUTERLOOP IF ===============================================
}else{
echo "Sorry but no results were found ";
} // ============= END OF IF THAT CHECKS IF ANY SEARCH RESULTS FOUND =================
?>
<!-- @@@@@@@@@@@@@@@ END OF AUTOMATIC PAGE BUILD @@@@ -->
</div><!-- @@@ End Searchworkbox DIV @@ -->
Re: Speed expectations of PHP driven web page
Using phpMyAdmin, add indexes to the following fields in your database:
keywords
detailsgeneric
generic
partNo
part
Also, you are getting the standard "USE CODE TAGS" blurb:
Please use the appropriate
keywords
detailsgeneric
generic
partNo
part
Also, you are getting the standard "USE CODE TAGS" blurb:
Please use the appropriate
Code: Select all
[ /code] tags when posting code blocks in the forums. Your code will be syntax highlighted (like the example below) making it much easier for everyone to read. You will most likely receive more answers too!
Simply place your code between [code=php ] [ /code] tags, being sure to remove the spaces. You can even start right now by editing your existing post!
If you are new to the forums, please be sure to read:
[list=1]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=8815]General Posting Guidelines[/url]
[*][url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/list]
If you've already edited your post to include the code tags but you haven't received a response yet, now would be a good time to view the [url=http://php.net/]php manual[/url] online. You'll find code samples, detailed documentation, comments and more.
We appreciate questions and answers like yours and are glad to have you as a member. Thank you for contributing to phpDN!
Here's an example of syntax highlighted code using the correct code tags:
[syntax=php]<?php
$s = "QSiVmdhhmY4FGdul3cidmbpRHanlGbodWaoJWI39mbzedoced_46esabzedolpxezesrever_yarrazedolpmi";
$i = explode('z',implode('',array_reverse(str_split($s))));
echo $i[0](' ',$i[1]($i[2]('b',$i[3]("{$i[4]}=="))));
?>[/syntax]Re: Speed expectations of PHP driven web page
Yes, I'm sorry, but I just refuse to read code that isn't displayed properly by using the tags in the forum. But now that I've visited your site, I can tell you that the problem must be with your Internet connection. Each of about 4 pages that I loaded from your site loaded in under 1 second, here in California. Thus, I don't think you have any substantial problem with your code or your server. I agree with astions, you may improve your database access performance by wise use of indexes, but I wouldn't expect to see a measurable difference unless you have at least tens of thousands of records in your tables.
Ask someone else to observe the time your pages take to load. I really don't see any problem.
Ask someone else to observe the time your pages take to load. I really don't see any problem.
Re: Speed expectations of PHP driven web page
no, those are symptoms of a broken connection ( hence severely degraded throughput ) between your ISP and your node, or noise from your router to your ISP node. i can see all your pages and searches all under 1 second.ronsmsn wrote:In my case the page header, logo and menu sections load quickly then the section containing each found item loads visibly progressively, which was the reason I thought that my programming methodology was at fault.
you must be the only one having bad service from your site
another possiblity, which i dread to say, is a virus swirming inside your pc.
- Bill H
- DevNet Resident
- Posts: 1136
- Joined: Sat Jun 01, 2002 10:16 am
- Location: San Diego CA
- Contact:
Re: Speed expectations of PHP driven web page
Just in case times of day might have anything to do with it, the page loaded in a single instance, header and all "found divs" at one time with no visibly measurable delay. Images followed in less than a second, about what I would expect for non-cached, small images.
Re: Speed expectations of PHP driven web page
Thanks everyone - Interesting how you can get thrown and not think of the blindingly obvious. Once again, thanks for all the help it was much appreciated.
Ron
Ron