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

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Nov 2004
Posts: 62
Reputation: 2ndPlatform is an unknown quantity at this point 
Solved Threads: 0
2ndPlatform's Avatar
2ndPlatform 2ndPlatform is offline Offline
Junior Poster in Training

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

 
0
  #1
Sep 3rd, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 1,655
Reputation: tgreer is an unknown quantity at this point 
Solved Threads: 35
Team Colleague
tgreer tgreer is offline Offline
Made Her Cry

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

 
0
  #2
Sep 4th, 2005
You want to turn a QueryString argument into a PHP variable?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC