RE: Another question on PHP

From: Date: Thu, 08 Jun 2000 07:35:31 +0000
Subject: RE: Another question on PHP
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-258@lists.php.net to get a copy of this message
You need to put the $foo=0 statement in the if() statement. If you don't $foo will always be 0. This will zero out $foo and submit, if you reload the page: <?php Print"<a href=\"YourFileName.php3?foo=0&amp;Submit=""\">"; ?>Another Look Up</a> If you want to do another look up. I think my syntax is right. I do not understand "the Anchor". Ted Knudson http://www.automatedcabinets.com http://www.pulsarusa.com > > I actually have two question. How do I initialize a > variable, I would like to initialize the variable to 0 > before the submit is ran. $foo=0, where do I put this > at in my source code? Also where do I put the Anchor > so it will show up at the bottom of my return query. > Where it at right now it shows up on top. > > Thanks for the help > > Tim > > <html> > <body> > <? > if(!isset($submit)){ > ?> > <form> > <form method=post action='divedepthq.php3'> > <input type='text' name='foo'> > <input type='submit' name='submit' value='Search'> > </form> > <A href = "divedepthq.php3">Back</A> > <? > } else { > > } > ?> > int settype(foo, integer type); > <table border=0><td width=105><td width=190><td > width=90><td width=88><td width=93> > <TR><TD><B><CENTER> Dive Location</CENTER></B></TD> > <TD><B><CENTER> Dive Site</CENTER></B></TD> > <TD><B><CENTER> Dive Buddy</CENTER></B></TD> > <TD><B><CENTER> Dive Depth</CENTER></B></TD> > <TD><B><CENTER> Bottom > Time</CENTER></B></TD></TR></B> > > <?php > $db = ODBC_Connect("dive", "", ""); > $res = ODBC_Exec($db, "SELECT * FROM tblDiveData > WHERE DiveDepth >=$foo"); > > while (ODBC_Fetch_Row($res)) { > echo "<table border=0><td width=107><td width=192><td > width=90><td width=88><td width=93>\n"; > echo "<TR><TD><CENTER>".ODBC_Result($res, > 'DiveLocation')."</CENTER></TD>", > "<TD><CENTER>".ODBC_Result($res, > 'DiveSite')."</CENTER></TD>", > "<TD><CENTER>".ODBC_Result($res, > 'DiveBuddy')."</CENTER></TD>", > "<TD><CENTER>".ODBC_Result($res, > 'DiveDepth')."</CENTER></TD>", > "<TD><CENTER>".ODBC_Result($res, > 'BottomTime')."</CENTER></TD>","</TR>"; > } > ODBC_Free_Result($res); > ?> > </body> > </html> > > > ===== > "Hokey religions and ancient weapons can never compare to a > good blaster at your side, Kid." > > > May all your bubbles be external. > > __________________________________________________ > Do You Yahoo!? > Yahoo! Photos -- now, 100 FREE prints! > http://photos.yahoo.com >

« previous php.db (#258) next »