From: nagendra prasad on 4 Jul 2010 04:30 Hi All, I have this php form that I have inserted in the result page. ************************************************************************************************ <form action="index.php" method="post"> <table class="bd" border="0" cellspacing="1" cellpadding="4"> <tr> <td><b></b> </td> <td><input type="text" name="filter" value="<?php echo $filter ?>"></td> <td><input type="submit" name="action" value="Search"></td> <td><select name="filter_field" style="width:100px;"> <option value="">All Fields</option> <option value="<?php echo "Type" ?>"<?php if ($filterfield == "type") { echo "selected"; } ?>><?php echo htmlspecialchars("Type") ?></option> <option value="<?php echo "Name" ?>"<?php if ($filterfield == "name") { echo "selected"; } ?>><?php echo htmlspecialchars("Name") ?></option> <option value="<?php echo "Date" ?>"<?php if ($filterfield == "date") { echo "selected"; } ?>><?php echo htmlspecialchars("Date") ?></option> <option value="<?php echo "Size" ?>"<?php if ($filterfield == "size") { echo "selected"; } ?>><?php echo htmlspecialchars("Size") ?></option> </select></td> </tr> </table> <hr size="1" noshade> *************************************************************************** The above code is giving me the following errors: <br /> <b>Notice</b>: Undefined variable: filter in <b>C:\wamp\www\5_Final\index.php</b> on line <b>228</b><br /> Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php on line 233 > Type Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php on line 234 > Name Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php on line 235 > Date Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php on line 236 > Size *Please help me with these errors.*
From: Kesavan Rengarajan on 4 Jul 2010 04:54 Hi, Those are notices not warnings(meaning they can be ignored sometimes, search for error_reporting in the PHP manual). In your example, if you do not wish ignore the notices, then initialize the different variables to some value. Sent from my iPhone On 04/07/2010, at 6:30 PM, nagendra prasad <nagendra802000(a)gmail.com> wrote: > Hi All, > > I have this php form that I have inserted in the result page. > > *** > *** > *** > *** > *** > *** > *** > *** > *** > ********************************************************************* > <form action="index.php" method="post"> > <table class="bd" border="0" cellspacing="1" cellpadding="4"> > <tr> > <td><b></ > b>& > nbsp; > > > </ > td> > <td><input type="text" name="filter" value="<?php echo $filter ?>"></ > td> > <td><input type="submit" name="action" value="Search"></td> > > <td><select name="filter_field" style="width:100px;"> > <option value="">All Fields</option> > <option value="<?php echo "Type" ?>"<?php if ($filterfield == > "type") { echo > "selected"; } ?>><?php echo htmlspecialchars("Type") ?></option> > <option value="<?php echo "Name" ?>"<?php if ($filterfield == > "name") { echo > "selected"; } ?>><?php echo htmlspecialchars("Name") ?></option> > <option value="<?php echo "Date" ?>"<?php if ($filterfield == > "date") { echo > "selected"; } ?>><?php echo htmlspecialchars("Date") ?></option> > <option value="<?php echo "Size" ?>"<?php if ($filterfield == > "size") { echo > "selected"; } ?>><?php echo htmlspecialchars("Size") ?></option> > > </select></td> > > </tr> > > > </table> > > <hr size="1" noshade> > > *** > *** > ********************************************************************* > > The above code is giving me the following errors: > > <br /> <b>Notice</b>: Undefined variable: filter in > <b>C:\wamp\www\5_Final\index.php</b> on line <b>228</b><br /> > > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final > \index.php on > line 233 > Type > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final > \index.php on > line 234 > Name > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final > \index.php on > line 235 > Date > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final > \index.php on > line 236 > Size > > > > *Please help me with these errors.*
From: nagendra prasad on 4 Jul 2010 05:55 Hi Everyone, Sorry, I haven't mentioned in my earlier mail that the variables $filter and $filterfield are global variables which I already defined. Best, Guru.
From: Nurul Abser on 4 Jul 2010 11:09 Dear coder, New version of php give php Notice if the script contain any variable which has not value. Please debug your script by printing the varible and confirm that the varible got value. Thanks Abser On Sun, Jul 4, 2010 at 4:30 PM, nagendra prasad <nagendra802000(a)gmail.com>wrote: > > > Hi All, > > I have this php form that I have inserted in the result page. > > > ************************************************************************************************ > <form action="index.php" method="post"> > <table class="bd" border="0" cellspacing="1" cellpadding="4"> > <tr> > > <td><b></b> </td> > <td><input type="text" name="filter" value="<?php echo $filter ?>"></td> > <td><input type="submit" name="action" value="Search"></td> > > <td><select name="filter_field" style="width:100px;"> > <option value="">All Fields</option> > <option value="<?php echo "Type" ?>"<?php if ($filterfield == "type") { > echo "selected"; } ?>><?php echo htmlspecialchars("Type") ?></option> > <option value="<?php echo "Name" ?>"<?php if ($filterfield == "name") { > echo "selected"; } ?>><?php echo htmlspecialchars("Name") ?></option> > <option value="<?php echo "Date" ?>"<?php if ($filterfield == "date") { > echo "selected"; } ?>><?php echo htmlspecialchars("Date") ?></option> > <option value="<?php echo "Size" ?>"<?php if ($filterfield == "size") { > echo "selected"; } ?>><?php echo htmlspecialchars("Size") ?></option> > > </select></td> > > </tr> > > > </table> > > <hr size="1" noshade> > > *************************************************************************** > > The above code is giving me the following errors: > > <br /> <b>Notice</b>: Undefined variable: filter in > <b>C:\wamp\www\5_Final\index.php</b> on line <b>228</b><br /> > > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php on > line 233 > Type > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php on > line 234 > Name > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php on > line 235 > Date > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php on > line 236 > Size > > > > *Please help me with these errors.* > __._,_.___ > Reply to sender<nagendra802000(a)gmail.com?subject=Need+help+with+HTML+form+errors>| Reply > to group<phpexperts(a)yahoogroups.com?subject=Need+help+with+HTML+form+errors>| Reply > via web post<http://groups.yahoo.com/group/phpexperts/post;_ylc=X3oDMTJyYW9jcGFoBF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARtc2dJZAMxMzY5OARzZWMDZnRyBHNsawNycGx5BHN0aW1lAzEyNzgyNTI4MzY-?act=reply&messageNum=13698>| Start > a New Topic<http://groups.yahoo.com/group/phpexperts/post;_ylc=X3oDMTJmY244YjNjBF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDZnRyBHNsawNudHBjBHN0aW1lAzEyNzgyNTI4MzY-> > Messages in this topic<http://groups.yahoo.com/group/phpexperts/message/13698;_ylc=X3oDMTM3cDJldWR0BF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARtc2dJZAMxMzY5OARzZWMDZnRyBHNsawN2dHBjBHN0aW1lAzEyNzgyNTI4MzYEdHBjSWQDMTM2OTg->( > 1) > Recent Activity: > > - New Members<http://groups.yahoo.com/group/phpexperts/members;_ylc=X3oDMTJnbG4yOTNwBF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDdnRsBHNsawN2bWJycwRzdGltZQMxMjc4MjUyODM2?o=6> > 5 > > Visit Your Group<http://groups.yahoo.com/group/phpexperts;_ylc=X3oDMTJmYzRidjg5BF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDdnRsBHNsawN2Z2hwBHN0aW1lAzEyNzgyNTI4MzY-> > Visit phpXperts website at www.phpxperts.net > [image: Yahoo! Groups]<http://groups.yahoo.com/;_ylc=X3oDMTJlcGZrN2RuBF9TAzk3NDc2NTkwBGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDZnRyBHNsawNnZnAEc3RpbWUDMTI3ODI1MjgzNw--> > Switch to: Text-Only<phpexperts-traditional(a)yahoogroups.com?subject=Change+Delivery+Format:+Traditional>, > Daily Digest<phpexperts-digest(a)yahoogroups.com?subject=Email+Delivery:+Digest> > Unsubscribe <phpexperts-unsubscribe(a)yahoogroups.com?subject=Unsubscribe> > Terms of Use <http://docs.yahoo.com/info/terms/> > . > > __,_._,___ >
From: Phansys Corp on 4 Jul 2010 12:39 Try the next verification to see what's the var <?php if (isset($_POST['filter']) && !empty($_POST['filter'])) { var_dump($_POST['filter']); } ?> Best regards. 2010/7/4 Nurul Abser <abser.it(a)gmail.com> > Dear coder, > > New version of php give php Notice if the script contain any variable which > has not value. Please debug your script by printing the varible and confirm > that the varible got value. > > Thanks > > Abser > > On Sun, Jul 4, 2010 at 4:30 PM, nagendra prasad <nagendra802000(a)gmail.com > >wrote: > > > > > > > Hi All, > > > > I have this php form that I have inserted in the result page. > > > > > > > ************************************************************************************************ > > <form action="index.php" method="post"> > > <table class="bd" border="0" cellspacing="1" cellpadding="4"> > > <tr> > > > > > <td><b></b> </td> > > <td><input type="text" name="filter" value="<?php echo $filter ?>"></td> > > <td><input type="submit" name="action" value="Search"></td> > > > > <td><select name="filter_field" style="width:100px;"> > > <option value="">All Fields</option> > > <option value="<?php echo "Type" ?>"<?php if ($filterfield == "type") { > > echo "selected"; } ?>><?php echo htmlspecialchars("Type") ?></option> > > <option value="<?php echo "Name" ?>"<?php if ($filterfield == "name") { > > echo "selected"; } ?>><?php echo htmlspecialchars("Name") ?></option> > > <option value="<?php echo "Date" ?>"<?php if ($filterfield == "date") { > > echo "selected"; } ?>><?php echo htmlspecialchars("Date") ?></option> > > <option value="<?php echo "Size" ?>"<?php if ($filterfield == "size") { > > echo "selected"; } ?>><?php echo htmlspecialchars("Size") ?></option> > > > > </select></td> > > > > </tr> > > > > > > </table> > > > > <hr size="1" noshade> > > > > > *************************************************************************** > > > > The above code is giving me the following errors: > > > > <br /> <b>Notice</b>: Undefined variable: filter in > > <b>C:\wamp\www\5_Final\index.php</b> on line <b>228</b><br /> > > > > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php > on > > line 233 > Type > > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php > on > > line 234 > Name > > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php > on > > line 235 > Date > > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php > on > > line 236 > Size > > > > > > > > *Please help me with these errors.* > > __._,_.___ > > Reply to sender< > nagendra802000(a)gmail.com?subject=Need+help+with+HTML+form+errors>| Reply > > to group< > phpexperts(a)yahoogroups.com?subject=Need+help+with+HTML+form+errors>| Reply > > via web post< > http://groups.yahoo.com/group/phpexperts/post;_ylc=X3oDMTJyYW9jcGFoBF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARtc2dJZAMxMzY5OARzZWMDZnRyBHNsawNycGx5BHN0aW1lAzEyNzgyNTI4MzY-?act=reply&messageNum=13698>| > Start > > a New Topic< > http://groups.yahoo.com/group/phpexperts/post;_ylc=X3oDMTJmY244YjNjBF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDZnRyBHNsawNudHBjBHN0aW1lAzEyNzgyNTI4MzY- > > > > Messages in this topic< > http://groups.yahoo.com/group/phpexperts/message/13698;_ylc=X3oDMTM3cDJldWR0BF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARtc2dJZAMxMzY5OARzZWMDZnRyBHNsawN2dHBjBHN0aW1lAzEyNzgyNTI4MzYEdHBjSWQDMTM2OTg- > >( > > 1) > > Recent Activity: > > > > - New Members< > http://groups.yahoo.com/group/phpexperts/members;_ylc=X3oDMTJnbG4yOTNwBF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDdnRsBHNsawN2bWJycwRzdGltZQMxMjc4MjUyODM2?o=6 > > > > 5 > > > > Visit Your Group< > http://groups.yahoo.com/group/phpexperts;_ylc=X3oDMTJmYzRidjg5BF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDdnRsBHNsawN2Z2hwBHN0aW1lAzEyNzgyNTI4MzY- > > > > Visit phpXperts website at www.phpxperts.net > > [image: Yahoo! Groups]< > http://groups.yahoo.com/;_ylc=X3oDMTJlcGZrN2RuBF9TAzk3NDc2NTkwBGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDZnRyBHNsawNnZnAEc3RpbWUDMTI3ODI1MjgzNw-- > > > > Switch to: Text-Only< > phpexperts-traditional(a)yahoogroups.com?subject=Change+Delivery+Format:+Traditional > >, > > Daily Digest< > phpexperts-digest(a)yahoogroups.com?subject=Email+Delivery:+Digest> > > Unsubscribe <phpexperts-unsubscribe(a)yahoogroups.com?subject=Unsubscribe> > > > Terms of Use <http://docs.yahoo.com/info/terms/> > > . > > > > __,_._,___ > > >
|
Next
|
Last
Pages: 1 2 Prev: Need Help in Mysql database Next: AW: [PHP-WIN] Need help with HTML form errors |