Page 1 of 1
Something wrong with code?
Posted: Sat Mar 20, 2010 2:25 pm
by nemxu
Code: Select all
<?php
include_once "/home/bidding2/public_html/thetop10women.com/polls/booth.php";
$php_poll->set_comments_per_page(5);
$php_poll->set_date_format("d/m/Y H:i");
$php_poll->data_order_by("time","desc");
echo $php_poll->view_poll_comments(5);
echo $php_poll->get_comment_pages(5);
?>
Is there something wrong with this code? I keep getting this error:
Fatal error: Call to undefined method poll::set_comments_per_page() in /home/bidding2/public_html/thetop10women.com/ukglamourmodels.php on line 72
Line 72 has nothing to do with the code....
Thanks
Re: Something wrong with code?
Posted: Sat Mar 20, 2010 2:58 pm
by JakeJ
Try this: (include_once "/home/bidding2/public_html/thetop10women.com/polls/booth.php");
Instead of: include_once "/home/bidding2/public_html/thetop10women.com/polls/booth.php";
Re: Something wrong with code?
Posted: Sat Mar 20, 2010 4:35 pm
by Christopher
JakeJ wrote:Try this: (include_once "/home/bidding2/public_html/thetop10women.com/polls/booth.php");
Instead of: include_once "/home/bidding2/public_html/thetop10women.com/polls/booth.php";
Huh? Put parens around the whole thing????
Re: Something wrong with code?
Posted: Sat Mar 20, 2010 4:37 pm
by Christopher
nemxu wrote:Is there something wrong with this code? I keep getting this error:
Fatal error: Call to undefined method poll::set_comments_per_page() in /home/bidding2/public_html/thetop10women.com/ukglamourmodels.php on line 72
Line 72 has nothing to do with the code....
What is on line 72 in the script "ukglamourmodels.php"? You showed some code, but did not say what file is was from.
Re: Something wrong with code?
Posted: Sat Mar 20, 2010 5:08 pm
by JakeJ
Sorry.. Brain fart. That's what I get for cutting, pasting and editing too quickly.
I meant: include_once ("/home/bidding2/public_html/thetop10women.com/polls/booth.php");
Re: Something wrong with code?
Posted: Sat Mar 20, 2010 6:58 pm
by cpetercarter
I don't think that adding brackets around the file name will make any difference.
The error is telling you that there isn't a method "set_comments_per_page" in the class "poll". You may have made a mistake in entering the name of the method - maybe it should be "comments_per_page" or something. If it isn't a spelling mistake, then the problem is that the class does not contain the method you want to use.
Seems to me that you are trying to use code devised by someone else. Can't the author of the code help sort out this problem?
Re: Something wrong with code?
Posted: Sat Mar 20, 2010 9:25 pm
by ell0bo
Do you need to do:
global $php_poll;
before you actually call the object. It doesn't make a lot of sense however, and I'm not familiar with the class you're implementing. Any chance you wanna send us what's in the file you're inclding?