| | |
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
![]() |
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 -
But I need to get 'referringURL' into that PHP file.
Any suggestions?
Thanks.
<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)
<script> if (document.referrer) { var referringURL = document.referrer; } else { var referringURL = "No referrer." } </script>
But I need to get 'referringURL' into that PHP file.
Any suggestions?
Thanks.
Web Design in Wisconsin : Milwaukee Web Design : Second Platform
![]() |
Similar Threads
- Pass Javascript variable to PHP code (PHP)
- Learning PHP but problem with script (PHP)
- Problem with javascript variable and hidden input (ASP.NET)
- javascript variable in jsp session (JSP)
- How to store javascript variable in jsp session (JSP)
- How Can I Pass A PHP Variable From One .php page to another (PHP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Simple number...
- Next Thread: Can javascript do session variables?
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
ajax ajaxexample ajaxjspservlets api autoplay blackjack browser bug captchaformproblem checkbox child class close codes cookies createrange() cursor date debugger dependent developer disablefirebug dom dropdown editor element embed engine events explorer ext file flash form forms game getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe images internet java javascript javascripthelp2020 jquery jsf jsfile jump libcurl maps math matrixcaptcha media mp3 mysql object onerror onmouseoutdivproblem onreadystatechange parent passing paypal pdf php player position post programming progressbar rated runtime safari scriptlets scroll search security session shopping size software star stars stretch synchronous tweet unicode variables web webkit webservice window wysiwyg \n






