Jump to content

websoftexpert

Members
  • Posts

    21
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

websoftexpert's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have html page with calender select input. It is working fine when I open in localhost but I call same code in php page via ajax it is not working. Below is HTML Code <html> <head> <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.8.3.js"></script> <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script> <script> $(function() { $( "#datepicker" ).datepicker({ numberOfMonths: 3, showButtonPanel: true }); }); </script> </head> <body> <input type="text" id="datepicker" /> </body> </html> If I am call above code in php page and loading that page via ajax the above code not working. I am using 2 php file delete.php, deleteDateCalender.php code for delete.php <html> <head> <title>test</title> <script> function deleteCalDateAjax() { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { //alert(xmlhttp.responseText); document.getElementById("calenderDIV").innerHTML=xmlhttp.responseText; //alert(xmlhttp.responseText); } } xmlhttp.open("GET","deleteDateCalender.php",true); xmlhttp.send(null); } </script> </head> <body> <form> <input type="button" value="test" onclick="deleteCalDateAjax();" /> <div id="calenderDIV"> </div> </form> </body> </html> code for deleteDateCalender.php <input type="text" id="datepicker" /> <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.8.3.js"></script> <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script> <script> $(function() { $( "#datepicker" ).datepicker({ numberOfMonths: 3, showButtonPanel: true }); }); </script> deleteDateCalender.php called on click of test button in delete.php Can anyone see what is wrong in the above code? Any help will be appreciated.
  2. Thanks for valuable reply. But I need to edit existing csv file as it used by other php files for displaying data on web application. Also csv file is created automatically by another software on regular interval based on stock available in real time. In real time stock may drop below prescribed limit. So we need to handle this by editing existing csv file. Thanks
  3. Another code but not working $myFile = "sample_csv.csv"; //exit(); /**/ $fh = fopen($myFile, 'r+'); while (($data = fgetcsv($fh, 1000, ",")) !== FALSE) { $num = count($data); echo "<p> $num fields in line $row: <br /></p>\n"; $row++; for ($c=0; $c < $num; $c++) { // echo $data[$c] . "<br />\n"; if($c>3) { //echo $c . "<br />\n"; echo $data[$c] . "<br />\n"; $fields = $data[$c]; if(($fields < 1000) && $fields) { $fields = 10000; } fputcsv($fh, $fields); } } } fclose($fh);
  4. Here is code I written $myFile = "sample_csv.csv"; //exit(); /**/ $fh = fopen($myFile, 'r+'); $theData = fread($fh, filesize($myFile)); //$theData = fgets($fh); $theData = explode("\n", $theData); //print_r($theData); //$theData = nl2br($theData); // converting line break in "<br />" for($i=1; $i<(count($theData)-1);$i++) { $theDataArray = explode(",",$theData[$i]); print "<P>"; //print_r($theDataArray); print "</P>"; //exit; $unit1 = trim($theDataArray[4]); $unit2 = trim($theDataArray[5]); $unit3 = trim($theDataArray[6]); $unit4 = trim($theDataArray[7]); $unit5 = trim($theDataArray[8]); print "<P>"; foreach ($theDataArray as $fields) { print $fields; print ","; if(($fields < 1000) && $fields) { $fields = 10000; } fputcsv($fh, $fields); } print "</P>"; }// for($i=1; $i<(count($theData)-1);$i++) fclose($fh); Please check and let me know what is wrong in above code. The above is reading csv file but not editing.
  5. Hi I want to edit value of csv file and save edited version of csv file based on condition. I know how to put condition but do not how to edit that particular line and position which I want to edit in php attached is sample csv file in pdf format in which I want to edit. There are column Unit1, Unit2, Unit3, Unit4 etc suppose if value of unit4 of day 8 is below 100 then I can reset it value to 1000 by php code and save csv file Thanks for heping us sample_csv.pdf
  6. I think so following value in php.ini file sendmail_from = no value sendmail_path = /usr/sbin/sendmail -t -i Path to sendmail = /usr/sbin/sendmail -t -i If you need full php.ini file info, let me know Thanks
  7. use strstr, if it returns true reset $sentance variable . thanks
  8. Hi I have a website in which I am facing problem in sending EMAIL from FROM. Below is the error details. ================================================================= This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: p.rma@xxxx.com Gid 5369 is not permitted to relay mail, or has directly called /usr/sbin/exim instead of /usr/sbin/sendmail. ================================================================= Below is code I am using for sending email mail($your_email, $subject, $message, "From: $YourName <$EmailAddress>\r\n" . "Reply-To: $YourName <$EmailAddress>\r\n" . "Return-Path: $YourName <$EmailAddress>\r\n" . "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1"); mail($your_email, $subject, $message, "From: $YourName <$EmailAddress>"); Both of above was working in php 5.2 but not in php5.3 Plz advice/help Thanks
  9. Here is code SMTPClass.php class SMTPClient { function SMTPClient ($SmtpServer, $SmtpPort, $SmtpUser, $SmtpPass, $from, $to, $subject, $body) { $this->SmtpServer = $SmtpServer; $this->SmtpUser = base64_encode ($SmtpUser); $this->SmtpPass = base64_encode ($SmtpPass); $this->from = $from; $this->to = $to; $this->subject = $subject; $this->body = $body; if ($SmtpPort == "") { $this->PortSMTP = 25; }else{ $this->PortSMTP = $SmtpPort; } } function SendMail () { if ($SMTPIN = fsockopen ($this->SmtpServer, $this->PortSMTP)) { fputs ($SMTPIN, "EHLO ".$HTTP_HOST."\r\n"); $talk["hello"] = fgets ( $SMTPIN, 1024 ); fputs($SMTPIN, "auth login\r\n"); $talk["res"]=fgets($SMTPIN,1024); fputs($SMTPIN, $this->SmtpUser."\r\n"); $talk["user"]=fgets($SMTPIN,1024); fputs($SMTPIN, $this->SmtpPass."\r\n"); $talk["pass"]=fgets($SMTPIN,256); fputs ($SMTPIN, "MAIL FROM: <".$this->from.">\r\n"); $talk["From"] = fgets ( $SMTPIN, 1024 ); fputs ($SMTPIN, "RCPT TO: <".$this->to.">\r\n"); $talk["To"] = fgets ($SMTPIN, 1024); fputs($SMTPIN, "DATA\r\n"); $talk["data"]=fgets( $SMTPIN,1024 ); fputs($SMTPIN, "To: <".$this->to.">\r\nFrom: <".$this->from.">\r\nSubject:".$this->subject."\r\n\r\n\r\n".$this->body."\r\n.\r\n"); $talk["send"]=fgets($SMTPIN,256); //CLOSE CONNECTION AND EXIT ... fputs ($SMTPIN, "QUIT\r\n"); fclose($SMTPIN); // } return $talk; } } Index.php $SmtpServer="mail.domainnama.com"; $SmtpPort="25"; $SmtpUser="email@domainname.com"; $SmtpPass="password"; include('SMTPClass.php'); if($_SERVER["REQUEST_METHOD"] == "POST") { $to = xyz@receiverdomainname.com; $from = xyz@senderdomainname.com; $subject = "Subject here"; $body = $_POST['message']; $body = 'Hello xyz@receiverdomainname.com, <BR><BR> The password for your account at http://domainname.com/ has been reset. <BR><BR> Your Ligin Id is xyz@receiverdomainname.com and Password is xxxxxxxx . Please login and change your password immediately.<BR><BR> Please <a href="http://domainname.com/">click here</a> to Login. <BR><BR> Thanks & regards <BR><BR> Webmaster (domainname.com) <BR><BR>'; $SMTPMail = new SMTPClient ($SmtpServer, $SmtpPort, $SmtpUser, $SmtpPass, $from, $to, $subject, $body); $SMTPChat = $SMTPMail->SendMail(); Important note : I have not written the above code but tested it. it works for plain email but not for html email. I also want send CC and BCC also. Any help will be appreciated. Thanks
  10. Hi I am also trying to sent email using SMTP. I have used similar example on internet but that is not working. I think I am missing require page require("Mail.php"). Can you provide me complete working code along with missing require file? Thanks in advance
  11. Hi I want to send HTML Email with SMTP Authentication but unable to that. I get a code in which I can send Plain Email with SMTP Authentication but not working with HTML Email Plz help Thanks a
  12. Hi Do you have any example? Please see below. <?php system("your.sh"); ?> Am I right? Thanks
  13. Hi I have shell script (.sh). I have execute it via php file. How to do this? And how to pass variable in shell script. Thanks
×
×
  • 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.