Re: [PHP] File moving hell on Windows

2012-07-31 Thread Brian Dunning
Regular Windows networking. On Jul 30, 2012, at 2:29 PM, Mike Mackintosh mike.mackint...@angrystatic.com wrote: What protocol are you targeting? FTP, SFTP, SSH, SMB, etc? -- Mike Mackintosh PHP 5.3 ZCE -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] File moving hell on Windows

2012-07-30 Thread Brian Dunning
I'm dealing with a Windows NT network that includes some digital printing presses that also run Windows. PHP 5.3.8 is running on one NT machine. Its job is to take CSV files that exist in a directory on one machine, and move them to a directory on the digital presses. All the source and

[PHP] Bust out a PDF via the print stylesheet?

2012-05-18 Thread Brian Dunning
Hey all - The articles on my web site already have a very nice stylesheet that produces a print version. Does anyone know if there's a such a thing as a PHP class that would let me put up a Download PDF link that would generate a PDF doc on the fly, using that same stylesheet? I've used

Re: [PHP] FPDF ?

2012-05-18 Thread Brian Dunning
I never found a solution to this myself. On Apr 26, 2012, at 2:13 PM, Jim Giner wrote: For those of you with FPDF experience. I've just begun using it and have figured out how it works I think. I am still having trouble with the bottom of the page tho. Seems that if I get too close to

[PHP] Running through an enormous SQL file

2012-05-04 Thread Brian Dunning
I have a script that downloads a 267MB SQL file (it creates and loads a MySQL database). Any idea how to do this? Obviously I'm not going to get a file that size into memory to loop through. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Running through an enormous SQL file

2012-05-04 Thread Brian Dunning
How would you launch that from PHP? On May 4, 2012, at 6:11 PM, tamouse mailing lists wrote: Is there any need to use PHP with this at all? If it's already in SQL, can't you just feed it to mysql? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Serving a .dmg via readfile?

2012-04-26 Thread Brian Dunning
Thanks, this suggestion from Dante completely solved the problem. Replaced: readfile('/var/www/mypath/My Cool Image.dmg'); With: $fd = fopen ('/var/www/mypath/My Cool Image.dmg', r); while(!feof($fd)) { set_time_limit(30); echo fread($fd, 4096); flush(); } fclose ($fd); It's now

[PHP] Serving a .dmg via readfile?

2012-04-25 Thread Brian Dunning
Hey all - I'm having no luck serving a .dmg from my online store. I stripped down the code to just the following to debug, but no matter what I get a zero-byte file served: header('Content-Type: application/x-apple-diskimage'); // also tried octet-stream header('Content-Disposition:

[PHP] Updating Google Plus

2012-03-29 Thread Brian Dunning
Anyone know a way to update Google Plus via the 33669 SMS number? Yes, I have seen the popular how-to instructions to get the secret email address by using Google Voice and forcing the error message, but I'd prefer a legit non-hack way to do it. I'd even be happy to pay for an SMS gateway

Re: [PHP] Updating Google Plus

2012-03-29 Thread Brian Dunning
Sorry, I did not mention the implied using PHP. Since everything I do eat breathe is PHP, it didn't even occur to me to state the obvious. :-) :-) On Mar 29, 2012, at 2:46 PM, Stuart Dallas wrote: Err, what has this got to do with PHP?!? -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Updating Google Plus

2012-03-29 Thread Brian Dunning
That's EXACTLY what I was looking for. Thanks! Don't know why my Google-Fu failed me... :-) On Mar 29, 2012, at 5:26 PM, Don Wieland wrote: First Google+ (Google Plus) status update bot in PHP http://360percents.com/posts/first-google-google-plus-status-update-bot-in-php/ Is that what you

[PHP] Time zones are spinning my brain

2011-06-29 Thread Brian Dunning
Help. I'm using PayPal's API to get a report of all the yesterday's transactions. I'm in California, and I define yesterday as California's yesterday, midnight to midnight. PayPal wants the STARTDATE and ENDDATE provided in UTC/GMT. I'm building and testing my report using this: $start =

Re: [PHP] Time zones are spinning my brain

2011-06-29 Thread Brian Dunning
Thanks everyone. It seems to be working correctly. You gave me some extra peace of mind. I did set the date_default_timezone_set('America/Los_Angeles') but it looks like that was in the defaults anyway. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Convert a PDF to a PNG?

2011-06-16 Thread Brian Dunning
I have heard back from Rackspace and ImageMagick is not going to happen for the time being, but they say Ghostscript is installed. Is it possible to do this completely with GS without ImageMagick? The PDFs are text only. On Jun 15, 2011, at 2:28 AM, Richard Quadling wrote: I use PDF2PNG as

[PHP] Best way to create an image with flowing text?

2011-06-16 Thread Brian Dunning
Hey all - I need to create PNG images with transparent backgrounds that contain text. The text will come from four fields in a database, and needs to be centered, and text wrapped. The fields are going to be of varying lengths, so each block of text (which will be shown in a different font

[PHP] Convert a PDF to a PNG?

2011-06-14 Thread Brian Dunning
My server has GD but NOT ImageMagick. Can I convert a PDF doc to a PNG? I have the PDFs stored as a files and I need to save an identical PNG alongside each. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Convert a PDF to a PNG?

2011-06-14 Thread Brian Dunning
The server does not have that software installed either. :-( On Jun 14, 2011, at 1:53 PM, Richard Quadling wrote: I do that using an external tool pdf2png. For me, I use Cygwin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Convert a PDF to a PNG?

2011-06-14 Thread Brian Dunning
The PDFs are text only (white text on transparent background). I made them using the FPDF, which was tedious to set up but works great. I've since learned that I need PNG images, not PDFs. I know that I could rebuild them using GD, but it's a lot of strings of text wrapping and formatting and

Re: [PHP] Going crazy with include require not working

2011-06-07 Thread Brian Dunning
Thanks, this helped me solve it. FPDI extends a class in FPDF, so I simply had to reverse the order in which I call them and all is hunky dory. On Jun 6, 2011, at 5:54 PM, Michael Shadle wrote: ini_set('display_errors', 1); -- PHP General Mailing List (http://www.php.net/) To

[PHP] Going crazy with include require not working

2011-06-06 Thread Brian Dunning
Here's my code: error_reporting(E_ALL); require_once('/var/www/mysite/includes/fpdi.php'); require_once('/var/www/mysite/includes/fpdf.php'); I have used fpdf many times and never had a problem with it. I've double checked my pathnames until I'm blue in the face. But for some reason, the

[PHP] webserviceX.net?

2011-04-23 Thread Brian Dunning
I'm looking for some geographic data, like ZIP codes, area codes, but it has to be current and correct. Has anyone ever used the free web services at webserviceX.net? Do you know anything about the data? How current/correct is it? Seems to be an awful lot they're giving away for free. -- PHP

[PHP] Can I modify a MySQL object?

2011-03-23 Thread Brian Dunning
Let's say I do a query: $result = mysql_query(select * from tablename); Is there some way I can manually update the contents of certain columns/records in $result? I don't want to actually update MySQL, just the results that I'm holding in memory for this script. Can I do it without converting

Re: [PHP] Can I modify a MySQL object?

2011-03-23 Thread Brian Dunning
I should have said modify the contents of a MySQL resource. On Mar 23, 2011, at 5:06 PM, Brian Dunning wrote: Let's say I do a query: $result = mysql_query(select * from tablename); Is there some way I can manually update the contents of certain columns/records in $result? I don't want

Re: [PHP] Help! Made a boo-boo encrypting credit cards

2011-03-03 Thread Brian Dunning
My merchant provider levies monthly fines based on how many of their security restrictions you fail to follow. I follow as many as are reasonably practical, but I think it's virtually impossible to follow them all, such as absurdly expensive (and probably unnecessary) hardware. IMHO, some of

Re: [PHP] Help! Made a boo-boo encrypting credit cards

2011-03-03 Thread Brian Dunning
That's a great suggestion. I will try this and report back. It's also been suggested to me that I should have base64_encoded the encryptions before storing them in MySQL, so I'll try this option at the same time. On Mar 1, 2011, at 2:04 PM, Ashley Sheridan wrote: Onto the problem of the data

Re: [PHP] Help! Made a boo-boo encrypting credit cards

2011-03-01 Thread Brian Dunning
I just wanted to ping this, as it's becoming a serious problem. I hope someone can help. On Feb 11, 2011, at 2:42 PM, Brian Dunning wrote: Hey all - I'm using mcrypt to store credit cards into MySQL. About 90% of them decrypt fine, but about 10% decrypt as nonsense (b1�\�JEÚU

[PHP] Finding split points in an article for inserting ads

2011-02-15 Thread Brian Dunning
Hey all - I've got long articles, the HTML for which comes out of MySQL. Works great. I want to split it up so that I can insert ad blocks at various points within it. The articles are all pretty long but they're of variable length. I want to chop them up into three close-to-equal (doesn't

Re: [PHP] Finding split points in an article for inserting ads

2011-02-15 Thread Brian Dunning
Yes, thanks, what I'm looking for is how to do that. On Feb 15, 2011, at 1:38 PM, Simon J Welsh wrote: Assuming you're only using p tags, count the number of opening p tags, divide by three. First ad block goes after the round($amount/3)-th /p, second ad block goes after the

Re: [PHP] Help! Made a boo-boo encrypting credit cards

2011-02-14 Thread Brian Dunning
On Feb 13, 2011, at 12:44 AM, Richard Quadling wrote: You are using addslashes($_POST['cc_number']). Considering a credit card number is purely numeric, the addslashes would seem to be redundant as you don't need to escape numbers. I do that routinely to all input fields as one additional

[PHP] Help! Made a boo-boo encrypting credit cards

2011-02-11 Thread Brian Dunning
Hey all - I'm using mcrypt to store credit cards into MySQL. About 90% of them decrypt fine, but about 10% decrypt as nonsense (b1�\�JEÚU�A��� is a good example). Maybe there is a character that appears in about 10% of my encryptions that's not being encoded properly??? // Encryption is set

[PHP] How to define a data range for graphing?

2010-12-17 Thread Brian Dunning
Hey all - I'm trying to provide reporting to users of our widget. Some may get 0 to 5 hits a day; others may get up to 10,000 hits a day. I need to define the range of the graph (using one of Google's). If their max day is 7, I'd like the graph to go from 0 to 10. If their max day is 5678, I'd

[PHP] Help with sending credentials?

2010-10-14 Thread Brian Dunning
Gents - I'm trying to work with a major vendor's web service, but all my efforts are met with a 401 authentication error response. I can log in manually to this URL using these credentials through a browser, so I know the credentials are good. Unfortunately the support guys at the vendor don't

[PHP] SimpleXML/array duality (like particles waves)

2010-09-28 Thread Brian Dunning
I am kind of jacked here. I have a SimpleXML object that's been converted to an array. In one of the nodes, for no reason I can see, the array is populated differently if there is only one order_item than if there are multiple order_items. If there is just one, my $order_item array looks like

Re: [PHP] SimpleXML/array duality (like particles waves)

2010-09-28 Thread Brian Dunning
If you read down to the bottom of the post, the function I used is given. On Sep 28, 2010, at 3:47 PM, Nathan Nobbe wrote: On Tue, Sep 28, 2010 at 4:29 PM, Brian Dunning br...@briandunning.com wrote: I am kind of jacked here. I have a SimpleXML object that's been converted to an array

[PHP] Can't read $_POST array

2010-08-18 Thread Brian Dunning
I'm trying to write a VERY simple script that does nothing but store all the submitted GET and POST vars in a string and echo it out. $response = print_r($_REQUEST, true); echo $response; The problem is it only shows GET vars. I've tried $POST instead of $_REQUEST and it always gives an empty

Re: [PHP] Can't read $_POST array

2010-08-18 Thread Brian Dunning
Sorry, my typo, $_POST is one of the options we tried, not $POST. It returns an empty array also. On Aug 18, 2010, at 1:50 PM, Joshua Kehn wrote: On Aug 18, 2010, at 4:45 PM, Brian Dunning wrote: I'm trying to write a VERY simple script that does nothing but store all the submitted GET

Re: [PHP] Can't read $_POST array

2010-08-18 Thread Brian Dunning
This was the complete code of the page (this is the POST version not the REQUEST version): ?php $response = print_r($_POST, true); echo $response; ? Returns an empty array no matter what POST vars are sent. We fixed it by changing it to this, which I've never even heard of, but so far is

[PHP] Battle of Spam

2010-06-07 Thread Brian Dunning
Hey - It looks like a PHP form on my server is insecure and is being used to send spam. This is Rackspace's best guess. The problem is there are SO MANY forms on all the web sites on this server that it would be a nightmare task to try and look at them all to be sure they're properly secured.

Re: [PHP] Battle of Spam

2010-06-07 Thread Brian Dunning
Agreed that's a great overall strategy but what I need now is a way to track down the offending script, within the next few days if possible. On Jun 7, 2010, at 1:35 PM, Jim Lucas wrote: Change all the forms to use a single processing script and then you won't have such a big problem tracking

Re: [PHP] Battle of Spam

2010-06-07 Thread Brian Dunning
I think I must have misstated the problem. Thanks to everyone for the replies, but the question is not how to fix it, it's how to find the script being attacked. Many different admins manage many different sites on this server, and I can't even begin to guess how many mail forms are on there

Re: [PHP] Battle of Spam

2010-06-07 Thread Brian Dunning
I'm currently geotargeting all the IPs in the log, and focusing on the hits from Russia (the majority of these apache@ spams seem to be Russian). I've got a much shorter list of scripts to look at now. Hopefully I'll find some that just use mail() with no scrubbing. -- PHP General Mailing List

[PHP] Help, FPDI is changing the size of my PDFs

2010-05-21 Thread Brian Dunning
I'm using FPDI to add some stuff to some existing PDF documents. Works great, except that it's slightly changing the size of the PDF document (the physical page size, not the file size), which is unacceptable since this is for a high-end print file. I've stripped out all the code to the bare

Re: [PHP] Help, FPDI is changing the size of my PDFs

2010-05-21 Thread Brian Dunning
Solved it. Here's the solution: $pdf = new fpdi(); $pdf-setSourceFile('D:\\DocShare\\'.$filename); $tplidx = $pdf-ImportPage(1); $s = $pdf-getTemplatesize($tplidx); $pdf-AddPage($s['h'] $s['w'] ? 'P' : 'L', array($s['w'], $s['h'])); // This gets it the right dimensions $pdf-useTemplate($tplidx,

[PHP] 2D barcodes

2010-05-11 Thread Brian Dunning
I have a project where I need to add some 2D barcodes onto some PDF files. I plan to use fpdi, since I've used it before and am familiar with it, but I need a source to generate the 2D barcodes, preferably as a png or jpg. Anyone have a suggestion - either a local classfile or a reliable web

Re: [PHP] PHP Encoder like IonCube

2010-05-11 Thread Brian Dunning
Hi Shiplu - I also have a product with similar requirements. I searched a LOT and was never able to find a free solution that I was satisfied with. Even a lot of the commercial solutions required some server-side runtime EXE or something be installed, and my customers are not tech savvy enough

Re: [PHP] PHP Encoder like IonCube

2010-05-11 Thread Brian Dunning
Totally agree. But just in case it wasn't clear, you only need a Windows computer once to run the obfuscator; once done the code runs on any PHP server. On May 11, 2010, at 5:06 PM, Ashley Sheridan wrote: Does slightly limit you to the Windows platform though, which I always think is a

Re: [PHP] simplexml choking on apparently valid XML - Solved

2010-05-10 Thread Brian Dunning
I was able to resolve this by changing the XML file encoding from UTF-8 to ISO-8859-1. Works like a charm now, with the XML-encoded characters. Thanks to all who offered their help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] simplexml choking on apparently valid XML

2010-05-07 Thread Brian Dunning
if it wouldn't. On May 6, 2010, at 5:02 PM, Brian Dunning wrote: Hey all - I'm using simplexml-load-string just to validation a string of XML, and libxml-get-errors to return any errors. It's always worked before, but today it's choking on this line in the XML

[PHP] simplexml choking on apparently valid XML

2010-05-06 Thread Brian Dunning
Hey all - I'm using simplexml-load-string just to validation a string of XML, and libxml-get-errors to return any errors. It's always worked before, but today it's choking on this line in the XML: client_orderitem_numberBasketball Personalized Notebook - Jeffapos;s/client_orderitem_number

[PHP] Simple code obfuscation

2010-02-08 Thread Brian Dunning
Hey all - I'm selling a custom PHP solution to FileMaker users. It uses FileMaker's PHP API, so everyone who has FileMaker Server is already set up to use it, but very few of them have any knowledge of how to set up a server or do anything PHP related. But I do want to add some level of code

[PHP] Can't get my PHP-generated RSS to serve properly

2010-02-03 Thread Brian Dunning
Hey all - Glad some of you found that sample data helpful. :-) I use PHP/MySQL to generate RSS feeds of my podcasts. The feed is submitted as *.xml and I use .htaccess to redirect it to my PHP document. The start of the document sets the right header and outputs the ? ? to prevent PHP from

Re: [PHP] Can't get my PHP-generated RSS to serve properly

2010-02-03 Thread Brian Dunning
Ugh. Stupid me. Thanks Robert. It was a type elsewhere in my code further down the page. I was so hung up thinking it was an encoding or MIME or delivery problem I didn't think to check my PHP. Someone slap me upside the head please. -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Good source for sample data?

2010-01-29 Thread Brian Dunning
, exchange, so will work for mapping, phone or address validation, whatever your needs are. Hope someone find it useful. http://www.briandunning.com/sample-data/ On Jan 28, 2010, at 3:52 PM, Brian Dunning wrote: I need a few million sample contact records - name, company, address, email, web

[PHP] Good source for sample data?

2010-01-28 Thread Brian Dunning
Hey all - I need a few million sample contact records - name, company, address, email, web, phone, fax. ZIP codes and area codes and street addresses should be correct and properly formatted, but preferably not real people or companies or email addresses. But they'd work if you did address

[PHP] Emergency! Performance downloading big files

2009-12-01 Thread Brian Dunning
This is a holiday-crunch emergency. I'm dealing with a client from whom we need to download many large PDF docs 24x7, several thousand per hour, all between a few hundred K and about 50 MB. Their security process requires the files to be downloaded via https using a big long URL with lots of

Re: [PHP] Emergency! Performance downloading big files

2009-12-01 Thread Brian Dunning
Oops, it's several hundred per hour, several thousand per day. Sorry for the accidental superlative. I'm dealing with a client from whom we need to download many large PDF docs 24x7, several thousand per hour, all between a few hundred K and about 50 MB. -- PHP General Mailing List

Re: [PHP] Emergency! Performance downloading big files

2009-12-01 Thread Brian Dunning
Can someone explain how this would work? It's a Windows web server running IIS and the files are saved to a drive that is outside the web root. PHP is grabbing each filename from a MySQL database, along with the URL and credentials for it, and ends up with a url something like this:

[PHP] Cookie Quandary

2009-10-27 Thread Brian Dunning
I wrote some cookies for a whole bunch of site admins, but failed to set the path, so all the cookies are set to '/admin', which is not going to work for everything they need to do. They are also too long, set for 6 months. I need to correct both issues, so I changed it to write cookies to

Re: [PHP] Cookie Quandary

2009-10-27 Thread Brian Dunning
No, I'm talking about cookies, thus the references to pathnames and expirations. On Oct 27, 2009, at 10:56 AM, Ashley Sheridan wrote: Cookies are client-side. Do you mean session files? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Really quick try/catch question

2009-08-18 Thread Brian Dunning
I have a new SimpleXMLElement() that is occasionally throwing: 'Exception: String could not be parsed as XML' Will this catch it when it happens, or am I missing something? function domyfunction() { // This does some stuff to exit the script gracefully } try { $xmlobject = new

Re: [PHP] Server change affecting ability to send downloaded files???

2009-08-08 Thread Brian Dunning
A Rackspace guy determined that php.ini was set to use 16MB of memory, and he upped it to 32MB, and now everything works. Some of my downloads are as large as 41MB so I asked him to up it to 48MB. Maybe they upgraded the PHP version or something and wiped this setting. The 41MB files had

[PHP] Server change affecting ability to send downloaded files???

2009-08-07 Thread Brian Dunning
Hey all -- A couple of weeks ago my online stores, on a machine I host at Rackspace, stopped delivering files that people purchase. I've used this for years, and it's always worked perfectly with all filetypes: header('Content-Type: application/octet-stream'); header('Content-Disposition:

Re: [PHP] Server change affecting ability to send downloaded files???

2009-08-07 Thread Brian Dunning
Very interesting. Excellent debugging advice. It's giving me a 500 error, probably why the Rackspace techs told me to check my code: HTTP/1.0 500 Internal Server Error Date: Sat, 08 Aug 2009 00:01:10 GMT Server: Apache/2.0.52 (Red Hat) X-Powered-By: PHP/5.2.10 Content-Disposition: attachment;

Re: [PHP] Server change affecting ability to send downloaded files???

2009-08-07 Thread Brian Dunning
Correct, the files on the server have not changed either, and have been working fine for a long time. No funny characters. On Aug 7, 2009, at 4:59 PM, Adam Randall wrote: Sorry for replying to myself, but the files themselves only contain US-ASCII characters, and no quotes, correct? Having

[PHP] Totally weird behavior trying to download a Mac DMG file

2009-06-16 Thread Brian Dunning
So I've added a product to my online store that's in .DMG format. Most of the other files are ZIP or PDF. When someone completes a purchase, it downloads the file to them, and this works great: header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment;

Re: [PHP] Totally weird behavior trying to download a Mac DMG file

2009-06-16 Thread Brian Dunning
Don't think so, only when I download via the PHP code I posted: On Jun 16, 2009, at 10:40 AM, Brian Dunning wrote: If you do a direct download, it mounts on the desktop perfectly, and there's all the stuff inside. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit

Re: [PHP] Totally weird behavior trying to download a Mac DMG file

2009-06-16 Thread Brian Dunning
Good idea, thanks. :-) On Jun 16, 2009, at 12:30 PM, Shawn McKenzie wrote: Use livehttpheaders or some other header capture utility and see what the difference in the headers are between the dl from the PHP page and direct download. -- PHP General Mailing List (http://www.php.net/) To

[PHP] fopen() on a network share?

2009-06-15 Thread Brian Dunning
Running on Windows... I have a network share, \\sharename\foldername, and I want to write a file. How do I format the pathname with fopen() for this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] fopen() on a network share?

2009-06-15 Thread Brian Dunning
, 2009, at 1:39 PM, Brian Dunning wrote: Running on Windows... I have a network share, \\sharename \foldername, and I want to write a file. How do I format the pathname with fopen() for this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] file_get_contents doesn't work on one particular server

2009-04-29 Thread Brian Dunning
Howdy all - We have a production server that runs our script fine. We're setting up a test server, and this particular script returns a length of zero: $ctx = stream_context_create(array('http' = array('timeout' = 1200))); // 20 minutes per file $contents = file_get_contents($full_url, 0,

[PHP] Zend Guard/Optimizer alternatives?

2009-02-16 Thread Brian Dunning
Is there a cheaper alternative to Guard/Optimizer? I have a single small PHP file that is part of a larger solution I sell, and I want it to be protected - and it has to be a runtime so it will run on anyone's standard PHP server. Zend's $600 was a little bit of sticker shock. Any

Re: [PHP] Zend Guard/Optimizer alternatives?

2009-02-16 Thread Brian Dunning
to have to know anything or do anything special (they are business people, not developers or server admins). On Feb 16, 2009, at 9:10 AM, Brian Dunning wrote: Is there a cheaper alternative to Guard/Optimizer? I have a single small PHP file that is part of a larger solution I sell, and I want

Re: [PHP] Re: Reverse IP lookup

2009-02-16 Thread Brian Dunning
And an equally important question: How do you prevent your servers from showing up in searches like this? On Feb 16, 2009, at 7:51 AM, Lewis Wright wrote: This may be a little more accurate: http://www.domaintools.com/reverse-ip/ -- PHP General Mailing List (http://www.php.net/) To

[PHP] Need to hire some PHP help...

2009-02-12 Thread Brian Dunning
I need probably no more than an hour of two of help from someone better than me at PHP, but have money sitting here ready to pay you. My project is way behind schedule and I'm burning too much time and making no progress trying to solve two problems. (1) Submitting some XML to a web

[PHP] Best way to post XML via curl?

2009-02-11 Thread Brian Dunning
I'm going crazy, can't quite get this encoding to work. I've tried all the various combinations, trying to send this block $xml (which is a simple string variable) via post along with 3 other params: $postArgs = http_build_query(array('method'='newPrintRequest', 'login'=$login,

Re: [PHP] Best way to post XML via curl?

2009-02-11 Thread Brian Dunning
Just realized I didn't happen to mention the problem. :-) The server is not seeing any of my posted fields. It's returning a properly-formatted XML response that says I did not submit the required fields. Unfortunately the server is a black box, but lots of other partners use it every

Re: [PHP] Best way to post XML via curl?

2009-02-11 Thread Brian Dunning
This line is the key. WITH the line, I get a properly formatted XML response from the server, telling me that I did not send any valid post fields. WITHOUT the line, all I get back from the server is a '1' and their tech reports that no valid call was received from me. On Feb 11, 2009, at

Re: [PHP] Best way to post XML via curl?

2009-02-11 Thread Brian Dunning
look at my code, it clearly is. On Feb 11, 2009, at 5:08 PM, Stuart wrote: 2009/2/12 Brian Dunning br...@briandunning.com: This line is the key. WITH the line, I get a properly formatted XML response from the server, telling me that I did not send any valid post fields. WITHOUT the line

[PHP] How can a script tell if there's a MySQL problem?

2009-01-09 Thread Brian Dunning
I have one server that's pretty busy and runs into Too many connections from MySQL from time to time, and needs to have MySQL restarted to clear it up. I've tried everything I can think of to have PHP take note of this error but continue executing with other stuff, but no matter what I

[PHP] imagejpeg, imagecreatefromjpeg both choke

2009-01-09 Thread Brian Dunning
I'm trying a stripped down test just to try to get this work. I have a valid jpeg on disk: 3.jpg- 3316x2220, 3.6 MB And am trying either of the following: // This does nothing at all imagejpeg('3.jpg'); // This displays failed $im = imagecreatefromjpeg('3.jpg'); if(!$im) echo 'failed';

Re: [PHP] imagejpeg, imagecreatefromjpeg both choke

2009-01-09 Thread Brian Dunning
Same thing, no output at all. I can access the image directly in my browser and it's fine. On Jan 9, 2009, at 7:52 AM, Zechim wrote: try, header('Content-type: image/jpeg'); $image = imagecreatefromjpeg($your_file); imagejpeg($image,, 100); imagedestroy($image); zechim -- PHP

[PHP] Convert CMYK values to RGB values?

2009-01-09 Thread Brian Dunning
Anyone know how to convert CMYK values to RGB values? I'm just trying to translate the numbers from one to the other, not actually do any graphic stuff. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Convert CMYK values to RGB values?

2009-01-09 Thread Brian Dunning
I think your short answer is the right one. This explains why I didn't find that cmyk_to_rgb() function on php.net. Thanks... :-( On Jan 9, 2009, at 3:14 PM, c...@l-i-e.com wrote: Short Answer: You can't. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] IM Convert PDF-JPG works in command line, not in PHP

2008-12-31 Thread Brian Dunning
Here's a weird thing. I have a new Redhat machine, with PHP 5.2.6 and IM 6.4.8. The following works beautifully on the command line: convert original.pdf new.jpg But from PHP, it only works beautifully if I specify complete pathnames for convert, the original file, and the new file (that's

Re: [PHP] IM Convert PDF-JPG works in command line, not in PHP

2008-12-31 Thread Brian Dunning
My typo skipping the '/html/' in the pathname, the paths are correct in my actual code. On Dec 31, 2008, at 3:24 PM, Brian Dunning wrote: /var/www/html/original.pdf /var/www/html/new.jpg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] IM Convert PDF-JPG works in command line, not in PHP

2008-12-31 Thread Brian Dunning
Interesting. When I try this, $return_output gives an empty array, and $return_code gives 1. On Dec 31, 2008, at 3:38 PM, chris smith wrote: Try using exec() so you get the whole return message, might be something useful in there. exec($command_line, $return_output, $return_code); --

Re: [PHP] IM Convert PDF-JPG works in command line, not in PHP

2008-12-31 Thread Brian Dunning
OMG. I had not set the permissions properly on the destination directory. It works now. Sorry for wasting the list's time, and thanks to Chris for your help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Anyone else have trouble with Apple Mail threading this list?

2008-12-31 Thread Brian Dunning
I use Apple Mail, and subscribe to many lists but PHP-General is the only one I have this problem with. People tell me that my replies are not properly threaded to the original post. When I hit Reply or Reply All in Mail, it wants to reply directly to the poster, and only CC's the list. So

[PHP] Help debugging a file upload on IIS

2008-12-29 Thread Brian Dunning
Hi - I have a file upload that returns no error, but the file does not appear on the server. Here is the result of $_FILES: Array ( [f] = Array ( [name] = Elephants.pdf [type] = application/pdf [tmp_name] = C:\WINDOWS\Temp\php3133.tmp

Re: [PHP] Help debugging a file upload on IIS

2008-12-29 Thread Brian Dunning
The one thing I was doing was: move_uploaded_file($_FILES['upload_file']['tmp_name'], $new_path); but nothing was happening, no new file appearing where it was supposed to, and no error returned, left me scratching my head. (Later the same script logs the upload to MySQL using data from

Re: [PHP] Can GD make a JPG thumbnail of a PDF?

2008-12-10 Thread Brian Dunning
I've spent most of the last week trying to get ImageMagick working on my Windows PHP installation. I gather that since I'm going to be converting PDFs to JPEGs, I need Ghostscript. Well, I've got ImageMagick installed: http://printhq2.com/info.php I ran a Ghostscript installer, but it didn't

[PHP] Slow file download

2008-12-02 Thread Brian Dunning
I'm using a PHP cron job to constantly download files from a remote server. Client and server both have abundant unused bandwidth, and the sysads have already eliminated switches, interface cards, etc. as the source of the slowdown. I'm looking at the script to see why file downloads are

Re: [PHP] Slow file download

2008-12-02 Thread Brian Dunning
I'm open to something like that - we're in the middle of the holiday crunch and can't afford any downtime, so a significant change is out of the question. This is part of much larger and more involved scripting, so it would need to be a plug-n-play replacement and also be able to return

Re: [PHP] Re: Slow file download

2008-12-02 Thread Brian Dunning
IIS, Windows PHP 5.2.6, and unfortunately the downloads are https. On Dec 2, 2008, at 12:32 PM, Nathan Rixham wrote: what's the server running? iis/apache, win/linux version of php (as accurate as you can) oh and via http or https/ssl? -- PHP General Mailing List (http://www.php.net/) To

[PHP] Anyway to simulate pcntl_fork() on Windows?

2008-11-21 Thread Brian Dunning
It's the function I need most and it's not available on Windows, and unfortunately that's what the client uses. Any suggestions for a workaround? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Can GD make a JPG thumbnail of a PDF?

2008-11-20 Thread Brian Dunning
Well can it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Launching multiple PHP threads via Scheduled Tasks

2008-10-27 Thread Brian Dunning
I've got a script that downloads files queued from a server, and it's launched by a Windows Scheduled Task that launches every minute. My understanding of the default behavior is that if the task is still running a minute later when it's time to launch again, a duplicate thread will not be

[PHP] Timing problem, putting PNG into PDF

2008-08-11 Thread Brian Dunning
I'm using GD to crop save an uploaded image, and then embedding it into a PDF made with FPDI. It works great when the image is small or low-res. When the uploaded file is bigger, more than a couple hundred K or so, it fails. I think that the image is not done writing yet by the time I try

[PHP] Splitting up long URLs

2008-07-01 Thread Brian Dunning
I have a web page that lists most recent comments in a left margin. Sometimes people post long URLs, or even just really really long words, that force that margin to display way too wide, screwing up the page layout. Is there a way to make sure URLs or other text in a string gets split up

[PHP] Simple array problem

2008-06-30 Thread Brian Dunning
I'm trying to add a number to a value in an array. Pretend I have this: $new_value = array('orange', 2); $arr = array( array('blue', 4), array('orange', 5), array('green', 6)); I want to add the new value to the existing matching array element, so I end up with this:

  1   2   3   4   >