Re: [PHP] Re: Very Large MySQL Query String
Dear Javier, Yes, indeed when you encode the file it grows. Normally about 30%.. Thus, the file in my situation of 1 Megabyte grows to 1.3 MegaByte.. But I would expect that this should not give any problems... The columns I am using allows 16 Megabyte.. Does anyone else know what the string limitation of PHP Mysql query function is? With kinds regards, David Bouw Hi, I think if you encode the file with base64 and store it in the database the size of the document will be more than 1MB sure. David Bouw wrote: Dear Kirk (and Julio) Thanks for the response.. I don't want to use a link to the images because backing up my data and porting it to another machine is much easier. (Replicating is also very easy.) When storing the file separately this gets more complex, especially when you want to get this data from another machine... The stored data isn't retrieved very often, so speed isn't really an issue. (Till now speed really never was an isse. When adding the right indexes MySql + PHP does incredible things!!.) I do though use the suggested 'linking' method for an website where the images are needed on the website.. In the current situation though I store PDF images of invoices which are basically only needed to look something up if there is a problem... Kirk, I already tried changing the properties of the column in which I store the images.. (Currently it is an longtext, but before this I always used an Longblob...) I can't remember the exact sizes of MySQL, but I believe that an Mediumblob can handle 16 Megabyte.. (I know have little more than a 1 MB..) I will try some things tomorrow, but I can't find out what the problem is.. (Column size, PHP-Mysql string length limitation or maybe something I am overlooking..) I can though echo the query to screen and see that the uploaded file is encoded to a very nice (large) text-string.. Any other suggestions are greatly appreciated. With kind regards, David Bouw If I use the link to the file, i.e. file//C:\filedir\file.pdf or .txt or whatever how do I insert/update/delete the file since MySQL is holding only the link? BTW David, what are the properties of the field you are inserting to? Could that be the problem? -Kirk Julio Nobrega Trabalhando [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Instead of uploading to Mysql, why don't you store the file at a directory and on Mysql only the path to it? Retrieving files from the hard drive is much faster than doing the same on Mysql, and also access to manipulation (insert, update, delete, etc...) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 David Bouw [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I can't seem to figure out the following. I use the http upload functions a lot, works great!!.. For some months now I have been using a small PHP program which I use to upload PDF files of scanned documents and insert them into a Mysql table.. Normally these files are small (250 kb), but I now have a PDF of 1 MB... When uploading files I run the function: chunk_split(base64_encode($binaryfile)); to encode it, this to transform the binary file to text.. (Works great!!!) When the query was called to insert the data, nothing happens, also no error from mysql... Only think I can think of is that the mysql query string is to long.. ?? (The data when encoded is about 1.3 MB of text).. This is the source code.. if (!($userfile_size == 0)) {$fd = fopen ($userfile, r); $contents = fread ($fd, filesize ($userfile)); fclose ($fd); unlink ($userfile); echo Eerste RAW: .strlen($contents); $encodes_data = chunk_split(base64_encode($contents)); $userfile_name = str_replace( , , $userfile_name); echo strlen($encodes_data). - Displays text size BR; //Works right! mysql ($databasename_boekhoud, insert mubo_boekhoud_images (data, originalname, groep, type) values '$encodes_data', '$userfile_name', '$groep', '$userfile_type')); // mysql_error(); //No error given..? } Any suggestions are very much appreciated... With kind regards, David Bouw -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Very Large MySQL Query String
I can't seem to figure out the following. I use the http upload functions a lot, works great!!.. For some months now I have been using a small PHP program which I use to upload PDF files of scanned documents and insert them into a Mysql table.. Normally these files are small (250 kb), but I now have a PDF of 1 MB... When uploading files I run the function: chunk_split(base64_encode($binaryfile)); to encode it, this to transform the binary file to text.. (Works great!!!) When the query was called to insert the data, nothing happens, also no error from mysql... Only think I can think of is that the mysql query string is to long.. ?? (The data when encoded is about 1.3 MB of text).. This is the source code.. if (!($userfile_size == 0)) {$fd = fopen ($userfile, r); $contents = fread ($fd, filesize ($userfile)); fclose ($fd); unlink ($userfile); echo Eerste RAW: .strlen($contents); $encodes_data = chunk_split(base64_encode($contents)); $userfile_name = str_replace( , , $userfile_name); echo strlen($encodes_data). - Displays text size BR; //Works right! mysql ($databasename_boekhoud, insert mubo_boekhoud_images (data, originalname, groep, type) values '$encodes_data', '$userfile_name', '$groep', '$userfile_type')); // mysql_error(); //No error given..? } Any suggestions are very much appreciated... With kind regards, David Bouw -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Very Large MySQL Query String
Dear Kirk (and Julio) Thanks for the response.. I don't want to use a link to the images because backing up my data and porting it to another machine is much easier. (Replicating is also very easy.) When storing the file separately this gets more complex, especially when you want to get this data from another machine... The stored data isn't retrieved very often, so speed isn't really an issue. (Till now speed really never was an isse. When adding the right indexes MySql + PHP does incredible things!!.) I do though use the suggested 'linking' method for an website where the images are needed on the website.. In the current situation though I store PDF images of invoices which are basically only needed to look something up if there is a problem... Kirk, I already tried changing the properties of the column in which I store the images.. (Currently it is an longtext, but before this I always used an Longblob...) I can't remember the exact sizes of MySQL, but I believe that an Mediumblob can handle 16 Megabyte.. (I know have little more than a 1 MB..) I will try some things tomorrow, but I can't find out what the problem is.. (Column size, PHP-Mysql string length limitation or maybe something I am overlooking..) I can though echo the query to screen and see that the uploaded file is encoded to a very nice (large) text-string.. Any other suggestions are greatly appreciated. With kind regards, David Bouw If I use the link to the file, i.e. file//C:\filedir\file.pdf or .txt or whatever how do I insert/update/delete the file since MySQL is holding only the link? BTW David, what are the properties of the field you are inserting to? Could that be the problem? -Kirk Julio Nobrega Trabalhando [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Instead of uploading to Mysql, why don't you store the file at a directory and on Mysql only the path to it? Retrieving files from the hard drive is much faster than doing the same on Mysql, and also access to manipulation (insert, update, delete, etc...) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 David Bouw [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I can't seem to figure out the following. I use the http upload functions a lot, works great!!.. For some months now I have been using a small PHP program which I use to upload PDF files of scanned documents and insert them into a Mysql table.. Normally these files are small (250 kb), but I now have a PDF of 1 MB... When uploading files I run the function: chunk_split(base64_encode($binaryfile)); to encode it, this to transform the binary file to text.. (Works great!!!) When the query was called to insert the data, nothing happens, also no error from mysql... Only think I can think of is that the mysql query string is to long.. ?? (The data when encoded is about 1.3 MB of text).. This is the source code.. if (!($userfile_size == 0)) {$fd = fopen ($userfile, r); $contents = fread ($fd, filesize ($userfile)); fclose ($fd); unlink ($userfile); echo Eerste RAW: .strlen($contents); $encodes_data = chunk_split(base64_encode($contents)); $userfile_name = str_replace( , , $userfile_name); echo strlen($encodes_data). - Displays text size BR; //Works right! mysql ($databasename_boekhoud, insert mubo_boekhoud_images (data, originalname, groep, type) values '$encodes_data', '$userfile_name', '$groep', '$userfile_type')); // mysql_error(); //No error given..? } Any suggestions are very much appreciated... With kind regards, David Bouw -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] Translating email to (real) plain text...
Hi Richard, So far so good! Only problem which I have is that some (=most) people create email with clients that output email with HTML codes (Internet Explorer for example).. Internet Explorer is a browser, it doesn't create email. It was a bit late, I meant Outlook Express which comes/came with Internet Explorer.. Does anyone khow how this is done..? Use either the imap extension, or the mimeDecode class available in PEAR, or here: http://www.phpguru.org Thanks for the tip! I grabbed (your) code and tried to decode some messages.. This (almost) worked perfectly..!!!. I only have the following problem: I (also) use your html.mime.mail class, for generating outgoing messages in php... :-) All messages generated by this class I can't decode the body.. :-( Because I am using your mime_mail.class quite some time I took a look at the version I was using.. I saw that I was still running 1.26.. I can remember that when I installed it, I had a lot of trouble getting the HTML emails to display correctly.. Back then I fixed it by removing all the '\r' characters in the source.. (I think this is the reason the decode class won't decode the body..) I grabbed version (2.0.3) with the hope that it would work out of the box.. But I still (now) have the same problem which I had with 1.26 I saw that you could define the CRLF yourself, I fiddled with '\n', '\r\n' and a few others.. But this doesn't seem to do anything for me... :-( I have attached the -not-working- generated email.. This was done using PHP 4.0.6 and the internal mail function.. (Qmail delivered the email.) I will give the smtp class a try tomorrow to see if that will work, but I still don't really understands what it does.. (Does it inject the email in mailer for the given IP number..?? Or does it try to deliver email himself to different hosts..?) I will try to solve the html.mime.class problems, and I think that will then also solve the decoding problem I have now.. Bye Bye David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Translating email to (real) plain text...
Hi there, I would like to ask some suggestions on my following problem: I am making a small tool which allows you to store incomming mail in a database table. This mail is then scanned on keywords etc etc and with the help of some status bits the priority is given. Via a webpage interface, people can then answer these emails... I started out by creating a extra Mailbox to which I route all the incoming mail. With the help of a Cron-Job which runs a PHP class made by Manual Lemos to retrieve POP mail I retrieve the mail and insert it into a database table (MySQL) So far so good! Only problem which I have is that some (=most) people create email with clients that output email with HTML codes (Internet Explorer for example).. I am not really interested in any attachment, pictures etc which are sent with the email, only the plain email body is important. For emails that contain HTML tags, I think that stripping the HTML tags will do enough for me.. I do though have a problem when dealing with emails in which text is Mime-encoded. The Mime_Class from Manual encodes everything for example.. Before I spend a great deal of time making some code which can decode and strip all the diferent email-client formats, isn't there a class out there which can get me the plain text email body out of a raw retrieved email..?? The Mailling-list archives of this PHP maillinglist at http://marc.theaimsgroup.com/?l=php-general for example contains very nicely stripped emails of all the members.. Does anyone khow this is done..? Thanks in advance for any help.. With kind regards.. David Bouw PS: To give some examples of problems I see in the retrieved mail I have quoted some pieces: -- -- //A stripslashes will do a lot for me.. --=_NextPart_001_0071_01C18105.33ABC800 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable This is a mail send to myself --=_NextPart_001_0071_01C18105.33ABC800 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN HTMLHEAD META content=3Dtext/html; charset=3Diso-8859-1 = http-equiv=3DContent-Type META content=3DMSHTML 5.00.3314.2100 name=3DGENERATOR STYLE/STYLE -- -- //I can probably us mime_decode, but I think that this will take quite some hours to code.. This is a MIME encoded message. Created by html_mime_mail.class. See http://www.heyes-computing.net/scripts/ for a copy. --=_7c76c35e24d83834b9c31a94ad6407ca Content-Type: multipart/alternative;boundary==_c15b829df5ff4f43680605bb761b564f --=_c15b829df5ff4f43680605bb761b564f Content-Type: text/plain Content-Transfer-Encoding: base64 PFBSRT5CZXN0ZSBQYXRyaWMgVmVyaG9ldmVuLAoKV2lqIHdpbGxlbiB1IGdyYWFnIGRlIHN0YXR1^M cyB2YW4gdXcgYmVzdGVsbGluZyBkb29yZ2V2ZW4uClV -- -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Site running from MySQL
Maybe this will be a surprise, but I think that more than 90% of the webpages that use MySQL, use it do exactly what you are wondering about.. Not only are the searches a lot easier, but if you do it right you can make a website which won't contain any dead links... (By generating links to other pages from the database.) The basic idea is though to make some kind of template in PHP which contains all the HTML code and that you store all text data in the database.. This text-data is then fitted between te HTML tags when you call the page.. (If you do it right (in my opinion) you will have a database which only consists of data, and PHP pages which only contains PHP code echoing HTML code with record information from the database.. When using BLOBs etc I can't see that you will ever run into limitations unless you are doing something silly.. Try it...! Out of interest, would it be possible to load a webpage as a record in a MySQL database, having another field as say a number or a unique name so that a whole site could be placed in a database with a couple of php files? Is there a limit on the size of a field in MySQL which would stop you doing this though and would it be noticeably slower that html / php files? I was only wondering as it would make full text searches an awful lot simpler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Header Nightmare...
Who can crack the following nut for me..? Or is it uncrackable...? I have some files stored in a MySQL database... I encoded this data using base64_encode.. These files can be anything from .pdf files to .jpg or even a Word document... To make these files visible I made the following code: include (config/database.cfg);//config file to connect to database etc etc... $result = mysql ($databasename, select * from image_table where id = '$admin[file]'); $nrrows = mysql_numrows($result); if ($nrrows == 1) {$row = mysql_fetch_array($result); header(Content-type: $row[type]); header(Content-Disposition: inline; filename=$row[originalname]); echo (base64_decode($row[data])); exit; } O.K, heres the problem... Basically the above example works for all documents which Explorer 5.5 (which I am testing on) has got built-in support for.. All documents which use an external application/plugin are giving problems! On the moment I am experimenting with .PDF files... My problems is binary data (of the pdf) showing up in my browser.. (E.g... It looks as if the normal html/text tag is used for the content... I need explorer to start Acrobat to view this page... The idea that I get, is that I named the above script: retrieve_date.htm I have got a feeling that Explorer 5.5 is still very buggy with the headers, especially when the filename you retrieve hasn't got the same extension as the filename will original be... Does anyone see any mistakes which I am making... ? With kind regards David Bouw -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] compiling PHP 4.04pl1 as dymanic module with Apache 1.3.19
Hi there, Till now I have always compiled and used PHP as an static module with Apache.. For the experience and to make it a little easier to compile different PHP packages I want to use PHP as an dynamic module.. Reading the documentation this seems easy... First I got apache 1.3.19 and ran: ./configure --target=/var/apache --enable-module=so Compiled and did a make install Did a ./httpd -l in the /var/apache/bin directory and got: Compiled-in modules: -- Cut out other listed modules -- mod_so.c suexec: disabled; invalid wrapper /var/apache/bin/suexec Looks great ... Then I got PHP-4.04pl and ran: ./configure --with-mysql --with-apxs --with-pdflib After starting I get the error: checking for AOLserver support... no checking for Apache module support via DSO through APXS... ./configure: apxs: command not found Sorry, I was not able to successfully run APXS. Possible reasons: 1. Perl is not installed; 2. Apache was not compiled with DSO support (--enable-module=so); 3. 'apxs' is not in your path. configure: error: ; Well, O.K, /var/apache/bin isn't a place PHP will probably look, so I run it again with: ./configure --with-mysql --with-apxs=/var/apache/bin/apxs --with-pdflib And then I got the error: checking for Apache module support via DSO through APXS... Usage: apxs -g [-S var=val] -n modname apxs -q [-S var=val] query ... apxs -c [-S var=val] [-o dsofile] [-D name[=value]] [-I incdir] [-L libdir] [-l libname] [-Wc,flags] [-Wl,flags] files ... apxs -i [-S var=val] [-a] [-A] [-n modname] dsofile ... apxs -e [-S var=val] [-a] [-A] [-n modname] dsofile ... Sorry, I was not able to successfully run APXS. Possible reasons: 1. Perl is not installed; 2. Apache was not compiled with DSO support (--enable-module=so); 3. 'apxs' is not in your path. configure: error: ; What is my problem: It looks as if apxs is found and that PHP configure tries to invoke it.. Looks like PHP configure needs to add a flag.. ?? Am I doing something wrong, or is this some king of 'changed' feature in Apache 1.3.19?? I have Perl installed... Also I am running everything on a Redhat 6.2 machien.. Thanks for all help.. Bye Bye David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] pumping database dump in mysql
If you can do it on the command line why not just use the system function and use the command you would use on the command line..? What you try to do now is to feed the whole dump file to mysql_query.. This will never work because mysql_query will only accept one query at a time and the mysqldump utility which you probably used also adds some comments in the dump file which can't be handled by mysql_query.. If you DO want to do it through PHP try to break the dump file into some array so that all the queries in the dump file are seperated and then make sure that you strip all not SQL data.. It's probably not worth the work... Problem gets easier when you create the dump yourself with PHP... My suggestion is to not work with dump files but to get an second mysql database on another machine and backup your database to that machine.. Makes everything easier, when you have a problem the other database can directly be used to restore the backup and you don't have to search for the dump file.. Sucess.. Bye Bye David I want to write a script that takes a mysql dump file and pumps it into the database. I got the dump in a variable and then did $res = mysql_query($dumpvariable); but that doesn't work? I know how to do it on the command line, I just want to do it in a php script... thanks for any hints! Peter ~~ http://liga1.com building multiple language/culture websites http://poorbuthappy.editthispage.com online ethnology, updown -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Which is better coding style...
Your coding style is not the most used.. But I must be honest and tell you that I also find the clearest way... I also use it on all my own code.. It has got the advantage that you always see all brackets (no need to scroll to the right to find a bracket) and if you go down on the same horizontal position you should always find a bracket closing your statement... This participates the clearest for me, but unfortunately not usual. if (...) {...commands... switch(...) {case commands... case commands... case commands... } while(...) {...commands... } } else {...commands... } it participates maybe uncomfortable to write, however, simply to debug... I learning be doing, but this already many years... ;-) m.f.G. N. Pfeiffer ___ www.uris.de[EMAIL PROTECTED] 0177-2363368 02292-681769 --- e.o.m. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Privilege system of Mysql...
Hi Sven, Yes, I just started playing with the GRANT syntax.. Only problem is that they first define a user with everything on 'N' And then they define a table in the DB with everything on Y... Problem is that you have to do this for all DB's which you want to allow. This means that newly created DB's should later be added.. This is though very secure, but I am wondering if there is a way to: allow EVERYTHING but the following in stead of allow NOTHING but the following Bye Bye David have you tried the GRANT syntax? maybe this helps take a look at the grant tables afterwards regards Am 11:48 19.03.2001 schrieben Sie: Hi there.. I am not understanding something how the mysql priviege system works: I want to do the following: Give a user access to all tables in an database (also tables which will be added in the future) except a few private tables like the mysql table itself This is the way I thought it should be done: Add a user: '%','username','password','Y',Y','Y','Y','Y','Y','N','N' etc// Then add the following to table db '%',mysql','username','N',N','N','N','N','N','N','N' etc// Run the Flush privileges command and try it.. This doesn't work! Or I am missing something.. When I think logically, I can maybe understand that the DB looks at the user table and sees that the uses has access to do everything and doesn't look further at de db table.. Is this correct? What is then the solution to do what I described above.. I looked at the manual, but I can't seem to figure out in what order the tables are checked.. Does it stop looking further when he finds permission to do something or does it stop at the first 'N'... PS: I am not planning to use the above example, but it will help me understand how the privilege system works.. Sven Huster Senior Unix System Administrator *BSD, Linux, Solaris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] EOF (End of File) character..
Thanks for the different characters to try.. I try tomorrow to see if I can try it on the program which needs it... Indeed the trick of reading the file and echoing all the different chars used should do the trick.. I will first try the underlying two chars to see if they do the trick... Thanks.. Bye Bye David I think EOF depends on the application/OS... Try chr(26) [Control-Z] and chr(4) [Control-D] Or have I just been using too many Un*x programs that can't agree on how to indicate the end of my typing? :-^ If those don't work, try everything below 32. Well, okay, I *know* it's not 9, 10, or 13 :-) If all else fails, take a file that works, and get PHP to read it char by char... Hey, maybe you just need a newline at the end! "\n" (aka chr(13)) Or, in Windoze, "\r\n" (aka chr(10) . chr(13)) -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm - Original Message - From: "David Bouw" [EMAIL PROTECTED] Newsgroups: php.general Sent: Sunday, February 18, 2001 5:17 AM Subject: [PHP] EOF (End of File) character.. Hi... How do I get an EOF character when echo'ing an web page which will be written to an file.?? What I am trying to do is the following. I have an textstring (variable): Then I do the following: header("Content-disposition: filename=CLIEOP03"); header("Content-type: application/octetstream"); header("Pragma: no-cache"); header("Expires: 0"); echo ("$datestring"); ($datastring contains the text) My browser pops up with a box to ask if I want to save this file.. The problem is, that when I save this file it has no EOF character at the end.. Normally I then use my text editor to open the file and then I just save it again to get the needed character.. I generate this file for an application.. The problem is that the application won't accept the file if there is no EOF character.. What is the correct characters to use to get an EOF character?? Thanks for the help.. Bye Bye David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] EOF (End of File) character..
Hi... How do I get an EOF character when echo'ing an web page which will be written to an file.?? What I am trying to do is the following. I have an textstring (variable): Then I do the following: header("Content-disposition: filename=CLIEOP03"); header("Content-type: application/octetstream"); header("Pragma: no-cache"); header("Expires: 0"); echo ("$datestring"); ($datastring contains the text) My browser pops up with a box to ask if I want to save this file.. The problem is, that when I save this file it has no EOF character at the end.. Normally I then use my text editor to open the file and then I just save it again to get the needed character.. I generate this file for an application.. The problem is that the application won't accept the file if there is no EOF character.. What is the correct characters to use to get an EOF character?? Thanks for the help.. Bye Bye David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Mailto: tag, how do I insert line breaks..?
Hi, I have a non PHP questions which probably doesn't fit in this mailling lists, but I have a feeling that someone can help me because it is very HTML related. I was busy making a small piece of PHP echo code which generates a link which enables you to click this and startup your email software with a basic message in it.. The URL is basically the following: mailto:$email?body=Dear $name, We would like to inform you With kind regards, $sendersubject=Message send on $date about $subject bcc=$bccopy When clicked you will get the $email text as email address, the Dear $name... etc as body of the email etc etc.. Now here the non-PHP questions.. I searched everywhere, but how can I get line breaks inserted IN the email program..?? After the 'Dear $name,' part I would like to have 2 line breaks.. Then after the We would like to inform you... another 2 breaks.. I tried \n, I tried BR (BR you simply see this as email text.).. Is this possible.. Hope someone understande the problem.. (I am not trying to get breaks in my source, or what you see on the screen, but line breaks in the email text.. Thanks. Bye Bye David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Mailto: tag, how do I insert line breaks..?
Hi, thanks for the help.. The \r\n trick didn't work.. You can only see this back in the source.. But, the RFC "standard??" trick did work just perfectly.!!! Thanks Ignacio, I don't anything about the RFC.. Probably some standard which describes these special chars..? Will search for it to see if it can learn me some more things.. :-) Bye Bye David Hi, I have a non PHP questions which probably doesn't fit in this mailling lists, but I have a feeling that someone can help me because it is very HTML related. I was busy making a small piece of PHP echo code which generates a link which enables you to click this and startup your email software with a basic message in it.. The URL is basically the following: mailto:$email?body=Dear $name, We would like to inform you With kind regards, $sendersubject=Message send on $date about $subject bcc=$bccopy When clicked you will get the $email text as email address, the Dear $name... etc as body of the email etc etc.. Now here the non-PHP questions.. I searched everywhere, but how can I get line breaks inserted IN the email program..?? After the 'Dear $name,' part I would like to have 2 line breaks.. Then after the We would like to inform you... another 2 breaks.. I tried \n, I tried BR (BR you simply see this as email text.).. Is this possible.. Hope someone understande the problem.. (I am not trying to get breaks in my source, or what you see on the screen, but line breaks in the email text.. Thanks. Bye Bye David RFC 2368 says that you use "%0D%0A" for newlines and "%20" for spaces (Section 5: Encoding). Remember: the RFCs are your friends :) -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]