CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   PHP (http://www.codingforums.com/forumdisplay.php?f=6)
-   -   PHP web page loading problem (http://www.codingforums.com/showthread.php?t=283567)

sweetpeet 12-05-2012 02:45 AM

PHP web page loading problem
 
I have an html page that has a form that posts to a php page. Aday ago it was working just fine but just recently once the html form is submitted the php page takes a really long time to load and almost always stops responding.

does anyone know how to fix this?

yesterday I was playing areound trying to get the html page to post to two different pages(it wasnt working) I have since removed that tho.

Custard7A 12-05-2012 02:54 AM

The part where you were "playing around" with the pages' inner working the day earlier doesn't seem like a coincidence. You probably didn't suceed in reverting the page back to it's original state. Have you checked twice for stray code fragments or typos you might have left there?

sweetpeet 12-05-2012 02:58 AM

Quote:

Originally Posted by Custard7A (Post 1297348)
The part where you were "playing around" with the pages' inner working the day earlier doesn't seem like a coincidence. You probably didn't suceed in reverting the page back to it's original state. Have you checked twice for stray code fragments or typos you might have left there?

yah im pretty sure that I removed everything. all i had was a script in the head and a name element int he form tag. its all gone now. could it be anything else?

also, when I go to my server and preview the php page that it posts to it alone takes a long time to load eventhough its not getting any data posted to it.

Custard7A 12-05-2012 03:10 AM

It could be any number of things, which is why details are most important.

Do you mean it is slow to load even when previewing the source? That would be rather strange, since it shouldn't get executed when doing that.

sweetpeet 12-05-2012 03:24 AM

Quote:

Originally Posted by Custard7A (Post 1297350)
It could be any number of things, which is why details are most important.

Do you mean it is slow to load even when previewing the source? That would be rather strange, since it shouldn't get executed when doing that.

it appears as if its loading but in the end it ends up just not responding.

sweetpeet 12-05-2012 04:02 AM

pk I have determined that it is this for statement that I have. for some reason it worked yesterday but is not working now. is there a better way to state this?:

<?php
$Biscuit = $_POST['BreakfastMenu_0'];
$Add_on1 = $_POST['Breakfast_Biscuit_Add_on'];
$Quantity1 = $_POST['quantity1'];

if($quantity1 > 0):
echo $quantity1 . " " . $Biscuit . " with " . $Add_on1 . "<br />";
endif;

?></td>
<td id="price">
<?php
//selections for buscuit
for($quantity1 >0; $Biscuit = true; ){
if($Add_on1 === "plain only-$0.95"):
$P1 = "0.95";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "plain with egg & cheese - $1.25"):
$P1 = "1.25";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Ham only - $1.50"):
$P1 = "1.50";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Ham with egg - $1.75"):
$P1 = "1.75";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Ham with cheese - $1.75"):
$P1 = "1.75";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Ham with egg - $1.75"):
$P1 = "1.75";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Ham with egg & cheese - $2.00"):
$P1 = "2.00";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Susage only - $1.50"):
$P1 = "1.50";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Sausage with egg - $1.75"):
$P1 = "1.75";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Sausage with cheese"):
$P1 = "1.75";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Sausage with egg & cheese - $2.00"):
$P1 = "2.00";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Bacon only - $1.50"):
$P1 = "1.50";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Bacon with egg - $1.75"):
$P1 = "1.75";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Bacon with cheese - $1.75"):
$P1 = "1.75";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Bacon with egg & cheese - $2.00"):
$P1 = "2.00";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Steak only - $2.00"):
$P1 = "2.00";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Steak with cheese - $2.15"):
$P1 = "2.15";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Steak with egg - $2.15"):
$P1 = "2.15";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Steak with cheese & egg - $2.50"):
$P1 = "2.50";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Chicken only - $2.00"):
$P1 = "2.00";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Chicken with cheese - $2.15"):
$P1 = "1.75";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Chicken with egg - $2.15"):
$P1 = "2.15";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Chicken with egg & cheese - $2.50"):
$P1 = "2.50";
echo "$" . $P1 * $quantity1 . "<br />";
elseif($Add_on1 === "Select One"):
echo "Please choose an add on.<br />";

endif;}

Custard7A 12-05-2012 09:23 AM

Okay, well.. $Quantity1 = $_POST['quantity1']; is being defined with a capital letter in it, but all further uses are lowercase.. $quantity1.

Variables are documented as case-sensative.


All times are GMT +1. The time now is 10:51 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.