For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > January 2005 > Passing data from java to a PHP script









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Passing data from java to a PHP script
Raju V.K

2005-01-27, 8:55 am

can I use javascript and PHP in the following manner to create a
pop-up window:

<--- in <head> </head>
<script language=javascript>

function popup(folder1, file1)
{
window1=open("solution.php?folder=folder1&file=file1");
}


In the body:
<?
echo "<a href = \"javascript:popup(folder, file)\"> show me the
solution</a>";

?>

the file is saved as a php file. My purpose is to have a popup window
generated using the values of folder and file. I can work with the
normal way that is without popup. But with popup, the javascript is
not seems to be working. Is the error is with PHP code or java script
code? Generally how do I can pass the parameter in such a situation ?

The popup is working without passing the parameter to a PHP script in
the server, so that the link is created from the page itself like
"folder/file", and passing it to the java script.

regards,

Raju
Martin Kissner

2005-01-27, 8:55 am

Raju V.K wrote :
> can I use javascript and PHP in the following manner to create a
> pop-up window:
>
><--- in <head> </head>
><script language=javascript>
>
> function popup(folder1, file1)
> {
> window1=open("solution.php?folder=folder1&file=file1");
> }
>
>
> In the body:
><?
> echo "<a href = \"java script:popup(folder, file)\"> show me the
> solution</a>";
>
> ?>
>
> the file is saved as a php file. My purpose is to have a popup window
> generated using the values of folder and file. I can work with the
> normal way that is without popup. But with popup, the javascript is
> not seems to be working. Is the error is with PHP code or java script
> code? Generally how do I can pass the parameter in such a situation ?
>
> The popup is working without passing the parameter to a PHP script in
> the server, so that the link is created from the page itself like
> "folder/file", and passing it to the java script.


I don't know much about java script.
But I guess you should keep in mind, tha php works on the webserver
while java script works on the client so possibilities of interaction
might be poor.

HTH
Martin

--
perl -e 'print 7.74.117.115.116.11.32.13.97.110.111.116.104.101.114.11
..32.13.112.101.114.108.11.32.13.104.97.99.107.101.114.10.7'
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com