Debt Consolidation - Debt Consolidation - Lyrics - Debt Consolidation - Wordpress Themes

PDA

View Full Version : Sending some var to php file (problem please help)


nikolaaa
Apr 10th 2007, 9:04 am
I'm calling my remote php script with

<script language="JavaScript" src="myscript.php" type="text/javascript"></script>


But now I want to call my php script like this:
myscript.php?url=URL OF PAGE

Url of page I got with:
var url = window.location.href;

but now how to do something like this:

<script language="JavaScript" >
var url = window.location.href;
</script>
<script language="JavaScript" src="myscript.php?url="+url type="text/javascript"></script>

This doesnt work.
Please help me.

nico_swd
Apr 10th 2007, 9:39 am
<script type="text/javascript">
var image = new Image();
image.src = 'myscript.php?url=' + window.location.href;
</script>

nikolaaa
Apr 10th 2007, 9:42 am
That doesnt work.
My php file return chars:
echo 'document.write (\'SOME CONTENT\')';

bibel
Apr 10th 2007, 12:42 pm
Why don't you use ajax. It seems the best sollution for what you want to do