Forum Home
Press F1
 
Thread ID: 14993 2002-01-25 03:42:00 Does anybody knows how to use/install PHP? Guest (0) Press F1
Post ID Timestamp Content User
32781 2002-01-25 03:42:00 Hi,

I'm a noivce php user.

Having just installed Apache and PHP, I started loading my first php file (hello.php) with the following code:
<? phpinfo(); ?>

That works. But when I create another php file:
<html>
<body>
<?php echo 'test<br>' ?>
<?php echo $test_value; ?>
<FORM METHOD='POST' ACTION='<?php echo $PHP_SELF ?> '>
<input type='hidden' name='test_value' value='Hello World' />
<INPUT TYPE='SUBMIT' VALUE='Next' />
</form>
</body>
</html>

All I see on the browser is 'test' on one line and a 'next' button on the next line. When I push the 'next' button, nothing happens!

It seems like my http server is able to read php files, but doesn't know how to process it.... :(

Any ideas?
Guest (0)
32782 2002-01-25 04:30:00 try doing it like this, it always works for me

create your form all in html

in the post section put this

FORM METHOD='POST' ACTION='process.php'>

then you create a php script file that processes the data

remember that what every you call a field in a form

eg name='user' will be what the vaiable name in the script

eg in the above it would be user

if you send a email to my address sirrab@casper.co.nz i can send you an example file to look at.

Sirrab
Guest (0)
32783 2002-01-25 04:32:00 Apache on what? Linux?

According to the miniHOWTO,

nix.tmk.auckland.ac.nz ,

the file needs the extension '.sphtml' to match the mime.type entry for application/x-http-php.

If you made a standard '.html' file, that has been processed as standard HTML, ignoring anything not understood: the PHP stuff. Did that correctly!
Guest (0)
32784 2002-01-25 05:12:00 Hi Graham,

Thanks for your reply.

I'm running Apache on win 98.

I've got these 2 lines in my httpd.conf file:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

The file that i used for testing is Test.php. Am i doing the right things?

One thing i do not understand is that, Apache seems to understand .php files but it doesn't respond to form submissions.....strange....
Guest (0)
1