Simple Machines Community Forum

General Community => Scripting Help => Topic started by: Vinoth on July 15, 2004, 10:26:22 AM

Title: PHP HELP/
Post by: Vinoth on July 15, 2004, 10:26:22 AM
i am new to PHP World,


i need an basic help in php,

http://www.webhoststalk.com/vote.php

now this is an vote, how to display this file in html page/

i need to include this file in html page.
Title: Re: PHP HELP/
Post by: Tomer on July 15, 2004, 01:37:59 PM
The include function is a PHP function so it wont work with a .PHP extention.
Title: Re: PHP HELP/
Post by: Vinoth on July 15, 2004, 03:43:41 PM
so would i able to do this or not/

i changed the ext of my file from html to php/
Title: Re: PHP HELP/
Post by: Tomer on July 16, 2004, 07:21:51 AM
Ok if you have a .PHP extention and your server allows PHP than you can inculde other pages into your PHP file.

I would suggest that in your file, vote.php you put the whole contents in a function:

<?php

function showVote()
{

echo
'HTML CODE';

return;
}
?>


And then on your new PHP files include it like this:

<?php
include("/vote.php");

showVote();
?>
Title: Re: PHP HELP/
Post by: Vinoth on July 17, 2004, 11:56:57 AM
Thanx for the help lamper, i got the help from my friends