[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

PHP Formatting Problems

Asked by qualityip in PHP Scripting Language, Hypertext Markup Language (HTML), Web Development

Tags: PHP, HTML

Please help!! I cannot get this PHP syntax right. Half of the PHP code is showing up as plain text instead of being executed as code. I've been working on this  for hours and am having no luck!

The PHP code for checkout.php iis:

<html>
<span style="font-size:24pt">Checkout Page</span>
<hr>
<?php
      $customerName=$_POST['customerName'];
      $totalCost=$_POST['totalAmount'];
      $totalMouse=$_POST['mousePurchased'];
      $totalTypewriter=$_POST['typewriterPurchased'];

if ($totalMouse>1) {
            echo "You have purchased $totalMouse mice";
      } else if ($totalMouse==1) {
            echo "You have purchased $totalMouse mouse";
      } else {
            echo "You did not purchased a mouse";
};

if ($totalTypewriter>1) {
            echo " and purchased $totalTypewriter typewriters.<br>";
      } else if ($totalTypewriter==1) {
            echo " and purchased $totalTypewriter typewriter.<br>";
      } else {
            echo " and you did not purchase a typewriter.<br>";
};
echo "Thank you, $customerName, for your business!<br><br>";
echo "<br>Your order total is \$$totalCost<br>";
?>

</html>
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
<html>
	
<head>
	
<title> 
	
Welcome to Typewriter and Mouse Store 2.0
 
</title>
 
<script>
 
	var totalCart = 0;
	var mouseCount = 1;
	var typewriterCount = 1;
	var mousePurchased = 0;
	var typewriterPurchased = 0;
 
 
function mousePurchase() {
    mousePurchased++;
    mouseCount++;
    totalCart=totalCart+10;
    document.getElementById('totalCost').innerText=totalCart; 
};
 
function typewriterPurchase() {
    typewriterPurchased++;
    typewriterCount++;
    totalCart=totalCart+50;
    document.getElementById('totalCost').innerText=totalCart; 
 
};
 
function checkoutFunction(){
		if (document.checkout.customerName.value=='') {
			alert('Please fill in Customer Name.');
			document.checkout.customerName.focus();
		} else if (mousePurchased==0 && typewriterPurchased==0) {
			alert('You have not purchased anything');
		} else {
			document.checkout.totalAmount.value=totalCart;
			document.checkout.totalMouse.value=mousePurchased;
			document.checkout.totalTypeWriter.value=typewriterPurchased;
			document.checkout.submit();
    };
};
 
		 
function resetForms() {
    mousePurchased=0;
    mouseCount=1;
    typeWriterPurchased=0;
    typeWriterCount=1;
    totalCart=0;
    document.getElementById('mouseInfo').innerText=0;
    document.getElementById('totalCost').innerText=totalCart;
    document.getElementById('typewriterInfo').innerText=0;
    alert('You reset your cart.');
                    
};
 
</script>
 
</head>
 
<body>
	
 
 
<span style='color:black;font-size:30px;'>The Mouse and Typewriter Store</span>
 
<br/>
<br/>
 
<form name="checkout" action="checkout.php" method="POST">
	
<input type='hidden' name='totalAmount'>
<input type='hidden' name='totalMouse'>
<input type='hidden' name='totalTypeWriter'>
 
</br>
</br>
</br>
 
<a href='javascript:mousePurchase()'> <img src="http://131.123.8.32/44044/mouse.gif" onclick="mouseInfo.innerText=mouseCount"/> </a>
 
</br>
 
<span> The mouse is $10 </span>
 
</br>
</br>
</br>
 
<a href='javascript:typewriterPurchase()'><img src="http://131.123.8.32/44044/typewriter.gif" onclick="typewriterInfo.innerText=typewriterCount"/> </a> 
 
</br>
 
<span> The typewriter is $50 </span>
 
</br>
</br>
</br>
 
<input type='button' value='Check Out' onclick='checkoutFunction()' /> 
 
<input type='button' value='Reset' onclick='resetForms()' /> 
 
</br>
</br>
</br>
 
First and Last Name: <input name="customerName" />
 
</br>
</br>
</br>
 
Total mice in cart: <span id='mouseInfo'>0</span>
 
</br>
</br>
</br>
 
Total typewriters in cart: <span id='typewriterInfo'>0</span>
 
</br>
</br>
</br>
 
The Total Cost is $ <span id='totalCost'>0</span>
 
</form>
 
</body> 
 
</html>
[+][-]02/25/09 07:12 AM, ID: 23734389Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/25/09 07:15 AM, ID: 23734435Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/25/09 07:16 AM, ID: 23734439Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: PHP Scripting Language, Hypertext Markup Language (HTML), Web Development
Tags: PHP, HTML
Sign Up Now!
Solution Provided By: al3cs12
Participating Experts: 3
Solution Grade: B
 
[+][-]02/25/09 07:37 AM, ID: 23734754Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/25/09 08:44 AM, ID: 23735582Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/25/09 08:46 AM, ID: 23735607Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/25/09 09:13 AM, ID: 23735923Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/25/09 09:30 AM, ID: 23736113Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/25/09 09:56 AM, ID: 23736370Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/25/09 10:04 AM, ID: 23736452Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/25/09 10:07 AM, ID: 23736480Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/25/09 10:13 AM, ID: 23736533Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/25/09 10:17 AM, ID: 23736574Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/25/09 10:28 AM, ID: 23736684Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/25/09 10:39 AM, ID: 23736803Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/25/09 10:54 AM, ID: 23736955Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/25/09 10:58 AM, ID: 23736992Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/25/09 11:01 AM, ID: 23737034Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625