Ok here goes although you may find this request a little odd.
What i would like is some code i can put on my index page that displays a box and a number of current people browsing my site, however i dont want it to be current users i would like it to be a made up number to look like there ara a lot of people browsing my site because at the moment ther isnt any.
I know this sounds odd but it would really help me out.
cheers
Strange but i need it.
Started by mandriva, Sep 25 2007 06:57 AM
4 replies to this topic
#1
Posted 25 September 2007 - 06:57 AM
|
|
|
#2
Posted 25 September 2007 - 07:43 AM
You can easily do this in PHP. You just need to get a random number and output it. Then, when somebody refreshes your website they will see a new number indicating how many people you want to "simulate." IMO, I think it's a bad practice to do. I don't like sites that tries to cheat its users, with incorrect information.
echo "There's currently " . rand(1, 15) . " users online right now!"; // Another alternative is mt_rand. Simply add "mt_" and it will work.
#3
Posted 25 September 2007 - 07:48 AM
Many thanks for that. I hear what you are saying and its something i have really tried to avoid. I have a good website and need people to advertise on it to make money. Feedback from people who want to advertise are that there isnt enough advertisements on the site hence i need something to sway them and a faked number maybe the way to start my business off.
#4
Guest_Jordan_*
Posted 26 September 2007 - 05:40 AM
Guest_Jordan_*
If you don't like the idea of using PHP you can always use JavaScript although anyone smart enough will be able to see the code and recognize that you are not actually calculating current users. PHP would be your best bet.
[HIGHLIGHT="JavaScript"]There are currently <script type="text/javascript">document.write(Math.floor(Math.random()*200))</script> browsing this site.[/HIGHLIGHT]
[HIGHLIGHT="JavaScript"]There are currently <script type="text/javascript">document.write(Math.floor(Math.random()*200))</script> browsing this site.[/HIGHLIGHT]
#5
Guest_Kaabi_*
Posted 10 November 2007 - 09:29 AM
Guest_Kaabi_*
The random number you would generate would have to be a relatively short interval, as jumping from 5,000 to 12,000 in a page refresh would look "sketch".


Sign In
Create Account


Back to top









