473,326 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

not executing embedded php commands

I just installed Apache 2.2 and PHP 5.2.6 on an XP machine. I created a
test.php file which contains only one function, phpinfo(). It ran fine.
I saw the php parameters.

I then tested it using an htm file (see code below). When I clicked on
the submit button, instead of calling test.php, IE displayed a file
download window and asked me whether I wanted to open or save test.php.
And the hello world page (see code below) was blank.

What am I doing wrong? Thanks.

p.s. I have the following line in the httpd.conf file

AddType application/x-httpd-php .htm

============================
<html>
<body>

<FORM METHOD=post ACTION="test.php">
<INPUT type="text" size="10">
<input type="Submit" VALUE="Submit">
</FORM>

</body></html>

======= Hello World =====================
<html>
<head>
<titleHello World </title>
</head>
<body>
<?php

echo 'Hello, world!';

?>
</body>
</html>
** Posted from http://www.teranews.com **
Jul 9 '08 #1
1 1221
John Smith wrote:
I just installed Apache 2.2 and PHP 5.2.6 on an XP machine. I created a
test.php file which contains only one function, phpinfo(). It ran fine.
I saw the php parameters.

I then tested it using an htm file (see code below). When I clicked on
the submit button, instead of calling test.php, IE displayed a file
download window and asked me whether I wanted to open or save test.php.
And the hello world page (see code below) was blank.

What am I doing wrong? Thanks.

p.s. I have the following line in the httpd.conf file

AddType application/x-httpd-php .htm

============================
<html>
<body>

<FORM METHOD=post ACTION="test.php">
<INPUT type="text" size="10">
<input type="Submit" VALUE="Submit">
</FORM>

</body></html>

======= Hello World =====================
<html>
<head>
<titleHello World </title>
</head>
<body>
<?php

echo 'Hello, world!';

?>
</body>
</html>
** Posted from http://www.teranews.com **

Did you configure PHP in Apache?

there is a php module and addType that must be included - my system uses
as mod_php.conf that includes lines similar to:

AddType application/x-httpd-php .php .phtml .html .htm
AddType application/x-httpd-php-source .phps

[and this will be different for Windows/Linux]
LoadModule php?_module modules/mod_php_apache-2_0.exe
works for me - minor mods to show it does function..

====================
<html>
<body>

<FORM METHOD=post ACTION="test.php">
<INPUT name=var1 type=text size="10">
<input type="Submit" VALUE="Submit">
</FORM>

</body></html>
=====================
<html>
<head>
<titleHello World </title>
</head>
<body>
<?php

echo 'Hello, world!<br>';
echo $_POST['var1'];

?>
</body>
</html>
=============================
OUTPUT:
=============================
Hello, world!
test

[page source]
<html>
<head>
<titleHello World </title>
</head>
<body>
Hello, world!<br>test</body>
</html>
=============================
Jul 9 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Simon Hawkins | last post by:
I seem to remember there's a java function for executing commands on the native system (UNIX in this case) but cannot remember which. Anyone know? Also, is it possible to grab the results of the...
26
by: jini us | last post by:
Hi, I am starting a new project where I intend to use embedded database server in my win32 application. I intend to use VC++ microsoft studio 6.0 as my development environment. The...
4
by: Justine | last post by:
Hi All, How can v execute DOS command while executing Console Application written using C#, like cls,dir commnads. Thanz in Advance, Justine
2
by: Pratibha | last post by:
Hi, I want to execute commands through .NET. Using process, i can execute them in WindowsApplication but the process doesn't work in WebApplication. I am executing a batch file which contains...
59
by: Jeff Bowden | last post by:
For ease of configuration and other reasons, I would like for my single-user GUI app to be able to use postgresql in-process as a library accessing a database created in the users home directory. ...
2
by: Pascal Polleunus | last post by:
(another try with a different subject as it doesn't seem to work with "EXECUTE + transaction = unexpected error -8" :-/) Hi, It seems that there is a problem when executing a dynamic...
0
by: Phas0r | last post by:
I have made a embedded scripting language for C++ based on XML. But the most important part is missing, calling C++ functions from within the script. I have a struct which stores all c++ commands....
2
by: Mark | last post by:
hi, i've written a c++ program that converts one file type to another via two arguments (the input and output filenames). i want to execute this on my server, using something like ...
1
by: natsran | last post by:
Hi All, Is there any perl module which would help in executing commands remotely on a windows machine? For doing the same on unix machine, I found that we could use Net::Telnet module. But...
2
by: SrivalliBapathi | last post by:
Hi, Please help me, if theres a way we can execute DB2 commands directly from the windows cmd prompt window instead of executing those from DB2 CLP window. I need to connect to a DB2 database...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.