Page 1 of 1

Include problem... :(

Posted: Wed Mar 17, 2010 12:24 am
by nemxu
Hi guys i've been trying to solve this problem for a week now and I haven't got any closer to solving it. Basically I have a website called ' thetop10women.com' and I would like to have a poll for every category (which is set up and working) however the problem is for some reason I cannot include it into my pages.

I will give you an example page... http://thetop10women.com/index2.php?page=wags
At the very bottom of this page I would like to include a poll but it just doesnt want to appear. The code for the poll is:

Code: Select all

<?php
// Important! You have to include it before your html code
include_once "/home/bidding2/public_html/thetop10women.com/polls/poll_cookie.php";
?>
 
<html>
<body>
<?php
include_once "/home/bidding2/public_html/thetop10women.com/polls/booth.php";
echo $php_poll->poll_process(4);
?>
</body>
</html>
If I use this code word for word it just show the text on the website part from the <? php tags. So I tried to include it another way. I saved this code to a seperate page tried to include it another way... See below.


I created this file, 'http://thetop10women.com/poll_wags.php' and used the following code to include it into my page.

Code: Select all

<?php include("poll_wags.php"); ?>
It doesn't show the code on the website any longer, in fact it doesn't show anything at all.

What am I doing wrong?

Is it not allowed to include something on an included page?? (?page=wags)

Any help is much appreciated!

Re: Include problem... :(

Posted: Wed Mar 17, 2010 1:43 am
by Christopher
It looks like your paths are wrong. Create a script with phpinfo() in it to see what the actual path to your public HTML directory is.

Re: Include problem... :(

Posted: Wed Mar 17, 2010 2:15 am
by scvinodkumar
I think you server have problem with apache, when i view your site source code, it showing php code. so contact your support.

Re: Include problem... :(

Posted: Wed Mar 17, 2010 10:51 am
by nemxu
arborint wrote:It looks like your paths are wrong. Create a script with phpinfo() in it to see what the actual path to your public HTML directory is.
erm, how do I do that? lol

Re: Include problem... :(

Posted: Wed Mar 17, 2010 2:25 pm
by Christopher
Do you mean, how do you create a script like this:

Code: Select all

<?php
phpinfo();
... and run it?

Re: Include problem... :(

Posted: Thu Mar 18, 2010 1:10 am
by nemxu
Do I just put that code into a file and open it?

Re: Include problem... :(

Posted: Thu Mar 18, 2010 2:32 am
by Christopher
It would be faster to try it than ask the question ;) and yes.

Re: Include problem... :(

Posted: Thu Mar 18, 2010 7:49 am
by nemxu
Ok, i did what you said and got the public directory however nothing wants to show up...

All I want to know is how is the pages being included but the poll not?

Re: Include problem... :(

Posted: Thu Mar 18, 2010 6:07 pm
by Christopher
What does "nothing wants to show up" mean?

Re: Include problem... :(

Posted: Fri Mar 19, 2010 8:17 am
by wanger220
I saw in your source code that the include says <?php include("poll_wags.html"); ?>. Not sure if this is a mistake or you were trying something else.

I also got a nice malware notification for your IP.

Re: Include problem... :(

Posted: Fri Mar 19, 2010 12:51 pm
by nemxu
Malware....?? What do you mean? The site is brand new only got the domain last week.

I was trying to see if it would solve the problem in a .html format....


I mean that the poll doesn't include...