mindapolis Posted November 21, 2011 Share Posted November 21, 2011 if you have a php file on a server, if you go to that webpage and click view source, should the whole file content be displayed? Quote Link to comment Share on other sites More sharing options...
requinix Posted November 21, 2011 Share Posted November 21, 2011 No. If you're seeing PHP code then your server isn't set up properly to handle PHP files. Quote Link to comment Share on other sites More sharing options...
mindapolis Posted November 21, 2011 Author Share Posted November 21, 2011 here is the problem. I have the following code on the server but on the webpage the php code isn't there and I'm not getting any PHP errors. <?php session_start(); 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> <style type="text/css"> #order { margin-right: auto; margin-left: auto; } .orderRow{ padding-bottom: 50px; } h2 { text-align: center; } </style> <link href="doggyTreats.css" rel="stylesheet" type="text/css" /> </head> <body> <?php logo(); navBar(); ?> <form action="" method="post" name="checkOut"> <table id="order"> <tr class="orderRow"> <td> First name:<br /> <input name="fname" type="text" size="10" maxlength="15" /></td> <td>Last name: <br /> <input name="lname" type="text" size="15" maxlength="30" /></td> <td> Address: <br /> <input name="address" type="text" size="30" /></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> <option value = "CA" >CA</option> <option value = "CO" >CO</option> <option value = "CT" >CT</option> <option value = "DE" >DE</option> <option value = "DC" >DC</option> <option value = "FL" >FL</option> <option value = "GA" >GA</option> <option value = "HI" >HI</option> <option value = "IA" >IA</option> <option value = "ID" >ID</option> <option value = "IL" >IL</option> <option value = "IN" >IN</option> <option value = "KS" >KS</option> <option value = "KY" >KY</option> <option value = "LA" >LA</option> <option value = "MA" >MA</option> <option value = "ME" >ME</option> <option value = "MD" >MD</option> <option value = "MI" >MI</option> <option value = "MN" >MN</option> <option value = "MO" >MO</option> <option value = "MS" >MS</option> <option value = "MT" >MT</option> <option value = "NC" >NC</option> <option value = "ND" >ND</option> <option value = "NE" >NE</option> <option value = "NH" >NH</option> <option value = "NJ" >NJ</option> <option value = "NM" >NM</option> <option value = "OH" >OH</option> <option value = "OK" >OK</option> <option value = "OR" >OR</option> <option value = "PA" >PA</option> <option value = "RI" >RI</option> <option value = "SC" >SC</option> <option value = "SD" >SD</option> <option value = "TN" >TN</option> <option value = "TX" >TX</option> <option value = "UT" >UT</option> <option value = "VA" >VA</option> <option value = "VT" >VT</option> <option value = "WA" >WA</option> <option value = "WI" >WI</option> <option value = "WV" >WV</option> <option value = "WY" >WY</option> </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"> <?php for ($age =1; $age <=20; $age ++) { print "<option value=\"age\"> $age</option>"; } ?> </select> </td> <td> Breed:<br /> <select name = "breed"> <option selected value ="Please choose a breed"> Please choose a breed </option> <option value = "I don't know" >I don't know </option> <option value = "Affernpincher" >Affernpincher </option> <option value = "Afghan Hound" >Afghan Hound </option> <option value = "Airedale Terrier" > Airedale Terrior</option> <option value = "Akita" > Akita </option> <option value = "Alaskan Malamute" > Alaskan Malamute </option> <option value = "Standard American Eskimo Dog"> Standard American Eskimo Dog</option> <option value = "Miniature American Eskimo Dog">Miniature American Eskimo Dog</option> <option value = "Toy American Eskimo Dog"> Toy American Eskimo Dog</option> <option value = "American Foxhound" > American Foxhound</option> <option value = "American Staffordshire Terrier" > American Staffordshhire Terrier</option> <option value = "American Water Spaniel" > American Water Spaniel</option> <option value = "Australian Shepherd Dog"> Anatolian Shepherd Dog </option> <option value = "Australian Cattle Dog"> Australian Cattle Dog</option> <option value = "Australian Shepherd"> Australian Shepherd </option> <option value = "Australian Terrier" > Australia Terrier</option> <option value = "Basenji" > Basenji</option> <option value = "Basset Hound" > Basset Hound </option> <option value = "Beagle" > Beagle</option> <option value = "Bearded Collie" > Bearded Collie</option> <option value = "Beauceron" > Beauceron </option> <option value = "Bedington Terrier"> Bedington Terrier</option> <option value = "Belgin Malinois"> Belgin Malinois</option> <option value = "Belgian Sheepdog"> Belgian Sheepdog</option> <option value = "Belgian Tervuren"> Belgian Tervuren</option> <option value = "Bernese Mountain Dog"> Bernese Mountain Dog</option> <option value = "Bichon Frise"> Bichon Frise</option> <option value = "Black and Tan Greyhound" > Black and Tan Greyhound</option> <option value = "Black Russian Terrier" > Black Russian Terrier</option> <option value = "Bloodhoung" > Bloodhound</option> <option value = "Border Collie" > Border Collie</option> <option value = "Border Terrier"> Border Terrier</option> <option value = "Borzoi"> Borzoi</option> <option value = "Boston Terrier"> Boston Terrier</option> <option value = "Bouvier des Flandres"> Bouvier des Flandres</option> <option value = "Boxer"> Boxer</option> <option value = "Briard"> Briard</option> <option value = "Brittany" > Brittany</option> <option value = "Brussels Griffon" > Brussels Griffon</option> <option value = "Bulldog" > Bulldog</option> <option value = "Bullmastiff" > Bullmasttiff</option> <option value = "Bull Terrier" > Bull Terrier</option> <option value = "Cairn Terrier" > Cairn Terrier</option> <option value = "Canaan Dog" > Canaan Dog</option> <option value = "Cardigan Welsh Corgi" > Cardigan Welsh Corgi</option> <option value = "Cavalier King Charles Spaniel" >Cavalier King Charles Spaniel</option> <option value = "Chesepeake Bay Retriever" >Chesapeake Bay Retriever</option> <option value = "Chilauhua" > Chilauhua</option> <option value = "Chinese Created" > Chinese Crested</option> <option value = "Chinese Shar-Pei" > Chinese Shar-Pei</option> <option value = "Chow Chow" > Chow Chow</option> <option value = "Clumber Spaniel" > Clumber Spaniel</option> <option value = "Cocker Spaniel" > Cocker Spaniel</option> <option value = "Collie" > Collie</option> <option value = "Curly-Coated Retriever" > Curly-Coated Retriever</option> <option value = "Dachshound" > Dachshund</option> <option value = "Dalmation" > Dalmation</option> <option value = "Dandle Dimonnt" > Dandie Dinmont Terrier</option> <option value = "Doberman Pincher" > Doberman Pincher</option> <option value = "Dogue de Bordeaux" > Dogue de Bordeaux</option> <option value = "English Cocker Spaniel" > English Cocker Spaniel</option> <option value = "English Foxhound" > English Foxhound</option> <option value = "English Setter" > English Setter</option> <option value = "English Springer" > English Springer</option> <option value = "English Toy Spaniel" > English Toy Spaniel</option> <option value = "Field Spaniel" > Field Spaniel</option> <option value = "Finnish Spitz" > Finnish Spitz</option> <option value = "Flat-Coated Retriever" > Flat-Coated Retriever</option> <option value = "French Bulldog" > French Bulldog</option> <option value = "German Shepherd Dog" > German Shepherd Dog</option> <option value = "German Shorthaired Pointer">German Shorthaired Pointer</option> <option value = "German Wirehaired Pointer" > German Wirehaired Pointer </option> <option value = "Giant Schnauzer" > Giant Schnauzer</option> <option value = "Glen of Imaal Terrier" > Glen of Imaal Terrier</option> <option value = "Golden Retriever" > Golden Retriever</option> <option value = "Gorden Setter" > Gorden Setter</option> <option value = "Great Dane" > Great Dane</option> <option value = "Greater Swiss Mountain Dog" > Greater Swiss Mountain Dog</option> <option value = "Great Pyrenees" > Great Pyrenees</option> <option value = "Greyhound" > Greyhound</option> <option value = "Harrier" > Harrier</option> <option value = "Havanese" > Havanese</option> <option value = "Ibizen Hound" > Ibizen Hound </option> <option value = "Irish Setter" > Irish Setter</option> <option value = "Irish Terrier" > Irish Terrier</option> <option value = "Irish Water Spaniel"> Irish Water Spaniel</option> <option value = "Irish Wolfhound" > Irish Wolfhound</option> <option value = "Italian Greyhound"> Italian Greyhound</option> <option value = "Jack Russell Terrier" > Jack Russell Terrier</option> <option value = "Japanese Chin" > Japanese Chin</option> <option value = "Keeshound" > Keeshound</option> <option value = "Kerry Blue TErrier" > Kerry Blue Terrier</option> <option value = "Komondor" > Komondor</option> <option value = "Kuvasz" > Kuvasz</option> <option value = "Labradar Retriever" > Labrador Retriever</option> <option value = "Lakeland Terrier" > Lakeland Terrier</option> <option value = "Lhasa Apso" > Lhasa Apso</option> <option value = "Lowchen" > Lowchen</option> <option value = "Maltese" > Maltese</option> <option value = "Standard Manchester Terrier" > Standard Manchester Terrier</option> <option value = "Mastiff" > Mastiff</option> <option value = "Miniature Bull Terrier" > Miniature Bull Terrier</option> <option value = "Miniature Pinche" > Miniature Pinscher</option> <option value = "Miniature Poodle" > Miniature Poodle</option> <option value = "Miniature Schnauzer" >Miniature Schnauzer</option> <option value = "Mutt" >Mutt</option> <option value = "Neopolitan Mastiff" >Neopolitan Mastiff</option> <option value = "Newfoundland"> Newfoundland </option> <option value = "Newfolk Terrier" >Norfolk Terrier</option> <option value = "Norwegian Elkhound" > Norwegian Elkhound</option> <option value = "Norwich Terrier" > Norwich Terrier</option> <option value = "Nova Scotia Duck Tolling Retriever"> Nova Scotia Duck Tolling Retriever</option> <option value = "Old English Sheepdog">Old English Sheepdog</option> <option value = "Otterhound" > Otterhound</option> <option value = "Papillon" >Papillon</option> <option value = "Parson Russell Terrier" > Parson Russell Terrier</option> <option value = "Pekingese" >Pekingese</option> <option value = "Pembroke Welsh Corgi" >Pembroke Welsh Corgi</option> <option value = "Petit Basset Griffon Vendeen">Petit Basset Griffon Vendeen</option> <option value = "Pharch Hound" >Pharoh Hound</option> <option value = "Plott" > Plott</option> <option value = "Pointer" > Pointer </option> <option value = "Polish Lowland Sheepdog" >Polish Lowland Sheepdog</option> <option value = "Pomeranian" > Pomeranian</option> <option value = "Portuguese Water Dog" >Portuguese Water Dog </option> <option value = "Pug" >Pug</option> <option value = "Pull" >Puli</option> <option value = "Rhodesian Ridgeback" >Rhodesian Ridgeback</option> <option value = "Rottweiler" >Rottweiler</option> <option value = "ASaint Bernard" > Saint Bernard</option> <option value = "Saluki" > Saluki</option> <option value = "Samoyed" >Samoyed</option> <option value = "Schipperke" >Schipperke</option> <option value = "Scottish Doverhound" >Scottish Deerhound</option> <option value = "Scottish Terrier" >Scottish Terrier</option> <option value = "Sealyham Terrier" >Sealyham Terrier</option> <option value = "Shetland Sheepdog" >Shetland Sheepdog</option> <option value = "Shiba Inu" >Shiba Inu</option> <option value = "Shih Tzu" >Shih Tzu</option> <option value = "Siberian Husky" >Siberian Husky</option> <option value = "Silky Terrier" >Silky Terrier</option> <option value = "Skye Terrier" >Skye Terrier </option> <option value = "Smooth Fox Terrier" >Smooth Fox Terrier</option> <option value = "Soft Coated Wheaten Terrier" >Soft Coated wheaten Terrier</option> <option value = "Spinone Italiano" >Spinone Italiano</option> <option value = "Staffordshire Bull Terrier" >Staffordshire Bull Terrier</option> <option value = "Standard Poodle" >Standard Poodle</option> <option value = "Standard Schnauer" > Standard Schnauzer</option> <option value = "Suseex Spaniel" >Sussex Spaniel</option> <option value = "Swedish Vallhound" >Swedish Vallhund</option> <option value = "Tibertan Mastiff" >Tibetan Mastiff</option> <option value = "Tibertan Spaniel" >Tibetan Spaniel</option> <option value = "Tibetan Terrier" >Tibetan Terrier </option> <option value = "Toy Fox Terrier" >Toy Fox Terrier </option> <option value = "Toy Manchester Terrier" >Toy Manchester Terrier </option> <option value = "Toy Poodle" >Toy Poodle</option> <option value = "Vizela" >Vizela</option> <option value = "Weimaraner" >Weimaraner</option> <option value = "Welsh Springer Spaniel" >Welsh Springer Spaniel</option> <option value = "Welsh Terrier" >Welsh Terrier </option> <option value = "West Highland White Terrier" >West Highland White Terrier </option> <option value = "Whippet" >Whippet</option> <option value = "Wire Fox Terrier" >Wire Fox Terrier </option> <option value = "Wirehaired Pointing Griffon" >Wirehaired Pointing Griffon</option> <option value = "Yorkshire Terrier">Yorkshire Terrier </option> </select> </td> </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></td> </tr> <tr> <td colspan = "6"><h2>Order Information</h2></td> </tr> <tr> <td>Product: <?php echo $_POST["product_title"];?></td> <td>Subtotal: </td> <td><?php echo $_POST["product_price"]*$_POST["quantity"]; ?> </td> </tr> <tr> <td>Price: <?php echo $_POST["product_price"];?></td> <td>Sales Tax: </td> <td> </td> </tr> <tr> <td>Quantity:<?php echo $_POST["quantity"];?></td> <td>Shipping: </td> <td> </td> </tr> <tr> <td> </td> <td> Total: </td> <td> </td> </tr> <tr> <td> </td> <td><input name="reset" type="submit" value="Cancel Order" /> </td><td> <input name="Submit" type="submit" value="Order Treats!" /></td> </tr> </table> </form> </body> </html> Quote Link to comment Share on other sites More sharing options...
Spring Posted November 29, 2011 Share Posted November 29, 2011 Then you're good to go..I think? The PHP won't show up when you view the source. PHP is server-sided. Quote Link to comment Share on other sites More sharing options...
Dragosvr92 Posted November 29, 2011 Share Posted November 29, 2011 PHP Gets parsed/generated inside the server, then outputs HTML, CSS, Javascipt etc.. Whever it is set to do. After the PHP functions/strings/whatever gets read/interpreted by the server, it outputs what you proggramed it to do. That is why its said its Server side scripting, same as Apache etc. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.