passing GET variable with javascript

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
bluesman333
Forum Commoner
Posts: 52
Joined: Wed Dec 31, 2003 9:47 am

passing GET variable with javascript

Post by bluesman333 »

This doesn't work:

Code: Select all

<?php

print
"<a href= "javascript:newWindow()"?Date=today>Link to New Page</a><br>";


?>
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

User avatar
bluesman333
Forum Commoner
Posts: 52
Joined: Wed Dec 31, 2003 9:47 am

Post by bluesman333 »

No that didn't help me.

I'm using a javascript function that opens a new window. The function is being used on a calandar, where each data has a link to a new window. I want to pass a GET variable to the new window.

but this does not work:

Code: Select all

<?php

print 
"<a href= "javascript:newWindow()"?Date=today>Link to New Page</a><br>"; 


?>

?>
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post by microthick »

Yep. That doesn't work. It has no chance of working.

Instead, pass the parameter you want to include into the URL to the newWindow() function.

Or get your new window function to add it on it's own.
Post Reply