![]() | ![]() | ![]() |
| |||||||
| Forums | Register | Groups | Awards | Arcade | Pets | T-Bucks / T-Store | Invite Your Friends | All Albums | Projects | Blogs | Mark Forums Read |
| Web Design Forums and discussions on webdesign |
Web Design | |||||||||
|
|
|
|
| |||||
![]() |
| | LinkBack | Thread Tools |
| | #8 (permalink) |
| Civilians | "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 Canadian Coordinator, Degree Confluence Project http://www.confluence.org/ My website: http://members.shaw.ca/davepatton/ |
|
| | #9 (permalink) |
| Civilians | "Gerry for email use my name at dergal dt com" <sales@exleaseit.co.uk> wrote in message news:Q8KMd.288$V84.246@newsfe3-win.ntli.net... > 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 Thanks Gerry, no unfortunately the homepage links need to be same...I was thinking along the cookie lines but have created one of those yet... thanks plato |
|
| | #10 (permalink) |
| Civilians | plato wrote: > 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. Javascript should do this: if (some cookie is not set) { do your stuff; set the cookie; } Of course, you'll probably want to figure out something to do with people who have cookies disabled. -- Toby A Inkster BSc (Hons) ARCS Contact Me ~ http://tobyinkster.co.uk/contact |
|
![]() |
| 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 |
![]() | ![]() | ![]() |