Page 1 of 1

Moving values between frames...

Posted: Fri Jan 07, 2005 9:14 am
by parallon
Hello all. I am a little new to PHP, so bear with me. I have a window with two frames. The upper is for navigation, and the main is where I want all the forms to show. Well anyway, I enter data into input.html and when I hit submit, the data goes to process_form.php. Well, the page shows, but there is no info. I know that it worked without the frames. Any suggestions?

Thanks in advance,

Parallon

Posted: Fri Jan 07, 2005 9:17 am
by Chris Corbyn
Ermmm... you can pass javascript variables between frames but if you needs to pass PHP variables you need to use $_GET or $_SESSION.

Have a look on http://www.php.net for $_GET ;-)

Posted: Sat Jan 08, 2005 2:24 am
by n00b Saibot
mebbe because you have changed the prior naming or arrangements they are not working as they were. check/post your code so that we may analyse it before giving any suggestions.

Here is the code...

Posted: Tue Jan 11, 2005 9:35 am
by parallon
check/post your code so that we may analyse it before giving any suggestions.
kb_input.html

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>KB_Input</title>
<style type="text/css">
<!--
body &#123;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
&#125;
a:link &#123;
	text-decoration: none;
&#125;
a:visited &#123;
	text-decoration: none;
&#125;
a:hover &#123;
	text-decoration: underline;
&#125;
a:active &#123;
	text-decoration: none;
&#125;
.style1 &#123;font-size: xx-large&#125;
-->
</style>
</head>

<body >
<p align="center" class="style1">Knowledge Base Input Form </p>
<table width="800" border="1">
  <tr>
    <td valign="top"><form action="process_form.php" method="post" name="input" id="input" target="mainFrame">
      <p>Problem<br>
        <input name="problem1" type="text" id="problem1" size="30" maxlength="150">
      </p>
      <p>        Solution<br>
          <textarea name="solution1" cols="75" rows="3" wrap="VIRTUAL" id="solution1"></textarea>
</p>
      <p>Problem<br>          
        <input name="problem2" type="text" id="problem2" size="30" maxlength="150">
        </p>
      <p>Solution<br>
          <textarea name="solution2" cols="75" rows="3" wrap="VIRTUAL" id="solution2"></textarea>
</p>
      <p>Problem<br>          
        <input name="problem3" type="text" id="problem3" size="30" maxlength="150">
        </p>
      <p>Solution<br>
          <textarea name="solution3" cols="75" rows="3" wrap="VIRTUAL" id="solution3"></textarea>
</p>
      <p>Problem<br>          
        <input name="problem4" type="text" id="problem4" size="30" maxlength="150">
        </p>
      <p align="left">Solution<br>
          <textarea name="solution4" cols="75" rows="3" wrap="VIRTUAL" id="solution4"></textarea>
          <br>
          <br>
          <input name="Submit" type="submit" value="Submit">
        </p>
      </form>
      </td>
  </tr>
</table>
</body>
</html>
process_form.php

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<table width="600" border="1">
  <tr>
    <td><?PHP
print "Your first problem is <B>$problem1</B><BR>"; 
print "and your solution is  <BR>\n";
print "<B>$solution1<B><BR>";

?></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="300">	<?PHP
	print "$problem1";
	?>      &nbsp;</td>
    <td width="300"><?PHP
	print "$solution1";
	?>&nbsp;</td>
  </tr>
  <tr>
    <td><?PHP
	print "$problem2";
	?>&nbsp;</td>
    <td><?PHP
	print "$solution2";
	?>&nbsp;</td>
  </tr>
  <tr>
    <td><?PHP
	print "$problem3";
	?>&nbsp;</td>
    <td><?PHP
	print "$solution3";
	?>&nbsp;</td>
  </tr>
  <tr>
    <td><?PHP
	print "$problem4";
	?>&nbsp;</td>
    <td><?PHP
	print "$solution4";
	?>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>
Hope this helps. If you need the other frame files, let me know.

Thanks,

Parallon