/    Sign up×
Community /Pin to ProfileBookmark

2 of the same scripts, one page

I have two of the same countdown scripts counting down to different times on one page. Only the first one shows up. Did i do some thing wrong? ?
Heres the body:

[code=php]<script language=”JavaScript” src=”dfcounter.php” type=”text/javascript”></script>
<script language=”JavaScript” src=”dfcounter.php” type=”text/javascript”></script>[/code]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@blue-eye-labsAug 07.2010 — The browser is probably ignoring the second one. Put a noCache string in like:

[CODE]
$url = sprintf("/myscript.php?noCache=%s", time() + rand(0,10));
[/CODE]


How you generate your number is irrelevant for only two requests, you could even use 1 and 2 just to keep them separate, or uniqid() or something for assured randomness...

Just use 1 and 2:
[CODE]
<script language="JavaScript" src="dfcounter.php?var=1" type="text/javascript"></script>
<script language="JavaScript" src="dfcounter.php?var=2" type="text/javascript"></script>
[/CODE]
Copy linkTweet thisAlerts:
@criterion9Aug 07.2010 — 
I have two of the same countdown scripts counting down to different times on one page.
[/quote]

How does your PHP script know which time you are trying to count down to?
×

Success!

Help @ZZY spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...