Plain Text Email Spacing Issues?
PHP Code:
// create final message, $text refers to the textarea they typed the original message in $message2 = "Dear $firstname,
$text
Regards,
The Team......
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
Plain Text Email
I'm wanting to protect all inputs for sending a plain text email, in a common routine. Have just found POSIX [:print:] which I thought looked useful. I didn't want to use htmlentities(); because it's a plain text email. Would this protect me from anyone sending spam though this? $raw = stripslashes($raw); $raw = preg_replace("/(content-type|bcc:|cc:|onload|onclick)/i", "DELETED", $raw); $raw = strip_tags($raw); $raw = preg_replace("/[^[:print:]]/", " ", $raw); $raw = substr($raw, 0, 500); $raw = trim($raw); Or, should I use: $raw = htmlentities($raw, ENT_NOQUOTES); The email address would obviously be different. This would cover just the name, subject and message. I don't need newlines etc.
View Replies !
View Related
Sending Plain Text Email
I have created a survey and I would like the results of the survey to be emailed the boss in *plain text*. Can someone PLEASE take a look and tell me why carriage returns are not being inserted after each $body ? The email comes out as one big line. Code:
View Replies !
View Related
Text Area Spacing...?
I have a form, and it's a text area. If I press enter twice, it makes a double space, but when I press submit, and it changes the page, it does not double space!. How can I make my code translate those "enter button" presses into a new line? Just in case you need to know, it's writing whats inside the text box into a row in my MySQL Database. So in a way, you could say that when you press the "enter" button, the text area does not take it as a new line. Here is my code:
View Replies !
View Related
Email Script - Line Spacing / Format
The script that i bought that runs my jobsearch site has a built in email script that you can send an email to the jobseekers or the employers that are in the database. The only problem is that the emails it sends out are all screwy When i get a copy of the emails it has extra line breaks, sometimes 3 breaks, when in my text editor it only has one. I have had emails from clients who said that the format was the complete oposite, that the whole email was one big paragraph! Code:
View Replies !
View Related
Csv Using Text/plain
I am using Excel to save a spreadsheet in .csv format. This creates a text file with extension .csvBut when I try to upload the file to the server by checking for its MIME type using $_FILE['userfile']['type'] I get my own error message that the file is not text file. If I change the extension to .txt I am able to upload the file. This is not reliable as it is only relying on extensions rather than contents of the file. Is there a reliable way of checking for file formats. I would like to upload jpeg, gif and text files reliably.
View Replies !
View Related
Text/plain Or Text/html?
I have a site (that someone else programmed) and I'm trying to fix a problem with the email formatting. There are five or six php scripts that send an email after registration, renewal, etc.. The only script that sends an email which is formatted correctly (ie, with line breaks in the body) is the one that says: $headers .= "Content-type: text/plain; charset=iso-8859-1"; The scripts that say text/html DON'T format the emails correctly. Isn't this backwards? Or should I just change all of the scripts to text/plain and not try to make sense of it?
View Replies !
View Related
Plain Text Database
i'm really a newbie to php but not OOP. i'm designing a database to hold simple text messages to display in a page called, "News". The client doesn't want a sql database so I suggested a plain text database. I have it working but when I pull the data (fopen) it all comes back as one line. It's set up as a simple form passing 2 variable, $title and $comments. They both write (fwrite) just fine to the .txt file but upon retreiving them (fopen) it's all one line. Since I can't pass formated text to a .txt file is there a different way? As a newbie I haven't come across a solution yet. The client wants this soon so I'm asking here due to the timeline. Given a few more weeks I'm sure I'd stumble across it in some text.
View Replies !
View Related
RTF To Plain Text Conversion
does anyone know of a good PHP "module" -- or something else that I can invoke from a PHP script -- that will perform a simple conversion from Rich Text Format (RTF) to plain text with line breaks? I want to store some data in a MySQL database in RTF and allow users to preview the data as unformatted text (except for line breaks/paragraphs) on a webpage before deciding whether to download a file containing the RTF data. I'd rather not try to hack something out myself if I don't have to. The RTF files are likely to be created with Microsoft Word.
View Replies !
View Related
Reading Plain Text
I have a small file wich i would like to insert in a database. the file has information from different users every line everyfield is separated with a coma. How do i read this with php so i can insert it?
View Replies !
View Related
Extract Only Plain Text From A Page
Basically, what I am trying to do is write some PHP code that will automatically take text from any web page and eliminate all the HTML, CSS, and JS codes and formatting, leaving only the plain text from the page. I got my code started, but I have hit a snag with javascript and css codes. This is what I have so far: <?php $geturl = $_GET["url"]; ob_start(); include($geturl); $page = ob_get_contents(); ob_end_clean(); $output = ereg_replace('<script.*.</script>', ' ', $page); $output2 = ereg_replace('<style.*.</style>', ' ', $output); $plaintext = strip_tags($output2); echo $plaintext; ?> The strip_tags function automatically removes all html tags, but it doesn't do anything to javascript and css because html code is not provided between the beginning and end tags, whereas javascript and css codes are both contained within two separate tags, like this for more clarification: html: <div name="htmltag">Keep this text here</div> javascript: <script>function somejs() {remove all this code}</script> As you can see, the text between the div tags should stay, but the js between the script tags should be removed because it is code. I then tried the ereg_replace function to get rid of js and css codes, but there is a problem when there is more than 1 piece of js or css code. The wildcard value (.*.) skips over any ending script or style tags until it reaches the last ending tag, therefore deleting all the text between the two pieces of code. Example: <SCRIPT>function somejs() {remove all this code}</script> //removes all text and code from beginning here KEEP ALL THIS TEXT HERE <script>function somejs() {remove all this code}</SCRIPT> //to end here Now finally down to the question, is there any way to only remove the js and css code between the beginning tag and the immediate next ending tag? Or is there any other way to get rid of the javascript and css codes?
View Replies !
View Related
Convert MS Word / Rtf / ... To Plain Text
i'm looking for standalone libraries that convert documents to plain text so i can let people edit the text in a textarea after uploading. One thing to notice is that i can not use COM because i can't configure the webserver. Does anyone has interesting classes that are able to do this. I found a PHP class for ms word documents at http://obninsk.name/obninsk_doc/ but that doesn't work at all for my word documents.
View Replies !
View Related
Display Code As Plain Text
how to display code as plain text on an html page? I've tried using <PRE> and <TEXTAREA> but that isn't working. <LI> is still transformed into a bullet, and other things like that keep happening. <TEXTAREA> just makes it look really messy. Basically, I want something exactly like this: PHP Code: <? if (isset($_POST['submit'])) { Â Â echo "This is exactly what I want to do."; } else { Â Â echo "Dangit. I can't figure it out."; } ?>
View Replies !
View Related
Phpinfo() Outputs Plain Text
When I execute a file with the phpinfo(), it outputs plain text instead of html. I've read that is has got to do with CLI (command Line ...). Config: Windows Xp IIS php: 5.1.2 What do I need to change to get html output (and where can I find it)?
View Replies !
View Related
Encoding A Plain Text File In UTF-8
I need to export database values to the contents of what will be a rather large file of around 100 MB into UTF-8 format. If I encode each line before it is written using utf8_encode(), could I expect to run into any problems decoding the file later? Also, would the file automatically be detected as UTF-8 by any editor or would I need to change some file attribute to designate it as UTF-8? The file can't have any XML tags in it.
View Replies !
View Related
Get File Contents As Plain Text
How can i get the html of a webpage not located on my server and check to see if the a div with the class myclass is present in the document if it is return the contents in between the div. In this case it would be: Hello this is a class <div class="myclass">Hello this is a class</div>
View Replies !
View Related
Modifying A Plain Text File
i have a text file with (ID - client name) like this: 01-bill 02-matt 03-john 04-martin I want to open this file, search for the id (ie. "03") and change the name "john" for another. How can i do this? How can i change an entirely line and save the results?
View Replies !
View Related
Plain Text Table Simulation
I'm currently working on an ecommerce project that requires the system to send out reciept emails after each order has been completed. I notice in own store email receipts that they're all plain-text, which is fine by me, but they also manage to format their text so that it appears as if there are tables in there for listing the products i've bought.
View Replies !
View Related
Saving To Plain Text File
I want to do exactly is open a file that essentially has alot of variables stored in it like this. $names = 'joe¦bob¦clem' $phone = ?¦323232' And it just goes on like that for a few hundred variables. Now all I want to do is open the file up find a certain variable and then just add the string I have to it. So like I have the new $names variable and it contains 'joe¦bob¦clem¦chris' and I just want to save that string to the file. I know it's possible but I usually work only with mySQL so I don't know how to open a file find where I want to edit, edit it and then save the file.
View Replies !
View Related
Mail() Plain Text Vs. Html Format
I have been testing the mail() code below using MS Outlook and Outlook Express and a hotmail account and the details sent are always in "plain text" format, which results in the information being nicely aligned (incidentally the e-mail contains order confirmation with lots of columns). However, my customer came back to me this morning to tell me that all is not well ! And rightly enough, when I looked at the snapshot he sent me he is receiving it in "html" format. What am I doing wrong ? Keeping in mind that I am a PHP greenhorn ... Can anyone help. Thanks in advance ! $headers = "From: info@somecompany.com "; $headers.= "X-Sender: <info@somecompany.com> "; $headers.= "X-Mailer: PHP "; $headers.= "X-Priority: 1 "; $headers.= "Return-Path: "."<info@somecompany.com> "; $headers.= "cc: info@anothercompany.com "; $headers.= "bcc: me@mycompany.com "; $headers.= "MIME-Version: 1.0 "; $headers.= "Content-type: text/plain; charset=iso-8859-1 "; if(@mail($to,$re,$msg,$headers)) { // tell them all was sent fine } else { // give an error message }
View Replies !
View Related
Inserting/parsing Plain Text With 'require'?
I am trying to setup a very simple site that will pull text files into an existing template. I am using a simple require statement, such as: <?php require "/www/companyname/body.txt" ?> The first problem is that it does not seem to respect the linefeeds, which are saved in Unix format, and just lists it as one massive block of text. The second problem is that, obviously, it does not convert symbols such as '&' to '&'. The reason behind this way of including text into HTML files is so that the lecturers can write articles without having to deal with HTML and the articles are inserted into the HTML templates with the 'require' statement. Also, the shear number of text documents that need to be posted would cause a lot of work. I have looked at Project Midguard, but I tend to shy away from applications with little documentation, even though that would be absolutely ideal.
View Replies !
View Related
Application/octet-stream Vs Text/plain When Uploading
when testing Zend's file upload script, i uploaded a file (sql.txt that was a sql backup) and $_FILES reported it as text/plain as it should. as soon as i renamed it to sql.sql, $_FILES now reports it as application/octet-stream. all i did was rename the file. to make matters worse, i thought Windows XPpro was adding some bits to the file to explain $_FILES new type so i renamed sql.sql to sql.exe; $_FILES now says it is text/plain, even with the .exe extention. does anyone know why adding the .sql extention would change the type from text/plain to application/octet-stream? btw, the webhost is a linux box (RH). more tested extentions (renaming sql.txt to the following extentions) .sql - application/octet-stream .php - application/octet-stream .gz - application/octet-stream .tar - application/octet-stream .htm - text/plain .html - text/plain .txt - text/plain .exe - text/plain .gif - text/plain .jpg - text/plain .asp - text/asp .rpm - audio/x-pn-realaudio-plugin .wav - audio/x-wav .mp3 - audio/mpeg (all i'm doing is changing the extention, nothing more. opening the file in notepad looks all ascii, no funky characters)
View Replies !
View Related
Phpmailer.class Messages Are Been Converted To Plain Text...
I am using a phpmailer class to send some staff over the email... I am tring to send it with text/html but for some reason the email are been converted to plain and all the headers are shown, here is the email... X-Tour4Less.co.il Mailer: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="b1_27976937fb6a931b3ed2d40aebd76a26" --b1_27976937fb6a931b3ed2d40aebd76a26 Content-Type: text/plain; charset = "windows-1255" Content-Transfer-Encoding: 8bit ×*יסיון עברית --b1_27976937fb6a931b3ed2d40aebd76a26 Content-Type: text/html; charset = "windows-1255" Content-Transfer-Encoding: 8bit <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"<html> <head> <META HTTP-EQUIV="Content-Type" content="text/html; charset=windows-1255"</head<body<p dir=RTL><span lang=HE>שלום חברת Tour4less contact .</span></p<p dir=RTL><span lang=HE>משתמש של האתר שלנו </span><span dir=LTR>TOUR4LESS.CO.IL</span><span dir=RTL></span><span lang=HE><span dir=RTL></spanהתעניין ביצירת קשר איתו ע"י.........
View Replies !
View Related
Sending Plain Text E-mail, Trying To Track Accesses
i am using php to dispatch from time to time using the mail() function. i have the message split into an html form and a plain text form, only one displays depending on the recipients mail client. my html message includes a 1x1 "image" that is really a php script, which allows me to track reads on the html version... but i don't know of a way to track reads/views/accesses/etc on the plain text version. is this possible?
View Replies !
View Related
Extract The Information By Converting The Binary File To Plain Text
I tried to extract the information by converting the binary file to plain text but I couldn't find any defining characteristics which I could use to extract the information. After looking around to see if anyone else had managed to accomplish this I found that the Freetype library has functions which can access the information I want, specifically TT_Get_Name_ID and TT_Get_Name_String. However I can't figure out how to access these functions from PHP (even though I have freetype installed with GD) or how to convert the code to php.
View Replies !
View Related
Working With Plain Text Passwords In Shell/telnet Script
I've got a crafty script that uses a really nice little php telnet class to feed commands via telnet to a remote application. Part of the script, however, is logging in: once to the remote unix host, x-times into submodules of the application itself. What is the best way to store these passwords so that at the time of execution, they're transmittable as plain text but so they're not easily retrieved via code source, db view, or external file view?
View Replies !
View Related
Regular Expression To Remove All The HTML Elements And Only Leave The Plain Text.
I am trying to take some HTML and remove all the HTML elements and only leave the plain text. Basically I am trying to extract information that was put into an HTML table. I have a regular expression which catches the HTML elements, it is <.*?> but I actually want the inverse of this, that regular expression returns the HTML elements to me, I want the plain text. I tried doing [^<.*?>]+ but square brackets will only work with 1 character at a time, so it is not seeing <.*?> as a whole.
View Replies !
View Related
Email Issues
I am sending out a newsletter. Everytime I send out the body the email shows any Qutoes with backslashes. EG: This is a 'test' Shows to the user: This is a 'test' Now, before I send the $body variable I put it through stripslashes() but that doesn't work. Code:
View Replies !
View Related
Email Issues.
I'm sending a MIME email with attachment from a form on a webpage to an email address on the same domain and they're not recieving it. I've tried all kinds of combinations of headers but they're just not getting it and neither is the designer I'm workign with, neither of their domain emails (on different hosts) can recieve the email. I've told them to contact their hosts multiple times but they wont, now they want to redevelop the whole thing storing everything in a db and have logins etc, all at my expense - which I've told them I'm not going to do. I want to be able to resolve this peacefully and not have to get the lawyers in to get my fee, so hopefully this can be solved at a code level. Code:
View Replies !
View Related
Mime_content_type() Returns "text/plain" For Quicktime Videos > 10mb
echo mime_content_type('/var/www/html/video/small.mov'); // 1.5mb Quicktime video returns "video/quicktime" echo mime_content_type('/var/www/html/video/huge.mov'); // 10.5mb Quicktime video returns "text/plain" PHP 5.0.4 - Windows XP --enable-mime_magic PHP 4.3.11 - Fedora Core 4 --enable-mime_magic In both cases, "--enable-mime_magic" was allowed with PHP installations. In both cases, if the Quicktime video is small, the MIME type returned is right; if the Quicktime video is large, the MIME type returned is wrong. We managed to change upload_max_filesize on /etc/php.ini and restarted HTTPD, however, this did not fix the mime_content_type() problem. We even changed the mime_magic.path variable to point to HTTPD (Apache)'s "magic" file instead of PHP's "magic.mime" file, which fixed an earlier problem with PNG images, but not with large MOV files. Any suggestions?
View Replies !
View Related
Email With Attachment Issues
I've been trying to make a script that would send an email with an attachment that a user selects off of his/her computer (It's for a resume enquiry). I've gotten very close, and can post my close attempt if that would help. Does anyone know where a prebuilt script for this is? Or for just emailing with an attachment that works (in PHP4)?
View Replies !
View Related
Input Text Issues
Whenever I receive input from an HTML text field or and HTML text area with " or ' meaning double or singe quotes into a php variable and then print or echo it back out to the user in html I get these characters accompanies by a . Why is this and how can I get rid of it. $submitform->body=@$_POST['body']; <<<< there are no in the input. print("body - ".$submitform->body."<br>"); <<<< but here there will be slashes for all ' or " .
View Replies !
View Related
Issues With Text Boxes
I have some textboxes that only require a single digit to be entered for a form... Seems to work fine, but every now and then when i test it on other computers, you click inside the box to enter the digit and for some reason it doen' repond... you hit the key to enter the number and nothing shows up inside of the box. Quite strange..
View Replies !
View Related
Including Database Fields In Email Forms & Other Form Issues
I need to find out how to put database fields into an email form as well as add radio buttons, drop down boxes, etc. I have some basic textarea boxes in the form part so far. Here is my code. The upper half of the page shows a search result and the lower half is a form that my client can notify us of changes they would like to make to a specific account. Code:
View Replies !
View Related
Saving Variables As Text Files: Any Security Issues?
I've been reading all the posts about permissions but I'd still like some help! I'm building a site where I have user account folders containing photos and text files. At this stage I'm not allowing user uploads - I'll do that myself via FTP, but for simplicity I'd like to save the settings and variables for each account in simple text files rather than use mysql. In order for my scripts to change the values in these text files I need to change the permissions to allow writing - but I'm not sure exactly what secruity issues are involved?
View Replies !
View Related
Spacing
I am making a series of forms which allow end-users to enter data in a textarea online... Many times they will be pasting text and I have noticed that when they past text, the text pasted has left trailing spaces behind it... there are 3-4 returns after the last character.. My question is how do I get rid of these spaces and still allowing space (returns) in between large amounts of info.
View Replies !
View Related
Spacing In Fields
I have a posting system for news, the admin types in what news he wants to post on his page via an admin section and another script out puts his comments from a database. My problem is as follows, if someone types a post and adds a space in it how to I get php to recognise this as a <BR> or whatever, e.g : intended post : "news blah blah etc regards . . ." but this is what I get "news blah blah etc regards . . ." as if the whole thing were one line, does anyone know a little trick for this ?
View Replies !
View Related
Spacing For <UL> Tags
Can anyone tell me if there is a way to set the default tabbing for the <UL> tag? For instance, if I display this.. Code: <ul> OPTION 1 <ul>OPTION 1a</ul> <ul>OPTION 1b</ul> OPTION 2 <ul>OPTION 2a</ul> <ul>OPTION 2b</ul> </ul> It puts all the options quite spaced apart (like a tab size). Any way of sorting this using CSS?
View Replies !
View Related
Table Spacing`
I want a table that has no cellspacing, border or padding. I'm using the following: echo "<table border=Ɔ' cellpadding=Ɔ' cellspacing=Ƈ' class="nx">"; But that leaves a smallspace. Is the syntax correct?
View Replies !
View Related
Spacing - Set Up The Top Of The Page To Set The Variables
I made a form that calls itself. HTML Code: <form action="<? echo $_SERVER["PHP_SELF"]; ?>" method="POST"> Now when I set up the top of the page to set the variables. it creates a giant gap at the top of my site. What am I doing wrong? HTML Code: <? $fname = $_POST["fname"]; $lname = $_POST["lname"]; $email = $_POST["email"]; $address = $_POST["address"]; $city = $_POST["city"]; $state = $_POST["state"]; $zipcode = $_POST["zip"]; $hphone = $_POST["hphone"]; $mphone = $_POST["mphone"]; $housing = $_POST["Own"]; $doors = $_POST["numberdoors"]; $comments = $_POST["comments"]; ?> <html>
View Replies !
View Related
Email Box - Text Editor
I'm writing a PHP program that will mass email to my clients in my database. Does anyone have any ideas how to create a email box similar to yahoo o Googles compose email form? It would be nice to edit text size and color.
View Replies !
View Related
Html Text In Email
i want to send them in mail. and wanted to display them as a html page. i have tried but in mail it displayed the html code not the result. <table><tr><td> jkshio sv9puips opi opg pgig g <a href ="to link </a> some bold <b>text will be here </b></td></tr></table>
View Replies !
View Related
How To Read HTML Email Text?
I've done a couple of hours web-searching without turning up many answers so far, and I guess I could figure it out (eventually) from the MIME format, but here goes with my question... I don't have any problems reading text emails, but can anybody direct me to some PHP source code that will read (the text inside) an HTML email, specifically the "From", "Subject" and especially the message body? I would like the code to be able to differentiate between (i.e. know that it is) a text or an HTML email, and I would like the code to ignore any attachments. I don't expect the incoming email to have any (or large) attachments, but I hope that any code samples can handle the possible case of big attachments coming along for the ride. Incidentally, if I did (not this time) want to handle large attachments, can PHP and/or servers handle megabytes of data being read into a string variable through fread()? I'm just getting into this stuff, and not sure of what areas would be a resource and/or performance hog.
View Replies !
View Related
|