I have been working on a website that is heavily reliant on some basic PHP scripts (Randomurl, Multiple counters, Reccomend & a Submission script). Everything worked fine while I had the site hosted as a test on a friends server, now that the site is 95% finished I needed to find a more permanent home for the site and as I dont want to have to pay for my "little project" I have setup a free hosting account with www.f2s.com.
Now the problem is none of my scripts seem to work any except the randomurl script, and I have no idea as to why, so any contributions or suggestions would be greatly appreciated.
The urls are as follows
this is the main page, and for example, at the top it should count the amount of visitors to that page (X portals served since 27-02-2001), also if you click on the Submit or Tell a friend these dont work either.
Is the randomurl script which seems to work fine
Is a non PHP server where there is copies of all the scripts and files used for the website.
One thing I forgot to mention is that are have triple checked all the various file permissions and they are fine.
In fact i have gone as far as setting everything to 777
they all worked for me fine, p.s. i like the site desing you got there.
So at the top where it says :
portals served since 27-02-2001 - RandomPortal Statistics
it actually gives you a number??? try clicking on the Statistics links to see if the popup window has the counts in them, cos they dont show for me
no the stats don't show
but i get portals served since 27-02-2001 - RandomPortal Statistics
These are the statistics for the RandomPortal.com, as you can see things can sometimes be a little busy round here!
Portals served :
Friends recommended :
Portal submitted :
Portals in the database :
User configurations :
Visitors to the main page :
Visitors to the Stats page :
These are the current stats running since 27-02-2001
and the tell a friend thing worked as well.
If you get the same as me, everything will seem to go through fine on the "tell a friend" and the "Submit a portal" scripts but the relevant emails wont get to the relevant people, i.e. if you recommend randomportal to somebody as it is now, they wont get the email even though the server reports that it was fine
On the counters the actual syntax on the page is this :
<?php virtual("count_portals.txt"); ?> portals served since 27-02-2001
Which should just include the value in the TXT files, which it does, if I manually add a number to the file, but the actuall counter script doesnt work
Any ideas on what may be causing this problem???
BTW thanks for the comments on the design :)
no idea, assuming as you say it is not a permission error 777 would be needed if you are writing to the file.
not sure if fs2 have put some strange limits on what you can do... don't know...
Where can we find the script that generates count_portals.txt ? Also on an unrelated note, use include() instead of virtual()
Also www.f2s.com uses php in safe mode, not sure if that is the cause of your problem though
This script that does the counting for the count_portals.txt is located at :
Is a copy of exactly the same script on a non PHP server, so the actual coding is visible there
is the working (hmmm) script
Your problem probably stems from th fact that you are using virtual() - this is an Apache specific function and will not work on non-apache servers, or servers where this functionality has been disabled.
You should use include() instead, as Philip Olsen said :)
I am not sure if that is thew case, as the counting script is called by using the following command (as per the readme, and it worked fine on another server) :
<? $type = "q"; include("count_stats.php"); ?>
So this should call the PHP script which then opens a text file (in this case count_stats.txt) and adds a number to it, if I run the scripts and visit the pages multiple times then get the count (txt) file from the server there is nothing in it, which is why it doesnt show. Which is why if I manually add a number to the TXT file it does work even if I use Include() or Virtual(). So basically the script isnt counting.