Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Dec 2003
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP code incorrect?

    Hi, can anyone see whats wrong with this bit of code?
    The poll.php file is not showing on my browser although it's uploaded.
    I'm assuming some simple php code is missing.
    Sorry, PHP is not my strong point!

    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <table width="100%" border="0" cellpadding="0">
    <tr>
    <td>


    <? php include("poll/AJpoll_path/poll.php"); ?>


    </td>
    </tr>
    </table>

    </body>
    </html>

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Nothing is wrong with the code, make sure the path and permissions are correct.

  • #3
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Actually there is something wrong, in your opening php tag you have a space between "<?" and "php". <?php is right, <? php is wrong.

  • #4
    New Coder
    Join Date
    Dec 2003
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Guys, thanks for replying!

    I've tried it both ways and there's still nothing showing.
    Below is the code when I select: "View" then "Source" when I have the page open:
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <table width="100%" border="0" cellpadding="0">
    <tr>
    <td>

    </td>
    </tr>
    </table>

    </body>
    </html>


    The php code isn't even showing.
    This is what the "Read me" file says:

    .: Installation & Usage:
    --------------------------------------------------------------------------------
    1. Download AJPOll and edit the config.php file to suite your needs.

    2. Place the files anywhere in your web directory:
    All files must be placed in the same directory observing directory structure.
    Set the attributes of the file "txtdb.ini.php" to 666 (meaning read and write access for all parties).

    3. Open up your webbrowser to:

    http://www.yourserver.com/poll/setup.php

    Default user id & password are: admin, admin.
    You can change default values in the "config.php" file.

    The script will check database-file (and if is writable) then will show the admin panel to create and edit your poll.

    4. In the page you want the poll displayed use this code (must be php file):

    <?php include("AJpoll_path/poll.php"); ?>


    I've created the poll and saved the page for the poll as a .php file as advised above (No. 4)
    In No.2 it advises setting the "attributes" of the file "txtdb.ini.php" to 666. I changed "Pollid" to 666. There was no setting for "attributes", only the poll question and answer.
    And here's the page download page:
    http://www.ajsquare.com/free%20scripts/poll.php#

    Any help is greatly appreciated!

  • #5
    New Coder
    Join Date
    Dec 2003
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Got it!
    The file pathway is poll/poll.php!
    Silly me!

  • #6
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Try using require instead of include. If the php file is not where it's supposed to be you'll at least get an error that way.

    Also I should point out the author's instructions say do <?php include("AJpoll_path/poll.php"); ?>, but you did <?php include("poll/AJpoll_path/poll.php"); ?>

    And did you really create a directory called AJpoll_path? I'm thinking you should just be using poll/poll.php, but since I'm not there I don't really know.

    EDIT: D'oh! Too slow

  • #7
    New Coder
    Join Date
    Dec 2003
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Fumigator!
    Yes I was looking everywhere for that directory!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •