/    Sign up×
Community /Pin to ProfileBookmark

Some javascript help needed

I have a code here

<script language=”javascript”><!–//
var hello_id = 1234;
//–></script>
<script type=”text/javascript” src=”http://www.examplesite.com/show.php“>
</script>

What I want to do is get the value of var hello_id to be accessed in the show.php file.

Can someone tell me how to access that variable in the PHP code.

Thanks.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991Jul 02.2008 — The only way to access it in PHP, is to pass it as a GET variable.<i>
</i>&lt;script type="text/javascript" src="http://www.examplesite.com/show.php?hello_id=1234"&gt;

Just as a side note, don't use HTML comments inside script tags. It was originally intended to hide the code from non-JavaScript browsers of which there are none now. It only leads to problems now.
×

Success!

Help @ruuz 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 6.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...