Chi Kien Uong
Geranienstraße 30
71034 Böblingen
Deutschland / Germany
|
If you are not registered or logged in, you may still use these forums but with limited features.
Show recent topics
|
|
|
Author |
Message |
|
If I understand you correctly, you are saying you want to put a poll on a page, and then have that poll page included on every other page of your website.
I hope I got that right.
Well, then the only way that I know how to do that would be to save your poll page as a .php file (for example: poll.php) and then on each page that you want the poll to appear, to place a php include tag (instead of ssi) like so:
<?php
include("myfolder/poll.php");
?>
You then, however, must rename every page you include your poll on with a .php file extension.
Personally, I don't know why anyone would want to use SSI to include a file when (in my opinion) using a php include tag is so much easier.
I am using php include tags for all the includes across my site. You just have to remember any page that contains php code(even if it is just one simple include tag) must be named with the .php extension.
Basically, what happens when a user requests a file from the server through their browser is this:
The server looks to see what the extension is on the file so it knows how it should handle the file. If the server sees a .shtml extension, it automatically knows to look for an incude on that page; it finds the path to the included file and then loads that file inside the requested document before sending it to the user’s browser. Some servers are configured to examine all files to see if they contain server-side includes; while most servers are configured to examine only files with a particular file extension, such as .shtml, .shtm, or .inc.
This holds true for php code and extensions. If a file containing php code is not saved with the .php extension the server will not bother to read the document and therefore not process the php code contained within it. The .php extension is like a big red flag waving around and saying to the server, “Hey, I got some stuff in here I need you to do, come take a look.” Without the extension, the server will simply ignore the file and send it to the browser as is.
For this reason, ssi and php do not work well together (at least in my humble non-expert opinion anyway) because each is dependant their file having their designated extension. And to my knowledge, you can’t put two extensions on one file. The solution to this is to simply use php include tags instead of server-side-includes.
You will find that php has far reaching possibilities, including the ability to easily include files inside of other files… while on the other hand, ssi is limited to only including files.
Obviously, it is your choice as to which method you want to use for the includes on your site; however, as far as I know the only method that is going to work with the Advanced Poll is to use php include tags and name all your files .php.
Again, I must emphasize that I am not an expert by any stretch of the imagination. I am just speaking from my own personal experience and research. I really hope this helps in some way.
|
|
|
It shouldn't matter... as long as your server is running php3 or higher.
|
|
|
But let's say you place a poll on a page called: poll.php and then you want to include that poll.php file on another page... like your index page.
Well, the way to do it is to simply to place this tag somewhere on your index page:
<?php
include("myfolder/poll.php");
?>
Then, you must also save your index page with the .php extension.
|
|
|
*bump*
|
|
|
Just in case anyone is interested, I created a sample poll page where you can see the code I used to generate that page. To see it just use the link below:
http:museium.net/testpoll.php
|
|
|
Well, the solution is very simple actually.
The page in which your poll is embedded MUST be named with the .php extension, or the poll will not work.
Then, all you have to do to get another page included is to add a tag like this one, on that page. Place the tag where you want the included page to load:
<?php
include("myfolder/myfile.txt");
?>
The home page of my site has both a poll and an included file... and everything works great.
Good Luck.
|
|
|
Perhaps you have the color of your results bars set as the same color as your background, making it appear as though it is not there when it really is.
If you need to know where to change the colors of the bars, go here:
http://museium.net/images/poll-admin.gif
|
|
|
I just registered with this forum. Just testing my signature.
|
|
|
|
|
|
Based on the open source JForum
|