View Single Post
Old 04-04-2009, 05:03 PM   #1 (permalink)
pipesportugal
The Contributor
 
pipesportugal's Avatar
 
Join Date: May 2008
Location: Oporto-Portugal
Posts: 32
Thanks: 11
pipesportugal is on a distinguished road
Default passing a java variable to php

Hello dear colleagues from the TalkPHP forum,

I often use the "alert" java function in the middle of PHP programs in order to display variables on screen as shown below.

PHP Code:
echo("<script>window.alert('var= ".$var."')</script>"); 
Now I wanted to use the "confirm" javascript function inside of a "for" cycle, so that if I click the OK the cycle should keep going on otherwise if I would click on the cancel there would be an exit from the "for" cycle (like the php break; function).

PHP Code:
echo("<script>window.confirm('var= ".$var."')</script>"); 
Can someone tell me how I can achieve this ?

Thanks in advance to all the help,
pipesportugal
pipesportugal is offline  
Reply With Quote