473,508 Members | 2,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

send variables to another window?

Hello all, is there any way to send php variables to another popup html
window? I just want users to be able to click on a hyperlink like this...

e.g., <a target=new href="www.mydomain.com/main.php?username=test&id=50>
click here </a>

....that will popup another window. This new window should be able to use
those variables.

Thanks in advance.

Mosher
Jul 17 '05 #1
6 3550
*** Mosher escribió/wrote (Fri, 11 Mar 2005 16:40:59 -0600):
Hello all, is there any way to send php variables to another popup html
window? I just want users to be able to click on a hyperlink like this...

e.g., <a target=new href="www.mydomain.com/main.php?username=test&id=50>
click here </a>

...that will popup another window. This new window should be able to use
those variables.


You can do this:

<a target=new href="/main.php?username=test&id=50>click here</a>
Further info:
http://www.php.net/manual/en/reserve....variables.get

--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Manda tus dudas al grupo, no a mi buzón
-+ Send your questions to the group, not to my mailbox
--
Jul 17 '05 #2
Mosher wrote:
Hello all, is there any way to send php variables to another popup html
window? I just want users to be able to click on a hyperlink like this...

e.g., <a target=new href="www.mydomain.com/main.php?username=test&id=50>
click here </a>
You've answered your own question. The target attribute
'specifies the name of a frame where a document is to be
opened' (HTML4.01 sec. 16.3).

There are a number of questionable things in your example,
though, not least of which are the two glaring syntax
errors: a missing double quote and an unescaped ampersand.
But browsers are usually quite tolerant of those. More
likely to cause problems is your address not beginning with
'http://', which leaves browsers to interpret it relative to
the base URI.
...that will popup another window.
There's nothing to say it will. For starters, it's not a
requirement. Some people don't like popups, so they block
them. More, if there's already a window named 'new', the
page should not open in another one.
This new window should be able to use those variables.


Window? Windows don't use variables. The resource
identified by the address could use them, but that address
probably doesn't identify a resource. Do you get a 404?

--
Jock
Jul 17 '05 #3
You most likely don't want the username and id posted into the address bar
as there are security issues with this.
Session register variables and you can use them on any page the user opens
from your site.
Eg.
<?php
session_start();
session_register("username");
$username = "user";
...........

In the popup window you can now reference the variables as long as you
include the session_start(); at the start of the page.

Brent Palmer.

"Mosher" <mo***********@yahoo.com> wrote in message
news:u_********************@comcast.com...
Hello all, is there any way to send php variables to another popup html
window? I just want users to be able to click on a hyperlink like this...

e.g., <a target=new href="www.mydomain.com/main.php?username=test&id=50>
click here </a>

...that will popup another window. This new window should be able to use
those variables.

Thanks in advance.

Mosher

Jul 17 '05 #4
Maybe you can put those variables in a cookie/session?
if you register them like $_SESSION['myvarx'] = $myvar I think that
you can use them in the other window then: $myvar =
$_SESSION['myvarx']
I'm not sure about this.
http://eye.cc -php- web design
Jul 17 '05 #5
I seem to have found a solution with the following in the form window:

<a href="#"
onclick="javascript:window.open('main.php?username =$username&id=$id','mywindow','width=400,height=45 0,scrollbars=yes,resizable=yes')">click
here</a>

Thanks for the help.

Mosher

"Mosher" <mo***********@yahoo.com> wrote in message
news:u_********************@comcast.com...
Hello all, is there any way to send php variables to another popup html
window? I just want users to be able to click on a hyperlink like this...

e.g., <a target=new href="www.mydomain.com/main.php?username=test&id=50>
click here </a>

...that will popup another window. This new window should be able to use
those variables.

Thanks in advance.

Mosher

Jul 17 '05 #6
This is ok as long as you don't mind the username and id being public in the
window.
You would be better off using session var's.
Brent Palmer.
"Mosher" <mo***********@yahoo.com> wrote in message
news:rJ********************@comcast.com...
I seem to have found a solution with the following in the form window:

<a href="#"
onclick="javascript:window.open('main.php?username =$username&id=$id','mywindow','width=400,height=45 0,scrollbars=yes,resizable=yes')">click
here</a>

Thanks for the help.

Mosher

"Mosher" <mo***********@yahoo.com> wrote in message
news:u_********************@comcast.com...
Hello all, is there any way to send php variables to another popup html
window? I just want users to be able to click on a hyperlink like this...

e.g., <a target=new
href="www.mydomain.com/main.php?username=test&id=50> click here </a>

...that will popup another window. This new window should be able to use
those variables.

Thanks in advance.

Mosher


Jul 17 '05 #7

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

Similar topics

9
3628
by: Pack Fan | last post by:
I've noticed that session variables will persist on Mac IE even after all browser windows have been closed. One must quit the program to clear the session variables. This presents a security risk...
4
3595
by: Daniel | last post by:
Hullo =) Inspired by another guy's questions here I've created an isset function that works (almost) like the one in native PHP: function isset(variablename) {...
3
6507
by: Marco Alting | last post by:
hi I have a javascript function, which gets parameters from a form and then opens a new form in another window. The new window also has a javascript function with parameters. My question is,...
3
4170
by: adeon | last post by:
Hi, I'm trying to create specific pop'up window (for product category selection), but in JS I'm a newbie and some problem occured, so I have a question: Is it possible in main window (that...
3
1819
by: Lars Netzel | last post by:
Hello! I have a button, in the click event I have this code: ---------------------------------------------------------------------------- ---------------------------- Response.Write("<script...
7
2016
by: Bill | last post by:
I've noticed that in my ASP application that session variables are not carried over from one IE6 open browser window to another. Can anyone tell me how IE can do this? It seems like it's a useful...
18
3401
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
0
1529
by: ahoyer | last post by:
Im currently writing a small phone directory, that allows a user to search by given name, surname, address, etc. everything is implemented with asp.net (the backend is in c#). My problem comes...
1
1601
by: phoenix917 | last post by:
I have been working on this code for 5 days... I have read multiple tutorials and looked at various code. This is my third forum try... :) My instructor refuses to help me. I think it's because...
0
7120
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
7323
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,...
0
7380
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
7039
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
4706
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
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1553
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
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
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.