473,573 Members | 2,950 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing variables to frames - cgi

This is the problem I am having:
I have an index page where I obtain input from the user (for example
their date of birth). This information is passed to Page2. Page2 has
frames. Outside of the frames I can access the user's input. But within
the frames I can't seem to be able to get the value. The date is stored
in a global variable.
Here are snippet's of code:

my ($BDAY, $path_info, $script_name);

##Obtaining value from the index page
if ($q->param('birthda y')) {
$BDAY = $q->param('birthda y');

##Creating frame
$path_info = $q->path_info;

##Printing the fames
if (!$path_info) {
&print_frameset ($BDAY);
exit 0;

##Printing the different frames
&print_html_hea der; ##HTML headers
&print_conte nt if $path_info=~/content/; ##Left pane with links
&print_expand($ BDAY) if $path_info=~/expand/; ##Expanded graph
&print_analy se if $path_info=~/analyse/; ##Options to do
&print_end; ##End HTML
&print_error ;

##Setting up the frames
sub print_frameset {

my $birthday = shift;
$script_name = $q->script_name;

print "<html><head><t itle>$TITLE</title></head>";
print "<frameset cols='8%,92%'>" ;
print "<frame src='$script_na me/content' name='content'> ";
print "<frameset rows='70%,30%'> ";
if ($birthday) {
print "<frame src='$script_na me/expand' name='expand'>" ;
print "<frame src='$script_na me/analyse' name='analyse'> ";
else {
print "<frame src='$script_na me/error' name='error'>";
print "</frameset>";
print "</frameset>";

exit 0;

One of the frame's contents:
sub print_expand {

my $birthday = shift;
print $q->h3("My birthday is on: $birthday");


In this frame all it prints is "My birthday is on: " it is not printing
the variable.

I cannot figure out why I cannot get the value in the subroutines. I
have checked and the value does get passed from the index page to this
page. I can print it from the global variable $BDAY but not from the
sub routines that form the frames.

I have spent almost 2 days on this and I am starting to go insane!! I
would appreciate any hints/help/suggestions you can provide.


Jul 19 '05 #1
1 6431
divya wrote:
if ($birthday) {
print "<frame src='$script_na me/expand' name='expand'>" ;
print "<frame src='$script_na me/analyse' name='analyse'> ";
} I cannot figure out why I cannot get the value in the subroutines.

print qq(<frame src="$script_na me/expand?birthday =$BDAY" name="expand">\ n);
print qq(<frame src="$script_na me/analyse?birthda y=$BDAY"
name="analyse"> \n);

You'll need to use some of the other methods from CGI.pm to
do URL encoding on the value of $BDAY.
Jul 19 '05 #2

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

Similar topics

by: Hans | last post by:
Hi There, I have a page that has links with some variables and I need to open the results set in a frameset. I have tried doing this in various different ways, but still cannot get the variable passed to the relevant frames within the frameset. What is the best way of getting this done. Thanks Hans
by: Dave Smithz | last post by:
Hi there, I have implemented a login sequence using session variables for a PHP/MySQL DB which I took over development. I read some books and this NG and it seemed straight forward. However the website I have taken over uses two frames. The left hand side is always a navigation frame with the righthand side of the screen always being the...
by: A Web Master | last post by:
I am designing a site for a client where I have a frameset and 3 frames (all in ASP). I am creating session variables in the frameset that need to be accessed in the frames. It seams that in Netscape (4.75), the Frameset Session variables are not defined when accessed in the frames. Why and how to fix this ? Take these for example. The only...
by: A Web Master | last post by:
I want to know the best way of passing on variable contents on a site coded in ASP using frameset/frame. Content is used in all frames for stuffs like screen_resolution, language, ... My client's site is visited by Netscape 4.x/6.x and IE-5.x/6.x. It's being converted to ASP and currently using frames (middle frame has a vert scroll bar). ...
by: Scott | last post by:
I need help to modify the code below to pass url variables from a framset. The click to run this will be in the mainFrame. This script works well in a non-frame page. Grabs the current url variables and adds them to my url. <script type="text/javascript"> //<!]> </script>
by: Russell | last post by:
Hi there, I'm currently creating a .NET Web Application and I have a question about passing values from one screen to another. I previously used Session variables in the code to store these values, however I can no longer use this method because of my current website "Cloaking" the URL. (When site is cloked, the session variables don't seem...
by: paleHail | last post by:
Hi all, I have my index.html where I have two frames: <frameset rows="144,*" border="0" frameborder="no"> <frame src="header.html" frameborder="no" noresize scrolling="no"> <frame src="rightFrame.html" name="frontpage" frameborder="no" noresize> </frameset> I wanted the top of the site to stay in tact while the bottom
by: chimambo | last post by:
Hi All, I am trying to pass variables between two frames in PHP. I want to get a variable from F1 to F2 and the variable that is now in F2 should pass back the variable to F1 and call another page. Anyone to help? Thanks X
by: Geoff Cox | last post by:
Hello, The following <frame src="topbar-frameset.php?newVar=<?php echo $groups; ?>"> passes the value of the variable $groups from a php file to the top page in a frameset but how do I change it if $groups is an array? Cheers,
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. ...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
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...
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...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
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
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.