Mime Parser
i am trying to decode a raw email, i succedded to get the headers such as the from & to & subjects field but i seem to have a problem extracting the attachment. does anybody has a clue how to check if there is an attachment & how to save it in a directory?
View Complete Forum Thread with Replies
Related Forum Messages:
Changing Parser Output MIME Type
Is there a way that without need of creating any "wrapper" script, PHP can parse .css files with scripts embedded and pass them to clients with proper MIME type (text/css instead of text/html)?
View Replies !
Sending MIME Format Email Without The PEAR Mail Mime Package?
Just wondering if anyone could please help. I would like to use PHP to send MIME format emails (with binary attachments). But I have to do this without the use of the mail mime PEAR package? We are on PHP 4.2.2 and we cannot change that, and we cannot install that PEAR package due to our web hosting....
View Replies !
PHP Mime
I am printing results from a database query. I have set the results in a format. I want to run PHP from the browser and get the results in the format I have specified. I am trying to set the mime.
View Replies !
The PHP XML-parser Doesn't Like < Or > ??
I'm using PHP's SAX parser to parse an XML file and display it as a chat-style application. However, to prevent people posting tags, I'm using htmlspecialchars() to convert <, > and ". These go into an XML document fine. Once it comes to parsing, the parser seems to interpret < and > as actual XML tags though, and it messes up everything. Is this a known bug, or is there a way of combatting it?
View Replies !
Php-xml Parser
I have a PHP script which sends a authorisation request to a Servlet and receives a response in XML format. I have also created a parser (using both DOM as well as SAX) for parsing the output. My problem: The parser takes in input from an external xml file but the output from the servlet needs to be dynamically fed into the parser something like this: PHP Code:
View Replies !
Php Parser
I like to know wheter it is possible with php to do the following taskes: - read a file (.txt, .doc, .pdf, ...) word by word to chek if a word or a sentencs exists... - chek the form of presentation of a word i.e. chek if the word is bold, in which size, is it centered or aligned to left,...
View Replies !
PDF Parser
i am trying to make a PDF parser in PHP which will be able to extract data from PDF files. i want to basically convert pdf files to XML data. any idea from where i could start?
View Replies !
XML Parser
I have a very complex xml doc which if convert into array gives you a lot of nested array. i wanted some good parser which would parse this complex xml data. any idea about a good parser or code..which would work on php 4.4.4 I want to extract values from one offset tag and get those extracted values to the DB.
View Replies !
Rss Parser
im using this script that somebody else has made. well some feeds work just fine, some feeds end up with nothing in the item array at all and some feeds come up with this fopen error. Code:
View Replies !
DOM XML Parser
Can we parse Xhtml file using DOM XML parser of PHP. What i really want is this, I have an xhtml file and i want to edit/delete some of the contents in that xhtml file. Xhtml file is organized into parts using <div> tags. this is how it looks like, <div id="book1"> this is the book introduction part. <div id="part1"> This is the part introduction <div id="sec1"> This is the section intrduction <div id="subSec1">This is the sub section introduction</div> </div> </div> </div> now what i want is to get the contents that resides inside the <div> tag and edit / delete that content. Which <div> tag to choose, is depending on the parameter i passes and the parameter i pass to the script will hold the <div> id . So according to that i know which <div> tag to choose. Can i do this using XML parser.
View Replies !
Parser
can anyone give me a good defination of a parser, (ive used it to take text from one website and put it into another) but i need some background knowledge of the workings of a parser etc.
View Replies !
Parser?
I am in the process of creating a parser, the following is the code i have started with: <?php /* © MMVI weiqiang's minisite productions This programme is intented to be used only on weiqiang's minisite,and no unauthorised usage is allowed. You may use the programme if only granted permission by the author. Programme filename: manager.php Programme function: Programme authorised to: Original Copy(weiqiang's minisite) */ /*Start Of Programme*/ function parsedocument($document,$returnview=null){ //document is with regards to root folder if(stristr($document,'.php')){ $handle = fopen($document, "r"); $contents = fread($handle, filesize($document)); fclose($handle); sprintf($contents); preg_replace("{title}","$title",$content); } /*elseif(!stristr($document,'.php')){ die(error_note(1010)); return false; }*/ } parsedocument('bbcode.php'); ?> But i am having a problem of "printing" out the final code as print() does not support anything other than variable,html and characters right?I mean it doesn't suppot those "<?php" and "?>".
View Replies !
SQL Parser
IS there a script out there in PHP that can run over a simple SQL statement a report in plain english what it will do? E.g. Updating data in company table name is now xxx date is now xxx.
View Replies !
How To Use My Own Parser?
My web host's PHP doesn't provide curl, so I want to run .php files thru my own PHP parser. However, I don't want to rename all the .php files into .cgi files and add some #!/path/to/php as the first line. Code:
View Replies !
Css Parser
is there any reason for this script not to work? after trying various ways of reading in the css files for some reason all im getting is the echo statements at the bottom. Code:
View Replies !
Getting The MIME Type
I know this is easy if youve just uploaded a file using a form but suppose the file already exists on the server. Is there a function that can be called that takes the filename and returns image/gif or whatever.
View Replies !
MIME-TYPE
I've written a file upload script and want to check the MIME-TYPE of the uploaded files. I've made use of the many posts and come up with the following: // Check file type from MIME $allowed_types = array("application/zip", "application/x-zip", "applicatoin/x-zip-compressed", "multipart/x-zip", "application/x-stuffit", "application/x-stuffit-compressed", "application/sit", "application/x-sit", "application/sea", "application/x-sea", "application/pdf"); if(in_array($file_type, $allowed_types)){ $error = 0; } else { $error = 1; $error_msg .= "<li>The file type you are uploading is not allowed. Compress all files ". "into ONE (1) archive with StuffIt or WinZip. As an alternative you may ". "create a PDF file to upload. Consult your software documentation ". "for more information. MIME-TYPE not matched.</li>";} I cannot seem to get a match from any file types in the allowed_types array.
View Replies !
How To Read MIME In Php?
Does anyone know if there is a class that handles e-mail MIME messages reading in php due to create a very simple webmail? If there aren't classes built for these purpose, how can I do it?
View Replies !
Mime Problem?
I have a php script that under some circumstances causes my browsers to prompt me to open or save the file. The file is an index file, index.php. When I try to open it from the root of the domain. domain.com (or www.domain.com), I get a dialog box asking if I wish to open the file or save it. If I open any other PHP script in the root of the domain, it parses and works properly. If I open the file from a sub domain, sub.domain.com, it works properly. If I open it locally (XP Pro SP2, Apache 2.0.48, PHP 4.3.4.), it works properly. If I open it on another machine, it works properly. Clearly, it has something to do with my machine, but given the limited circumstances under which the problem occurs, I'm struggling to figure out what the problem might be.
View Replies !
Mail() And MIME
I have a multi language website. Sometimes users send messages to us via the online contact form. This uses the mail() function in PHP. The problem is, when chinese or korean is in the subject, the from and subject data is lost. Actually it is fine in gmail, yahoo mail, thunderbird and everyones email client except my companies local email client (Eudora, japanese version). So for everyone else it is ok, only us here get the lost data. I dont know if this is caused by our homemade anti-spam program or Eudora or something else. The systems guy said its a bug in my code, which is think is dubious. Something about the MIME type not being set correctly etc.
View Replies !
MIME Stuff
I have a db full of headers / body of emails,i need to get all the info from it such as attachments. Anyone seen any classes around that do this, all i can find are ones that connect to the pop box an do it. whereas i have this data in the db already.
View Replies !
S/MIME Over HTTP
The thing im trying to do is transport encrypted data to a client browser (which will have the private key certificate in PKCS12 format). I want to be able to be sure that the client is who it says it is, and that this data is transferred encrypted with only the client having the private key being able to decrypt it. The problem is i dont have access to httpd.conf in this case, which would have been a posible solution. My next idea was therefore to use S/MIME over http where in the client browser IE it has a installed certificate in PKCS12 format (thus having private key access). I believe IE has support for S/MIME, and i guess this needs some sort of programming of the http headers sent (through headers() function).
View Replies !
Mime Type
When I upload a file I can check the mime type from the $_FILES array which is great for making sure that the files being uploaded are of the correct type, the files are being uploaded to a directory off root but you can never be too carefuly. The problem is, these files are very large but because they're just basically text (xml & csv files), they're very small when zipped up, so I allow zip files too - if a zip is detected then the system unzips it to a temp directory - but is there any way to detect the type of file that came out of the zip. It would be pointless to do all this checking of file type but allow them to upload anything in a zip.
View Replies !
Mime Types - IE
I'm having a problem with Mime Types in IE. Now on my machine I have no problem but our clients - who incidentally are using the same version of IE and XP as we are are having difficulties. The mime type that IE is sending is different on their machine than on ours. Its identifying a csv as an excel file - application/vnd.ms-excel now if I allow that then it will allow xls files as uploads - which we dont want. I dont know what to do or what to suggest to the clients.
View Replies !
MIME Types - IE
I have a script that checks the mime type of uploaded files before handling them, this works fine in FF, it checks for text/tab-separated-values, text/comma-separated-values, text/plain, text/xml, application/zip but ie is sending files through as application/octet-stream... is there anything I can do about this other than allow application/octet-stream?
View Replies !
MIME Types
I have a script I've downloaded (I do intend to learn PHP eventually, but this needs to be done ASAP!) which uploads 4 files into a folder on my server. I've specified the MIME file types it needs to upload, and most of them (except image/png) work in Mozilla Firefox. I tried MSIE: image/jpeg doesn't work. Opera: png works, application/zip doesn't. If someone can tell me what's wrong, I'll be the happiest person alive (well, almost!). You can call me stupid, I don't care. Code:
View Replies !
Mime Message
I have been trying to send mail with an attachemnt and have run into a problem with the message body. I have tried using both mime_mail and sendmail classes and can use both to send emails with attachments successfully, but for some reason I can not get the message body to appear. I am currently using sendmail and have the following code to store the attachment and send the email: PHP Code: include_once ("inc.upload.php"); include_once ("inc.sendmail.php"); $file = $_FILES['fileUpload']; $name = $_POST['name']; $to = 'emailAddress' $to_title = 'Company Enquiry' $subject = 'Company Appointments Enquiry - from company.co.uk' $header = '' $Upload = new Upload(); $Upload->setTheFile($file); $Upload->setFilePath("uploadedFiles"); $Upload->setMaxFileSize("3000000"); $Upload->setAllowedTypes(array("application/msword",
View Replies !
XML Parser Installation
I am using RH 7.1 with Php4.1.0 and Apache 1.3.22 .... I have installed libxml and zlib also configured php with dom support. now problem is that when i try to open xml file it gives following error: Fatal error: Call to undefined function: xmldocfile() in /development/test.php on line 19 any idea where is the problem ?
View Replies !
Parser Question
I would like to make a simple parser which should work as follows: this is my text {link:href=mypage,link_text} some other text {link:href=otherpage,other_description} This is a string I would like to store in the database and then load in php. Later I would like to insert some other text between { and } signs. I would have a function name "link" with one parameter passed. Return value of this function would be a string to replace that one between { and } signs. function link($params) { ... some logic ... return string; } This function will return something like <a href="/mydir/some_file.php">link_text</a>
View Replies !
Simple Parser In PHP?
I'm coming to the end of a large and exhausting project, done in my new favorite language PHP, and its time for a diversion. I'm wondering if anyone has experience with writing simple parsers. I've never done it myself, but I know they are not as mysterious as they may seem, it's a matter of finding the tools. The idea is to take something like CSS format, except that it allows nesting, and turn it into associative arrays, such as: anykey { property: value; property: value; nestedkey { property: value; property: value; } } could be processed by a command like: <?php $parsed = ParseMyFile(...) ?> and $parsed would hold the same as if we'd done this: $arr = array( anykey("property"=>"value",...
View Replies !
Stand Alone PHP Parser
I'm wondering if someone could give some direction on a problem I have or share their experiences. I'm wanting to create a little PHP application that will run on a local machine and use ODBC to connect to a Access database on that machine. A series of forms will interact with the database but if I understand correctly, I need some way to parse the PHP code. Is there a stand alone parser that could be used in place of a HTTP server?
View Replies !
Php Parser And Editor
Does anyone know of a HTML/PHP editor that has syntax highlighting support for PHP and HTML and a Windows/DOS based parser for checking the PHP syntax? At the minute I write in notepad, upload to my site and run it, which isn't ideal. I have various HTML editors but they only allow the addition of simple tags. Linux is out of the question, as I only have Windows on my works computer.
View Replies !
Html Parser For Php
i need to parse an html document from a PHP script. i want to extract the URLs in <a>, <img>,etc. tags, make some changes (which i know how todo with regexp) and then output the HTML document with url changed. is there something as perl-HTML-Parser in PHP or i have to program it myself?
View Replies !
Simple XML Parser
I am trying to write a simple XML parser with PHP. What would be the best way to assign the string/text stored in between <TAG> … and … </TAG> to a variable? The 'content' between the XML tags can have multiple lines and may contain other html tags.
View Replies !
Xml & Xsl Parser Method?
I have 3 xml files and they are connected with 3 different xsl pages.. i want to make a Object Class that first build up the first xml.. then the 2 etc and parse it in 1 time together.. or how can i merge 3 different xsl files and xml at the same time together and with the DOM parser memdump() all? at once..? [Project] I have a header.. that is also dynamicly fron database, a main content from database and a static footer.. so i need to make first a UML static case.. and then programm the classes and parse them in html :)
View Replies !
Text Parser
I have a string of text assigned to a variable $text. What l want to do is to read through the text file and according to a set of rules change parts of the text into html format. For example if $text contained: hello my name is [[jim]], how are you. I would like the parser to change $text to: hello my name is <strong>jim</strong>, how are you. Then the new text will be printed out on the screen and will be styled properly. This system is to enable users of the website to click an edit button on a webpage and change the content easily using a set of rules rather than having to use pure html. My question is: What is the best was to accomplish this sort of text parsing?? I was thinking of doing something along the lines of placing each element of $text into an array then checking what the first and last elements were of each element. If they are letters do nothing, but if they are 'special characters' (i.e ones in my rules) then change the element to the relevant html.
View Replies !
Wiki Parser
I posted this in comp.programming before, but I figured the question applies to a PHP wiki parser only, so I am taking a shot at posting it here: I might be missing the obvious here, but I am looking for a (simplified) wiki parser to put in a page, preferably in PHP. Of course I can code all the parsing myself, but if I can save the time, I might as well. Having to alter the source for the parser is not a problem, so it does not have to perfectly meet my requirements.
View Replies !
Easy PHP+XML Parser
I have data like: <?xml version="1.0" encoding="ISO-8859-2"?> <news> <post> <date>10.04.2004</date> <text>Test test test</text> </post> <post> <date>15.04.2004</date> <text>Bleh bleh bleh <a href="www.test">test</a></text> </post> </news> and I want to have it in PHP as array looking like: array( [0] => array( date => "10.04.2004" text => "Test test test" ) [1] => array ( date => "15.04.2004" text => "Bleh bleh bleh <a href="www.test">test</a>" ) ) problem - text can have some HTML tags, so I want to just have it all in string. How can I do this in PHP if I have XML data in some data.xml ?
View Replies !
ICal Parser For Php
I was googling for some php scripts/class that would help me generate/parse iCal files for events. But I could not find anything proper. I got hold of http://www.phpicalendar.sf.net/. But i cannot generate iCal file. It can only read them.
View Replies !
Most Efficient XML Parser For PHP
I was trying to get the answer on the net but I only found partial answers - I hope someone can help me out... I am looking for an XML parser that would: 1) validate XML before doing anything 2) be fast 3) allow parsing of big XML documents (small memory footprint) I am implementing a system that will fetch XMLs from multiple sites across...
View Replies !
Datafeed Parser
I need to build a parser that dumps the data into a MySQL database and I'm hoping someone out there will be kind enough to guide me through this. My data comes to me via a .txt format and is pipe delimited. Here's a snippet of the data: |58196|0206|Lube & tire work. F/T. Bilingual a plus. Apply at Elliott Tire |40008295| |57719|0206|Heavy Equipment Mechanic needed North end. (123)555-5555|40020937| The really tricky thing is that I need the first and last columns to be removed completely. I also need the second column (the 0206) to be converted to a name based on the number. In this example the 0206 would be renamed to 'Mechanical'.
View Replies !
Parser Generator
What do I do if I need a parser too parse more complex user input? Is there a parser generator like lex/yacc for PHP? Or Can I call a parser written in another language?
View Replies !
Fastest XML Parser?
I want to know where to find the world's fastest PHP XML parser code. I really need it as my page is generated from multiple source of XML feed.
View Replies !
Excel Parser Pro How To
any body know how to use this? so basicly it is good for importing excell sheets on a linux server and it converts it to php?? i have tryed it but i don't know how to retreive it from the database?
View Replies !
Calling The Php Parser
I would like to know if it is possible to call the php parser from a Win32 program (e.g. a VB or C++ program), WITHOUT calling the commandline php.exe utility. I mean, is there any "php_parse" function, exported by the php5ts.dll, which I can declare in my Win program and then call to parse a php script?
View Replies !
Best Xml Parser Code
I've searching my way through the forum trying to find some code with a regex to parse through an xml file and turn it into an array because I'm not good enough to write one myself. is there one that is considered as working better than the others ?
View Replies !
Parser For Bug Detection
Using PHP, tracking down a missing semicolon can take a while. I miss the GNU C compiler:) I have read in places that php parsers do exist eventhough most people do not use them. Maybe even a php IDE exists out there somewhere? Can anyone give me any pointers to good php parsers or IDE's? If possible open source would be my choice.
View Replies !
XML Parser Daemon
I'm trying to write a daemon script that will monitor an xml file (an iPhoto 5 library to be exact). I know PHP can easily parse xml files (right? I actually don't know this, but it's true, right?) but can I compile the script at all so that it runs in the background and executes whenever the xml file changes?
View Replies !
Email Parser
I laboriously write one, I was trying to find a PHP script that would take an email spool file and parse it, putting each part into an array (including attachments). The eventual goal would be to take each individual array element and put them into a MySQL database.
View Replies !
|