...

View Full Version : PHP code incorrect?



BK123
03-06-2007, 10:04 PM
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>

Inigoesdr
03-06-2007, 10:07 PM
Nothing is wrong with the code, make sure the path and permissions are correct.

Fumigator
03-06-2007, 10:09 PM
Actually there is something wrong, in your opening php tag you have a space between "<?" and "php". <?php is right, <? php is wrong.

BK123
03-06-2007, 10:25 PM
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!;)

BK123
03-06-2007, 10:30 PM
Got it!
The file pathway is poll/poll.php!
Silly me!:o

Fumigator
03-06-2007, 10:31 PM
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 :D

BK123
03-06-2007, 10:56 PM
Thanks Fumigator!
Yes I was looking everywhere for that directory!:D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum