Board index   FAQ   Search  
Register  Login
Board index PHP PHP Installation

Running PHP from HTML form

Forum for you who has PHP installation issues

Moderators: macek, egami, gesf

Running PHP from HTML form

Postby Zeeuw » Sun Feb 02, 2003 11:23 am

Hi,

I've just installed PHP (Win 98 and Apache webserver) and php-files I run by entering http://localhost/someting.php in my browser run correctly.

However when I try to run a php-file from, for example, a form (I'm following a quick course) in a HTML page, it doesn't work.

Can somebody help me out with this one?

Thanx,

Zeeuw
Zeeuw
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sun Feb 02, 2003 11:11 am

Postby Oleg Butuzov » Sun Feb 02, 2003 11:20 pm

i did not understud what you gona do=)

if you want to run php files like html pages (C:\phpinfo.php for exemple) - it imposible apache run PHP for your script

if you want to include php scripts in the htmml pages you must use SSI.
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Redcircle » Mon Feb 03, 2003 12:00 am

Do you want to include php code in .html files?

Depending on the course you are reading make sure you are coding with the aspect that register_globals is off. This is default for PHP 4.2+

Basically this means the information that you post will look like $_POST['variable'] or $_GET['variable']


If you are just wanting to include PHP code in a file with .html extension all you have to do is edit your httpd.conf for apache
and add
AddType application/x-httpd-php .html

then restart apache and it will process all .html files as .php scripts.
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby Zeeuw » Mon Feb 03, 2003 1:21 am

Waaha! Thanx with this one, exactly what went wrong!
Zeeuw
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sun Feb 02, 2003 11:11 am


Return to PHP Installation

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.