Gummie Posted July 10, 2006 Share Posted July 10, 2006 Hi Everybody,[color=blue]Here's my situation:[/color]I've connected to a database and populated a select/combo box. No problem.When the user makes a selection and submits the form, a new page is opened which displays a query according to their selection. Again no problem.[color=blue]Here is the problem:[/color]On my form page, I have placed an iframe. I'm trying to load the iframe with the new page that displays the query, but I receive errors along the lines that the variables don't exist. So what's happening?!The reason for the iframe is so that the user can make a selection and update to see the immediate effect of their choice. Otherwise, they have to go back to the form page, which is rather annoying.If anyone has come across this before, or can offer wise words of wisdom, I would be grateful indeed.Thanks in advance all,Gummie Quote Link to comment https://forums.phpfreaks.com/topic/14168-re-iframe/ Share on other sites More sharing options...
redarrow Posted July 10, 2006 Share Posted July 10, 2006 Post the code of the iframe then and related other code cheers. Quote Link to comment https://forums.phpfreaks.com/topic/14168-re-iframe/#findComment-55509 Share on other sites More sharing options...
cmgmyr Posted July 10, 2006 Share Posted July 10, 2006 It sounds like you would have to global the variable in the page that you have in the iframe. Quote Link to comment https://forums.phpfreaks.com/topic/14168-re-iframe/#findComment-55511 Share on other sites More sharing options...
Gummie Posted July 10, 2006 Author Share Posted July 10, 2006 Thanks for the replies.This is the code of my form page.[code]<script type="text/javascript"><!-- function Loaders() { document.all.Loader.src = 'Main_Display.php'; }//--></script><?phprequire_once('odbc.php');$query = odbc_exec($odbc, "SELECT * FROM Verb_Listing ORDER BY Verb_ita") or die (odbc_errormsg());?><table><tr><td><form id="form1" name="form1" method="post" action="javascript:Loaders()"><label> <input type="checkbox" name="Ind_Pres" value="true" checked="checked" /> Indicative: Present </label><br /><label> <input type="checkbox" name="Ind_Pass_Pros" value="true" /> Indicative: Passato Prossimo </label><br /><label> <input type="checkbox" name="Ind_Pass_Rem" value="true" /> Indicative: Passato Remoto </label><br /><br /> <select name="Verb_ID" size="20" class="st1"> <?php while($row = odbc_fetch_array($query)) { echo "\n"; $Italian_Verb = strtolower($row['Verb_ita']); echo " <option value = \" " . $row['Verb_ID'] . " \"> " . $Italian_Verb . "       [ to " . $row['Verb_ing'] . " ]" . " </option> "; } odbc_close($odbc); ?> </select> <p> <label> <input type="submit" name="btnSelect" value="Select" style="width: 150px" /> </label> </p> </form></td><td><iframe name="Loader" width="300" marginwidth="1" height="250" marginheight="1" align="top" scrolling="auto" allowtransparency="true"></iframe>[/code]And this is the code of the file being called (Main_Display.php):[code]<?php// Show VERB HEADER. $verb = $_POST["Verb_ID"]; $Ind_Pres = $_POST["Ind_Pres"]; $Ind_Pass_Pros = $_POST["Ind_Pass_Pros"]; $Ind_Pass_Rem = $_POST["Ind_Pass_Rem"]; require_once('odbc.php'); $query2 = odbc_exec($odbc, "SELECT Verb_ita FROM Verb_Listing WHERE Verb_ID = $verb") or die (odbc_errormsg()); $Title = odbc_fetch_array($query2); echo "<div align = 'center'>"; echo "<table width = '125' border = '0' cellpadding = '0' cellspacing= '0' class = 'table_style'>"; echo "<tr>"; echo "<td class = 'verb_header'>" . strtoupper($Title['Verb_ita']) . "</td>"; echo "</tr>"; echo "</table>"; echo "</div>"; echo "<br>";/* echo $Ind_Pres; echo $Ind_Pass_Pros; echo $Ind_Pass_Rem;*/// Display PRESENT tense. if ($Ind_Pres == true) { require_once('Indicativo_Presente.php'); } else { $Ind_Pres = true; }// Display SIMPLE PAST. if ($Ind_Pass_Pros != null) { require_once('Indicativo_Passato_Prossimo.php'); }// Display REMOTE PAST. if ($Ind_Pass_Rem != null) { require_once('Indicativo_Passato_Remoto.php'); } odbc_close($odbc);?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/14168-re-iframe/#findComment-55570 Share on other sites More sharing options...
Gummie Posted July 10, 2006 Author Share Posted July 10, 2006 *bump* Quote Link to comment https://forums.phpfreaks.com/topic/14168-re-iframe/#findComment-55688 Share on other sites More sharing options...
redarrow Posted July 10, 2006 Share Posted July 10, 2006 <iframe src="main_display.php?&Verb_ID=$verb name="content" width="100" height="100"></iframe> Quote Link to comment https://forums.phpfreaks.com/topic/14168-re-iframe/#findComment-55700 Share on other sites More sharing options...
Gummie Posted July 10, 2006 Author Share Posted July 10, 2006 Thanks for the suggestion redarrow, I'm working on it. I'll let you know how things go.Thanks again,Gummie Quote Link to comment https://forums.phpfreaks.com/topic/14168-re-iframe/#findComment-55723 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.