Jump to content


Photo

PHP timer question please.


  • Please log in to reply
5 replies to this topic

#1 Rianna

Rianna
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 09 September 2006 - 11:55 PM

Hello, I prefer using php but someone said you can't rotate ads on a timer using php, you have to use javascript, is that true?

Thank you very much!

#2 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 10 September 2006 - 12:08 AM

PHP is server side, so Nothing will happen to ur site without a reload
You will need to use Client Side Scripting (Javascript for example)
Tell me the problem, I will try tell you the solution

#3 Rianna

Rianna
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 10 September 2006 - 10:11 AM

Is javascript the only option, will any other scripts that you know of do it as well? Trying to avoid javascript for a few reasons. Thanks.

#4 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 10 September 2006 - 10:21 AM

Surely rotating ads on a timer is a bad idea.

If I go to a page with a banner at the top and I scroll down to read that page, it's going to make no sense if that banner changes to something else after five minutes, as I won't be able to see it.

I think you'd be better coding the server-side to deal with which banner's are shown when, and just have the front-end display them.  It means not having to use JavaScript and probably better control over what's seen where and when.

There's some examples of such here that maybe able to give you a few ideas.

Regards
Rich
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#5 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 10 September 2006 - 11:02 AM

What I would do on the advertisments, is have each add, with a id Number
then using the rand() function, randomly select a number every page load
then every time the page loads, a random add is shown to the user
Tell me the problem, I will try tell you the solution

#6 Rianna

Rianna
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 10 September 2006 - 12:28 PM

OK, I get what you mean, I should have also said text. If I want the text to change, I have some odd things going on, on my pages so I will need it. What about it? Javascript the only good second, minute, and even hour timers? Thanks much for the thinking outside the box, anyway as you both do. ;) Its appreciated.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users