943,733 Members | Top Members by Rank

Ad:
Sep 3rd, 2005
0

Passing a Javascript variable to a PHP using <script> call

Expand Post »
Alright - I'm stumped. I need to get a variable from file1.html to file2.php which is called like this from file1.html:

<script src="scripts/file2.php" type="text/javascript"></script>

In file1.html I have the variable definition to grab the referring URL -

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <script>
  2. if (document.referrer) {
  3. var referringURL = document.referrer;
  4. } else {
  5. var referringURL = "No referrer."
  6. }
  7. </script>

But I need to get 'referringURL' into that PHP file.

Any suggestions?

Thanks.
Similar Threads
Reputation Points: 15
Solved Threads: 0
Junior Poster in Training
2ndPlatform is offline Offline
61 posts
since Nov 2004
Sep 4th, 2005
0

Re: Passing a Javascript variable to a PHP using <script> call

You want to turn a QueryString argument into a PHP variable?
Team Colleague
Reputation Points: 227
Solved Threads: 37
Made Her Cry
tgreer is offline Offline
1,697 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Simple number...
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Can javascript do session variables?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC