Jump to content

sasi

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Everything posted by sasi

  1. Hi Thank's for your quick response i tried as you specified and it is working fine. Really thank you very much Pikachu2000.
  2. Dear All Good Day, i am new to PHP (a beautiful server side scripting language). i want to send a mail with line by line message i tried with different types like by placing the things in table and using <br /> but the thing is the tags are also visible in the message of the mail. Here is my code: $message1 = "Name :". $_REQUEST['name']."<br />"; $message1 .= "Surname :". $_REQUEST['surname']."<br />"; $message1 .= "Cellphone :". $_REQUEST['mobileno']."<br />"; $message1 .= "Telephone :". $_REQUEST['landno']."<br />"; $message1 .= "Fax :". $_REQUEST['fax']."<br />"; $message1 .= "Company :". $_REQUEST['company']."<br />"; $message1 .= "Email :". $_REQUEST['email']."<br />"; $message1 .= "Country :". $_REQUEST['country']."<br />"; $message1 .= "Enquity :". $_REQUEST['enquiry']."<br />"; $message1 .= "Date&Time :". $date."<br />"; For this code if try to print/echo it it is working fine it is displaying line by line, but using this variable ($message1) in the mail these <br /> are also visible. Can any one guide me to resolve(to remove these tags from the message part) this issue. Thanks in Advance.
  3. $string = "/home/localftp1/DTFFiles/tr_his1240.dtf"; preg_match('|/([^/]+)\z|', $string, $match); echo $match[1]; hello thank you very much i got the result with your code,but now watch the following code: <?php $username="root"; $password=""; $database="mic"; $host="localhost"; $flag = true; $search=$_POST['search'];//text field value where we give the file name with ext as input //echo $search."<br>"; mysql_connect($host,$username,$password); mysql_select_db($database) or die( "Unable to select database"); $fsearch="SELECT Fname from logging"; $result1=mysql_query($fsearch); $num1=mysql_num_rows($result1); while($row = mysql_fetch_array($result1)) { $fstring=$row['Fname']; preg_match('|/([^/]+)\z|', $fstring, $match); //echo $match[1]."<br>"; foreach($match as $value) { //echo $value."<br>"; if($value === $search){ echo "File Found:".$search."<br>"; break; } else{ echo "File Not Found:".$search."<br>"; break; } } } ?> now if i had given some filename with extension in the text field, that value is compared and if found then i have to display that file is founded but in the while loop i am getting all the values from the database and then i am parsing that string and getting only the filename from that and later unable to compare. please respond to this as early as possible.
  4. Hello everybody, I want the only filename with extension in the following string, ex:/home/localftp1/DTFFiles/tr_his1240.dtf so here the tr_his1240.dtf is the only file name, so from the database i will get a set of records from that each record contains the above (path) string and in that i want only the filenames from each record. please respond to this as early as possible.
  5. Hello every body, I got some help to generate reports in php using XML and data from the database.But In my sytem i have to get the PHPreportMaker.php. can anybody help me.Here is the code of xml and php files.This is the xml file Code: <?xml version="1.0" standalone="no" ?> <REPORT> <TITLE>Sales Report</TITLE> <BACKGROUND_COLOR>#FFFFFF</BACKGROUND_COLOR> <PAGE SIZE="25"></PAGE> <GROUPS> <GROUP NAME="maingroup"> <FIELDS> <ROW> <COL TYPE="FIELD">id</COL> <COL TYPE="FIELD">name</COL> <COL TYPE="FIELD">city</COL> <COL TYPE="FIELD">product</COL> <COL TYPE="FIELD">value</COL> </ROW> </FIELDS> </GROUP> </GROUPS> </REPORT> here is the php file code: <?php // include the PHPReports classes on the PHP path! configure your path here ini_set("include_path",ini_get("include_path").":/www/mic/phpreports/"); include "PHPReportMaker.php"; $sSQL = "select * from saleslog order by city,id"; $oRpt = new PHPReportMaker(); $oRpt->setXML("sales.xml"); $oRpt->setUser("root"); $oRpt->setPassword(""); $oRpt->setConnection("localhost"); $oRpt->setDatabaseInterface("mysql"); $oRpt->setSQL($sSQL); $oRpt->setDatabase("mic"); $oRpt->run(); ?> The output on the browser is like this: Warning: main(PHPReportMaker.php): failed to open stream: No such file or directory in c:\program files\easyphp1-8\www\mic\sales.php on line 4 Warning: main(): Failed opening 'PHPReportMaker.php' for inclusion (include_path='.;C:/Program Files/EasyPHP1-8\php\pear\:/www/mic/phpreports/') in c:\program files\easyphp1-8\www\mic\sales.php on line 4 Fatal error: Cannot instantiate non-existent class: phpreportmaker in c:\program files\easyphp1-8\www\mic\sales.php on line 7 please reply the solution as early as possible. regards, sasi.
  6. Hello everybody, As i earlier asked is it possible r not to generate the reports, i read ur response and now the question is i want to generate reports from one date to another date(who accessed the system and what he had done either I/O data from that system)this data is the main output form of the report which are then to take them as printouts thats all. regards, sasi.
  7. Hello every body, I got some help to generate reports in php using XML and data from the database.But In my sytem i have to get the PHPreportMaker.php. can anybody help me.Here is the code of xml and php files.This is the xml file <?xml version="1.0" standalone="no"?> <REPORT> <TITLE>Sales Report</TITLE> <BACKGROUND_COLOR>#FFFFFF</BACKGROUND_COLOR> <PAGE SIZE="25"></PAGE> <GROUPS> <GROUP NAME="maingroup"> <FIELDS> <ROW> <COL TYPE="FIELD">id</COL> <COL TYPE="FIELD">name</COL> <COL TYPE="FIELD">city</COL> <COL TYPE="FIELD">product</COL> <COL TYPE="FIELD">value</COL> </ROW> </FIELDS> </GROUP> </GROUPS> </REPORT> This is the php file <?php // include the PHPReports classes on the PHP path! configure your path here ini_set("include_path",ini_get("include_path").":/www/mic/phpreports/"); include "PHPReportMaker.php"; $sSQL = "select * from saleslog order by city,id"; $oRpt = new PHPReportMaker(); $oRpt->setXML("sales.xml"); $oRpt->setUser("root"); $oRpt->setPassword(""); $oRpt->setConnection("localhost"); $oRpt->setDatabaseInterface("mysql"); $oRpt->setSQL($sSQL); $oRpt->setDatabase("mic"); $oRpt->run(); ?> The ouput on executing in the browser is: Warning: main(PHPReportMaker.php): failed to open stream: No such file or directory in c:\program files\easyphp1-8\www\mic\sales.php on line 4 Warning: main(): Failed opening 'PHPReportMaker.php' for inclusion (include_path='.;C:/Program Files/EasyPHP1-8\php\pear\:/www/mic/phpreports/') in c:\program files\easyphp1-8\www\mic\sales.php on line 4 Fatal error: Cannot instantiate non-existent class: phpreportmaker in c:\program files\easyphp1-8\www\mic\sales.php on line 7 regards, sasi.
  8. Hello everybody i want the procedure to generate reports with php,can any one help me regarding this issue. regards, sasi.
  9. Hello every one, The problem is, i am using EasyPHP1-8(setup)file which consists of (php,mysql,apache),once i didn't stop the apache webserver and i had shutdown the system.When i restarted the system and then the apache server it is consuming more time to start and a new window is coming showing some languages.txt and EasyPHP.exe file with some ok,cancel,refresh button on that and the title of that window is like this e Mise a jour....,on closing that window it is not closing and it is contineously on the monitor, i am thincking that this is problem that my applications are not accessible on the intranet. Even the Apache server of my system is not visible in other systems.How can i get out of this problem can any body help me as early as possibe. regards, sasi.
  10. Hai everybody, Can anybody tell me how my application is going to work in INTRANET.Well i am using (Easyphp1-8setup) a three in one setup in which Apache and Mysql and php are installed in my windows system. And I am placing all the php files in the www folder of Easyphp folder means(C:\Program Files\EasyPHP1-8\www\my folder) and then executing them from the browser. Now i want to check it that files from another system,by using my IP address it is not displaying the files why it is so happening. Is there any procedure to view the pages from another system,provide me the necessary documentation as early as possible. regards, sasi.
  11. Hello everybody, I want to know where these cookies and sessions are actually used and what is main purpose of using them. I know how to create them but i am unable to understand the need/necessity of them and where they are actually used. And one more thing i want to run php program in the unix platform as a thread(means for every half an hour it is to be executed),the main moto of that file is converting the unix log file(date format) into the MySql date format and after that writing that result data into another file and after that it is to be loaded into the database. Can anybody provide the documentation reagarding these issues.
  12. Hello every body, i have to generate reports in php,can anybody help me on this issue,providing me the documentation for that. regards, sasi
  13. yesterday the switch case worked properly bu after this another problem is that a special charcater like this "</br>" is also appended at last of the each line in the destination txt file,and i have to avoid this bcoz i have to insert that data into the database with load command,so please once execute this and help me as early as possible. Main goal of this is i am converting the unix date format(log file) into the MySql date format.(Ex : "Tue Oct 13 10:11:01 2007 3 192.168.1.13 31533058 /home/localftp1/TADSIM-Beta-3.0_withDB.exe b _ i r localftp1 ftp 0 * c" into like this: "2007:02:14 and remainig txt also"). <html> <body> <?php $file = fopen("vsftpd.log","r+")or exit("Unable to open file!"); $file1 = fopen("result.txt","w+")or exit("Unable to open file!"); //echo "file opened"."</br>"; while(!feof($file))//Read the entire file up to the EOF. { $date = array();//Array to store the entire data of the file $date= fgets($file)."</br>"; $month = substr($date,4,3); $rstring = substr($date,25); $result = trim($rstring); $fitting = strstr($result,</br>); echo $fitting; switch($month)//Switch case to check and print the month in the number format { case "Jan": $a = sprintf("%2s:%2s:%2s",substr($date,20,4), "01" ,substr($date,8,2)); fwrite($file1,$a); fwrite($file1," "); fwrite($file1,$result); //fwrite($file1,$fitting); break; case "Feb": $a = sprintf("%2s:%2s:%2s",substr($date,20,4), "02" ,substr($date,8,2)); fwrite($file1,$a); fwrite($file1," "); fwrite($file1,$result); //fwrite($file1,$fitting); break; case "Mar": $a = sprintf("%2s:%2s:%2s",substr($date,20,4), "03" ,substr($date,8,2)); fwrite($file1,$a); fwrite($file1," "); fwrite($file1,$result); //fwrite($file1,$fitting); break; case "Apr": $a = sprintf("%2s:%2s:%2s",substr($date,20,4), "04" ,substr($date,8,2)); fwrite($file1,$a); fwrite($file1," "); fwrite($file1,$result); //fwrite($file1,$fitting); break; case "May": $a = sprintf("%2s:%2s:%2s",substr($date,20,4), "05" ,substr($date,8,2)); fwrite($file1,$a); fwrite($file1," "); fwrite($file1,$result); //fwrite($file1,$fitting); break; case "Jun": $a = sprintf("%2s:%2s:%2s",substr($date,20,4), "06" ,substr($date,8,2)); fwrite($file1,$a); fwrite($file1," "); fwrite($file1,$result); //fwrite($file1,$fitting); break; case "Jul": $a = sprintf("%2s:%2s:%2s",substr($date,20,4), "07" ,substr($date,8,2)); fwrite($file1,$a); fwrite($file1," "); fwrite($file1,$result); //fwrite($file1,$fitting); break; case "Aug": $a = sprintf("%2s:%2s:%2s",substr($date,20,4), "08" ,substr($date,8,2)); fwrite($file1,$a); fwrite($file1," "); fwrite($file1,$result); //fwrite($file1,$fitting); break; case "Sep": $a = sprintf("%2s:%2s:%2s",substr($date,20,4), "09" ,substr($date,8,2)); fwrite($file1,$a); fwrite($file1," "); fwrite($file1,$result); //fwrite($file1,$fitting); break; case "Oct": $a = sprintf("%2s:%2s:%2s",substr($date,20,4), "10" ,substr($date,8,2)); fwrite($file1,$a); fwrite($file1," "); fwrite($file1,$result); //fwrite($file1,$fitting); break; case "Nov": $a = sprintf("%2s:%2s:%2s",substr($date,20,4), "11" ,substr($date,8,2)); fwrite($file1,$a); fwrite($file1," "); fwrite($file1,$result); //fwrite($file1,$fitting); break; case "Dec": $a = sprintf("%2s:%2s:%2s",substr($date,20,4), "12" ,substr($date,8,2)); fwrite($file1,$a); fwrite($file1," "); fwrite($file1,$result); //fwrite($file1,$fitting); break; }//End of the switch case. //echo "\t".$rstring."</br>"; fwrite($file1," "); //$len=strlen($result); //echo $len."</br>"; //echo $result[$len:7]; //$result = ($result[$len:7] = ""); //fwrite($file1,$result); //substr_replace($file1,"</br>"," "); //fwrite($file1,"\n"); }//End of the while loop. fclose($file);//File is closed. ?> <?php $uname = "root"; $pwd = ""; $db = "mic"; $sys = "localhost"; mysql_connect($sys,$uname,$pwd); mysql_select_db($db)or die("unable to connect"); echo "Database connected"; $query = "LOAD DATA LOCAL INFILE 'C:/Program Files/EasyPHP1-8/www/mic/result.log' REPLACE INTO TABLE `logging` FIELDS TERMINATED BY ' ' LINES TERMINATED BY '\n'"; $value = mysql_query($query); echo "Query executed"; mysql_close(); ?> </body> </html>
  14. Sorry that was the mistaken by me $z was printing mistake.I had used $a.
  15. Hello everybody, This is sasi working as a software programmer,and i am working on php from past 2 months and right now i am doing a small convertion program means(converting the string from reading a file(31 records) in to the MySql date format).so the problem is i used the switch case where the value is not checking why it is so happening.please kindly view this and respond to it immediately. here is my code: <?php //Open the file from where we have to parse the date format into the MySql date format. $file = fopen("new.txt","r+")or exit("Unable to open file!"); echo "file opened"."</br>"; //Read the entire file up to the EOF. while(!feof($file)) { $string = array();//Array to store the entire data of the file $string = fgets($file)."</br>";//Reads the entire file $word = substr($string,3,4)."</br>";//Getting the day from the array which contains the data of the file //echo "Month is:".$word; $a = trim($word); echo "new value:".$a; $word1 = substr($string,8,2)."</br>";//Getting the month from the array echo "Date is:".$word1; $word3 = substr($string,20,4)."</br>";//Getting the year from the array echo "Year is:".$word3; $word4 = substr($string,25)."</br>";//Getting the reaming data from the arrray switch($a)//Switch case to verify and print the month in the number format. { case "Jan": echo "checking:".$a; echo $word3."\t"."-".$word1."-"."01"."\t".$word4; break; case "Feb": echo date("Y")."-".$word1."-"."02"."\t".$word4; break; case "Mar": echo date("Y")."-".$word1."-"."03"."\t".$word4; break; case "Apr": echo date("Y")."-".$word1."-"."04"."\t".$word4; break; case "May": echo date("Y")."-".$word1."-"."05"."\t".$word4; break; case "Jun": echo date("Y")."-".$word1."-"."06"."\t".$word4; break; case "Jul": echo date("Y")."-".$word1."-"."07"."\t".$word4; break; case "Aug": echo date("Y")."-".$word1."-"."08"."\t".$word4; break; case "Sep": echo date("Y")."-".$word1."-"."09"."\t".$word4; break; case "Oct": echo date("Y")."-".$word1."-"."10"."\t".$word4; break; case "Nov": echo date("Y")."-".$word1."-"."11"."\t".$word4; break; case "Dec": echo date("Y")."-".$word1."-"."12"."\t".$word4; break; default: echo "final result:".$word; }*/ }//End of the while loop fclose($file);//Close the file ?> regards, sasi.
  16. Hello everybody, This is sasi working as a software programmer,and i am working on php from past 2 months and right now i am doing a small convertion program means(converting the string from reading a file(31 records) in to the MySql date format).so the problem is i used the switch case where the value is not checking why it is so happening.please kindly view this and respond to it immediately. here is my code: <?php //Open the file from where we have to parse the date format into the MySql date format. $file = fopen("new.txt","r+")or exit("Unable to open file!"); echo "file opened"."</br>"; //Read the entire file up to the EOF. while(!feof($file)) { $string = array();//Array to store the entire data of the file $string = fgets($file)."</br>";//Reads the entire file $word = substr($string,3,4)."</br>";//Getting the day from the array which contains the data of the file //echo "Month is:".$word; $a = trim($word); echo "new value:".$a; $word1 = substr($string,8,2)."</br>";//Getting the month from the array echo "Date is:".$word1; $word3 = substr($string,20,4)."</br>";//Getting the year from the array echo "Year is:".$word3; $word4 = substr($string,25)."</br>";//Getting the reaming data from the arrray switch($z)//Switch case to verify and print the month in the number format. { case "Jan": echo "checking:".$a; echo $word3."\t"."-".$word1."-"."01"."\t".$word4; break; case "Feb": echo date("Y")."-".$word1."-"."02"."\t".$word4; break; case "Mar": echo date("Y")."-".$word1."-"."03"."\t".$word4; break; case "Apr": echo date("Y")."-".$word1."-"."04"."\t".$word4; break; case "May": echo date("Y")."-".$word1."-"."05"."\t".$word4; break; case "Jun": echo date("Y")."-".$word1."-"."06"."\t".$word4; break; case "Jul": echo date("Y")."-".$word1."-"."07"."\t".$word4; break; case "Aug": echo date("Y")."-".$word1."-"."08"."\t".$word4; break; case "Sep": echo date("Y")."-".$word1."-"."09"."\t".$word4; break; case "Oct": echo date("Y")."-".$word1."-"."10"."\t".$word4; break; case "Nov": echo date("Y")."-".$word1."-"."11"."\t".$word4; break; case "Dec": echo date("Y")."-".$word1."-"."12"."\t".$word4; break; default: echo "final result:".$word; }*/ }//End of the while loop fclose($file);//Close the file ?> regards, sasi.
×
×
  • 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.