Jump to content

Gummie

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Gummie's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the suggestion redarrow, I'm working on it. I'll let you know how things go. Thanks again, Gummie
  2. 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> <?php require_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 . " &emsp; &emsp; &emsp; [ 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]
  3. 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
  4. Hi All, Glen, can you be more specific please. I've put together your files and they appear to work, though your menu system still requires a lot of work. One point though; when you include a file, remove all the extraneous HTML tags. For instance, after your page has been executed on the server, it shouldn't show multiple BODY or HEAD tags. Gummie PS Please also mention the server/software/setup that you have for future reference i.e. phpMyAdmin or EasyPHP, etc, etc Thanks
  5. Somebody did mention that earlier, but I found that restarting the server didn't do it for my system; perhaps it should. In any case, it was a sure thing once I rebooted. Gummie
  6. Okay, first of all, thanks everybody for pointing me in the right direction. If anyone has the same problem, note the following for future reference. [color=red] If you are using EasyPHP as specified at the beginning of this post, do the following: Go to the directory: "[color=black]C:\EasyPHP1-8\conf_files\php.ini[/color]" or appropriate to wherever you have installed EasyPHP and open THIS file. I don't know how EasyPHP works, but it creates duplicate copies of this file in other folders for backup or whatever else. If you amend the text in the duplicates, the changes WILL NOT take effect when using EasyPHP. So, make sure you access ONLY this file and close all others. Then find the following section that contains: [color=black]error_reporting  =  ...[/color] and [color=black]display_errors = ...[/color] Amend these to: [color=black]error_reporting  =  E_ALL & ~E_NOTICE[/color] and [color=black]display_errors = On[/color] Then save your file, reboot your system and the changes should take affect. [/color] Best regards to all, Gummie
  7. Point taken Crayon, thanks. And thanks also for the reference in the ini file. I'll play around with it and try to get the error reporting down a little. Gummie
  8. Thanks everyone for your feedback, I took Shogun's advice and when I initially declare the variable as NULL, everything works fine. Also, no matter how I declare the variable, as long as it is initialised, I receive no errors. I guess I have to initialise all my variables before using them. However, where do I find ERROR_REPORTING and how can I amend it? Thanks, Gummie
  9. By the way, I have a similar problem if I use the [color=blue]var_dump[/color] function instead of [color=blue]gettype[/color]. e.g. [code] <?php $testing; // Declare without assigning. print var_dump( $testing ); // NULL print "<br />"; $testing = 5; print var_dump( $testing ); // int(5) print "<br />"; $testing = "five"; print var_dump( $testing ); // string(4) "five" print "<br />"; $testing = 5.0; print var_dump( $testing ); // float(5) print "<br />"; $testing = true; print var_dump( $testing ); // bool(true) print "<br />"; ?> [/code] with the corresponding output: [color=red]Notice: Undefined variable: testing in f:\easyphp1-8\www\+ learning\courses\sams 24 hrs\hour 04\04_var_dump.php on line 11 Notice: Undefined variable: testing in f:\easyphp1-8\www\+ learning\courses\sams 24 hrs\hour 04\04_var_dump.php on line 12[/color] [color=blue]NULL int(5) string(4) "five" float(5) bool(true)[/color] So I guess it has something to do with the way PHP is setup to deal with unassigned variables?!
  10. Don't worry about the line numbers, I have other standard HTML in the document so the code may not appear to match the line numbers as I have only given the PHP coding. And does anyone know how I should configure the ini file to solve this issue? Thanks Gummie
  11. Thanks Crayon Violent and redarrow for the prompt replies. I made the change: [color=red]var $testing[/color] and I received a parse error. However, when I made the change: [color=blue]global $testing[/color], everything works fine. In addition, this only works if global is declared only the first time the variable is declared. Thanks Crayon but can anyone explain why this is happening? What if I just want to declare a local variable, what do I do then? I can't always use a global variable. Gummie
  12. Hi Everybody, I hope someone can help me because I'm a newbie. I've been learning PHP for a short while now, but it's been rather haphazard so I decided to learn it properly. As such, I'm studying from Sam's Teach Yourself PHP in 24 hours (PHP ver 4.3) using EasyPHP 1.8. Everything appears to have been installed hunky-dory without any errors whatsoever. My problem is this; I've written some code directly from the book (a chapter on DATA TYPES). This is it: [code]<?php $testing; // Declare without assigning. print gettype( $testing ); // NULL print "<br />"; $testing = 5; print gettype( $testing ); // Integer print "<br />"; $testing = "five"; print gettype( $testing ); // String print "<br />"; $testing = 5.0; print gettype( $testing ); // Double print "<br />"; $testing = true; print gettype( $testing ); // boolean print "<br />"; ?>[/code] According to the book, I should receive this in my browser: [color=blue]NULL integer string double boolean[/color] However, I actually receive the following: [color=red]Notice: Undefined variable: testing in f:\easyphp1-8\www\+ learning\courses\sams 24 hrs\hour 04\04_data_types.php on line 11 Notice: Undefined variable: testing in f:\easyphp1-8\www\+ learning\courses\sams 24 hrs\hour 04\04_data_types.php on line 12[/color] [color=blue]NULL integer string double boolean[/color] Can anyone please explain why this is happening and what I can do to prevent the error message? Reference texts state that I can declare a variable without assigning an initial value to it, so why then am I receiving an error message? It's probably a very simple issue for the experienced, but it's bugging me. Thanks very much in advance for any help anyone can offer, Gummie [b]Edited by a moderator to put the [nobbc][code][/code][/nobbc] tags in instead of [nobbc][color=blue][/nobbc][/b]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.