SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Hybrid View

  1. #1
    Non-Member
    Join Date
    Feb 2001
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    http://www.randomportal.f2s.com
    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.

    http://www.randomportal.f2s.com/games/
    Is the randomurl script which seems to work fine

    http://www.randomportal.btinternet.co.uk
    Is a non PHP server where there is copies of all the scripts and files used for the website.

  2. #2
    Non-Member
    Join Date
    Feb 2001
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    Last edited by WiseBuddha; Apr 18, 2001 at 18:48.

  3. #3
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    they all worked for me fine, p.s. i like the site desing you got there.

  4. #4
    Non-Member
    Join Date
    Feb 2001
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  5. #5
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no the stats don't show

    Code:
    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
    but i get portals served since 27-02-2001 - RandomPortal Statistics

    and the tell a friend thing worked as well.

  6. #6
    Non-Member
    Join Date
    Feb 2001
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    Last edited by WiseBuddha; Apr 18, 2001 at 18:43.

  7. #7
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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...

    sorry..

  8. #8
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    Washington State
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where can we find the script that generates count_portals.txt ? Also on an unrelated note, use include() instead of virtual()

  9. #9
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also www.f2s.com uses php in safe mode, not sure if that is the cause of your problem though
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  10. #10
    Non-Member
    Join Date
    Feb 2001
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This script that does the counting for the count_portals.txt is located at :

    http://www.randomportal.btinternet.c...nt_portals.php
    Is a copy of exactly the same script on a non PHP server, so the actual coding is visible there

    http://www.randomportal.f2s.com/count_portals.php
    is the working (hmmm) script

  11. #11
    SitePoint Columnist Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  12. #12
    Non-Member
    Join Date
    Feb 2001
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.


Bookmarks

Posting Permissions

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