Search the Community
Showing results for tags 'processing'.
-
My website is on a free host that not only limit the storage space, like many do, but also limit the processing. It happened to me a few times in the past that my website was temporarily replaced by a parking space for a day or less. Luckily it's just a homepage and most (all?) things on it are not urgently needed. The CMS my site use has a throttling function but I have some directories not covered by the CMS. In one of those there's a ¨H¨which process just fine. The issue is if it was accessed too often, the processing it take might very well shutdown my homepage. Something on my favor: the script only need to be interpreted once in a little while ; once a day should do. A;so if the PHP is not accessed, there's no need to run it anyway ; it's not like some external process (ie: feed aggregator) would fetch content it generated è if the page is not directly accessed, there's no need to interpret it, be it months. Is there a way to limit the processing used by a PHP? Perhaps limiting the number of daily uses. Thank you kindly for your help
- 7 replies
-
- throttling
- limit
-
(and 3 more)
Tagged with:
-
Hi guys, I'm having a hard time displaying the quantity the user selects in my index.php to reflect that same exact quantity in my invoice.php page. Please help! Any suggestions will be greatly appreciated:) my product information is stored in a file called products_info.inc and looks something like this: $hulkhamburger = array('Product' => 'Hulk Hamburger', 'Description' => '<img src="hamburger.jpg" "height=100" "width=100">', 'Price' => '$1.00', 'Quantity' => "<input type='text' name='quantity[]'>"); $atomichotdog = array('Product' => 'Atomic Hot Dog', 'Description' => '<img src="hotdog.jpg" "height=100" "width=100">', 'Price' => '$2.00', 'Quantity' => "<input type='text' name='quantity2[]>"); $friedchicken = array('Product' => 'Fantastic 4 Fried Chicken', 'Description' => '<img src="friedchicken.jpg" "height=100" "width=100">', 'Price' => '$3.00', 'Quantity' => "<input type='text' name='quantity[]'>"); $psyonicpizza = array('Product' => 'Psyonic Pizza', 'Description' => '<img src="pizza.jpg" "height=100" "width=100">', 'Price' => '$4.00', 'Quantity' => "<input type='text' name='quantity[]'>"); $marvelmeatloaf = array('Product' => 'Marvel Meatloaf', 'Description' => '<img src="meatloaf.jpg" "height=100" "width=100">', 'Price' => '$5.00', 'Quantity' => "<input type='text' name='quantity[]'>"); //The following array takes our previous five arrays and puts them into one array for easier coding and reading. $allfood = array ($hulkhamburger, $atomichotdog, $friedchicken, $psyonicpizza, $marvelmeatloaf); Now my index.php looks like this: <?php //Include products info.inc (Which holds all our product arrays and info) //Credit: Tracy & Mark (Thank you!) include 'products_info.inc'; /*The following code centers the table on the page, makes the table background white, makes the table 50% of the browser window, gives it a border of 1 px, gives a padding of 2 px between the cell border and content, and gives 1 px of spacing between cells. */ echo "<table align=center bgcolor='FFFFFF' width=50% border=1 cellpadding=1 cellspacing=2>"; //Credit: Tracy & Mark (Thank you!) echo '<th>Product</th> <th>Description</th> <th>Price</th> <th>Quantity</th>'; //The following code loops through the whole table body and then prints each row. for($i=0; $i<count($allfood); $i++) { //Credit: Tracy & Mark (Thank you!) echo "<tr align=center>"; echo "<td>{$allfood[$i]['Product']}</td>"; echo "<td>{$allfood[$i]['Description']}</td>"; echo "<td>{$allfood[$i]['Price']}</td>"; echo "<td>{$allfood[$i]['Quantity']}</td>"; echo "</tr>"; } //This code ends the table. echo "</table>"; echo "<br>"; ?> The problem arises when I enter any quantity in my index after pressing submit, it goes to this following invoice.php and does not display the quantity that was inputed from the index <?php //Include products info.inc (Which holds all our product arrays and info) //Credit: Tracy & Mark (Thank you!) require 'products_info.inc'; //Display the invoice & 'WELCOME USER. THANK YOU FOR USING THIS DAMN THING msg' /*The following code centers my invoice table on the page, makes the table background white, makes the table 50% of the browser window, gives it a border of 1 px, gives a padding of 2 px between the cell border and content, and gives 1 px of spacing between cells. */ echo "<table align=center bgcolor='FFFFFF' width=50% border=1 cellpadding=1cellspacing=2>"; echo "<tr>"; echo "<td align=center><b>Product</b></td>"; echo "<td align=center><b>Quantity</b></td>"; echo "<td align=center><b>Price</></td>"; echo "<td align=center><b>Extended Price</b></td>"; echo "</tr>"; for($i=0; $i<count($allfood); $i++) { //Credit: Tracy & Mark (Thank you!) $qty= @$_POST['quantity']['$i']; // This calculates the price if the user orders more than 1 item. $extendedprice = $qty*$allfood[$i]['Price']; echo "<tr>"; echo "<td align=center>{$allfood[$i]['Product']}</td>"; echo "<td align=center>$extendedprice</td>"; echo "<td align=center>{$allfood[$i]['Price']}</td>"; echo "</tr>"; } // The goal here was to make it so that if the user selected a certain quantity from index.php, it would carry over and display on the invoice.php if ($qty == 0) { $quantityErr = "<BR><span style='color:red'>Please go back and input a quantity.</spand></BR>"; } elseif ($qty > 0) { echo $qty; } /*echo "<tr>"; echo "<td align=center>Subtotal</b></td>"; echo "<td align=center></td>"; echo "<td align=center></td>"; echo "<tr>"; echo "<td align=center>Tax at 5.75%</td>"; echo "<td align=center></td>"; echo "<td align=center></td>"; echo "<tr>"; echo "<td align=center><b>Grand total</b></td>"; echo "<td align=center></td>"; echo "<td align=center></td>"; */ echo "</table>"; ?> I bolded the items that might be of question, but then again, I'm new to PHP:( Thank you in advance folks!