![]() | ![]() | ![]() |
| |||||||
| Forums | Register | Groups | Awards | Arcade | Pets | T-Bucks / T-Store | Invite Your Friends | Blogs | Mark Forums Read |
| Web Design Forums and discussions on webdesign |
Web Design | |||||||||
|
|
|
|
| |||||
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Civilians | My site is predominantly php...photo gallery... and the index page displays thumbs ( at random) from each of the 20 galleries. When people click on a gallery they go to that gallery to look at paintings and ultimately come back to Home which is the index page. I want to run a javascript on the index page that will only run when they arrive at the site, not again when they return to the index page... can someone tell me how I accomplish this. cheers Plato |
|
| | #2 (permalink) |
| Civilians | plato wrote: > My site is predominantly php...photo gallery... and the index page displays > thumbs ( at random) from each of the 20 galleries. When people click on a > gallery they go to that gallery to look at paintings and ultimately come > back to Home which is the index page. > > I want to run a javascript on the index page that will only run when they > arrive at the site, not again when they return to the index page... can > someone tell me how I accomplish this. > > cheers > > Plato > > Completely honestly - you can't ... However by checking against IP addresses, or cookies you sort of can - i.e. create a cookie, Alternatively - could all your "homepage" links be a different homepage? G |
|
| | #3 (permalink) |
| Civilians | use a php query string on the index page?... if ($HTTP_GET_VARS['giver']) { echo $javascript_code; } or you could always an index2.html page or something... the page will be exactly like index.html, but without the javascript. And put the link to index2.html on all of the other pages instead of index.html so no one goes back to it. hope this helps. -Ryan "plato" <platoTAKETHISOUT@telpacific.com.au> wrote in message news:42036279@news.rivernet.com.au... > My site is predominantly php...photo gallery... and the index page > displays > thumbs ( at random) from each of the 20 galleries. When people click on a > gallery they go to that gallery to look at paintings and ultimately come > back to Home which is the index page. > > I want to run a javascript on the index page that will only run when they > arrive at the site, not again when they return to the index page... can > someone tell me how I accomplish this. > > cheers > > Plato > > |
|
| | #4 (permalink) |
| Civilians | "plato" <platoTAKETHISOUT@telpacific.com.au> wrote in message news:42036279@news.rivernet.com.au... > My site is predominantly php...photo gallery... and the index page > displays > thumbs ( at random) from each of the 20 galleries. When people click on a > gallery they go to that gallery to look at paintings and ultimately come > back to Home which is the index page. > > I want to run a javascript on the index page that will only run when they > arrive at the site, not again when they return to the index page... can > someone tell me how I accomplish this. The easy way to do it is just have index.php as the page you want them to see at the start, and then have all links to your home page point at home.php, for example. Otherwise you are going to have to either use cookies or keep a record of their IP address and look it up every time they access the page. Myself I prefer the easy approach to most situations ;-) |
|
| | #5 (permalink) |
| Civilians | Once upon a time, far far away, the king summoned "plato" <platoTAKETHISOUT@telpacific.com.au> who replied: >My site is predominantly php...photo gallery... and the index page displays >thumbs ( at random) from each of the 20 galleries. When people click on a >gallery they go to that gallery to look at paintings and ultimately come >back to Home which is the index page. > >I want to run a javascript on the index page that will only run when they >arrive at the site, not again when they return to the index page... can >someone tell me how I accomplish this. > Require them to sign in, and use strict checking to ensure they only create one account, perhaps by charging thousands of dollars. Then, you can show the gallery when they register and never again to that account! Brilliant, aint I ? What's that? Time for my lobotomy? <BG> Matt |
|
| | #6 (permalink) |
| Civilians | "Mark Hewitt" <mail@markhewittDotCoDotUk.spammers.will.die> wrote in message news:ctvvki$obr$1@ucsnew1.ncl.ac.uk... > > "plato" <platoTAKETHISOUT@telpacific.com.au> wrote in message > news:42036279@news.rivernet.com.au... > > My site is predominantly php...photo gallery... and the index page > > displays > > thumbs ( at random) from each of the 20 galleries. When people click on a > > gallery they go to that gallery to look at paintings and ultimately come > > back to Home which is the index page. > > > > I want to run a javascript on the index page that will only run when they > > arrive at the site, not again when they return to the index page... can > > someone tell me how I accomplish this. > > The easy way to do it is just have index.php as the page you want them to > see at the start, and then have all links to your home page point at > home.php, for example. > > Otherwise you are going to have to either use cookies or keep a record of > their IP address and look it up every time they access the page. Myself I > prefer the easy approach to most situations ;-) > > Thanks Mark, it seems the concensus is to make all the links except the arrival page different (ie duplicate the index page and then refer all other links back to it)...many thanks. Yes I like easy approaches also... cheers plato |
|
| | #7 (permalink) |
| Civilians | "Dave Patton" <spam@trap.invalid> wrote in message news:Xns95F35B8488D56mrzaphoddirectcaold@24.71.223 .159... > "plato" <platoTAKETHISOUT@telpacific.com.au> wrote in > news:42036279@news.rivernet.com.au: > > > My site is predominantly php...photo gallery... and the index page > > displays thumbs ( at random) from each of the 20 galleries. When > > people click on a gallery they go to that gallery to look at paintings > > and ultimately come back to Home which is the index page. > > > > I want to run a javascript on the index page that will only run when > > they arrive at the site, not again when they return to the index > > page... can someone tell me how I accomplish this. > > PHP questions would best be asked in a PHP newsgroup ;-) > > When http://www.example.com/index.php is requested, > it checks for the existance of a session variable > (e.g. "been_here_already"). If it exists, the PHP > script generates the page, without the javascript. > If the "been_here_already" session variable does > not exist, then create it, and generate the page, > including the javascript. You'll have to pay > attention to caching issues. > > Of course that is predicated on sessions, so it depends > on what you mean by "arrive at the site". > > And, as you should never be reliant on javascript anyway, > why not just have the PHP script do whatever it is you > want to do with the javascript. > > -- > Dave Patton Thanks Dave, often hard to know whether the answer lies in a php script or a simple html solution. I'm sure lots of guys here know both anyway as i regard this group as a 'mob of all rounders'... Again seems the problems of a php solution can be overcome by duplicating the index page and changing all links on site back to the mirror page and run the script only on the index page. PHP can't do what the javascript can in this instance (running msagent character) cheers plato |
|
![]() |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| simple setup for allowing visitors to choose their country | Nicole | Web Design | 8 | 10-25-2005 22:03 |
| DoD Allowing More Wounded Troops to Remain on Duty | cato2 | DOD News Services | 1 | 10-15-2004 19:59 |
| DoD Allowing More Wounded Troops to Remain on Duty | Press Service | DOD News Services | 0 | 10-14-2004 22:00 |
| F2 (Refresh) stops allowing me to overwrite after the second character | dep397 | Microsoft Applications | 4 | 06-16-2004 00:04 |
| Allowing text to overlap other cells | Scot | Microsoft Applications | 2 | 06-15-2004 16:30 |
![]() | ![]() | ![]() |