473,421 Members | 1,469 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,421 software developers and data experts.

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 4326
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
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
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
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
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
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
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
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
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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
1
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...
0
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...

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.