Creating XML Documents
I'm trying to get myself to grips with XML and PHP, I've been through the XML parsing tutorials here and they are very good.
However, what is the best way of doing the reverse, i.e. actually dynamically creating XML documents in PHP as opposed to parsing them? Is there a library for doing this, or is it best just to do it from scratch?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Phplib Creating Pdf Documents
I can load a font, set a font, load an image, draw a line, output text in a box, output text on a line, create a pdf, open a pdf, add a page, close a page, close a pdf but I can not set a font to bold or italic or underlined. I currently use a function which moves the text position slightly and re outputs it for bold and I simply draw line for underlined text but now I need to do italicized and I am stuck. I found little on font styles anywhere when using the pdf commands on php.net I can see the list of commands but everything is deprecated and the new commands don't have clear documentation on how to use them: pdf_setfont($pdf, $times, 9); pdf_setcolor($pdf,"both","rgb",0,0,0); pdf_set_parameter($pdf,"fontstyle","italic"); the first line sets the font to be times roman and size 9 the second change the color to black I though the last line would set the font to be italic but it is not correct Any ideas?
Unexpected Behavior When Creating Xhtml Documents
The following has been posted before (2 years ago) but no response was added. Therefor again, the following code for creating xhtml file: <?php error_reporting(6143); $xmlns = "http://www.w3.org/1999/xhtml"; $lang = "en"; $xhtml_1_strict = new DomImplementation(); $dtd_xhtml_1_strict = $xhtml_1_strict->createDocumentType("html", "-// W3C//DTD XHTML 1.0 Strict//EN", "http://www.w3.org/TR/xhtml1/DTD/ xhtml1-strict.dtd"); $xhtml_1_strict_document = $xhtml_1_strict->createDocument("", "", $dtd_xhtml_1_strict); $xhtml_1_strict_document->encoding = "UTF-8"; $xhtml_1_strict_document->standalone = "no";
Generating .pdf Documents On The Fly...
Does anyone know if it's possible to generate pdf documents from content held in a database? The idea is to use a template to dynamically generate pdf documents on the fly based on what the data a user has selected on a site. Is this possible with PHP/ ASP?
MS Word Documents
I've been asked to write a script to upload Microsoft Word documents and then convert them into 'printer friendly' pages. The uploading part I've got no problem with, but I can't find anything about reading MS word docs into PHP. Does anyone know anything about this? I hope it's not as difficult as excel documents - which I'm still trying to get working on and off without any real success.
Word (or Other Documents) To PDF On The Fly?
Is there an option to convert any (or mosts file types) a user might upload to PDF format upon upload? I'd like users to be able to upload Word, Excel, Text and other documents, then have our upload script convert the document to PDF on the fly. Then viewing users would simply need the acrobat reader to view files, not all these other office products. Is this possible with just PHP and pdflib for example? If not, what are the options?
Printing Documents
I have a web page that displays CVs submitted by users (in DOC, PDF or RTF format). CVs are stored in a folder for e.g. user_cv Admin can select the CVs to be printed and then click on Print button. This should send all documents to printer for printing. How do I do that in PHP?
SSI And Perl Within .php3 Documents
Im new to PHP. I want to know if you can use ssi within .php3 documents and call php3 funtions in a .pl scritp. That is if you want to use the useful perl scripts you find on the web and combine them with php.
Compare Two Word Documents Using Php
In my system I want to compare two word documents ,but my server is a Linux one and thats y I cant create COM object . Any othermethods to find this one .I think to connect PHP to some other mightt be useful for this.....
Parsing Existing PDF Documents
I have an existing PDF document; "myfile.pdf". I want to be able to seek through that document for particular strings. The thing is, I can't find a way to open the file as something that's legible/readable. I've tried using PDFLib aswell as using fopen/fgets (among many other things) to open the file and display the content. The only content I get is a little mark-up and a bunch of garbbled text. I'm assuming that when a PDF is created it has some form of character encoding passed over it, or it's encrypted in some way. I've looked at a few classes around, but none show ways of opening a PDF document up.
How To Upload Documents In Mysql
I'm a beginner and will like to know how to upload documents in mysql. These documents will be cited on the intranet and a user will have to search for a particular document using either date, title etc.
Downloading Secure Documents
i'm building a site which will have a secure section (still haven't decided between cookies and sessions), but anyhow, after the login screen, there will be links to a bunch of word documents that the user can download or view. I'm thinking anyone who knows the path to those documents can view them without logging in.. is there a way to prevent this? or am I just wrong?
Evaluating Php Tags/documents Outside Of Web Server?
I need to generate and send multiple xml documents over a socket. Is it feasible to use php as a templating language for these? How would i go about that? I figure i _could_ make them into 'normal pages' and fetch the contents using some http library, but that doesn't sound too elegant. There has to be a better way?
Tutorials/Articles/Documents Script?
I was looking for a script that could let me manage tutorials, articles or documents in my website. There should be categories and they are not for download but to be displayed right on the page, extra functions like rating, comments would be nice but not required. I'm currently using Tutorials Manager (http://scripts.phpwiz.net/tb2/) but the script is in beta state and is quite buggy. If anyone knows about any others scripts, please let me know all of them so I can choose one. Free ones or under the GPL only.
PDF Generation - Making Large Documents
I am trying to generate a large PDF using PDFLib. Specifically, I have a database of University researchers (perhaps 300-400) and I need to generate a printed report with a table of contents - all of the entries are stored in a MySQL database. There can be several researchers / page and I want to avoid a researcher's entry spanning two pages. I think PDFLib would be a good solution for me, but all the examples / tutorials I have seen using it have been quite trivial. I wonder if anyone has some tips / tricks for using PDFLib for text spanning several pages or if you can think of a better way to generate this larger document for print - keeping in mind that I must keep track of page numbers.
Reading EXCEL (XLS) Documents With Other Charactersets
(the other code i cannot post due weird carakters!) I've been searching over the internet for days but havent found why! i've tried alot of scripts (both free or wich i need to pay for) but only a pricy script (like 80$) would show the carakters in ROW C correctly. If i convert the script to a HTML document i get the carakters with &# and a four digit number... that's what i like to extract from the excel sheet. The script i wrote is. Code: <?php $excel = new COM("excel.application") or die("Unable to instanciate excel"); //bring it to front $excel->Visible = 1;//NOT //dont want alerts ... run silent $excel->DisplayAlerts = 1; //open document $excel->Workbooks->Open("d:/excel.xls"); for ($h = 1; $h <= 3; $h++) { $book = $excel->Workbooks(1); $sheet = $book->Worksheets($h); echo "<table> "; //Wtite row for ($i = 1; $i <= 150; $i++) { echo "<tr> "; //write colom for ($j = 1; $j <= 5; $j++) { $cell = $sheet->Cells($i, $j); // #Select the cell (Row Column number) $cell->activate; // #Activate the cell if($cell->value == Ɔ') { $td = ""; } else { $td = $cell->value; } echo "<td>" . $td . "</td> "; // #write the cell } echo "</tr> "; } echo "</table> "; } //closing excel $excel->Quit(); ?>
Extract Text From Word Documents
Is there a way to extract the text of a word document with php? And perhaps some of the formatting (like break lines, bold, italic,...)?
Algorithm For Detecting/highlighting Changes In Documents
Anyone knows a good algorithm for detecting difference between two pieces of text? I'm working on a content management system and would like to add the ability to highlight changes made between versions. I don't think diff is suitable here, since I want word level detection. Besides, I'll need to handle a large number of relatively short strings. Spawning an process for each would be too time consuming. AFAIK, PHP doesn't have a build-in function. If necessary, I can build a wrapper extension.
Automatically Download Documents Onload
i have another problem with regards to documents. The thing is, when a user registers, they upload a document right, and we store the document's link and the date it was loaded on the database, but now i would like this to happen, that when i log in and there has been a dcument uploaded, it takes the date now and compares it with the date that the document was loaded, like this: Code:
Multiple Forms, Different PHP Documents, Same Page?
In a PHP file 'main.php' I have <?php include 'header.php'; include 'login.php'; include 'body.php'; include 'footer.php';?> Login.php has a form on it to allow the user to log in to the site. Body.php has a form on it to allow a user to post a message. What I'm finding is that the 'submit' button on 'body.php' actually calls the form from 'login.php'. Does PHP have issues when there are 2 separate forms doing 2 saperate things displayed on the same page - is there anything I need to look out for?
Uploading Documents To Multiple Servers At Once
I have two servers: Server X and Server Y. I'm looking for a solution so that when users upload their documents to server X, they also upload to server Y to the same folder and directory. This way, if server X is down, we can still access the uploaded documents through server Y.
Secure Login Area For Documents
I built a login area with a document manager. It works great and all and all the pages are secure. My question though if the pages are protected by php and you can't get to them, how do you keep someone from linking to the document directly. Since the document is not going to process the php and check for credentials when they put in the direct link to the document.
Reading Microsoft Office Documents?
I need to be able to upload a Microsoft office document and then show the contents to the visitor, in addition i need to be able to write documents on the fly. Is there a way of doing this, or will i have to spend days researching and programming my own classes to handle it?
Trouble With Counting New Documents With Complex Query
width formulating the most effective (in terms of processing time) SQL query to count all the "new" documents in the repository, where "new" is defined as "from 00:00:01 up to 23:59:59 today". My current query does not give me satisfactory results, it creates a visible delay in rendering of the main page of one of the departments (Drugs) :8[[[ (at least I, for now, think it's the culprit). It's for the <url: https://hyperreal.info > site, see for yourself, notice the delay <url: https://hyperreal.info/drugs/go.to/index >. Currently I ask MySQL to (offending PHP fragment follows, I hope it is self- explanatory)....
Can I Convert MySQL Db Records Into Microsoft Word Documents?
i found the solution to export file from mysql db into *.csv. but is there anyway to convert the contents into *.doc and save in my webserver and providing a link for the end users to download the word file? FYI, the database records are obtained by end users submitting the forms themselve and i saved it in my db...
Creating XML In Php
I have a website that is hosted on another machine not under my control. i want to be able to use a file to share info between pages. one page inserts into the file and the other reads from the file. i wanted to use XML because there would be a lot of fields and some would variable length or values. i'm looking into the XML functions with PHP however they all seem to read an XML document. is it possible to have one write an XML document?
Creating Dir
I wanted that when users register on my site, automatically a directory would be created, The problem is, when submiting the registration form via HTTP, the user nobody doesnt have the permissions to create this directory. So I tryed ftp_mkdir. And it worked. The problem is... the directory permissions where automatically set to 655. How can this be changed? Chmod will not work here, because the user is nobody.
PHP - Creating DB
i have a form with textbox default value='10', i want to add to database, and changes made on this page will update into database. this is my form field : <input type='text' size='1' name='$i' value='10' /> $i is for loop that prints outs textbox What column do i create in mysql db and how do i assign the each value of textbox ? for example if i create table example... Create example(date date, qty int); how do i insert each textbox value and each day date into database?
Creating PDF
I need to create a pdf on the fly from 6 fields of my database. What my question is, is how can I make sure that the pdf created is in the landscape profile, not the portrait profile? I have never created PDF's on the fly from a db before.
Creating An Image
I am making a links page for my site that takes the links out of the database and displays the name on a button, but the text on each button is different lengths and I was wondering if there was a way I could align them center on the button? This is the button.php code: <?php header ("Content-type: image/png"); $string = $_GET['text']; $im = @imagecreatefrompng ("button1.png"); $text_color = imagecolorallocate ($im, 255, 255, 255); imagettftext($im, 10, 0, 5, 35, $text_color, "c:phpfontsariblk.ttf", "$string"); imagepng ($im); imagedestroy($im); ?>
Creating Directory
I am trying to make my webpage create a file for each person that submits a file, so at first I was using... $myfile=fopen("create/$user.txt","w"); This worked, and it would create the file if it was not there. Then I decided that each user would recieve their own directory, and that the first file to be edited was called options.txt, in their user directory. So, I used this: $myfile=fopen("create/$user/options.txt","w"); But it came back saying that the directory did not exist. Is there a way to create a directory along with the new file that goes into it?
Creating Pdf File
Is it possible to create a pdf file from a HTML form. i want to create a pDF file from HTML form which looks like the scanned copy of HTML form. I hope there must be somebod< who can answer this question.
Help On Creating Images With GD
I'm using a class to easily create plots and charts: 'GRAPH' by Herman Veluwenkamp downloadable from: http://phpclasses.upperdesign.com/ The problem I've found is the following: -When using Win9x-PHP4-Apache all is OK -When using Linux-PHP4-Apache plots appear as viewed in a mirror (both text and numbers) Does anyone give me a clue about what's happening?
Creating Files
I was wondering, if/how do you create a file with PHP, Im making a "network" for my site with PHP, and ran across this problem.
Help In Creating XML File From DB
Hi friends i need to get the details from two tables for creating one XML file.. for that, first i started by defining a DOMXML object $doc = domxml_new_doc(Ƈ.0'); and i have one outertable query as $outer_table = 'main_category' $query = "SELECT * FROM $outer_table"; $resouter = mysql_query($query, $mysql_connect); and when its first row is read its creating elements by $child = $doc->create_element($fieldname); $child = $outer->append_child($child); $value = $doc->create_text_node($fieldvalue); $value = $child->append_child($value); and i need to get some details from second table with its subcategid=maincategid to do this i need to get that particular field that alrady appended to the xml How i can..... i tried get_elements_by_id() but it returns only those elements that comes under it.]
Creating Files
Is there a way to create files such as config.ini thoruhg a form. so they put in all the stuff they want and press submit and then the file is created with their settings in it.
Creating A Schedule
I am building a diet/weight loss website where a customer would subscribe for 1,3,6 or 12 months. I am using Paypal IPN to handle the subscription payments. I would like to create a schedule when the customer first logs on, from the date they signed up to the date when the subscription ends and every 7 days is highlighted as the weigh in day. Basically I would like to generate a list of dates from one date to another with every 7th day highlighted.
Creating Pics On The Web
I am developing a claims input form. part of this form, the original paper version, was to draw a brief picture of the accident. Is there anyway in PHP, or other addied controld to achieve the same result.
Creating Files
I am rather new to PHP and a relative newbie to Linux too. I have a webserver at home (Apache 2.0.48 on SuSe 9.0, PHP4). I have some scripts, one of them needs to be able to create logfiles somewhere on my machine. It must also later be able to read from and write to these files again. Sofar I get a permission error. I tried chmodding 666 or 777 the directory in which the files could reside, to no avail. How do I set up the permissions so that my script can simply fopen a file for writing. Or if that's not the issue, what am I doing wrong or overlooking ? The errors: Warning: fopen(logfileslog1.txt): failed to open stream: Permission denied in script1.php on line 142 Warning: fwrite(): supplied argument is not a valid stream resource in script1.php on line 154 Warning: fclose(): supplied argument is not a valid stream resource in script1.php on line 161 It's the first I am puzzled about, the 2nd and 3rd are a logical consequence. By the way, reading from and writing to a file I have previously created myself with exactly the names I tried to get created by the script (echoed the name, ok) is no problem at all. So I don't think it has much to do with a safemode or open_basedir setting. I also tried creating the scripts in the same dir the script itself resides. Did not work either.
Creating XML Feed Using PHP
I am trying to create an xml-feed using php (without any classes). So I wrote a php script that fetches data from a mySQL db and displays that in xml-format. So far no problem. But then there occured the first problem. I used that code: PHP Code:
Creating Files
I am currently creating a file manager to add/edit/delete files and folders, etc but i was wondering if there is a function in PHP to create files such as a php file or txt file? All i want is a function that will allow you to create a file from the name you give! Is this possible? I have seen a script called Genesis but the problem is that it is Perl! and i dont have a clue about Perl!
Creating Subdomain ?
I want to create a subdomain with the username and then upload files in the subdomain of user ...so that the user can view his files directly from his subdomain...examle...if my site is www.a.com and a user comes with username....anjali...then a subdomain should be created with the name anjali.a.com and all the files of "anjali" user should be uploaded in that folder and that user should be able to directly view his files from the domain "anjali.a.com" ...... i came to know that creating a subdomain is easier in php.....where to find its solution ?
Creating ThumbNails In PHP Without GD
I want to create an image upload script were the user will upload 1 photo while the script will store it in 2 different locations... /pictures /thumbs the script must alo create a second version of the original photo and the new version must be resized into certain width/height....I pretty much know what to do till here...however, what I am asking is that the new version will be resized as well as decreased in terms of quality in order to have a smaller size (but still be fairly viewable)...can this be feasible?
Creating URLs
I'm having problems creating urls when taking info from a mySQL table. For example a table with user_id, name, email and description. Then you've set up a template there this information will be displayed. You have this information in the database: user_id: 1 name: myname email: myname@myemail.com description: information about me Now in this template it should create an URL for this info that looks something like: www.myhost.com/page.php3?id=1 when they click on this link, another page will popup by using a second template with the name, email, description etc.
Creating A Subdomain
I want to create a subdomain with the username and then upload files in the subdomain of user ...so that the user can view his files directly from his subdomain...examle...if my site is www.a.com and a user comes with username....anjali...then a subdomain should be created with the name www.anjali.com and all the files of "anjali" user should be uploaded in that folder and that user should be able to directly view his files from the domain "www.anjali.com". i came to know that creating a subdomain is easier in php. where to find its solution ?
Creating A Jpeg
what i need to do is to create a graphic file. the problem is that my hosting doesnt have the GD needed for all the graphic monipulation. so i need to build the file step by step. as for building a BMP file, well that was a childs game, plain and simple. but as BMP file goes, its way too big. what i need is some way (algorithm mybe) to convert this bmp file data to a jpg file, or to create a jpg file to start from is also a possiblity. now, i've dome some reading, and the jpeg stuff, something way out of my league, the calculations, the commpression, the 8 bit stuff. i was wondering if someone has a good and practical tutorial or documentation of steps (in the form of cookbook) to take in order to either convert a bmp data or create a jpg.
|