473,473 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

passing vars - popup window problem

Hi,

I currently have a problem passing a variable value from one page to
another. Once a form submit button is pressed java pops up a window and
displays some information. The problem being is variables value needs to
be passed from the main page to this popup window ... but it isn't. why?
the submit button one the PHP page is

$s_download_action = "index.$phpEx?page=downloads";

$download_url = "download.$phpEx";

$hidden_download_vars = '<input type="hidden" name="download_id"
value="' . $d_id . '" />';
$u_download = "<input type=\"submit\" name=\"get_download\" value=\"" .
$lang['Download'] . "\" class=\"mainoption\" onClick=\"window.open('" .
$download_url . "', '_spdownload', 'HEIGHT=250,resizable=yes,WIDTH=
400');return false;\" />";
echo '<form action="' . $s_download_action . '" method="post">';
echo $hidden_download_vars . '' . $u_download;
echo '</form>';
Mar 15 '06 #1
5 2397
Steve wrote:
Hi,

I currently have a problem passing a variable value from one page to
another. Once a form submit button is pressed java pops up a window and
displays some information. The problem being is variables value needs to
be passed from the main page to this popup window ... but it isn't. why?
the submit button one the PHP page is

$s_download_action = "index.$phpEx?page=downloads";

$download_url = "download.$phpEx";

$hidden_download_vars = '<input type="hidden" name="download_id"
value="' . $d_id . '" />';
$u_download = "<input type=\"submit\" name=\"get_download\" value=\"" .
$lang['Download'] . "\" class=\"mainoption\" onClick=\"window.open('" .
$download_url . "', '_spdownload', 'HEIGHT=250,resizable=yes,WIDTH=
400');return false;\" />";
echo '<form action="' . $s_download_action . '" method="post">';
echo $hidden_download_vars . '' . $u_download;
echo '</form>';


This looks more like javascript, not java.

And I don't see any problem with your PHP code. But it looks like there
are problems with your html and javascript.

First of all - the submit button isn't in the form. Why not? Or is
there more you haven't shown us?

Next, I don't see where you're passing the value to the popup window in
your javascript.

Try a javascript newsgroup.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 15 '06 #2
"Try a javascript newsgroup." - nope this is more of an html question.
Maybe try an html newsgroup, as this is a common html mistake...

Anyway, the problem is that you are passing a get variable here
(instead of a post var):

$s_download_action = "index.$phpEx?page=downloads";

which is the wrong way to sumbit a get variable through an html form
anyway. Especially when you declare:

method="post"

The possible solution is to have a hidden field like:

<input type="hidden" name="something" value="$s_download_action">

and then catch that in the popup as:

$s_download_action_is=$_POST['something'];

of course, if you wish to use

method="get"

then the above would be

$s_download_action_is=$_GET['something'];

Mar 15 '06 #3
d
"Steve" <stuck@need_help.co.uk> wrote in message
news:Xn********************************@195.92.193 .157...
Hi,

I currently have a problem passing a variable value from one page to
another. Once a form submit button is pressed java pops up a window and
displays some information. The problem being is variables value needs to
be passed from the main page to this popup window ... but it isn't. why?
the submit button one the PHP page is

$s_download_action = "index.$phpEx?page=downloads";

$download_url = "download.$phpEx";

$hidden_download_vars = '<input type="hidden" name="download_id"
value="' . $d_id . '" />';
$u_download = "<input type=\"submit\" name=\"get_download\" value=\"" .
$lang['Download'] . "\" class=\"mainoption\" onClick=\"window.open('" .
$download_url . "', '_spdownload', 'HEIGHT=250,resizable=yes,WIDTH=
400');return false;\" />";
echo '<form action="' . $s_download_action . '" method="post">';
echo $hidden_download_vars . '' . $u_download;
echo '</form>';


Your form is not actually submitting anything. The submit button is
returning false, which will cancel the form being submitted anywhere. You
could replace the submit with a button, have that create a new window, have
the new window (once loaded) call the opening document, and submit the form
to itself. You can specify a name for the window in the javascript that
creates it, and you can specify a "target" in your <form>. It's messy, but
will have you submitting to a pop-up box.

Posting to a pop-up box seems somewhat dirty. :-P
Mar 15 '06 #4
"d" <d@example.com> wrote in
news:MQ******************@text.news.blueyonder.co. uk:
"Steve" <stuck@need_help.co.uk> wrote in message
news:Xn********************************@195.92.193 .157...
Hi,

I currently have a problem passing a variable value from one page to
another. Once a form submit button is pressed java pops up a window
and displays some information. The problem being is variables value
needs to be passed from the main page to this popup window ... but it
isn't. why?
the submit button one the PHP page is

$s_download_action = "index.$phpEx?page=downloads";

$download_url = "download.$phpEx";

$hidden_download_vars = '<input type="hidden" name="download_id"
value="' . $d_id . '" />';
$u_download = "<input type=\"submit\" name=\"get_download\" value=\""
. $lang['Download'] . "\" class=\"mainoption\"
onClick=\"window.open('" . $download_url . "', '_spdownload',
'HEIGHT=250,resizable=yes,WIDTH= 400');return false;\" />";
echo '<form action="' . $s_download_action . '" method="post">';
echo $hidden_download_vars . '' . $u_download;
echo '</form>';


Your form is not actually submitting anything. The submit button is
returning false, which will cancel the form being submitted anywhere.
You could replace the submit with a button, have that create a new
window, have the new window (once loaded) call the opening document,
and submit the form to itself. You can specify a name for the window
in the javascript that creates it, and you can specify a "target" in
your <form>. It's messy, but will have you submitting to a pop-up
box.

Posting to a pop-up box seems somewhat dirty. :-P


I see your point about being dirty! but its only a confirmation window
once the download button is pressed. basically its just saying "The
requested file 'blahblahblah.zip' will download in the next 3 seconds.

might look at onther way instead ... but thanks anyway.
Mar 16 '06 #5
"Tyxod" <yr****@gmail.com> wrote in news:1142427614.295685.117830
@i39g2000cwa.googlegroups.com:
"Try a javascript newsgroup." - nope this is more of an html question.
Maybe try an html newsgroup, as this is a common html mistake...

Anyway, the problem is that you are passing a get variable here
(instead of a post var):

$s_download_action = "index.$phpEx?page=downloads";

which is the wrong way to sumbit a get variable through an html form
anyway. Especially when you declare:

method="post"

The possible solution is to have a hidden field like:

<input type="hidden" name="something" value="$s_download_action">

and then catch that in the popup as:

$s_download_action_is=$_POST['something'];

of course, if you wish to use

method="get"

then the above would be

$s_download_action_is=$_GET['something'];


the variable I am trying to obtain is a hidden var

$hidden_download_vars = '<input type="hidden" name="download_id"
value="' . $d_id . '" />';
which is in the form like this

echo '<form action="' . $s_download_action . '" method="post">';
echo $hidden_download_vars . '' . $u_download;
echo '</form>';
the get var your on about in the form element is not the var i am trying
to obtain in the popup window. I need the download_id var as above.

will try it as GET anway and see what happens.

thanks.
Mar 16 '06 #6

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

Similar topics

5
by: Jim Banks | last post by:
Greetings I'm opening a pop up window with a html form, (in one document) and I want to pass a variable to the html form called from the hyperlink. Here's the code I'm using to pop up the...
6
by: veganeater | last post by:
Hi Everyone, I was wondering if there was a way to pass a variable to a popup window. The purpose is make it so when a user clicks on a specific region/link of the glossary page, a popup opens...
29
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the...
3
by: Dan Nash | last post by:
Hi I want to be able to click an item in a list, and a new window popup. Obviously i would use window.open in javascript within a RegisterClientScript thingy. However, i want to pass the id...
3
by: Aaron | last post by:
I am having a little difficulty with a relatively simple task. I have a parent webform. I have a javascript attribute added to a button to open a new window when clicked. The user fills in a...
3
by: michael | last post by:
let me keep it clean, quick and simple. I am passing a variable into another window and am reassigning the value on the new page - window.document...value = opener.document. ....value and...
1
by: johnjsforum | last post by:
Buddies, I have a web page to create HTML buttons dynamically as in the “formDivColorPicker” function ////////////////////////////////////////////////////////////////////////////////////...
12
meenakshia
by: meenakshia | last post by:
hi forum i have read a lot of articles regarding passing data from popup to parent up but i m looking for the opposite that is from parent to popup window pls help me in this regard i have...
12
by: Lahiru778 | last post by:
I require to appear the Name which i click on the "new.php" page in the "Window_open.php" page..I use some Java Script also to accomplish this but I couldn't.. Could you pleas Help ...!!! ...
0
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,...
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...
0
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
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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
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 ...
0
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...

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.