Include problem... :(

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
nemxu
Forum Newbie
Posts: 6
Joined: Wed Mar 17, 2010 12:14 am

Include problem... :(

Post 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!
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Include problem... :(

Post 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.
(#10850)
scvinodkumar
Forum Newbie
Posts: 2
Joined: Thu Jun 11, 2009 2:30 am

Re: Include problem... :(

Post 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.
nemxu
Forum Newbie
Posts: 6
Joined: Wed Mar 17, 2010 12:14 am

Re: Include problem... :(

Post 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
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Include problem... :(

Post by Christopher »

Do you mean, how do you create a script like this:

Code: Select all

<?php
phpinfo();
... and run it?
(#10850)
nemxu
Forum Newbie
Posts: 6
Joined: Wed Mar 17, 2010 12:14 am

Re: Include problem... :(

Post by nemxu »

Do I just put that code into a file and open it?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Include problem... :(

Post by Christopher »

It would be faster to try it than ask the question ;) and yes.
(#10850)
nemxu
Forum Newbie
Posts: 6
Joined: Wed Mar 17, 2010 12:14 am

Re: Include problem... :(

Post 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?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Include problem... :(

Post by Christopher »

What does "nothing wants to show up" mean?
(#10850)
wanger220
Forum Newbie
Posts: 19
Joined: Tue Feb 02, 2010 8:44 pm

Re: Include problem... :(

Post 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.
nemxu
Forum Newbie
Posts: 6
Joined: Wed Mar 17, 2010 12:14 am

Re: Include problem... :(

Post 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...
Post Reply