Forum Moderators: coopster

Message Too Old, No Replies

passing variables around a web page

         

eatspinach

10:48 am on Jun 26, 2009 (gmt 0)

10+ Year Member



I have 2 php pages, test.php and testLibrary.php (which is a popup window) my problem is on testLibrary.php there is a form submit button and on that button i want the checked items to move from testLibrary.php into the input boxs in test.php, this might be a bit hard to explain so my code is as follows,

test.php
------------------------------------------------------

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>


<select name="quesLib" size="4" multiple="multiple" style="width:258px;" ondblclick="window.open('testLibrary.php?quesLib='+options[selectedIndex].value,'Questionlibrary','width=400,height=600');" >

<option value="IVR Service">IVR Service</option>
<option value="Contact Centre">Contact Centre</option>
<option value="Opinions">Opinions</option>
<option value="Loyalty Awareness">Loyalty Awareness</option>
<option value="Employee Satisfaction">Employee Satisfaction</option>

</select>

<br />
<textarea name="ques1" cols="15" rows="2" wrap="virtual"></textarea><br />
<textarea name="ques2" cols="15" rows="2" wrap="virtual"></textarea><br />
<textarea name="ques3" cols="15" rows="2" wrap="virtual"></textarea><br />
<textarea name="ques4" cols="15" rows="2" wrap="virtual"></textarea><br />

</body>
</html>

testLibrary.php
--------------------------------------------------------
<?php

require_once('fns/main_fns.php');

$quesLib= $_GET['quesLib'];

?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Sentient Voice Surveys ¦ Question Library</title>
<!--<link href="css/login.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">-->
</head>
<body>

<form action="home.php" method="post">

<div style=" width:90%; height:95%; ">

<h3>Question Library ¦ <?php print $quesLib; ?></h2>
<hr style=" border:1px solid #e3e3e3; width:95%;" />

<table border="0" cellspacing="10">

<tr>
<td style="background-color:#f4f5f4; height:20px;"></td>
<td style="background-color:#f4f5f4; height:20px; width:100%;"></td>
</tr>

<tr><td valign='top'><input name='1' type='checkbox' value='828'></td><td valign='top'>two</td></tr><tr><td valign='top'><input name='2' type='checkbox' value='829'></td><td valign='top'>three</td></tr><tr><td valign='top'><input name='3' type='checkbox' value='830'></td><td valign='top'>four</td></tr>
</table>
<hr style=" border:1px solid #e3e3e3; width:95%;" />
<input name="quesLibrary" type="submit" value="Done">
</div>
</form>
</body>
</html>

Thanks for any help in advance..

chief stains

11:05 am on Jun 26, 2009 (gmt 0)

10+ Year Member



Just trying to get my head around this... You are sending the form from testLibrary.php to home.php but when the form is sent, you want to get the variables from the submitted form to be available in test.php?

eatspinach

12:56 pm on Jun 26, 2009 (gmt 0)

10+ Year Member



sorry that was a typo the home.php was supposed to be test.php

jatar_k

1:42 pm on Jun 26, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



maybe you could submit it, then kill the popup and force the opener to refresh

that's all i can think of