I have a poll.php file. I wanted to embed this into my existing HTML file instead of just linking to the poll. So I use the include to add the poll.php to my home.html. When I viewed the home.html page, the poll.php appeared, but on voting on the poll or trying to see the results, I get the following error:
Method Not Allowed
The requested method POST is not allowed for the URL /x/home_test.html.
The test page is at <!-- m --><a class="postlink" href="http://www.dark-street.com/x/home_test.html">http://www.dark-street.com/x/home_test.html</a><!-- m -->
Please help!you can't include php into an html page. html will not be parsed as php. unless the server is setup to do it, but that is not recommended.
but looking into your code, you don't have an action for the form
<form METHOD="POST"> it has nowhere to goI also noticed that, but that's the way the include was parsed. Maybe I must change the poll.php script so that when you click on Vote it will be processed immediately. Anyway, here is the poll script. Have a look. (attachment)ok I can see the form tag. it seems that you might have register globals off, that would explain why you don't get anything when you submit.
try changing this line
if (! $vote && ! $result) {
top this
if (!$_POST["vote"] && !$_POST["result"]) {
that may help.Hi! I got it right. I renamed my html page to php and used the following code to embed my poll:
<?php require "php_poll.php"; ?>
Is this right? because it does work.yes that is correct, how did you have it before?I used this:
<!--#include virtual="php_poll.php" -->
which gave me the error.You could also have used
<?
include ("poll.php");
?>Originally posted by DarkStreetDev
I used this:
<!--#include virtual="php_poll.php" -->
which gave me the error.
ahh yes you were using SSI, which makes since. yes renaming your page php is the best fix.Thanks for helping people! You're the greatest! Now to look for some easy-to-understand introduction-to-php tutorials...Now this topic has a title Using PHP includes in HTML. Do you mean putting PHP commands into a regular HTML document or putting PHP commands into a HTML prased page?
If you want to put them into a HTML prased document then you need to use .htaccessHave read this thread with interest, as I have been messing around doing exactly this today.
I have a php application - php list - which I've installed without problem.
I'm now attempting to integrate it into the site's graphics.
I'm trying to use an include and have tied myself up in knots.
The page here (<!-- m --><a class="postlink" href="http://www.bloodlust-uk.com/lists/?p=subscribe&id=4">http://www.bloodlust-uk.com/lists/?p=subscribe&id=4</a><!-- m -->) and if you view source you'll see:
<?
include ("../head.php");
?>
along with a few other similar tags throughout the page.
There's something I'm doing wrong as I've tried everything.
<?
include ("fullurl/head.php");
?>
<?php
include ("../head.php");
?>
<?
require ("../head.php");
?>
None of these work. } Anything obvious?
And hi everyone, please ta meet you.welcome to the forums illonavamp.
I looked at the page and frankily it looks fine to me. what is is suppose to include?
I see the head.php and I also see you have two title tags in the main page you linked to and you have 2 link tags for css in the head section.
so it doesn't appear to be including anything? can you show us the index.php page of the lists folder?
<!-- m --><a class="postlink" href="http://www.bloodlust-uk.com/lists/?p=subscribe&id=4Apologies">http://www.bloodlust-uk.com/lists/?p=su ... 4Apologies</a><!-- m -->,
I was playing with a shortcut which puts the flat html code into the template. This works, but I really want my site in a state which calls includes so I can update one file when I change the site - saves me updating a million lines of html..This application just happens to be the ideal lab rat at the moment.
I've put it back into it's broken state now so you can see my problem.
=:Oit appears as if you are doing it in a html file? I can see the source and it shows the php stuff, this will work as php is not being parsed to show it.
are you sure you can run php? is this page a php file?
and you can't use this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">
you can't use a transistional with a strict. you can't mismatch. do one of the other.
Method Not Allowed
The requested method POST is not allowed for the URL /x/home_test.html.
The test page is at <!-- m --><a class="postlink" href="http://www.dark-street.com/x/home_test.html">http://www.dark-street.com/x/home_test.html</a><!-- m -->
Please help!you can't include php into an html page. html will not be parsed as php. unless the server is setup to do it, but that is not recommended.
but looking into your code, you don't have an action for the form
<form METHOD="POST"> it has nowhere to goI also noticed that, but that's the way the include was parsed. Maybe I must change the poll.php script so that when you click on Vote it will be processed immediately. Anyway, here is the poll script. Have a look. (attachment)ok I can see the form tag. it seems that you might have register globals off, that would explain why you don't get anything when you submit.
try changing this line
if (! $vote && ! $result) {
top this
if (!$_POST["vote"] && !$_POST["result"]) {
that may help.Hi! I got it right. I renamed my html page to php and used the following code to embed my poll:
<?php require "php_poll.php"; ?>
Is this right? because it does work.yes that is correct, how did you have it before?I used this:
<!--#include virtual="php_poll.php" -->
which gave me the error.You could also have used
<?
include ("poll.php");
?>Originally posted by DarkStreetDev
I used this:
<!--#include virtual="php_poll.php" -->
which gave me the error.
ahh yes you were using SSI, which makes since. yes renaming your page php is the best fix.Thanks for helping people! You're the greatest! Now to look for some easy-to-understand introduction-to-php tutorials...Now this topic has a title Using PHP includes in HTML. Do you mean putting PHP commands into a regular HTML document or putting PHP commands into a HTML prased page?
If you want to put them into a HTML prased document then you need to use .htaccessHave read this thread with interest, as I have been messing around doing exactly this today.
I have a php application - php list - which I've installed without problem.
I'm now attempting to integrate it into the site's graphics.
I'm trying to use an include and have tied myself up in knots.
The page here (<!-- m --><a class="postlink" href="http://www.bloodlust-uk.com/lists/?p=subscribe&id=4">http://www.bloodlust-uk.com/lists/?p=subscribe&id=4</a><!-- m -->) and if you view source you'll see:
<?
include ("../head.php");
?>
along with a few other similar tags throughout the page.
There's something I'm doing wrong as I've tried everything.
<?
include ("fullurl/head.php");
?>
<?php
include ("../head.php");
?>
<?
require ("../head.php");
?>
None of these work. } Anything obvious?
And hi everyone, please ta meet you.welcome to the forums illonavamp.
I looked at the page and frankily it looks fine to me. what is is suppose to include?
I see the head.php and I also see you have two title tags in the main page you linked to and you have 2 link tags for css in the head section.
so it doesn't appear to be including anything? can you show us the index.php page of the lists folder?
<!-- m --><a class="postlink" href="http://www.bloodlust-uk.com/lists/?p=subscribe&id=4Apologies">http://www.bloodlust-uk.com/lists/?p=su ... 4Apologies</a><!-- m -->,
I was playing with a shortcut which puts the flat html code into the template. This works, but I really want my site in a state which calls includes so I can update one file when I change the site - saves me updating a million lines of html..This application just happens to be the ideal lab rat at the moment.
I've put it back into it's broken state now so you can see my problem.
=:Oit appears as if you are doing it in a html file? I can see the source and it shows the php stuff, this will work as php is not being parsed to show it.
are you sure you can run php? is this page a php file?
and you can't use this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">
you can't use a transistional with a strict. you can't mismatch. do one of the other.