PDA

View Full Version : ; ?> showing up in browser.


JDesigns
01-28-2009, 01:26 AM
New to php and learning. I have a simple form that is suppose to run a php file and post some text. but after the text the closing php ; ?> shows up in the browser. Why?

PHP file:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bob's Auto Parts - Order Results</title>
</head>
<body>
<h1>Bob's Auto Parts</h1>
<h2>Order Results</h2>
<?php
echo '<p>Order processed.</p>';
?>
</body>
</html>

Thanks. And what is up with other browsers. FF displays at least the file with extra characters. IE and chrome want to save the file.

edbr
01-28-2009, 01:56 AM
are you using a local testing server? other than no doc type this looks ok

JDesigns
01-28-2009, 02:02 AM
I have apache running with the php module. but i am not running a testing server through DW. Do i need to?

edbr
01-28-2009, 02:50 AM
when you view your page you are seeing it in localhost? if not you should be

JDesigns
01-28-2009, 04:00 AM
I placed the files in the apache htdocs folder and the php file was displayed correctly. Thanks.

bee80
02-07-2009, 02:57 PM
JDesigns i have exactly the same book as you, started learning that way. But i would seriously consider taking davidJ's php lessons if i were you! He makes everything so much clearer, now when i pick up that book or read code i understand exactly what its trying to do and what im looking at i.e functions,arrays .. etc. Although i still need to refer to books ,tutorials for the harder code. Variables ,if statements, switches some loops i can now write from my head! Doesnt sound much?? Consider that i took the course 2 weeks ago(before that i was trying that book!), we got through the course in a little over 4 hours. And know i feel i have a good understanding of BASIC PHP syntax on which i am slowly building knowledge daily.

davidj
02-07-2009, 04:28 PM
:oops: aww shucks

edbr
02-09-2009, 06:42 AM
why thats champion

JDesigns
02-11-2009, 09:14 PM
Thanks for the input bee80 and I will probably take your advice. I just have to find the time.

As always thanks for everyone's help.