LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-05-2005, 09:54 PM   #1
rblampain
Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 7
Posts: 837

Rep: Reputation: 35
HTML frames javascript php problem


Can anyone tell me how to fix the problem described below?

When line 21 is executed and line 22 is commented out, the PHP code in z2.php does not execute properly but the link from z2.php to z3.php works.
When line 22 is executed and line 21 is commented out, the PHP code in z2.php is executed properly but the link from z2.php to z3.php does not work.

These scripts are what's left of full scripts after meticulously removing what's not relevant except perhaps some lengthy PHP code but this php code works properly when its script is called from the browser.

The 'filename' is between the <title></title> tags and you can test these scripts with just a "cut and paste" and adjusting line 22 to your set up.


<html><head><title>z0.htm</title></head>
<frameset frameborder="yes" border="1" cols="*,*">
<frame src="zl0.htm" name="left_window" frameborder="1">
<frame src="zr0.htm" name="right_window" frameborder="1">
</frameset>
</html>

1 <html><head><title>zl0.htm</title></head>

2 <body>

3 </body></html>
4 =======================================================
5 <html><head><title>zr0.htm</title>
6 <script type="text/javascript" language="javascript">
7 <!--
8 function twoframes()
9 {
10 parent.left_window.location.href="zl1.htm";
11 }
12 //-->
13 </script>
14 </head>
15 <body>
16 <a href="javascript:twoframes();">Agenda Update.</a>
17 </body></html>
18 =======================================================
19 <html><head><title>zl1.htm</title></head>
20 <body>
21 <!--<a href="z2.php" target="left_window">Continue</a>-->
22 <a href="http://192.168.1.13/z2.php" target="left_window">Continue</a>
23 </body></html>
24 =======================================================
25 <html><head><title>z2.php</title>
26 <script type='text/javascript' language='javascript'>
27 <!--
28 //parent.right_window.location = 'z3.php';
29 parent.right_window.location = 'http://192.168.1.13/z3.php';
30 //-->
31 </script>
32 </head>
33 <body>
34 <h2>z2.php</h2>
35 </body></html>
36 =======================================================
37 <html><head><title>z3.php</title></head>
38 <body>
39 <input type="submit" name="submit" value="Selected.">
40 </form>
41 </body></html>
 
Old 04-06-2005, 02:55 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
What is the php code in z2.php that doesn't execute? Is the page loaded ok?
 
Old 04-07-2005, 12:47 AM   #3
rblampain
Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 7
Posts: 837

Original Poster
Rep: Reputation: 35
Here is the full code (note this z2.php is called open_session.php in production). Using one line as explained above, this code executes properly, when using the other line, it executes only partially and then displays the rest of the code.

<? session_start(); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Open Session</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel=stylesheet type="text/css" href="h123.css">
</head>
<body background="wp2c.png">
<table class="tabl01"><tr><td width="100%">
<h2>Session of Council of Officials:</h2>
<h3>Date of Session</h3>
<font size="1" color="red">open_session.php</font><br>
<form method="post">1) Click in the window below then<br>2) Enter the date of the Session in format<br> YYMMDD, then press 'Enter'.<br>
<font size="1">(Input from numeric keypad does not work.)</font><br>
<input type="text" name="date"></form><br>

<?php
if (isset($_POST['date']))
{
$date = ($_POST['date']);
$filename1 = "agenda/session_agenda" . $date;
$_SESSION['filename1'] = $filename1;
echo "Session date = Day: ";
?><b><font color="red"><?
echo substr($filename1,25,2);
?></font></b><?
echo " &nbsp; Month: ";
?><b><font color="red"><?
echo substr($filename1,23,2);
?></font></b><?
echo " &nbsp; Year: ";
?><b><font color="red"><?
echo "20",substr($filename1,21,2);
?></font></b><br><?

$year="20" . substr($date,0,2);
settype($year, "integer");
$month=substr($date,2,2);
settype($month, "integer"); #required
$day=substr($date,4,2);
settype($days, "integer"); #required
if (!$bool=checkdate($month,$day,$year))
{
echo "<font color='red'>Entered= ";
echo $date;
echo "<br>Date is invalid \n";
echo "<br>Please re-enter.</font><br><br>";
break;
}

if (file_exists($filename1))
{
echo "<form method='post' action='select_element.php'><select size='8' name='selected'>";
$agenda = file("$filename1");
$_SESSION['agenda'] = $agenda;
foreach($agenda as $lineNumber => $lineStr)
{
echo "<option>$lineStr</option>";
}
echo "</select><br><br>";
echo "<input type='submit' name='submit' value='Continue '></form>";
}
else
{
echo "No file found for the date entered<br><br>";
}
}
echo "last modified ".date('d F Y, H:i:s.',getlastmod());
?>
</td></tr></table></body></html>
 
Old 04-07-2005, 02:16 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
At what point does it start displaying code?
 
Old 04-08-2005, 03:51 AM   #5
rblampain
Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 7
Posts: 837

Original Poster
Rep: Reputation: 35
From the 42nd line of code starting with the following word:
Entered=
it doesn't print the HTML code though.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple PHP / HTML frames question Mq2004 Linux - Software 2 05-04-2005 11:36 AM
Html Javascript help apt Programming 3 03-21-2005 12:46 AM
Possible to create a frames effect in an HTML page without using frames? furfurdemon666 General 10 12-12-2004 07:52 AM
help needed in frames with php meluser Programming 1 03-15-2003 07:54 PM
frames in html and php ranixlb Programming 3 12-04-2002 01:58 AM


All times are GMT -5. The time now is 02:53 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration