Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-05-2012, 02:45 AM   PM User | #1
sweetpeet
New to the CF scene

 
Join Date: Dec 2012
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
sweetpeet is an unknown quantity at this point
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.
sweetpeet is offline   Reply With Quote
Old 12-05-2012, 02:54 AM   PM User | #2
Custard7A
Regular Coder

 
Custard7A's Avatar
 
Join Date: Jul 2010
Location: Australia
Posts: 269
Thanks: 32
Thanked 32 Times in 32 Posts
Custard7A is an unknown quantity at this point
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?
Custard7A is offline   Reply With Quote
Old 12-05-2012, 02:58 AM   PM User | #3
sweetpeet
New to the CF scene

 
Join Date: Dec 2012
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
sweetpeet is an unknown quantity at this point
Quote:
Originally Posted by Custard7A View Post
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.
sweetpeet is offline   Reply With Quote
Old 12-05-2012, 03:10 AM   PM User | #4
Custard7A
Regular Coder

 
Custard7A's Avatar
 
Join Date: Jul 2010
Location: Australia
Posts: 269
Thanks: 32
Thanked 32 Times in 32 Posts
Custard7A is an unknown quantity at this point
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.
Custard7A is offline   Reply With Quote
Old 12-05-2012, 03:24 AM   PM User | #5
sweetpeet
New to the CF scene

 
Join Date: Dec 2012
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
sweetpeet is an unknown quantity at this point
Quote:
Originally Posted by Custard7A View Post
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 is offline   Reply With Quote
Old 12-05-2012, 04:02 AM   PM User | #6
sweetpeet
New to the CF scene

 
Join Date: Dec 2012
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
sweetpeet is an unknown quantity at this point
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;}
sweetpeet is offline   Reply With Quote
Old 12-05-2012, 09:23 AM   PM User | #7
Custard7A
Regular Coder

 
Custard7A's Avatar
 
Join Date: Jul 2010
Location: Australia
Posts: 269
Thanks: 32
Thanked 32 Times in 32 Posts
Custard7A is an unknown quantity at this point
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.
Custard7A is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:17 AM.


Advertisement
Log in to turn off these ads.