posting php on htm page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gordons
Forum Newbie
Posts: 2
Joined: Mon Nov 30, 2009 11:49 am

posting php on htm page

Post by gordons »

Hi everyone

I'm new to both php and to this forum and would appreciate your help

I'm trying to post a php code to a htm page and thought all I had to do was add

AddType application/x-httpd-php .htm

to my .htaccess then add the php code to the source code on my htm page

Alas this did not work, I got the following error message


Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/gotgo/public_html/index2.htm on line 36

Warning: include(http://si.goldencan.com/GetData.aspx?ve ... 5.30729%29) [function.include]: failed to open stream: no suitable wrapper could be found in /home/gotgo/public_html/index2.htm on line 36

Warning: include() [function.include]: Failed opening 'http://si.goldencan.com/GetData.aspx?ve ... 5.30729%29' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/gotgo/public_html/index2.htm on line 36

I'm afraid I'm totally baffled, can anyone please help

Many thanks in anticipation
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: posting php on htm page

Post by AbraCadaver »

Change in php.ini:

allow_url_include Off

to:

allow_url_include On
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
gordons
Forum Newbie
Posts: 2
Joined: Mon Nov 30, 2009 11:49 am

Re: posting php on htm page

Post by gordons »

Wow, thanks AbraCadaver for a very speedy reply

Could I ask for a bit more help

Where do I find the php.ini so I can alter it?
User avatar
Weiry
Forum Contributor
Posts: 323
Joined: Wed Sep 09, 2009 5:55 am
Location: Australia

Re: posting php on htm page

Post by Weiry »

Well assuming your server is localhost currently.
<WEB SERVER DIRECTORY>\bin\php\phpX.X.X\

If your running on an online server, then you might have to use
ini_set() because an online service usually wont allow you access to their php.ini
Post Reply