473,499 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing data from java to a PHP script

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=fil e1");
}
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
Jul 17 '05 #1
3 4328
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=fil e1");
}
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.


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.1 14.11
..32.13.112.101.114.108.11.32.13.104.97.99.107.101 .114.10.7'
Jul 17 '05 #2
function popup(folder1, file1)
{
window1=open("solution.php?folder=" + folder1 + "&file=" + file1);
}

Jul 17 '05 #3
Thanks for the reply. The absence of the "+" and spaces between the
elements caused the error. Now I nave corrected it as suggested by you,
window1=open("solution.php?folder="+folder1+"&file ="+file1); and is
working fine.

Regards,
Raju

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3462
by: Andy R. | last post by:
Hello everyone, I've spent quite some time now, looking for some information on how to get this done, sadly none has helped me much, though. I have a bit of java scrpt on a webpage (.php) to...
4
8049
by: timwap | last post by:
I hava a Java Applet that produces a DTMF tone at a certain time of day. There are 4 parameters to the Applet, they are hour = Hour of triggered event 00~23 min = minute of triggered event 00~59...
10
2445
by: vbMark | last post by:
Hello, I am doing this: window.location="page2.php?subj="+subj+"&body="+body; to send information to another page. However, I don't want that second page to show up or display in any way....
11
3072
by: comp.lang.php | last post by:
On one of my sites, I have a TCL CGI script that has a security hole in spite of it having effective server-side validation (the fact that it's CGI IS its security hole). The front end is a PHP...
4
3340
by: jos | last post by:
Hi There, What would be suitable options to exchange data between a Dot net program and a java program? Thanks Jyotsna Sharan
7
11041
by: Oleg Konovalov | last post by:
Hi, I am trying to pass a bunch of checked checkboxes (Javascript array) from page1 to the Java action class on subsequent web page (page2). (on page 1 I have a bunch of DB rows with a checkbox,...
1
2471
by: Eric Capps | last post by:
This may be more of a Java question, but I feel that JavaScript experts may be more qualified to help me find a solution. In short: is it possible to call a Java method from JavaScript, passing...
2
1941
satterfieldben
by: satterfieldben | last post by:
I have a newbie question about passing variables between functions. I am wanting to use a drop down box to select a value. Then base on which was selected, it would create a variable and I would...
8
1882
by: pt36 | last post by:
I have two pages one.html two.html page one.html have a form named form1 and a textarea named text1 man one write in the textarea text 1 page two.html have a form named form2 and a...
0
7128
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7215
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7385
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5467
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4917
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.