473,548 Members | 2,697 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=javasc ript>

function popup(folder1, file1)
{
window1=open("s olution.php?fol der=folder1&fil e=file1");
}
In the body:
<?
echo "<a href = \"javascript:po pup(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 4332
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=javasc ript>

function popup(folder1, file1)
{
window1=open("s olution.php?fol der=folder1&fil e=file1");
}
In the body:
<?
echo "<a href = \"javascript:po pup(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.11 6.11.32.13.97.1 10.111.116.104. 101.114.11
..32.13.112.101 .114.108.11.32. 13.104.97.99.10 7.101.114.10.7'
Jul 17 '05 #2
function popup(folder1, file1)
{
window1=open("s olution.php?fol der=" + 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("s olution.php?fol der="+folder1+" &file="+file 1); 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
3467
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 aquire the screen resolution of the visiting user. Now I need to pass the java variable to another variable on the same document. I have a feeling,...
4
8059
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 sec = Second of triggered event 00~59 tone = DTMF Tone to play 0~9 A~F # & * I now need to write a HTML/JavaScript web page that will enable me...
10
2452
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. There is only behind-the-scenes work going on in that page.
11
3080
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 script, and I am writing server-side validation onto it, however, it is required to redirect to the TCL CGI script because only a CGI script has the...
4
3349
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
11047
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, need to iterate through pages page2 - e.g. allow user to update the fields there) On page1 I have a bunch of checkboxes with the same name v1...
1
2480
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 as an argument a JavaScript array (in my case, an array of doubles)? Supposing I have array x containing only doubles, I have tried:...
2
1948
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 call that variable in another Java script. Sample script <SCRIPT LANGUAGE="JavaScript"> function GetSelectedItem() { len =...
8
1894
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 textarea named text2
0
7518
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7711
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7467
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7805
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5367
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3478
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1932
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 we have to send another system
1
1054
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
755
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.