Hello, I am trying to get php to echo a javascript script. Here's what Im trying to do. I have 3 parts. I am using javascript to remotely call a php file like this:
<script language="JavaScript" src="check.php?id=777
</script>
This is located on just about all my html pages. And it sends the value for id and the php file checks to see if that is a registered user number.
Now what I want this php file to do after getting and going through its if statements is to echo javascript: I want a new window to pop up with specific height and width. Im sure this is the correct javascript code to so this. Since its being called remotely I leave out the <Script> tags also the variable with the dollar sign is there since php will parse it:
document.write( "<A HREF=members/index.php?$id onClick=\"window.open('members/index.php?$id', 'Member Check', 'width=400,height=500,resizable=yes,scrollbars=yes'); return false;\"> Check If Name Is in Use</A>" );
I need the false there so the current page does not change.
Now I have serious problems when I put that into a php echo statement like so. As you see I used the backlashes but still I can't get it to come up without a problem I know I need to change something but my javascript skills aren't great so I just can't figure it Out thanks in advance. Also here is how I attempt to echo it. I have tried many other variants but theres to many to post. they all haven't worked tho.
<?php
echo "document.write( "<A HREF=members/index.php?$id onClick=\"window.open('members/index.php?$id', 'Member Check', 'width=400,height=500,resizable=yes,scrollbars=yes'); return false;\"> Check If Name Is in Use</A>" );";
?>
Thanks for all the help.
Kyle