Re: [PHP] Editing an existing pdf?
Jay Contonio wrote: I am just looking for someone to point me in the right direction. I need to be able to *edit* an existing pdf, not create a new one. I basically would be adding an image or text from a form to an existing pdf. Does the PDFLib have an overlay function? These will not be 72 DPI pdf's either. Never used it myself, but FPDF says it can do this using the FPDI extension. http://fpdf.org/en/FAQ.php (see item 17) -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Editing an existing pdf?
Jay Contonio wrote: With FPDF you have been able to add jpegs or pngs to existing high-res pdfs? I understand adding data using the FDF file but what about an image? Yeah, I use FPDF on a fairly busy site to generate PDFs that have one of various logos embedded. The PDF can be regular 72DPI - that's print quality for text. But the image should be at print resolution, i.e. 300DPI or better, preferably a 24-bit PNG. -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help with nl2br
canobit canobit wrote: I have cobbled the following code that when it retrieves the data from Mysql, the data is displayed with no line breaks which results in one large paragraph. I have been trying for quite awhile without sucess to get nl2br working with this code. The original data is entered by the user via a textarea form. snip /snip / while($row = mysql_fetch_row($result)) { echo trfont color=blue size =4; echo .$row[1]/b; echo trfont color=black size = 3; echo .$row[2]; echo br \n; echo br \n; snip / There is no nl2br in your code sample, so I'm assuming you want to put $row[2] through it? It's about as simple as nl2br($row[2]). If that doesn't work, then perhaps you should post sample code that is failing, and the output you get, along with the output you're expecting. All that said, you might want to invest some time in learning a DB abstraction layer such as ADODb or PEAR::DB (there are lots of others). You'll commonly find convenience functions to do things like output query results into an HTML table. Why waste time debugging the wheel? -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Calling Curt Z, Curt Z to the white courtesy phone please
Curt Zirzow wrote: I'm including the list in this reply in case any wants to give some feedback. http://zirzow.dyndns.org/php-general/NEWBIE http://www.thelinuxconsultancy.co.uk/phpeditors.php is no longer valid. I mean, the list is no longer there, though the URL is still valid. It got pretty out of date anyhow. php-editors.com is a good alternative suggestion. -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php-cgi limitations
Can anyone offer or point me to a summary of differences between running php as an Apache module vs as a cgi executable? Specifically, I'm wanting to upgrade our servers to php 5 but there is one crucial third-party app we're using that still needs php 4, so I'm hoping I can run just that app under php 4 cgi until the vendor updates to support php 5. Google is unusually laconic on this, but perhaps I just offended it with too many daft queries on the subject... :) -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php-cgi limitations
El Bekko wrote: Max Schwanekamp wrote: Can anyone offer or point me to a summary of differences between running php as an Apache module vs as a cgi executable? Specifically, I'm wanting to upgrade our servers to php 5 but there is one crucial third-party app we're using that still needs php 4, Are you sure that app won't work under PHP5? Thanks for the reply. The app in question is FogBugz, and they state emphatically that it does not yet work under PHP5. I guess there's only one way to find out, really - test test test. -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: please shed some light on SQLsyntax error
Bruce Gilbert wrote: //build and issue query $sql = INSERT INTO $table_name values ('', '$_POST[f_name]', '$_POST[l_name]', '$_POST[address1]', '$_POST[address2]', '$_POST[address3]', '$_POST[postcode]', '$_POST[country]', '$_POST[prim_tel]', '$_POST[sec_tel]', '$_POST[email]', '$_POST[birthday]'); Holy riddled-with-security-holes batman! Strange that no one has jumped on this. That code could be easily hijacked to do nasty things to your server. Google sql injection php or something like that and you'll get lots of resources. E.g.: http://dev.mysql.com/tech-resources/articles/guide-to-php-security.html PS - Hello all! This is my first post to the list; I've been lurking for a week or two. -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] probably a simple mysql copy multiple rows question
Dave Carrera wrote: so if the output of my current table is BASE 600 1.99 BASE 601 2.99 then i would like to copy these rows so that the table looks like this BASE 600 1.99 BASE 601 2.99 NEW600 33 NEW601 33 This is a SQL question, not PHP. That said, what you're describing is INSERT...SELECT syntax. In your example, something like: INSERT INTO mytable (name, code, price) SELECT 'NEW', code, '33' FROM mytable WHERE name = 'BASE' /* or whatever rows you need to copy */ Supported by MySQL, PostGres and others. -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PhpMailer vs Pear:Mail
Richard Heyes wrote: Petr Smith wrote: I tried all and ended with http://www.phpguru.org/static/htmlMimeMail5.html fast, stable, usable. A very good choice. ;-) But but but, what *is* the advantage of one over the other? I've been a PhpMailer devotee for some time. PEAR::Mail is too spare, PhpMailer is reasonably quick and has proven quite stable (I've built a couple newsletter apps using it). What's the advantage of Richard's package vs. the Pear one (on which he is a lead dev) vs. PhpMailer? -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SELECT?
William Stokes wrote: I have one MySQL table with about 500 rows. I need to read the table one row at a time, make some changes to data in one field and then store the changed data to another table. I'm using PHP to change the data but I have no idea how to select one row at a time from the DB table. A couple of possible options, depending on your specific situation: 1. Use INSERT...SELECT syntax. If you're doing a regular transformation on all selected rows that can be handled by MySQL function(s), this would be easiest and fastest. e.g. (table_b.id is an auto-incremented primary key): INSERT INTO table_b (id, table_a_id, transformed_value) SELECT NULL, id, SOME_FUNCTION(mycolumn) FROM table_a 2. Depending on the size of the records, you might want to just read all 500 rows into a two-dimensional array and use an array fn such as array_walk to apply a function to change the relevant data and insert into your new table. To get all rows into an array, you set an array variable and iterate over the MySQL result set to build the members of the array. If you need details on how to do *that*, you'll need to indicate which version of PHP you're using and whether you're using an abstraction layer for database access. For an example in PHP 4, you might have: $db_cursor = mysql_query(SELECT * FROM my_table, $db); //check for errors [omitted] //count the records $recordcount = mysql_num_rows($db_cursor); //assemble the recordset array $recordset = array(); for($i=0;$i$recordcount; $i++) { $recordset[] = mysql_fetch_assoc($db_cursor); } //clean up, etc. [omitted] Then use array_walk() or similar... HTH -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get timestamp?
Jay Paulson wrote: How would I go about getting the timestamp of a day of the week from 7 weeks ago? $lastSunday = strtotime(last Sunday); $Sunday7Weeks = $lastSunday - ???; $lastsunday = strtotime(last Sunday); $sunday7weeks = $lastsunday - (86400 * 49); // 7 weeks = 49 days Test: echo 'Last Sunday\'s date was '.date(m/d/y,$lastsunday); echo 'br7 Weeks prior to Last Sunday, the date was '.date(m/d/y,$sunday7weeks); -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get timestamp?
Max Schwanekamp wrote: Jay Paulson wrote: How would I go about getting the timestamp of a day of the week from 7 weeks ago? $lastsunday = strtotime(last Sunday); $sunday7weeks = $lastsunday - (86400 * 49); // 7 weeks = 49 days Oops, that would be the sunday 7 weeks prior to _last_ Sunday, which would really be Sunday 8 weeks ago, so maybe change the 49 to 42... -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reverse Engineering of Smarty
Zareef Ahmed wrote: Accidentally I got deleted all of my php code in one of my application, I was using smarty and its compiled directory has the code in its native format. Is there any way so I can do some type of reverse engineering to bring back my original code? No, Smarty's compiled PHP is strictly for the output. There is little connection (or there shouldn't be anyway) between your application php and the compiled php that Smarty produces when it parses a template file. -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php