akkad Posted August 9, 2007 Share Posted August 9, 2007 hi again, i am sending information using this form to the body.php file. <?php echo" <FORM style=PADDING-RIGHT: 0px; MARGIN-TOP: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px name=FormDateFilter mehtod=post action=body.php target=body>"; echo"<SELECT class=formfield name=day> <OPTION value='' selected>- Day -</OPTION> <OPTION value=01>01</OPTION> <OPTION value=02>02</OPTION> <OPTION value=03>03</OPTION> <OPTION value=04 >04</OPTION> <OPTION value=05>05</OPTION> <OPTION value=06>06</OPTION> <OPTION value=07>07</OPTION> <OPTION value=08>08</OPTION> <OPTION value=09>09</OPTION> <OPTION value=10>10</OPTION> <OPTION value=11>11</OPTION> <OPTION value=12>12</OPTION> <OPTION value=13>13</OPTION> <OPTION value=14>14</OPTION> <OPTION value=15>15</OPTION> <OPTION value=16 >16</OPTION> <OPTION value=17>17</OPTION> <OPTION value=18>18</OPTION> <OPTION value=19>19</OPTION> <OPTION value=20>20</OPTION> <OPTION value=21>21</OPTION> <OPTION value=22>22</OPTION> <OPTION value=23>23</OPTION> <OPTION value=24>24</OPTION> <OPTION value=25>25</OPTION> <OPTION value=26>26</OPTION> <OPTION value=27>27</OPTION> <OPTION value=28>28</OPTION> <OPTION value=29>29</OPTION> <OPTION value=30>30</OPTION> <OPTION value=31>31</OPTION> </SELECT> <SELECT class=formfield name=month> <OPTION value='' selected>- Month -</OPTION> <OPTION value=01>Jan</OPTION> <OPTION value=02>Feb</OPTION> <OPTION value=03>Mar</OPTION> <OPTION value=04 >Apr</OPTION> <OPTION value=05>May</OPTION> <OPTION value=06>Jun</OPTION> <OPTION value=07>Jul</OPTION> <OPTION value=08>Aug</OPTION> <OPTION value=09>Sep</OPTION> <OPTION value=10>Oct</OPTION> <OPTION value=11>Nov</OPTION> <OPTION value=12>Dec</OPTION> </SELECT> <SELECT class=aws_formfield name=year> <OPTION value='' selected>- Year -</OPTION> <OPTION value=2006>2006</OPTION> <OPTION value=2007>2007</OPTION> </SELECT> <INPUT class=aws_button type=submit value=OK>"; ? ---------------------body.php--------------------- <?php error_reporting(E_ALL); ini_set('display_errors', True); $userid = $_COOKIE['cookie']['user']; #echo $userid; echo"<BR>"; if(!isset($day) && !isset($month) && !isset($year)) { $day=""; $month=""; $year=""; } if(!isset($day) && !isset($month) && isset($year)) { $date=$year; echo $date; echo shell_exec("cat `bash ./cal $date` | grep akadi_icho | /usr/bin/perl /opt/lampp/htdocs/xampp/thesis/calamaris/calamaris -a -P 60 -T 0 -r 400 -d 500 -u -O -F html"); } if(!isset($day) && isset($month) && isset($year)) { $date=$year."-".$month; echo $date; echo shell_exec("cat `bash ./cal $date` | grep akadi_icho | /usr/bin/perl /opt/lampp/htdocs/xampp/thesis/calamaris/calamaris -a -P 60 -T 0 -r 400 -d 500 -u -O -F html"); } if(isset($day) && isset($month) && isset($year)) { $date=$year."-".$month."-".$day; echo shell_exec("cat `bash ./cal $date` | grep akadi_icho | /usr/bin/perl /opt/lampp/htdocs/xampp/thesis/calamaris/calamaris -a -P 60 -T 0 -r 400 -d 500 -u -O -F html"); #echo $date; } ?> i want to get mothly report and daily report and yearly report. so i have used 4 if statements the first one is the default coz i want by default the page to be empty. the problem is that only the last if is working i don't know why? Quote Link to comment https://forums.phpfreaks.com/topic/64083-if-statement/ Share on other sites More sharing options...
HuggieBear Posted August 9, 2007 Share Posted August 9, 2007 You can't use isset(). As you have a default value in the field, it will always be set you'll need to use: <?php if(($day == "- Day -") && ($month == "- Month -") && ($year == "- Year -")) { $day=""; $month=""; $year=""; } ?> Regards Huggie Quote Link to comment https://forums.phpfreaks.com/topic/64083-if-statement/#findComment-319358 Share on other sites More sharing options...
LiamProductions Posted August 9, 2007 Share Posted August 9, 2007 Your HTML code is wrong first of all: mehtod=post Thats in your Form tags. Turn it to method=post Quote Link to comment https://forums.phpfreaks.com/topic/64083-if-statement/#findComment-319417 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.