Jump to content

Passing through PHP code


graham23s

Recommended Posts

Hi Guys,

 

I'm not sure if this is more PHP or a javascript problem (both really) i'm trying to pass a url to a javascript function using php.

 

code:

 

<a href="#" onclick="payScreenPopup(<?php print 1; ?>);"><img src="img/img-button.gif" border="0"></a>

 

function payScreenPopup(affURL)
{
alert(affURL);
var l   = screen.availWidth / 2 - 450;
var t   = screen.availHeight / 2 - 320;
var win = window.open(affURL, 'papPopupMain', 'width=900,height=650,left='+l+',top='+t+',scrollbars=1');
}

 

The problem is numbers get through and are alerted fine, but when i try any kind of text it doesn't seem to get through and popup, i'm not sure if it's something i need to do on the php side of things or javascript.

 

any help would be appreciated

 

thank guys

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/169748-passing-through-php-code/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.