I have a page in which user can enter first name,last name , date and according to that My script should search for the records which matches the above last n first names and print it.
I have the below code,
But seems not working..
Expand|Select|Wrap|Line Numbers
- <?php
- $title = " Form";
- echo "Hello";
- if(isset($_POST['fname'])) { $f1 = $_POST['fname']; }
- if (isset($_POST['lname'])) { $ll = $_POST['lname']; }
- if (isset($_POST['add'])) { $a1 = $_POST['add']; }
- if (isset($_POST['date'])) { $d1 = $_POST['date']; }
- $fullname = $l1.","f1;
- echo "$fullname;
- $dirname = "/home/gr/ereports/O1" ;
- $handle = opendir($dirname) or print "cant open";
- $ans = shell_exec("find /home/gr/ereports/O1/$d1 -name \*.ps -exec grep -i -e "$fullname" {} \; -print; ");
- ?>
Expand|Select|Wrap|Line Numbers
- find dirname -name "*.ps" -exec grep -i -e "CAK, SO" {} \; -print ;
its giving me the result perfectly.
I am thinking that the way I used the above statment in PHP is wrong..
Can anybody help me...
Thanks