Jump to content

Recommended Posts

why does this code display this webpage? brandysstudioofdance.com/checkOut.php

 

<?php
session_start();
if (isset($_SESSION['cart'])){
foreach ($_SESSION['cart'] as $key => $value){
//echo "Product Number $key Quantity $value<br />";
}
}
require_once("functions.php");
//DatabaseConnection(); 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ordering doggy treats</title>
<link href="doggyTreats.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#order {

margin-right: auto;
margin-left: auto;
}
.orderRow{ 
padding-bottom: 50px;
}
h2 {
text-align: center;
}

</style>
</head>
<body>
  
<?php
$errors=array();
if(isset($_POST['submit'])){
validate_input();
if(count($errors) !=0)
{
	display_form();	
}
else 
    {
	display_form();	
}
function validate_input()
{
	global $errors;
		if($_POST["fname"] == " ")
		{
			$errors['fname']="<span style=\"color:red;\">
			Please enter your first name </span>";
		}
}
        }
//logo();
navBar();
extract($_POST);
if(!isset($submit))
{ 
echo "<table id=\"order\">"; 
function display_form() {
global $errors;
?>   
<form action="php_self" method="post" name="checkOut">
<caption><h2>Customer Information </h2> </caption>
<tr class = "orderRow">
<td> First Name:<br />
     <input name="fname" type="text" size="10" maxlength="20" value="<?php echo  $_POST[fname] ?>">
         <br />  <br />
	<!--<?php echo $errors['fname']; ?>  -->  
    </td>  
<td> Last Name: <br />
     <input name="lname" type="text" size="10" maxlength="20" /> 
</td>
<td>    Address: <br />
         <input name="address " type="text"  size="25" /> 
</td>  
</tr>
<tr class = "orderRow">
	<td>  City:  <br />
      <input name="city " type="text" size="15" maxlength="20" /> 
</td>
<td>   State:   <br />
          <select name = "state">  <option selected value ="Please choose a state"/>
		Please choose a state</option>
		<option value = "AL" />AL</option>
		<option value = "AK" />AK</option>
		<option value = "AR" />AR</option>
		<option value = "AZ" />AZ
		<option value = "CA" />CA
		<option value = "CO" />CO
		<option value = "CT" />CT
		<option value = "DE" />DE
		<option value = "DC" />DC
		<option value = "FL" />FL
		<option value = "GA" />GA
		<option value = "HI" />HI															
		<option value = "IA" />IA
		<option value = "ID" />ID
		<option value = "IL" />IL
		<option value = "IN" />IN
		<option value = "KS" />KS
		<option value = "KY" />KY
		<option value = "LA" />LA
		<option value = "MA" />MA
		<option value = "ME" />ME
		<option value = "MD" />MD
		<option value = "MI" />MI
		<option value = "MN" />MN
		<option value = "MO" />MO
		<option value = "MS" />MS
		<option value = "MT" />MT
		<option value = "NC" />NC
		<option value = "ND" />ND
		<option value = "NE" />NE
		<option value = "NH" />NH
		<option value = "NJ" />NJ
		<option value = "NM" />NM
		<option value = "OH" />OH
		<option value = "OK" />OK
		<option value = "OR" />OR
		<option value = "PA" />PA
		<option value = "RI" />RI
		<option value = "SC" />SC
		<option value = "SD" />SD
		<option value = "TN" />TN
		<option value = "TX" />TX
		<option value = "UT" />UT
		<option value = "VA" />VA
			<option value = "VT" />VT
		<option value = "WA" />WA
		<option value = "WI" />WI
		<option value = "WV" />WV
		<option value = "WY" />WY
		</select> 
  </td>   
<td>  Zip Code:<br />
          <input name="zipcode" type="text" size="5" maxlength="5" /> 
</td>  
</tr>  
<tr class = "orderRow">
<td> Phone  <br />  Please include area code <br />  
    <input name="phone" type="text" size="13" maxlength="13" /> 
</td>
<td>  Fax:<br />   
    <input name="" type="text" size="13" maxlength="13" /> 
    </td>
<td>   Email: <br />  
<input name="email " type="text" size="15" maxlength="30" />
</td>
</tr>
<tr class = "orderRow">  
     <td>   Please choose method of payment: <br /> 
Check <input name="check " type="radio" value="Check " /> Money Order <input name="money " type="radio" value="Money order " /><br />PayPal<input name="paypal" type="radio" value="Paypal" /> </td>
</tr>
<tr>
<td colspan = "6">	 <h2>  Pet Information </h2></td>
</tr>
<tr>
  <td>  Name: <br /> 
      <input name="petName" type="text" size="10" maxlength="20" /> 
  </td>  
<td>   Age: <br />
<select name="age">  
HEREDOC;
  for ($age =1; $age <=20; $age ++)
	{
	print "<option value=\"age\">  $age</option>"; 
}
echo <<<HEREDOC
</select>
</td>   
<td>   Breed:<br />
<select name = "breed">  <option selected value ="Please choose a breed"/>
		Please choose a breed
		    <option value = "I don't know" />I don't know 
			<option value = "Affernpincher" />Affernpincher
			<option value = "Afghan Hound" />Afghan Hound 
			<option value = "Airedale Terrier" /> Airedale Terrior
			<option value = "Akita" />  Akita 
			<option value = "Alaskan Malamute" />  Alaskan Malamute
			<option value = "Standard American Eskimo Dog"/> Standard American Eskimo Dog
			<option value = "Miniature American Eskimo Dog"/>Miniature American Eskimo 		                                 Dog
			<option value = "Toy American Eskimo Dog"/> Toy American Eskimo Dog
			<option value = "American Foxhound" />  American Foxhound
			<option value = "American Staffordshire Terrier" />  American Staffordshhire                                 Terrier
			<option value = "American Water Spaniel" /> American Water Spaniel
			<option value = "Australian Shepherd Dog"/>  Anatolian Shepherd Dog 
			<option value = "Australian Cattle Dog"/>  Australian Cattle Dog
			<option value = "Australian Shepherd"/>  Australian Shepherd 
			<option value = "Australian Terrier" />  Australia Terrier
			<option value = "Basenji" />  Basenji
			<option value = "Basset Hound" />  Basset Hound 
			<option value = "Beagle" />  Beagle
			<option value = "Bearded Collie" />  Bearded Collie
			<option value = "Beauceron" />  Beauceron 
			<option value = "Bedington Terrier"/>  Bedington Terrier
			<option value = "Belgin Malinois"/> Belgin Malinois
			<option value = "Belgian Sheepdog"/>  Belgian Sheepdog
			<option value = "Belgian Tervuren"/>  Belgian Tervuren
			<option value = "Bernese Mountain Dog"/>  Bernese Mountain Dog
			<option value = "Bichon Frise"/>  Bichon Frise
			<option value = "Black and Tan Greyhound" />  Black and Tan Greyhound
			<option value = "Black Russian Terrier" />  Black Russian Terrier
			<option value = "Bloodhoung" />  Bloodhound
			<option value = "Border Collie" /> Border Collie
			<option value = "Border Terrier"/> Border Terrier
			<option value = "Borzoi"/>  Borzoi
			<option value = "Boston Terrier"/>  Boston Terrier
			<option value = "Bouvier des Flandres"/>  Bouvier des Flandres
			<option value = "Boxer"/>  Boxer
			<option value = "Briard"/>  Briard
			<option value = "Brittany" />  Brittany
			<option value = "Brussels Griffon" />  Brussels Griffon
			<option value = "Bulldog" /> Bulldog
			<option value = "Bullmastiff" /> Bullmasttiff
			<option value = "Bull Terrier" />  Bull Terrier
			<option value = "Cairn Terrier" />  Cairn Terrier
			<option value = "Canaan Dog" />  Canaan Dog
			<option value = "Cardigan Welsh Corgi" />  Cardigan Welsh Corgi
			<option value = "Cavalier King Charles Spaniel" />Cavalier King Charles   	                                 Spaniel
			<option value = "Chesepeake Bay Retriever" />Chesapeake Bay Retriever
			<option value = "Chilauhua" /> Chilauhua
			<option value = "Chinese Created" />  Chinese Crested
			<option value = "Chinese Shar-Pei" />  Chinese Shar-Pei
			<option value = "Chow Chow" />  Chow Chow
			<option value = "Clumber Spaniel" />  Clumber Spaniel
			<option value = "Cocker Spaniel" />  Cocker Spaniel
			<option value = "Collie" />  Collie
			<option value = "Curly-Coated Retrieve" />  Curly-Coated Retriever
			<option value = "Dachshound" />  Dachshund
			<option value = "Dalmation" /> Dalmation
			<option value = "Dandle Dimonnt" /> Dandie Dinmont Terrier
			<option value = "Doberman Pincher" />  Doberman Pincher
			<option value = "Dogue de Bordeaux" /> Dogue de Bordeaux
			<option value = "English Cocker Spaniel" />  English Cocker Spaniel  
			<option value = "English Foxhound" />  English Foxhound
			<option value = "English Setter" />  English Setter
			<option value = "English Springer" /> English Springer
			<option value = "English Toy Spaniel" />  English Toy Spaniel
			<option value = "Field Spaniel" /> Field Spaniel
			<option value = "Finnish Spitz" />  Finnish Spitz
			<option value = "Flat-Coated Retriever" />  Flat-Coated Retriever
			<option value = "French Bulldog" />  French Bulldog
			<option value = "German Shepherd Dog" /> German Shepherd Dog
			<option value = "German Shorthaired Pointer"/>German Shorthaired Pointer
			<option value = "German Wirehaired Pointer" />  German Wirehaired Pointer 
			<option value = "Giant Schnauzer" /> Giant Schnauzer
			<option value = "Glen of Imaal Terrier" />  Glen of Imaal Terrier
			<option value = "Golden Retriever" /> Golden Retriever
			<option value = "Gorden Setter" /> Gorden Setter
			<option value = "Great Dane" /> Great Dane
			<option value = "Greater Swiss Mountain Dog" /> Greater Swiss Mountain Dog
			<option value = "Great Pyrenees" /> Great Pyrenees
			<option value = "Greyhound" /> Greyhound
			<option value = "Harrier"  /> Harrier
			<option value = "Havanese" />  Havanese
			<option value = "Ibizen Hound" /> Ibizen Hound 
			<option value = "Irish Setter" />  Irish Setter
			<option value = "Irish Terrier" /> Irish Terrier
			<option value = "Irish Water Spaniel" /> Irish Water Spaniel
			<option value = "Irish Wolfhound" />  Irish Wolfhound
			<option value = "Italian Greyhound" />  Italian Greyhound
			<option value = "Jack Russell Terrier" />  Jack Russell Terrier
			<option value = "Japanese Chin" />  Japanese Chin
			<option value = "Keeshound" />  Keeshound
			<option value = "Kerry Blue TErrier" />  Kerry Blue Terrier
			<option value = "Komondor" /> Komondor
			<option value = "Kuvasz" />  Kuvasz
			<option value = "Labradar Retriever" />  Labrador Retriever
			<option value = "Lakeland Terrier" />  Lakeland Terrier
			<option value = "Lhasa Apso" />  Lhasa Apso
			<option value = "Lowchen" />  Lowchen
			<option value = "Maltese" />  Maltese
			<option value = "Standard Manchester Terrier" /> Standard Manchester Terrier
			<option value = "Mastiff" />  Mastiff
			<option value = "Miniature Bull Terrier" />  Miniature Bull Terrier
			<option value = "Miniature Pinche" /> Miniature Pinscher
			<option value = "Miniature Poodle" /> Miniature Poodle
			<option value = "Miniature Schnauzer" />Miniature Schnauzer
			<option value = "Mutt" />Mutt
			<option value = "Neopolitan Mastiff" />Neopolitan Mastiff
			<option value = "Newfoundland&nbsp" /> Newfoundland 
			<option value = "Newfolk Terrier" />Norfolk Terrier
			<option value = "Norwegian Elkhound" /> Norwegian Elkhound
			<option value = "Norwich Terrier" /> Norwich Terrier
			<option value = "Nova Scotia Duck Tolling Retriever" /> Nova Scotia Duck 	                                 Tolling Retriever
			<option value = "Old English Sheepdog" />Old English Sheepdog
			<option value = "Otterhound" /> Otterhound
			<option value = "Papillon" />Papillon
			<option value = "Parson Russell Terrier" /> Parson Russell Terrier
			<option value = "Pekingese" />Pekingese
			<option value = "Pembroke Welsh Corgi" />Pembroke Welsh Corgi
			<option value = "Petit Basset Griffon Vendeen" />Petit Basset Griffon Vendeen
			<option value = "Pharch Hound" />Pharoh Hound
			<option value = "Plott" /> Plott
			<option value = "Pointer" /> Pointer 
			<option value = "Polish Lowland Sheepdog" />Polish Lowland sheepdog
			<option value = "Pomeranian" /> Pomeranian
			<option value = "Portuguese Water Dog" />Portuguese Water Dog 
			<option value = "Pug" />Pug
			<option value = "Pull" />Puli
			<option value = "Rhodesian Ridgeback" />Rhodesian Ridgeback
			<option value = "Rottweiler" />Rottweiler
			<option value = "ASaint Bernard" /> Saint Bernard
			<option value = "Saluki" /> Saluki
			<option value = "Samoyed" />Samoyed
			<option value = "Schipperke" />Schipperke
			<option value = "Scottish Doverhound" />Scottish Deerhound
			<option value = "Scottish Terrier" />Scottish Terrier
			<option value = "Sealyham Terrier" />Sealyham Terrier
			<option value = "Shetland Sheepdog" />Shetland Sheepdog
			<option value = "Shiba Inu" />Shiba Inu
			<option value = "Shih Tzu" />Shih Tzu
			<option value = "Siberian Husky" />Siberian Husky
			<option value = "Silky Terrier" />Silky Terrier
			<option value = "Skye Terrier" />Skye Terrier 
			<option value = "Smooth Fox Terrier" />Smooth Fox Terrier
			<option value = "Soft Coated Wheaten Terrier" />Soft Coated wheaten Terrier
			<option value = "Spinone Italiano" />Spinone Italiano
			<option value = "Staffordshire Bull Terrier" />Staffordshire Bull Terrier
			<option value = "Standard Poodle" />Standard Poodle
			<option value = "Standard Schnauer" /> Standard Schnauzer
			<option value = "Suseex Spaniel"  />Sussex Spaniel
			<option value = "Swedish Vallhound" />Swedish Vallhund
			<option value = "Tibertan Mastiff" />Tibetan Mastiff
			<option value = "Tibertan Spaniel" />Tibetan Spaniel
			<option value = "Tibetan Terrier" />Tibetan Terrier 
			<option value = "Toy Fox Terrier" />Toy Fox Terrier 
			<option value = "Toy Manchester Terrier" />Toy Manchester Terrier 
                <option value = "Toy Poodle" />Toy Poodle
			<option value = "Vizela" />Vizela
			<option value = "Weimaraner" />Weimaraner
			<option value = "Welsh Springer Spaniel" />Welsh Springer Spaniel
			<option value = "Welsh Terrier" />Welsh Terrier 
			<option value = "West Highland White Terrier" />West Highland White Terrier 
			<option value = "Whippet" />Whippet
			<option value = "Wire Fox Terrier" />Wire Fox Terrier 
			<option value = "Wirehaired Pointing Griffon" />Wirehaired Pointing Griffon
			<option value = "Yorkshire Terrier" />Yorkshire Terrier 	

</td>
</select>
</tr>
<tr>
<td>Nutritional Needs:</td>
<td><textarea name="nutritionalNeeds" cols="17" rows="5"></textarea>
</td>
</tr>
<tr>
<td>Special Instructions</td>
<td><textarea name="specialInstructions" cols="17" rows="5"></textarea>
</tr>
<tr>
<td colspan = "6"><h2>Order Information</h2></td>
</tr>
<tr>
HEREDOC;
<?php
/*foreach($key as $value){
	echo $value;
}*/
?>
echo <<<HEREDOC
</tr>
<tr>
<td> <input name="Submit" type="submit" value="Order Treats!" /></td><td><input name="reset" type="submit" value="Cancel Order" /> </td>
</tr>
</table>
</form>
HEREDOC;
<?php
}
}
footer();
?>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/250029-very-confused/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.