473,394 Members | 1,800 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,394 software developers and data experts.

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:

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

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

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

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

##Printing the different frames
&print_html_header; ##HTML headers
&print_content if $path_info=~/content/; ##Left pane with links
&print_expand($BDAY) if $path_info=~/expand/; ##Expanded graph
&print_analyse if $path_info=~/analyse/; ##Options to do
analysis
&print_end; ##End HTML
&print_error;

##Setting up the frames
sub print_frameset {

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

print "<html><head><title>$TITLE</title></head>";
print "<frameset cols='8%,92%'>";
print "<frame src='$script_name/content' name='content'>";
print "<frameset rows='70%,30%'>";
if ($birthday) {
print "<frame src='$script_name/expand' name='expand'>";
print "<frame src='$script_name/analyse' name='analyse'>";
}
else {
print "<frame src='$script_name/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.

Thanks!
Me

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


print qq(<frame src="$script_name/expand?birthday=$BDAY" name="expand">\n);
print qq(<frame src="$script_name/analyse?birthday=$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.
-Joe
Jul 19 '05 #2

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

Similar topics

8
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...
1
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...
4
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...
4
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...
7
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...
1
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...
1
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...
8
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...
25
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...
0
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.