33 users online (1 members and 32 guests)  


  Results 1 to 11 of 11

Related

  1. Need help with PHP poll code    Forum: PHP Forum
    Replies: 4
  2. Replies: 0
  3. Hand Writing Poll Results Scripts    Forum: PHP Forum
    Replies: 0
  4. php code for poll    Forum: PHP Forum
    Replies: 4
  5. Replies: 4
  1. #1
    pesky's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2002
    Location
    Silicon Valley
    Posts
    1

    Question Help with PHP poll script

    Hi there,
    I've installed an advanced PHP based poll script on my server. I've gotten the mySQL part of it working just fine, and everything seems peachy--except that when I follow the exact instructions in the poll app, the code won't work on the page.

    The app asks me to insert the following code into my page:
    <?php
    // Important! You have to include it before your html code
    include_once "/www/mackerelstreet/poll/poll_cookie.php";
    ?>

    <html>
    <body>
    <?php
    include_once "/www/mackerelstreet/poll/booth.php";
    echo $php_poll->poll_process(4);
    ?>
    </body>
    </html>

    However, when I do this (inserting the first part at the beginning of the page, above the <html> tag, and the second part (minus the html & body tags) in the body of the page.), when the page displays, instead of seeing my poll, I get this fragment:

    poll_process(4); ?>

    It appears that the processor can't read anything beyond the -> in the code. Does this make sense to anyone? I have another PHP application, a weblog, running on this same server/domain. Could that be interfering somehow? I don't have a lot of experience with the guts of PHP, but it seems strange I was able to install the PHP based administration interface to this poll application without trouble and now the PHP won't work on the business end of things.

    Thanks for any help!
    Susan

  2. #2
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    Welcome to the forums

    My guess would be the problem code is the "->". It is probably seeing this as a comment even though it is only the ending part of a comment tag. Remove the dash and let us know how it goes.

    Dave

  3. #3
    Zaire's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Mar 2001
    Location
    Hamburg, NY
    Posts
    312
    How about a link to your page, I would like to take a look..

    Also, if it IS being read as a comment, then PHP or something else isn't working properly.


    Eric

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hello.

    We could do with a copy of booth.php to play with. Is this sympoll? Or some other poll software?

    Offhand, it looks like the script is trying to access an object that has not been substantiated, therefore is just echoing what should be the method, with a blank variable before it. I don't think its a problem with php, just a typo somewhere.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  5. #5
    Zaire's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Mar 2001
    Location
    Hamburg, NY
    Posts
    312
    Dean, if he was trying to access a non-existant object, he would get an error, not a -> sign...

  6. #6
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    like this one -

    Fatal error:
    Call to a member function on a non-object in test.php on line 2
    I don't think there is anything wrong with php, tho. I think this is a typo. hmm.
    Would love to see that source code.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  7. #7
    nitewing's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Sep 2002
    Location
    Panama City, Florida
    Posts
    139
    I guess the problem has already been solved but my guess is the white space between the html and the php code...according to what I have been studying, that is a not done.

    Won't go any further as this is an older thread and probably already fixed.

    nitewing
    Ann/nitewing

  8. #8
    Papp's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2004
    Posts
    2

    Question

    Quote Originally Posted by pesky
    Hi there,
    I've installed an advanced PHP based poll script on my server. I've gotten the mySQL part of it working just fine, and everything seems peachy--except that when I follow the exact instructions in the poll app, the code won't work on the page.

    The app asks me to insert the following code into my page:
    <?php
    // Important! You have to include it before your html code
    include_once "/www/mackerelstreet/poll/poll_cookie.php";
    ?>

    <html>
    <body>
    <?php
    include_once "/www/mackerelstreet/poll/booth.php";
    echo $php_poll->poll_process(4);
    ?>
    </body>
    </html>

    However, when I do this (inserting the first part at the beginning of the page, above the <html> tag, and the second part (minus the html & body tags) in the body of the page.), when the page displays, instead of seeing my poll, I get this fragment:

    poll_process(4); ?>

    It appears that the processor can't read anything beyond the -> in the code. Does this make sense to anyone? I have another PHP application, a weblog, running on this same server/domain. Could that be interfering somehow? I don't have a lot of experience with the guts of PHP, but it seems strange I was able to install the PHP based administration interface to this poll application without trouble and now the PHP won't work on the business end of things.

    Thanks for any help!
    Susan

    Hey,

    I have the same problem. Can some help me to rigth down exakt code? I be glad :-)

    My code is:

    <?php
    // Important! You have to include it before your html code
    include_once "/hsphere/local/home/myname/homeadress.com/db/poll_cookie.php";
    ?>

    <html>
    <body>
    <?php
    include_once "/hsphere/local/home/myname/myadress.com/db/booth.php";
    echo $php_poll->poll_process(4);
    ?>
    </body>
    </html>

    After I have this in my site, is this only be displayed:

    poll_process(4); ?>

    Hvat aer vrong?

    Sorry my English I am from norway

    Frendley Papp
    Last edited by Papp; 03-21-2004 at 11:11 AM.

  9. #9
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    As this problem keeps occuring with this particular script, I would say you need to speak to the scripts author abojut this problem.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  10. #10
    Papp's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2004
    Posts
    2
    Hey,

    Ok, I tray jobb hard, so i se

    Thanks for your answer.

  11. #11
    derebote's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2008
    Posts
    1

    Cool Re: Help with PHP poll script

    Hi,

    Probably this reply 4 years after your problem might not be valid for you people... hehehe,

    Still I wanted to share my experience with future users of advanced poll script, as right today Ive been learning how to install it and make it work.

    First of all, try making sure you are not pasting the php code in and html document. If you you paste it in an htm or html document it wont execute alone.(See exception to the rule above)*

    Third, if your server allows you tu run php, then you may insert an I-frame in the webpage you want your poll to appear. The i-frame may refer to a file named mycode.php or something like that. In that page mycode.php you include the code that you find in the admin section of the Advanced Poll script, for the poll that you created. Remember to include just like it appears.

    *Exception to the rule: There are other alternatives, you can put the php code into an html file if you previously add some text in your .htaccess file. Try finding in google about this as I cannot find exactly what you needed to configure in the .htaccess file. Take into account that this function may slow down your server response, still try finding out more about this in google.

    I think that the main reason that it appears that text in your browser is because you included the php code in an html file. That happened to me today!

    Hope this helps you solve your problem or at least guides you to a solution,

    Success,

    Martin



Tags for this Thread