GetDotted Domains

Viewing Thread:
"php help"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Sat 02/03/02 at 21:37
Regular
Posts: 787
Can anyone please help. I have copied the coding from freeola help pages to display a counter on my site using php. I pasted it into my html code and renamed the file using .php extention when I upload this page all I can see is the code being displayed. What am I doing wrong?
Mon 04/03/02 at 14:01
Regular
"Eff, you see, kay?"
Posts: 14,156
Line 29:

for ($i = 0; $i < strlen($hits); $i++) {

should be:

for ($i = 0; $i < strlen($hits); $i++) {
Mon 04/03/02 at 11:05
Posts: 0
Hi Guys have done as you sujested now have this displayed
Parse error: parse error, expecting `')'' in /freeola/users/6/1/sr0143116/htdocs/test/testcnt.php on line 29
Mon 04/03/02 at 01:35
Regular
"It goes so quickly"
Posts: 4,083
Turbonutter wrote: Incorrect Chris! Look at the source!

I see what you mean, I missed that first time ..... it's late, lol.
Mon 04/03/02 at 01:34
Regular
"It goes so quickly"
Posts: 4,083
Copy the code below, and paste it into NotePad, and save it as a .php file.

--------------------------------------------------------------


hello to you




You are visitor no.
$counterstyle = "image";
$invisible = "no";
$height = "19";
$width = "15";
$hitsfile = "";
$images = "http://registration.freeola.net/user_includes/phpcounter";
if (!$hitsfile)
$hitsfile = dirname(__FILE__)."/hits";
if (!$images) $images =
dirname(__FILE__)."/images";
$images = str_replace($DOCUMENT_ROOT, "", $images);
if(file_exists($hitsfile) == TRUE) {
$hits = file($hitsfile);
$hits = $hits[0] + 1;
} else {
$hits = 1;
}
$fp = fopen($hitsfile, "w");
fwrite($fp, $hits);
if ($invisible != "yes") {
if ($counterstyle == "text") {
print $hits;
} else {
$digit = strval($hits);
for ($i = 0; $i < strlen($hits); $i++) {
print "$hits";
}
}
}
?> to my site.




--------------------------------------------------------------


Upload and try that :o)

Mon 04/03/02 at 01:34
Regular
"Eff, you see, kay?"
Posts: 14,156
Incorrect Chris! Look at the source!
Mon 04/03/02 at 01:28
Regular
"It goes so quickly"
Posts: 4,083
Theres yor problem, the .html on the end.

You need to make sure the file is just called "testcnt.php" and not "testcnt.php.html"
Mon 04/03/02 at 01:26
Regular
"Eff, you see, kay?"
Posts: 14,156
Problems:

The file should have the extension ".php". NOT ".php.html", or any variants. ONLY ".php".

Secondly, you've somehow converted the < and > characters to their HTML escaped versions. This is used so you can actually display these < and > characters without confusing the browser thinking they're tags. Look at the source, you can see a lot of < and > things all over the place. These *MUST* be converted to < and > properly:

$lt; = <

$gt; = >

Finally, if I were you I'd give your HTML program (Front Page?) a good kick up the anus, preferably in the direction of the recycle bin.
Sun 03/03/02 at 22:05
Posts: 0
Thanks for help. I am uploading to htdocs and I think the tags are in place. url is http://www.thedesigndetectives.co.uk/test/testcnt.php.html have also tried without html should be empty test page with counter
Sun 03/03/02 at 17:25
Regular
"It goes so quickly"
Posts: 4,083
When you say you renamed the file with a .php extension, check that it worked ok. Sometimes, if you just right click a file and rename it, it keeps it's original extension, so you might have a file called "whatever.php.html". Go into the notepad and save it again, and put the speech marks eaither side of the name: "file.php" that will ensure it's a proper PHP file.

Also, did you try and alter the code in any way???
Sat 02/03/02 at 23:33
Regular
"Eff, you see, kay?"
Posts: 14,156
Are you uploading it to the htdocs/ folder, or the cgi-bin? What's the URL? Also, have you enclosed it in the tags? It really does need those.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

I am delighted.
Brilliant! As usual the careful and intuitive production that Freeola puts into everything it sets out to do. I am delighted.
Very pleased
Very pleased with the help given by your staff. They explained technical details in an easy way and were patient when providing information to a non expert like me.

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.