<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Advanced Poll 2.0 (MySQL version) - Strange problem"]]></title>
		<link>https://proxy2.de/forum/posts/list/3.php</link>
		<description><![CDATA[Latest messages posted in the topic "Advanced Poll 2.0 (MySQL version) - Strange problem"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Advanced Poll 2.0 (MySQL version) - Strange problem</title>
				<description><![CDATA[ Bascially my content system builds a features bar along the right of every page and one section of this was going to include the poll. I'm having problems getting it to work though.<br /> <br /> If I create a file called polltest.php just containing this:<br /> [code]&lt;?php<br /> // Important! You have to include it before your html code<br /> include_once "/home/maxpayne/cgi-bin/site/poll/poll_cookie.php";<br /> ?&gt;<br /> <br /> &lt;html&gt;<br /> &lt;body&gt;<br /> &lt;?php<br /> include_once "/home/maxpayne/cgi-bin/site/poll/booth.php";<br /> echo $php_poll-&gt;poll_process(2);<br /> ?&gt;<br /> &lt;/body&gt;<br /> &lt;/html&gt;[/code]<br /> <br /> Then it works fine.<br /> <br /> However, the problem occurs when I try to put it into my content system.<br /> The way it differs is the file display.php is called with a page name. As the cookie information needs to be sent before headers, this is where poll_cookie.php is included. display.php then includes global.inc.php for common functions including one called rightBar(). In rightBar rightBar.inc.php is included and this runs through drawing out the different sections. When it hit's:<br /> <br /> [code]include_once "/home/maxpayne/cgi-bin/site/poll/booth.php";<br /> echo $php_poll-&gt;poll_process(2);[/code]<br /> <br /> I get:<br /> [code]Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/maxpayne/cgi-bin/site/poll/include/class_mysql.php on line 30<br /> <br /> Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/maxpayne/cgi-bin/site/poll/include/class_mysql.php on line 30<br /> Connection Error<br /> --------------------------------------------------------------------------------<br /> <br /> MySQL Error : Connection Error<br /> Error Number: 2002 Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)<br /> Date        : Tue, April 9, 2002 11:52:31<br /> IP          : 213.1.128.93<br /> Browser     : Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; PCPLUS)<br /> Referer     : <br /> PHP Version : 4.1.2<br /> OS          : Linux<br /> Server      : Apache/1.3.23 (Unix) PHP/4.1.2<br /> Server Name : dynamic4.gamespy.com<br /> Script Name : /~maxpayne/site/display.php[/code]<br /> <br /> I've also tried putting it all in a seperate file and including that but this just results in the same problems.<br /> <br /> I've also tried moving the booth.php include to one of the preceding files (display.php or global.inc.php) but all this results in is a different error:<br /> <br /> [code]Fatal error: Call to a member function on a non-object in /home/maxpayne/cgi-bin/site/rightBar.inc.php on line 120[/code]<br /> <br /> The only way I have got it to work so far is include it in display.php (the originally called file) so I guess I might be able to rework my rightBar function into 2 pieces so I can do the following in display.php:<br /> <br /> [code]...<br /> ...<br /> ...<br /> rightBarTop();<br /> include_once "/home/maxpayne/cgi-bin/site/poll/booth.php";<br /> echo $php_poll-&gt;poll_process(2);<br /> rightBarBotton();<br /> ...<br /> ...<br /> ...<br /> [/code]<br /> <br /> But I really don't want to have to do that unless it's absolutely necessary, and this is the best poll system I've seen, so if anyone has any suggestions they'd be greatly appreciated.<br /> <br /> Thx in advance<br /> <br /> (Oh and I've tried the textfile version but this just results in a different problem, all the $question, etc variables in the templates get replaced with nothing so it doesn't work too well... :wink:)]]></description>
				<guid isPermaLink="true">https://proxy2.de/forum/posts/preList/434/1093.php</guid>
				<link>https://proxy2.de/forum/posts/preList/434/1093.php</link>
				<pubDate><![CDATA[Tue, 9 Apr 2002 21:05:11]]> GMT</pubDate>
				<author><![CDATA[ Anonymous]]></author>
			</item>
	</channel>
</rss>