Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/64083-if-statement/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.