Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Regular Coder Custard7A's Avatar
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    286
    Thanks
    32
    Thanked 33 Times in 33 Posts
    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?

  • #3
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Regular Coder Custard7A's Avatar
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    286
    Thanks
    32
    Thanked 33 Times in 33 Posts
    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.

  • #5
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.

  • #6
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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;}

  • #7
    Regular Coder Custard7A's Avatar
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    286
    Thanks
    32
    Thanked 33 Times in 33 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •