PHP - Help - The Pgp-crypted Mails Were Not Readable Any More - I Am Lost
how to tell gmail to send plan messages only i want to send my friend a pgp-crypted mail - but this fails since the html-based mails allways do some changes to the pgp my friend receives the mails in a broken style they are not readable any more plz advice me - any and all help is much appreciated by the way i use kgpg and the editor to create the crypted message. i do not like the enigmail-addon for tbird. + But if i should try this - : Which credentials are needed to configure the einigmail - the public key that i have generated recently. love to hear from you greetings Similar TutorialsHi All, Sometimes after some calculation php may return this: 1.02563125481E+54 But how to make this into 1 number without the E+ etc ?! Cheers How do I write a bit of code to check if a file is NOT readable...and if (and only if) it is NOT readable (doesn't exist) , wget the file. Here's what I tried...but it loops forever and ever...even if the file does exist. Code: [Select] $filename = "file.mp3"; while(!is_readable($filename)) { $url = "domain.com" . ".mp3"; echo system('wget '.escapeshellcmd($url)); echo system('sleep 30'); } ?> I Googled...and couldn't find the correct syntax for IS NOT READABLE. Thanks! Hi Guys, I need a function which makes huge numbers normally readable... For example 1000000 must become 1.000.000 The same with smaller or lager numbers... Does someone know a simple solution ? Cheers Hello there, I was curious about PHP's 'time()', now is there any way to parse that into a human readable version e.g 7:53 PM, because I'm unsure on how to work with the time function since it's returned in the unix format, thanks again in advance for your help guys. Hi, I have a date and time stored in a database field (publishdate) and I'm using php to fetch it and display it in an HTML table. Only problem is it shows up in epoch time. I can't get it to display in human readable time for some reason. Here's the code I'm using (it's automatically generated by some software) // View column for publishdate field $column = new TextViewColumn('publishdate', 'Publishdate', $this->dataset); $column->SetOrderable(true); Many thanks in advance. Tony I'm getting data from a third party API and the first_name and last_name fields from this third party are sometimes not in english and they come out quite odd looking. Example... "first_name": "Pesh\u042fo", "last_name": "\u062d\u0633\u064a\u0646" How could I normalize that using PHP to make it readable again? Hi, I have a connection set up to an API using a PHP script - the API sends back data in JSON format, and if I capture it and echo it, it displays in extremely unfriendly format on the screen. I've tried to find a way to convert this data into readable format, ideally in a HTML table, but although there are articles on converting manually inputted JSON data into a HTML table using Javascript, I can't find a way to do it from a PHP variable. This is what I have so far: if ($_POST['getcompany']) { $companyname = $_POST['_Name']; $ch = curl_init(); $data_array2 = array( 'token' => $token ); $make_call2 = json_encode($data_array2); //echo 'Token is '.$token; $token2 = substr($token, 14); $token3 = substr($token2, 0, -3); //echo 'Token 2 is '.$token3; //echo 'Company Name is '.$companyname; //curl_setopt($ch, CURLOPT_GET, 1); //curl_setopt($ch, CURLOPT_POSTFIELDS, $make_call2); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: '.$token3.'')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, 'https://connectionurl?countries=GB&name='.$companyname); //Execute the request $result = curl_exec($ch); echo 'Companies: '.$result; //This displays the data provided by the search, but is in JSON format
So I need a way to get the data held in $result, into a HTML table. Any idea how I can do this? I'm using this code to create and populate a database. It gets a bit involved as it is creating a series of times for every day in the year. The database gets created and populated just fine, however I have 2 quirks I can't figure out. First, I am creating a separate file to store connection creds to the database. The file gets created and holds the correct information, but as I am using the program, somehow the file is getting overwritten with blank spaces, making it impossible to connect to the database. 2nd, the program sends me an e-mail when the database is created. Problem is I'm getting 2 e-mails about 20 minutes apart. 1 with all the correct information and 1 blank. I'm thinking maybe these problems are related??? Like the program is trying to run itself twice or is getting called twice. Once the program runs, it never gets called again in any other part of the program code. Any ideas? Thanks. Code: [Select] <?php $coursename = $_POST["coursename"]; $websiteurl = $_POST["websiteurl"]; $email = $_POST["email"]; $otime = $_POST["opentime"]; $ctime = $_POST["closetime"]; $interval = $_POST["interval"]; $year = $_POST["year"]; $server = $_POST["server"]; $username = $_POST["username"]; $password = $_POST["password"]; $userpassword = $_POST["userpassword"]; //--Creates a file to store Login Information--\\ $data = <<<DATA <?php \$server = "$server"; \$username = "$username"; \$password = "$password"; ?> DATA; file_put_contents("databasedata.php", $data); //--Connect to the Server--\\ mysql_connect("$server", "$username", "$password"); //--Create the Database--\\ mysql_query("CREATE DATABASE IF NOT EXISTS TeeTimes"); mysql_select_db("TeeTimes"); //--Create the Tables--\\ mysql_query("CREATE TABLE IF NOT EXISTS CourseInfo ( Course_ID int NOT NULL AUTO_INCREMENT, PRIMARY KEY(Course_ID), CourseName varchar(40) NOT NULL default '', HomePage varchar(50)NOT NULL default '', Email varchar(50) NOT NULL default '', Password varchar(20) NOT NULL default '' )"); mysql_query("CREATE TABLE IF NOT EXISTS Daysheets$year ( Sheet_ID int NOT NULL AUTO_INCREMENT, PRIMARY KEY(Sheet_ID), Date date NOT NULL, Time time NOT NULL, Player1 varchar(30) NOT NULL default '', Cart1 varchar(3) NOT NULL default '', Player2 varchar(30) NOT NULL default '', Cart2 varchar(3) NOT NULL default '', Player3 varchar(30) NOT NULL default '', Cart3 varchar(3) NOT NULL default '', Player4 varchar(30) NOT NULL default '', Cart4 varchar(3) NOT NULL default '', Player5 varchar(30) NOT NULL default '', Cart5 varchar(3) NOT NULL default '', Men smallint(4) NOT NULL default 0, Women smallint(4) NOT NULL default 0, Guest smallint(4) NOT NULL default 0, Event varchar(3) NOT NULL default '', EventName varchar(30) NOT NULL default '' )"); //***To Populate the Database with Dates and Times***\\ mysql_query(" INSERT INTO CourseInfo (CourseName,HomePage,Email,Password) VALUES('$coursename','$websiteurl','$email','$userpassword')"); $rows = mysql_query("SELECT * FROM Daysheets$year"); if ($rows[Date]=="") { $firstday = "$year:01:01 $otime:00:00"; $firstdate = strtotime($firstday); $firsttime = "$year:01:01 $otime:00:00"; $opentime = strtotime($firsttime); $lasttime = "$year:01:01 $ctime:00:00"; $closetime = strtotime($lasttime); $time = date("g:i",$opentime); $i=1; //***To Account For Leap Years***\\ if ($year == 2012 || $year == 2016 || $year == 2020 || $year == 2024) {$n=366;} else {$n=365;} while ($i <= $n) { $newday = date("Y-m-d",$opentime); mysql_query(" INSERT INTO Daysheets$year (Date,Time) VALUES('$newday','$time')"); while ($opentime < $closetime) { $newtime = strtotime("+$interval minute", $opentime); $nexttime = date("Y-m-d g:i a",$newtime); $nextd = date("Y-m-d",$newtime); $nextt = date("g:i",$newtime); mysql_query(" INSERT INTO Daysheets$year (Date,Time) VALUES('$nextd','$nextt')"); $opentime = strtotime($nexttime); } $opentime = strtotime($firsttime); $newday = strtotime("+$i day", $opentime); $nextday = date("Y-m-d g:i a",$newday); $opentime = strtotime($nextday); $closetime = strtotime($lasttime); $newday = strtotime("+$i day", $closetime); $nextday = date("Y-m-d g:i a",$newday); $closetime = strtotime($nextday); $i++; } } mysql_close(); //--Send Information for Safekeeping--\\ $to = "someone@somewhere.org"; $subject = "Tee Time Maker User Info"; $message = "Course Name:' '$coursename \n Website: ' '$websiteurl \n E-Mail: ' '$email \n Password: ' '$userpassword"; mail($to, $subject, $message, "From: $coursename <$email>"); //--Redirect user to the newly created site--\\ header("Location: /teetimes/adminteetimes.php"); ?> I 'm having some problem while sending mails . i am sending bulk mails using php script, der is no problem in the script. i hope some guys have faced similar issue. while i am sending bulk emails, i figured out that - few mails are going to spam not into their INBOX. can you guys pls give some hint to resolve this issue. .. A form is filled and the information is emailed to my address. The problem is it goes to the spam folder. Is it a problem with the email filter? I suppose I could whitelist the email address the server uses to email the info, but then spam would get through as well. Any ideas? Hi, I'm developing a php newsletter software but I'm in trouble with bounce mails! I set a return path directing them into a specific email box then I read that email box with php and I process bounce mails to get the kind of problem. Well, I need to get some informations about those bounce emails: The name of the user that should recive that mail, the date when the mail has been sent, the kind of error encountered; It could be so easy if I could read the body of the mail I sent into the back bounce one but every server sends a different kind of bounce...for example mailer-daemon won't let me get the body of the sent message...how can I handle this? Andrea. I've been using something like this to send email messages to users on a site: $to = $email; $subject = "Message From Microsoft.com\r\n"; $headers = "From: support@Microsoft.com\r\n"; $headers .= "Return-Path: support@Microsoft.com\r\n"; $headers .= "Reply-To: support@Microsoft.com\r\n"; $message = "<html><body><img src='http://www.Microsoft.com/images/logo.png' /><br /><br />You have a message from Bill:<br /><br />"; $message .= '<img src="' . $image . '" /><br /><br />'; $message .= 'Isn't it pretty?.<br /><br />'; $message .= '<a href="http://www.Microsoft.com">Microsoft.com</a></body></html>'; mail($to,$subject,$message,$headers); This sends, literally, text like this: <html><body><img src='http://www.Microsoft.com/images/logo.png' /><br /><br />You have a message from Bill:<br /><br /><img src="http://www.Microsoft.com/images/billiam.jpg" /><br /><br />Isn't it pretty?.<br /><br /><a href="http://www.Microsoft.com">Microsoft.com</a></body></html> Obviously, I would like the email to hide the HTML, but use it to format the output. Also, I'd obviously like the image to show up, not a link to the image, and I would like the link to show up as a link, not as HTML. How do I do this? Cheers. Hello I am working on php website. Now here im working on sending orders. So once it is ordered the confirmation e-mail goes to one who ordered(he enters his e-mail id manually) and the head of the department(e-mail ids written in code). But now I have put a checkbox that if the person is head of the department he checks the checkbox and e-mail should be sent to him. So how to verify this by checkbox.Can anyone please help me with this. The person should not get 2 e-mails. I hope I was clear in explaining my doubt. If not please do ask me for more explanation. Thank you. I have this script that sends an E-mail to my custoemr when an account is created and does a Bcc to me. Every email gets sent once, then about 2 min later another one is sent. So both the customer and myself get 2 emails. I did a test and just after the mail() function i write to a text file. What is odd is that it logs the sent mail 2 times. So somehow it is going through it a second time. The time difference between the first and the second seem to usually be about 2-3 min. For exampel this was only sent one time. My guess is there has to be something wrong with my headers, but i have been over them many times and tried different configurations. To: ben@....com Time 05/12/2011 12:18:30 am To: ben@...com Time 05/12/2011 12:21:09 am Code: [Select] <?php $db_con = mysql_pconnect($hostname, $username, $password) or trigger_error(mysql_error(),E_USER_ERROR); mysql_select_db($database, $db_con); if((isset($_POST['password'])) && ($_POST['password'] == 'mandb108' )) { $install_date = date("Y-m-d"); $end = mktime(0, 0, 0, date("m"), date("d"), date("y")+1); $end_date = date("Y-m-d", $end); $folder = $_POST['folder']; $school_db = $_POST['school_db']; $school_name = $_POST['school_name']; // Check to see if school, db or folder exists if (mysql_num_rows(mysql_query("Select * FROM $select_table WHERE `school_name` = '$school_name'"))) { $message = 'School Name Already Exists in Database'; } elseif (mysql_num_rows(mysql_query("Select * FROM $select_table WHERE `school_db` = '$school_db'"))) { $message = 'Database Already Exists'; } elseif (mysql_num_rows(mysql_query("Select * FROM $select_table WHERE `school_folder` = '$folder'"))) { $message = 'School Folder Already Exists'; } else { ////////////////////id, school, db, folder, install, renew, end, contact, email, job, notes $insertSQL = sprintf("INSERT INTO $select_table VALUES (null, %s, %s, %s, %s, '$install_date', null, '$end_date', %s, %s, null, null)", GetSQLValueString($_POST['school_state'], "text"), GetSQLValueString($_POST['school_name'], "text"), GetSQLValueString($_POST['school_db'], "text"), GetSQLValueString($_POST['folder'], "text"), GetSQLValueString($_POST['contact'], "text"), GetSQLValueString($_POST['email'], "text")); mysql_select_db($database, $db_con); if($Result1 = mysql_query($insertSQL, $db_con) or die(mysql_error())) { $message = 'Added to Database - Successful<br>'; } else { $message = 'Added to Database - Failed<br>'; } // Funcatiobn to copy sampel folder to new directory for school full_copy("01_sample","$folder"); // Echo results $message .= 'Install Date - '.$install_date; $message .= '<br>'; $message .= 'Expire Date - '.$end_date.'<br>'; $message .= 'Copy of Folder - Successful<br>'; $message .= '<br><br>School - '; $message .= $_POST['school_name']; $message .= '<br>Database - '; $message .= $_POST['school_db']; $message .= '<br>Folder - '; $message .= $_POST['folder']; $message .= '<br>Contact - '; $message .= $_POST['contact']; $message .= '<br>Email - '; $message .= $_POST['email']; // Write to school_info file $open = fopen ("$folder/school_info.php", "at"); fwrite($open, "<?php\n$".$old); fwrite($open, "school_folder = '$folder';\n$".$old); fwrite($open, "school_db = '$school_db';\n$".$old); fwrite($open, "database = $".$old); fwrite($open, "school_db;\n?>".$old); fclose($open); // Link to create a database on voting site $message .= '<br><a href="http://www.anaheimartscouncil.com:2082/frontend/x3/sql/index.html" target="_blank">Cpanel</a><br>'; // link to setup Database tables on new site $message .= '<br><a href="'.$folder.'/index.php?install=yes&school='.$school_name.'" target="_blank">Database Setup</a><br>'; // link to send email to client $message .= '<br><a href="web_install.php?email=yes&school_db='.$school_db.'">Send E-mail</a><br><br>'; }// end if school name, databae or folder already exists } elseif ((isset($_GET['email'])) && ($_GET['email'] == 'yes')) { $school_db = $_GET['school_db']; $results = mysql_query("select * from tbl_schools_vote WHERE school_db = '$school_db' LIMIT 1"); // removed the while loop to get rid of duplicate emails. //while($row = mysql_fetch_array($results)){ $row = mysql_fetch_array($results); $school_contact = $row['school_contact']; $school_folder = $row['school_folder']; $school_contact_email = $row['school_contact_email']; //} // end while loop $email_message = 'Dear '; $email_message .= $school_contact; $email_message .= ',<br>'; $subject = "Voting 4 Schools - Account Activated"; $email_message .= 'Your Voting 4 Schools account has been setup. Below is all the information that you should need to get started.<br><br> Here is a link to your voting site. <a href="http://www.voting4schools.com/'.$school_folder.'">www.voting4schools.com/'.$school_folder.'</a><br><br>At the bottom of the page you will find an admin link. The user name and password are as follows<br><br>User Name: admin<br>Password: vote<br><br>When you log in please go to the control panel and create a new admin user and delete the default one that we have assigned you. At the top of the page you will find a link that says video tutorial. If you are unsure how to use the software, this is a great place to start. If you have any questions, or need help setting it up, please let us know.<br><br>Thank You,<br>Ben Star<br><br>Software 4 Schools<br>(866)757-7226<br><a href="http://www.software4schools.com">www.software4schools.com</a>'; // website link here //$to = $school_contact_email.', support@software4schools.com'; $to = $school_contact_email; //$email = 'support@software4schools.com'; //$headers = "To: ".$school_contact_email."\r\n"; //$headers .= "From: Software 4 Schools <support@software4schools.com>" . "\r\n"; //$headers .= "Bcc: Software 4 Schools <support@software4schools.com>" . "\r\n"; //$headers .= "MIME-Version: 1.0" . "\r\n"; //$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n"; $headers = 'From: michael@anaheimartscouncil.com' . "\r\n" . 'Reply-To: anaheimartscouncil.com' . "\r\n" . 'Bcc: ben@software4schools.com' . "\r\n" . 'Content-type: text/html; charset=iso-8859-1'; //. "\r\n"; //. 'X-Mailer: PHP/' . phpversion(); if (mail($to, $subject, $email_message, $headers)) { $date = date('m/d/Y h:i:s a', time()); $myFile = "mail.txt"; $fh = fopen($myFile, 'a') or die("can't open file"); $stringData = "To: ". $to."\n"; fwrite($fh, $stringData); $stringData = "Time ". $date."\n\n"; fwrite($fh, $stringData); fclose($fh); $message = 'E-mail was sent once'; }else { $message = 'Problem sending message'; } } elseif ((isset($_POST['password'])) && ($_POST['password'] != 'mandb108' )) { $message = 'Password is incorrect'; $folder = $_POST['folder']; $school_db = $_POST['school_db']; $school = $_POST['school']; $contact = $_POST['contact']; $email = $_POST['email']; } else { // not sure what to do here yet... } // end if password isset from post if (!isset($_POST['school_db'])) { $school_db = 'voting_'; } ?> hi, im new here i hope to learn and help in the way i can since i'm a newbie with php but here it goes. I have some old databases i need to test, i want to mail these old users from a website i had but i need to know if the database contains invalid e-mails and remove them so i dont mess up my server's good ip reputation. So i found the checkdnsrr function: Code: [Select] function checkEmail($email) { // checks proper syntax if(preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/" , $email)) { // gets domain name list($username,$domain)=split('@',$email); // checks for if MX records in the DNS if(!checkdnsrr($domain, 'MX')) { return false; } return true; } return false; } so everyone knows this function, i just wanted to run it to multiple e-mail addresses like from a text file. when i say multiple, i mean arround 500.000 or 50k at the time. i just want to output the bad e-mails to a text file. hope someone can help me on this one. thanks in advance I have an index.php code. The code doesn't recognize UTF-8. The php identify the right part (one txt has many infos) from a .txt file and send that information to browser. Can I send this information to a specific email address instead of browser? And if Yes, can I say to this code to calculate more than one day but for more? Is this possible? Please help me with that. Thanks! [attachment deleted by admin] I'm building a PHP application that's connect to gmail and download the messages. I have an account that contains more than two millions messages and the PHP cannot connect to that account. What can I do? The error is: Mailbox has more messages (2004032) exist than maximum (1000000) Hello everyone, it's my first post here. I was recommend this community for it's professionalism and "friendlyness". During my stay here, please excuse my english. I know it can be unpleasant for you to read a thread with terrible grammar, I hate it in my native language, I'll do my best. Okay, so I'm having two major issues for my website to operate like I'd like it to, I've done everything I knew about, and I can't think about anything else Google didn't help me much either this time. First one is that I seem to have a cookies/sessions problem. Well, I use Liberty Reserve to allow my members to top up their account. So I send my form to their SCI and when I either cancel or complete a transaction, I return to my website but I'm not logged in anymore! So the auto-add to balance system can't work. Alright, when I saw this I was only using sessions, so I added cookies so I could rely on them too. And there again, same thing. Doubled, tripled checked all the LR settings and everything, I know they are right. But what's really, really, weird to me and what's really doing my head in is that I'm not actually logged out, because if I use another tab/window I'm still logged in. In other words, it's only the window coming back from Liberty Reserve that won't log in. The cookies are still here and so is the session so... Another terrible thing is that it used to work when I was on my previous host (just moved to a dedicated server, which may be causing the problems, it's the first time I administrate a dedi). This is blocking my entire website from working. And my second problem is with the function mail() -there again 'caused' by new server-. I don't get any error message, or anything. The e-mails with cPanel/WHM work great. Though, I have done several tests and it never reaches my Gmail, Hotmail or Yahoo account. It did work with a Yopmail inbox though. So, I was focusing on 'why isn't it sending it' but since I just noticed it worked with Yopmail, I'm sure it is sending it and have no ideas why wouldn't it work with other e-mail service providers. I hope you understood what I meant and that, hopefully, you guys can help me out with those totally handicapping issues. Thank you, Regards. -Ben. Hello, guys. I'm using the following code to send me an automated mail in case the user find a broken link. But there are 2 problems: 1) after submitting I'd rather not disrupt their game by refreshing the page. So, is there any way to send mail without the post refreshing? 2) if the user hits F5, the page reloads and the code runs again, sending two or more times the same email. How can I avoid duplicated emails caused by manual browser refresh? (the most important solution currently is how to to avoid duplicated entries, in case an ajax solution is too hard to post here.) <form name="fbrlink" action="<?= $_SERVER['PHP_SELF']."?page=ok" ?>" method="post"> <?php echo('<input name="sbrlink" id="B1" type="button" value="broken Link?" style="border:none; background-color:#FFFFFF; font-family:Trebuchet MS; font-size:15px; font-weight:bold; color:#1A4877; cursor:pointer; display:block; text-decoration:underline;" onclick="this.form.submit();"/>'); ?> <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($_SERVER['QUERY_STRING'] == 'page=ok') { echo '<script type="text/javascript" >confirm("Click OK to notify us.");</script>'; mail("contact@ctt.net","report broken link","Game notified:MarioBros"); echo '<script type="text/javascript" >document.fbrlink.sbrlink.disabled = true;</script>'; ?> <script type="text/javascript" >document.fbrlink.action='<?php echo $a; ?>'; alert('<?php $_SERVER['QUERY_STRING'];?>'); </script> <?php } else {} }else{ } ?> Hello, New to this forum so appreciate the patience and apologize for any breaking of etiquette. I currently have a PHP script which generates the appropriate HTML headers and body packet and would like to place it in either a Thunderbird outbox so that Thunderbird will handle sending it or put it in the Evolution outbox so Evolution will handle the actual sending of the e-mail. I've scoured the internet looking for an answer and I know it is possible because I wrote a bash script to do it a few years back that I can't find. Would appreciate any insight. Thanks, |