| View previous topic :: View next topic |
| Author |
Message |
Iskandar Guest
|
Posted: Fri Jun 17, 2005 4:44 pm Post subject: Guide on How to Add Poll to HTML page |
|
|
I have been reading this forum for a few hours and there are ideas scattered evrywhere. I have been searching this forum for a way to make it work in *.htm/html files instead of *.php. Why?
Because if you have a nice page that ranks highly in a search engine with an html or htm extension, and suddenly change it to *.php. The engine won't be able to find the page. It will think that the page won't exist anymore!
That is a very easy way to lose traffic!
So... How do you add it in normal html pages?
1) Add this to your .htaccess file
AddType application/x-httpd-php .php .html
or
AddType application/x-httpd-php .php .htm
(if you use htm extension)
2)Add this code as in the documentation
<?php
// Important! You have to include it before your html code
include_once "poll/poll_cookie.php";
?>
3)In the place where you want it to appear (in the body of course) put this code
<?php
include_once "poll/booth.php";
echo $php_poll->poll_process(1);
?>
4) Of course the poll process number should be the poll number. That's just an example. I dunno if it will take a lot of bandwith or if it works for you. It works for me on my test pages. I am still looking if there's error because of it.
I just want to help people who have been wandering here for so long looking for this info.
If it helps, good. If not, I apologise
= edit ===
I have checked and it appears to be good.
You can an example of how i integrate the polls at http://oohoi.com/natural%20remedy/everyday_food/apple.htm
Oh! By the way. Make sure your path is correct okay?
=======
Iskandar |
|
| Back to top |
|
 |
Auron

Joined: 23 Jun 2003 Posts: 1051
|
Posted: Fri Jun 17, 2005 9:21 pm Post subject: |
|
|
Good job, saves me having to do it! ^^, _________________ Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought) |
|
| Back to top |
|
 |
Iskandar Guest
|
Posted: Fri Jun 17, 2005 10:55 pm Post subject: Glad to help |
|
|
Very glad to be able to help! I hope this would settle the problem and confusion and saves a lot of ppl from lost traffics.
Good luck everybody! |
|
| Back to top |
|
 |
Auron

Joined: 23 Jun 2003 Posts: 1051
|
Posted: Sat Jun 18, 2005 1:00 am Post subject: |
|
|
Hopefully it will, I hope you don't mind me putting all your posts into one to make it tidier and more convenient for others.
Auron _________________ Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought) |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Jun 21, 2005 6:30 am Post subject: |
|
|
Firstly, thanks. The .php exten
Secondly, I am still confused...
Step 1, add this to the .htaaccess file. Do that in Notepad? Remove the one line that is in that file, paste what you've said? I find 2 of these htaaccess files, change both? |
|
| Back to top |
|
 |
Iskandar Guest
|
Posted: Tue Jun 21, 2005 7:16 am Post subject: Add to .htaccess |
|
|
Yo!
Add that line, you don't have to delete anything in your .htaccess file. Look at the name, there's a dot before htaccess, so the right name is .htaccess.
Use whatever editor you want. I think notepad is decent enough (editing on cpanel is easier). If you use notepad, save the filename as .htaccess (see the dot?) and save as All Files (not text)
Okay? Take care & good luck!  |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Jun 21, 2005 3:02 pm Post subject: |
|
|
Thanks again. I was accidently cut off from finishing my first post! Okay, please don't laugh if my questions seem stupid. I'm determined to get this working as you have.
You mention cpanel. What is that? I've done as you said to the .htaccess file however, once I add that line and upload to my server, I don't see it in the folder on the server. That is normal?
I've tried many variations based on your steps, and still I'm getting no poll. Hmm. So just to recap this for rookies like me....
1. Just add this text below what is already in the .htaccess file, not the same line. Perhaps opening this file and editing in Notepad is causing problems?
2. Adding that code, must this be at the very start of my page at the very top? Or simply needs to be pasted before part 3.
3. This is obviously a lot less information that what I take from the admin panel for pasting the poll. So, I use exactly what you have here with just changing the process poll number?
Basically, use exactly what you have here and forget about the code that is from the admin panel for my poll?
Again, please don't flame me. Honestly my launch of my website is dependent on having this work. Your instructions are great, but I'm a Dreamweaver guy, so I"m used to the software doing this stuff! |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Jul 12, 2005 7:24 pm Post subject: |
|
|
SUCCESS!!!!
Thank you, Iskandar, for your instructions!
I'm not a web design person so I'm blindly making my own blog with MT and learning as I go. I don't know what a .htaccess file is or what it's purpose is. I had never heard of it before but I did as per your inst and viola! It worked ... finally ...after wasting a whole day on it yesterday. I did everthing right except I didn't know about the .htaccess file trick and there was nothing in the documentation.
Thanks again for your inst and patience!
Martha |
|
| Back to top |
|
 |
heidis
Joined: 17 Jul 2005 Posts: 3
|
Posted: Sun Jul 17, 2005 4:54 am Post subject: |
|
|
| your instructions LOOK like they would work but call me the idiot. I can't seem to get them to work for me. Would you care to include some screen shots of where you put things? I'm totally new to this kind of add-on. I use dreamweaver but can figure out some other things. Thanks for any help! |
|
| Back to top |
|
 |
heidis
Joined: 17 Jul 2005 Posts: 3
|
Posted: Mon Jul 18, 2005 12:17 am Post subject: |
|
|
| YAY!! I got it to work! thanks so much!! |
|
| Back to top |
|
 |
DavidB
Joined: 18 Jul 2005 Posts: 3
|
Posted: Mon Jul 18, 2005 2:39 am Post subject: |
|
|
This of course will cause all HTML/HTM pages on yoru site to render slower. Also be sure NOT to delete any other .htaccess settings for HTML. Many folks user server parse to do 'include virtual' commands in html. Remember that each of these that you add causes even more overhead.
The BETTER way is in the .htaccess file is create a redirect command such as this...
Redirect permanent /index.html /index.php
that is not 100% accruate syntax, you will have to research and set the paths etc for your site. |
|
| Back to top |
|
 |
DavidB
Joined: 18 Jul 2005 Posts: 3
|
Posted: Mon Jul 18, 2005 2:41 am Post subject: |
|
|
| Anonymous wrote: |
Firstly, thanks. The .php exten
Secondly, I am still confused...
Step 1, add this to the .htaaccess file. Do that in Notepad? Remove the one line that is in that file, paste what you've said? I find 2 of these htaaccess files, change both? |
You DO NOT hve two .htaccess. You MAY have an .htaccess and an .htpasswd. Do NOT change anything there. Add the commands in either set of instructions listed above. |
|
| Back to top |
|
 |
iskandar
Joined: 22 Jun 2005 Posts: 6
|
Posted: Thu Jul 21, 2005 5:02 pm Post subject: Sorry |
|
|
I apologise for not replying you guys' messages. After i had put up the instruction i had wondered around this forum for a few weeks to see if anyone needs help.
After that i have been away until today. Again, i apologise for not responding
iskandar |
|
| Back to top |
|
 |
ukkpower Guest
|
Posted: Wed Aug 03, 2005 9:25 pm Post subject: Dont get table |
|
|
Hi, I have done what was required but all I get on the webpage is the text
poll_process(1); ?>
The code I used was
| Code: |
<?php
// Important! You have to include it before your html code
include_once "poll/poll_cookie.php";
?>
<head>
</head>
<body>
<?php
include_once "poll/booth.php";
echo $php_poll->poll_process(1);
?>
</body>
|
There is a poll with ID 1. I can get it to work with .shtml. Anyone have any ideas what I am doing wrong?
Thanks
|
|
| Back to top |
|
 |
iskandar
Joined: 22 Jun 2005 Posts: 6
|
Posted: Mon Aug 08, 2005 5:04 pm Post subject: |
|
|
I don't know what went wrong here but you mentioned it worked in .shtml and .php ( from your other posts, i think ).
So the best way is to rename your file to .php or .shtml . Then do a 301 redirect. What this does is to let the search engine spiders know that you have changed the name. Any links pointing to your old link will automagically be redirected to the newly renamed file.
This is the way.
Let say the name of your old file is does-not-work.html and you renamed it to now-it-work.php .
What you need to do is to add this line to your .htaccess file
redirect 301 /old/does-not-work.html http://www.you.com/old/now-it-work.php
( assuming that your old file is in the old folder)
That's all. Hope it helps
More about 301 redirect here http://www.tamingthebeast.net/articles3/spiders-301-redirect.htm  |
|
| Back to top |
|
 |
|