HTML source code received on screen instead of data

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

husky
New php-forum User
New php-forum User
Posts: 2
Joined: Wed Sep 26, 2012 12:27 pm

HTML source code received on screen instead of data

Postby husky » Wed Sep 26, 2012 12:45 pm

Hello,

I'm new to PHP and Apache so I'm not sure the problem is PHP, Apache or something else.
I have this input HTML:

Code: Select all

<!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" xml:lang="en" lang="en">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>feedback</title>
</head>

<body>
<form action="handle_form.php" method="post" name="form1" id="form1" >

<p>Name:<select name="title">       
         <option value="Mr.">Mr.</option>
         <option value="Mrs.">Mrs.</option>
         <option value="Ms.">Ms.</option>
      </select>
   <input name="name" type="text" size="20"  />
</p>
<p>E-mail:<input name="email" type="text" size="20"  />
   
</p>
<p>Radio Response: This is...
   <input name="response" type="radio" value="excellent"/>Excellent
   <input name="response" type="radio" value="okay" />Okay
   <input name="response" type="radio" value="lousy" />Lousy
</p>
<p>COMMENTS:<textarea name="comments" cols="20" rows="3"></textarea>
   
</p>
   <input name="Submit1" type="submit" value="Send"  />
   
</form>

</body>
</html>


At execution time, this code is called:

Code: Select all

<!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" xml:lang="en" lang="en">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>handle_form</title>
</head>
<body>
<?php
$title       = $_POST["title"];
$name       = $_POST['name'] ;
$email      = $_POST["email"];
$response    = $_POST["response"];
$comments    = $_POST["comments"];
print "<p>Thanks:  $title $name  </p>";
print "<p>Your response was $response and you added this comment:<br/> $comment </p.";
print "<p>Bye, $name.....</p>";
?>
</body>
</html>


This is what I get after the execution is the second HTML and not the contents that should have been processed by PHP.

Apache V2.3.4 (from Apache Lounge)
PHP Version :PHP Version 5.3.17 VC9
Windows 7.

Any ideas what I'm doing wrong?

Thank You for Your time

Husky

User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: HTML source code received on screen instead of data

Postby egami » Wed Sep 26, 2012 1:50 pm

Not to be synical.. but your first problem is using Windows. :)


The other problem seems to be that your Apache server doesn't recognize the PHP extensions.

husky
New php-forum User
New php-forum User
Posts: 2
Joined: Wed Sep 26, 2012 12:27 pm

Re: HTML source code received on screen instead of data

Postby husky » Thu Sep 27, 2012 7:46 am

OK,
So, I'm using Windows. That's what I have so no way around that.

What's missing here is what I need to look for in order to make Apache talk to PHP.

Thanks

User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: HTML source code received on screen instead of data

Postby egami » Thu Sep 27, 2012 9:11 am

I'm sorry, but I don't know the Windows HTTP platform.


Return to “PHP coding => General”

Who is online

Users browsing this forum: Google [Bot] and 5 guests