Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

use php var in javascript

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

use php var in javascript

Postby crue » Thu Jun 26, 2003 12:54 pm

Hi,

I have a button called 'view' and as I click it, I want to dynamically generate a pop-up window whose content from some php var........
I tried: (inside php file)
<?php
$temp = "pic.jpg";
?>
<input type='submit' value='view' OnClick="window.open('<?php $temp ?>','myWindow')">
It failed......................

thanx,
crue
crue
New php-forum User
New php-forum User
 
Posts: 9
Joined: Sun Jun 22, 2003 6:51 pm

Postby liquedus » Thu Jun 26, 2003 12:57 pm

<input type='submit' value='view' OnClick="window.open('<?php echo $temp; ?>','myWindow')">

enjoy! :D
liquedus
php-forum Active User
php-forum Active User
 
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada

Postby crue » Thu Jun 26, 2003 1:53 pm

I can't believe I missed that.......

thank's liquedus,
it works fine now
crue
New php-forum User
New php-forum User
 
Posts: 9
Joined: Sun Jun 22, 2003 6:51 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron