[PHP] Does php 5.2.5 support imap4rev1 search criterias
I have php 5.2.5 installed on fedora 9. I have written a little php program that uses the search criteria SENTSINCE. But it complains with : Unknown search criterion: SENTSINCE Can anbody help ? -- Ergün Koray bb, vm, mu, xg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Does php 5.2.5 support imap4rev1 search criterias
I have php 5.2.5 installed on fedora 9. I have written a little php program that uses the search criteria SENTSINCE. But it complains with : Unknown search criterion: SENTSINCE It doesn't appear to be a valid search option - only SINCE is listed here: http://uk2.php.net/manual/en/function.imap-search.php -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 29th) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP - Jasper Report Integeration
Dear All, Do any one know how to integrate PHP with Jasper Reports. I tried it..but its says Unable to create Java Virtual Machine Please refer this link for more details. http://jagadmaya.com/integration-phpjasperreports.html Regards, Johny www.phpshore.com
[PHP] IE8 and HTML5
Hi, From a recent IEBlog post: http://blogs.msdn.com/ie/archive/2008/12/03/compatibility-view-improvements-to-come-in-ie8.aspx ...and our start on HTML5 support. Does this mean canvas support? Is it as a direct result of Chrome being released and MS realising (finally) they are going to have to remain competitive? Wouldn't that be nice? -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 29th) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Does php 5.2.5 support imap4rev1 search criterias
Thank you. Will this be implemented or should I get in touch with the developers of the c-client libraries ? Our mail server is Lotus Domino 7 and the problem with this server is that it does not get correct results from the SINCE query. It understands the SENTSINCE query correct. On Thu, Dec 4, 2008 at 10:30 AM, Richard Heyes [EMAIL PROTECTED] wrote: I have php 5.2.5 installed on fedora 9. I have written a little php program that uses the search criteria SENTSINCE. But it complains with : Unknown search criterion: SENTSINCE It doesn't appear to be a valid search option - only SINCE is listed here: http://uk2.php.net/manual/en/function.imap-search.php -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 29th) -- Ergün Koray bb, vm, mu, xg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE8 and HTML5
On Thursday 04 December 2008 10:45:21 Richard Heyes wrote: Hi, From a recent IEBlog post: http://blogs.msdn.com/ie/archive/2008/12/03/compatibility-view-improvements -to-come-in-ie8.aspx Microsoft and Standarts ? Ship load of crap... Every web developer should open class action suit against M$ because of IE and M$ should banned from to create web browser for ever... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Does php 5.2.5 support imap4rev1 search criterias
Thank you. Will this be implemented or should I get in touch with the developers of the c-client libraries ? Our mail server is Lotus Domino 7 and the problem with this server is that it does not get correct results from the SINCE query. It understands the SENTSINCE query correct. No idea. Can you fake it? ie get all the message numbers, remove the ones that result from a BEFORE search. -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 29th) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imagecreatefromgif imagecolortransparent() ??
Hi all, the simple code snippet: header('Content-type: image/gif'); $im = imagecreatefromgif(/path/Mypic.gif); $background = imagecolorallocate($im, 255, 255, 255); imagecolortransparent($im,$background); imagegif($im,'/path/TransparentPic.gif'); imagedestroy($im); is creating the new image but is not setting the white background to transparent; I am sure about the presence of the white color in the background (checked it with imagecolorat() etc). a similarly simple test setting transparency on a new image created with 'imagecreatetruecolor()' works correctly... any hints?! Cheers, Luca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE8 and HTML5
On Thu, Dec 4, 2008 at 4:44 AM, Sancar Saran [EMAIL PROTECTED]wrote: On Thursday 04 December 2008 10:45:21 Richard Heyes wrote: Hi, From a recent IEBlog post: http://blogs.msdn.com/ie/archive/2008/12/03/compatibility-view-improvements -to-come-in-ie8.aspx Microsoft and Standarts ? Ship load of crap... Every web developer should open class action suit against M$ because of IE and M$ should banned from to create web browser for ever... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I am running IE8 beta and its a PoS. Constantly crashing and flaky as shit. -- Bastien Cat, the other other white meat
Re: [PHP] IE8 and HTML5
I am running IE8 beta and its a PoS. Constantly crashing and flaky as shit. Point of Sale...? -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 29th) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE8 and HTML5
On Thu, Dec 4, 2008 at 9:10 AM, Richard Heyes [EMAIL PROTECTED] wrote: I am running IE8 beta and its a PoS. Constantly crashing and flaky as shit. Point of Sale...? -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 29th) haha -- Bastien Cat, the other other white meat
Re: [PHP] Last working day of a month
On Thu, Dec 4, 2008 at 9:03 AM, Angelo Zanetti [EMAIL PROTECTED] wrote: Hi all, I am busy trying to figure out how to get the last working day in a month. I was wondering if there was a script already written, but this is what I imagine should work: Get the current day and see if it's the last day of the month. If its true check if it's a Saturday or Sunday if it's either of those 2 days then return false else return true? I also need to take public holidays into account. What would be the best solution for that? Store the public holidays in a table and check if the current day isn't a public holiday? Any advice is appreciated. TIA Angelo If your application is already using a database, I would use a date table rather than a holiday table. You can add columns to indicate whether each date is a workday, weekday, weekend, holiday, or any other date category/group that you need to track. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to fetch .DOC or .DOCX file in php
Hi ! I want to fetch text from .doc / .docx file and save it into database file. But when I tried to fetch text with fopen/fgets etc ... It gave me special characters with text. (With .txt files everything is fine) Only problem is with doc/docx files. I dont know whow to remove SPECIAL CHARACTERS from this text ... Regards Jagdeep Singh India 9988009272
[PHP] Last working day of a month
Hi all, I am busy trying to figure out how to get the last working day in a month. I was wondering if there was a script already written, but this is what I imagine should work: Get the current day and see if it's the last day of the month. If its true check if it's a Saturday or Sunday if it's either of those 2 days then return false else return true? I also need to take public holidays into account. What would be the best solution for that? Store the public holidays in a table and check if the current day isn't a public holiday? Any advice is appreciated. TIA Angelo Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to fetch .DOC or .DOCX file in php
-Original Message- From: Jagdeep Singh [mailto:[EMAIL PROTECTED] Sent: Thursday, December 04, 2008 8:39 AM To: php-general@lists.php.net Subject: [PHP] How to fetch .DOC or .DOCX file in php Importance: Low Hi ! I want to fetch text from .doc / .docx file and save it into database file. But when I tried to fetch text with fopen/fgets etc ... It gave me special characters with text. (With .txt files everything is fine) Only problem is with doc/docx files. I dont know whow to remove SPECIAL CHARACTERS from this text ... A.) This has been handled on this list several times. Please search the archives before posting a question. B.) Did you even TRY to Google for this? In the first 5 matches for php open ms word I found this: http://www.developertutorials.com/blog/php/extracting-text-from-word-doc uments-via-php-and-com-81/ You will need an MS Windows machine for this solution to work. If you're using *nix... well... good luck. // Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Last working day of a month
-Original Message- From: Andrew Ballard [mailto:[EMAIL PROTECTED] Sent: Thursday, December 04, 2008 8:32 AM To: Angelo Zanetti Cc: php-general@lists.php.net Subject: Re: [PHP] Last working day of a month Importance: Low On Thu, Dec 4, 2008 at 9:03 AM, Angelo Zanetti [EMAIL PROTECTED] wrote: Hi all, I am busy trying to figure out how to get the last working day in a month. I was wondering if there was a script already written, but this is what I imagine should work: Get the current day and see if it's the last day of the month. If its true check if it's a Saturday or Sunday if it's either of those 2 days then return false else return true? I also need to take public holidays into account. What would be the best solution for that? Store the public holidays in a table and check if the current day isn't a public holiday? If your application is already using a database, I would use a date table rather than a holiday table. You can add columns to indicate whether each date is a workday, weekday, weekend, holiday, or any other date category/group that you need to track. That seems like a waste of space and database calls to me. (Yes, I know space is cheap... but it should at least be thought about briefly. Using that space costs cycles, etc.) Since the exceptions to his rule are so few in comparison to the days that follow, I think documenting the exceptions and assuming it's a workday if it's not an exception makes more sense (IMHO). I'd probably store all holidays in a table and assume that Saturdays/Sundays are not workdays unless they have a corresponding entry in the same table that holds the holidays. Call the table exceptions. The exception to a workday is a holiday. The exception to a weekend is a workday. :) HTH, // Todd
Re: [PHP] Last working day of a month
Angelo Zanetti schreef: Hi all, I am busy trying to figure out how to get the last working day in a month. I was wondering if there was a script already written, but this is what I imagine should work: Get the current day and see if it's the last day of the month. If its true check if it's a Saturday or Sunday if it's either of those 2 days then return false else return true? I also need to take public holidays into account. What would be the best solution for that? Store the public holidays in a table and check if the current day isn't a public holiday? you need a process with a few simple steps. 1. find the last day of the month, this is quite easy ... google gives answers as does the manual. e.g.: http://lutrov.com/blog/php-last-day-of-the-month-calculation/ 2. determine if this is a week day. if yes go to step three else 'roll the date back' 24 hours and go to step 2. 3. determine if this is a holiday, if yes 'roll the date back' 24 hours and go to step 2. else you have found the last working day of the month. with regard to determining if a day is a holiday your best bet is to store these in a database table. and check against that ... you may be able to find a source of holiday data online from which you can sync your local datasource periodically (e.g. via a cron job). hth Any advice is appreciated. TIA Angelo Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using DateTimeZone
I'm looking to tidy up things a bit by clearing out a lot of old code and switching to using the internal DateTime functions. Information is stored in the databases UTC normalized, and we get around the problem of getting a real tz offset by getting the users to register it rather than simply relying on the browser. So dates and times are displayed either UTC or user local time. The server defaults are not relevant, as only the user details should be used. The thing that I am having a little trouble establishing is the correct way to take a UTC unix epoch timestamp from the data and display it with the users timezone offset. $dateTimeZoneUser = new DateTimeZone(user's setting); $dateTimeUser = new DateTime( date( U, $datetime_to_display ), $dateTimeZoneUser ); $date = $dateTimeUser-format( DATE_ATOM ); Is giving results wildly different from 2008 So how is one supposed to handle epoch values? I little aside while sorting the lookup table for timezones, DateTimeZone::listIdentifiers() apparently should accept a country code, but again I can't seem to find out how to make it work. Would I expect it to return just values for the country requested? Lester Caine - G8HFL - Contact - http://lsces.co.uk/lsces/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Last working day of a month
you need a process with a few simple steps. 1. find the last day of the month, this is quite easy ... google gives answers as does the manual. e.g.: http://lutrov.com/blog/php-last-day-of-the-month-calculation/ 2. determine if this is a week day. if yes go to step three else 'roll the date back' 24 hours and go to step 2. 3. determine if this is a holiday, if yes 'roll the date back' 24 hours and go to step 2. else you have found the last working day of the month. with regard to determining if a day is a holiday your best bet is to store these in a database table. and check against that ... you may be able to find a source of holiday data online from which you can sync your local datasource periodically (e.g. via a cron job). hth Well it should!! The advice I love most of all is like this, helping me see the clear logic, and then letting me figure out how to write it w/the language at hand. This reply post of mine does not add anything for anyone; sometimes I just can't help express my appreciation for things. Brilliant Jochem! -G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using DateTimeZone
Lester Caine wrote: I'm looking to tidy up things a bit by clearing out a lot of old code and switching to using the internal DateTime functions. Information is stored in the databases UTC normalized, and we get around the problem of getting a real tz offset by getting the users to register it rather than simply relying on the browser. So dates and times are displayed either UTC or user local time. The server defaults are not relevant, as only the user details should be used. OK cracked the first bit - need an '@' in place of the U The thing that I am having a little trouble establishing is the correct way to take a UTC unix epoch timestamp from the data and display it with the users timezone offset. $dateTimeZoneUser = new DateTimeZone(user's setting); $dateTimeUser = new DateTime( date( U, $datetime_to_display ), $dateTimeZoneUser ); new DateTime( '@'.$datetime_to_display, $dateTimeZoneUser ); $date = $dateTimeUser-format( DATE_ATOM ); Is giving results wildly different from 2008 So how is one supposed to handle epoch values? That gives me the correct date - but changing the timezone makes no difference to the output - seems to be displaying local timezone only. I little aside while sorting the lookup table for timezones, DateTimeZone::listIdentifiers() apparently should accept a country code, but again I can't seem to find out how to make it work. Would I expect it to return just values for the country requested? -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/lsces/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreatefromgif imagecolortransparent() ??
Here's a code snippet from the php.net documentation on imagecolortransparent by Blaine Ehrhart ?php $im = imagecreatefromgif('trans.gif'); $img = imagecreatetruecolor(16,16); $trans = imagecolorallocate($img,255,99,140); imagecolortransparent($img,$trans); imagecopy($img,$im,0,0,0,0,16,16); imagetruecolortopalette($img, true, 256); imageinterlace($img); imagegif($img,'trans.gif'); imagedestroy($img); ? See if it works. On Thu, Dec 4, 2008 at 10:44 AM, LucaP [EMAIL PROTECTED] wrote: Hi all, the simple code snippet: header('Content-type: image/gif'); $im = imagecreatefromgif(/path/Mypic.gif); $background = imagecolorallocate($im, 255, 255, 255); imagecolortransparent($im,$background); imagegif($im,'/path/TransparentPic.gif'); imagedestroy($im); is creating the new image but is not setting the white background to transparent; I am sure about the presence of the white color in the background (checked it with imagecolorat() etc). a similarly simple test setting transparency on a new image created with 'imagecreatetruecolor()' works correctly... any hints?! Cheers, Luca -- 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] COM and the PHP equivalent of ASP Currency data type
Hi all, I am working with a COM interface and the specification which is wrtten for ASP calls for a Currency data type to be passed to a function. What is the equivalent in PHP? If I call com_print_typeinfo() I can see that the function has the following info: function GetPrice( /* VT_PTR [26] [in][out] -- VT_VARIANT [12] */ $Account, /* VT_PTR [26] [in][out] -- VT_CY [6] */ $Quant, /* VT_PTR [26] [in][out] -- VT_I2 [2] */ $QuantMult, /* VT_PTR [26] [in][out] -- VT_I2 [2] */ $prMult ) The parameter I am having problems with parameter 2 - $Quant. I tried to create a VARIANT of type VT_CY so I did: $qty = new VARIANT('1.', VT_CY); The error I am getting is: Uncaught exception 'com_exception' with message 'Parameter 2: Type mismatch. Thanks all, Alex - Alex Bovey Web Developer | Alex Bovey Consultancy Ltd Registered in England Wales no. 6471391 | VAT no. 934 8959 65 PHP | MySQL | AJAX | XHTML | CSS | Javascript | XML | W3C Accessibility
Re: [PHP] Using DateTimeZone
Lester Caine wrote: Lester Caine wrote: I'm looking to tidy up things a bit by clearing out a lot of old code and switching to using the internal DateTime functions. Information is stored in the databases UTC normalized, and we get around the problem of getting a real tz offset by getting the users to register it rather than simply relying on the browser. So dates and times are displayed either UTC or user local time. The server defaults are not relevant, as only the user details should be used. OK cracked the first bit - need an '@' in place of the U The thing that I am having a little trouble establishing is the correct way to take a UTC unix epoch timestamp from the data and display it with the users timezone offset. $dateTimeZoneUser = new DateTimeZone(user's setting); $dateTimeUser = new DateTime( date( U, $datetime_to_display ), $dateTimeZoneUser ); new DateTime( '@'.$datetime_to_display, $dateTimeZoneUser ); Completing the circle slowly $dateTimeUser = new DateTime( '@'.$datetime_to_display); $dateTimeUser-setTimeZone( $dateTimeZoneUser ); $date = $dateTimeUser-format( DATE_ATOM ); But of cause the bit of the jigsaw I forgot is that this needs translating to the correct language. format does not respect 'setlocale' setting? How do I get this translated to the users language as well as their timezone? Is giving results wildly different from 2008 So how is one supposed to handle epoch values? That gives me the correct date - but changing the timezone makes no difference to the output - seems to be displaying local timezone only. I little aside while sorting the lookup table for timezones, DateTimeZone::listIdentifiers() apparently should accept a country code, but again I can't seem to find out how to make it work. Would I expect it to return just values for the country requested? -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/lsces/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE8 and HTML5
I am running IE8 beta and its a PoS. Constantly crashing and flaky as shit. Devil's Advocate It's a beta. What do you expect? /Devil's Advocate -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE8 and HTML5
On Thu, Dec 4, 2008 at 11:57 AM, Jay Moore [EMAIL PROTECTED] wrote: I am running IE8 beta and its a PoS. Constantly crashing and flaky as shit. Devil's Advocate It's a beta. What do you expect? /Devil's Advocate -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php How about not throwing a js error on opening a new tab? Kinda basic, even MS should be able to handle that or so I would have hoped. I have less issues with Chrome and its beta -- Bastien Cat, the other other white meat
Re: [PHP] IE8 and HTML5
Bastien Koert wrote: On Thu, Dec 4, 2008 at 11:57 AM, Jay Moore [EMAIL PROTECTED] wrote: I am running IE8 beta and its a PoS. Constantly crashing and flaky as shit. Devil's Advocate It's a beta. What do you expect? /Devil's Advocate -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php How about not throwing a js error on opening a new tab? Kinda basic, even MS should be able to handle that or so I would have hoped. I have less issues with Chrome and its beta At least have the decency to wait till it's out of beta to complain about all the issues that should have been fixed in the beta. Don't worry. They'll still be there. ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE8 and HTML5
I have less issues with Chrome and its beta Not thrashing my HDD is also kinda basic, but Chrome 0.2 was more than happy to do that. -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 29th) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] IE8 and HTML5
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Richard Heyes Sent: Thursday, December 04, 2008 11:10 AM To: Bastien Koert Cc: Jay Moore; php-general@lists.php.net Subject: Re: [PHP] IE8 and HTML5 I have less issues with Chrome and its beta Not thrashing my HDD is also kinda basic, but Chrome 0.2 was more than happy to do that. http://www.srware.net/en/software_srware_iron.php Iron: Chromium source re-worked for efficiency and privacy. Not sure if it will solve your thrashing issue, but then again... I'm not sure how or why a browser would cause your HDD to thrash in the first place. Got a lot of questionable videos open in several tabs, eh? ;) I've had Firefox thrash sometimes when it's loading lots of Applets and Flash objects, etc., though, so I guess I can understand. (And don't get me wrong--I had tons of problems with Chrome; mostly about crashing unexpectedly.) // Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE8 and HTML5
(And don't get me wrong--I had tons of problems with Chrome; mostly about crashing unexpectedly.) That was the only one for me, and it doesn't do it anymore. Guess it was an update to 0.4 (?) that fixed it. Switching to FF fixed it quite well... Thing is, it's a beater - until it gets close to a 1 version, I'm not going to worry about it. -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 29th) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to fetch .DOC or .DOCX file in php
Boyd, Todd M. wrote: -Original Message- From: Jagdeep Singh [mailto:[EMAIL PROTECTED] Sent: Thursday, December 04, 2008 8:39 AM To: php-general@lists.php.net Subject: [PHP] How to fetch .DOC or .DOCX file in php Importance: Low Hi ! I want to fetch text from .doc / .docx file and save it into database file. But when I tried to fetch text with fopen/fgets etc ... It gave me special characters with text. (With .txt files everything is fine) Only problem is with doc/docx files. I dont know whow to remove SPECIAL CHARACTERS from this text ... A.) This has been handled on this list several times. Please search the archives before posting a question. B.) Did you even TRY to Google for this? In the first 5 matches for php open ms word I found this: http://www.developertutorials.com/blog/php/extracting-text-from-word-doc uments-via-php-and-com-81/ You will need an MS Windows machine for this solution to work. If you're using *nix... well... good luck. // Todd Ah, not true about the MS requirement. If all you want is the clear/clean text (without any formatting), then I can do it with php on any platform. If this is what is needed, here is the code to do it. ?php $filename = './12345.doc'; if ( file_exists($filename) ) { if ( ($fh = fopen($filename, 'r')) !== false ) { $headers = fread($fh, 0xA00); # 1 = (ord(n)*1) ; Document has from 0 to 255 characters $n1 = ( ord($headers[0x21C]) - 1 ); # 1 = ((ord(n)-8)*256) ; Document has from 256 to 63743 characters $n2 = ( ( ord($headers[0x21D]) - 8 ) * 256 ); # 1 = ((ord(n)*256)*256) ; Document has from 63744 to 16775423 characters $n3 = ( ( ord($headers[0x21E]) * 256 ) * 256 ); # (((ord(n)*256)*256)*256) ; Document has from 16775424 to 4294965504 characters $n4 = ( ( ( ord($headers[0x21F]) * 256 ) * 256 ) * 256 ); # Total length of text in the document $textLength = ($n1 + $n2 + $n3 + $n4); $extracted_plaintext = fread($fh, $textLength); # if you want the plain text with no formatting, do this echo $extracted_plaintext; # if you want to see your paragraphs in a web page, do this echo nl2br($extracted_plaintext); } } ? Hope this helps. I am working on a set of php classes that will be able to read the text with the formatting included and convert it to a standard document format. The standard format that it will end up in has yet -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with IF ELSE
Hi All, I'm new to PHP - I'm trying to figure out what is wrong with a simple IF ELSE block I have...if the recordset $rs is empty (login fails), the 1st part of the block works, and redirects the user to default.php - but if the login works, and $rs is not empty, the 2nd else part does not work, and does not redirect to menu.php - I just get a blank white screen on the login.php page (where this code is) Any ideas? What is the proper way to detect an empty recordset? Thanks! Below is the code: ... $query = SELECT user_id FROM users WHERE username = '$uname' AND password = '$pword'; $rs = $conn-execute($query); if($rs-EOF) { $rs-Close(); $conn-Close(); $rs = null; $conn = null; header(Location: default.php?err=Invalid%20Login%20Attempt); exit; } else { $rs-Close(); $conn-Close(); $rs = null; $conn = null; header(Location: menu.php); exit; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with IF ELSE
I'm new to PHP - I'm trying to figure out what is wrong with a simple IF ELSE block I have...if the recordset $rs is empty (login fails), the 1st part of the block works, and redirects the user to default.php - but if the login works, and $rs is not empty, the 2nd else part does not work, and does not redirect to menu.php - I just get a blank white screen on the login.php page (where this code is) You could try setting error_reporting() to full before you do anything, it may help, and it's always prudent to use it that way: ?php error_reporting(E_ALL); ? Additionally, redirects fail when you've sent output to the browser, even if its just whitespace. Your code looks OK, but check for it. The error reporting thang may help you with that. -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 29th) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE8 and HTML5
On Thu, 2008-12-04 at 17:37 +, Richard Heyes wrote: (And don't get me wrong--I had tons of problems with Chrome; mostly about crashing unexpectedly.) That was the only one for me, and it doesn't do it anymore. Guess it was an update to 0.4 (?) that fixed it. Switching to FF fixed it quite well... Thing is, it's a beater - until it gets close to a 1 version, I'm not going to worry about it. -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 29th) I recall M$ saying a lot of the same during IE7 development, then they fell behind schedule, and decided that focusing on standards wasn't that important and they needed to re-align their focus. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using DateTimeZone
Lester Caine schreef: Lester Caine wrote: Lester Caine wrote: I'm looking to tidy up things a bit by clearing out a lot of old code and switching to using the internal DateTime functions. Information is stored in the databases UTC normalized, and we get around the problem of getting a real tz offset by getting the users to register it rather than simply relying on the browser. So dates and times are displayed either UTC or user local time. The server defaults are not relevant, as only the user details should be used. OK cracked the first bit - need an '@' in place of the U The thing that I am having a little trouble establishing is the correct way to take a UTC unix epoch timestamp from the data and display it with the users timezone offset. $dateTimeZoneUser = new DateTimeZone(user's setting); $dateTimeUser = new DateTime( date( U, $datetime_to_display ), $dateTimeZoneUser ); new DateTime( '@'.$datetime_to_display, $dateTimeZoneUser ); Completing the circle slowly $dateTimeUser = new DateTime( '@'.$datetime_to_display); $dateTimeUser-setTimeZone( $dateTimeZoneUser ); $date = $dateTimeUser-format( DATE_ATOM ); But of cause the bit of the jigsaw I forgot is that this needs translating to the correct language. format does not respect 'setlocale' setting? How do I get this translated to the users language as well as their timezone? DATE_ATOM is a locale independent format AFAICT. secondly, and I think this is rather odd, DateTime uses the same formatting code as date() ... which only does english, to quote: quote from=http://php.net/date To format dates in other languages, you should use the setlocale() and strftime() functions instead of date(). /quote and seeing as you don't seem to be able to retrieve the timestamp that the DateTime object represents in order to feed it to strftime() you shit out of luck. ... well you could do something like the following but it makes me feel like maybe one should avoid DateTime until it's somewhat more flexible/complete: ?php setlocale(LC_TIME, nl_NL.ISO8859-1); $d = new DateTime(); echo strftime(%A, %d %B %Y, strtotime($d-format(DATE_ATOM))), \n; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COM and the PHP equivalent of ASP Currency data type
Alex Bovey schreef: Hi all, I am working with a COM interface and the specification which is wrtten for ASP calls for a Currency data type to be passed to a function. What is the equivalent in PHP? If I call com_print_typeinfo() I can see that the function has the following info: function GetPrice( /* VT_PTR [26] [in][out] -- VT_VARIANT [12] */ $Account, /* VT_PTR [26] [in][out] -- VT_CY [6] */ $Quant, /* VT_PTR [26] [in][out] -- VT_I2 [2] */ $QuantMult, /* VT_PTR [26] [in][out] -- VT_I2 [2] */ $prMult ) The parameter I am having problems with parameter 2 - $Quant. I tried to create a VARIANT of type VT_CY so I did: $qty = new VARIANT('1.', VT_CY); total guess work from me: $qty = new VARIANT('1', VT_CY); i.e. use an 'int' rather than a 'float' or maybe just $qty = new VARIANT(1); The error I am getting is: Uncaught exception 'com_exception' with message 'Parameter 2: Type mismatch. you might try catching the exception and see if it contains any more useful info. Thanks all, Alex - Alex Bovey Web Developer | Alex Bovey Consultancy Ltd Registered in England Wales no. 6471391 | VAT no. 934 8959 65 PHP | MySQL | AJAX | XHTML | CSS | Javascript | XML | W3C Accessibility -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 5.3.0alpha3
Hello! Johannes has packaged PHP 5.3.0alpha3, which you can find here: http://downloads.php.net/johannes/ Windows binaries thanks to Pierre, which are available here: http://windows.php.net/qa/ Please test it carefully, and report any bugs in the bug system, but only if you have a short reproducable test case. It seems unlikely that we will be able to release a beta this year. However we currently do not plan another alpha release unless we find larger issues in the namespace changes. Please also note that the documentation for namespaces has been updated already: http://php.net/namespace regards, Johannes and Lukas
[PHP] Re: [PHP-DEV] PHP 5.3.0alpha3
On Thu, Dec 4, 2008 at 22:17, Lukas Kahwe Smith [EMAIL PROTECTED] wrote: in the namespace changes. Please also note that the documentation for namespaces has been updated already: http://php.net/namespace Not 100% true. The example are missing the separator due to wrong syntax highlighting. This has been fixed in CVS and will be updated tomorrow. Until then, please use the special docs mirror: http://docs.php.net/namespaces -Hannes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE8 and HTML5
Richard Heyes wrote: From a recent IEBlog post: http://blogs.msdn.com/ie/archive/2008/12/03/compatibility-view-improvements-to-come-in-ie8.aspx ...and our start on HTML5 support. Does this mean canvas support? Not in IE8. http://blogs.msdn.com/ie/archive/2008/11/19/ie8-what-s-after-beta-2.aspx#9129600 Everyone has their favorite unstandardized feature they'd love IE to support. (Personally I'd be delighted by -ms-border-radius and content:uri() support.) Experimental support for Canvas and other unstandardized features might be a good thing; I know the spec editors would welcome implementor feedback. It would be a shame, however, if we were locked into a technically poor solution thanks to the most popular browser implementing an early version of the specification, websites beginning to rely on that behaviour, and subsequent versions of the specification being forced to mandate such behaviour. I haven't used Canvas much, but it seems to me there a lot of areas of Canvas where there's room for further evolution, e.g. proper text width calculations? an accessible Canvas example? what about 3D? Is it as a direct result of Chrome being released and MS realising (finally) they are going to have to remain competitive? Given Chrome's poor rate of take-up and tendency to canibalize the userbases of non-MS browsers, I somewhat doubt it. http://blog.statcounter.com/2008/09/chrome-whos-losing/ Regardless of Chrome's technical merits, it seems to me that it's Firefox's growing userbase, tailed by the other popular browsers in some markets, that has long represented the market challenge to IE. http://www.upsdell.com/BrowserNews/stat.htm Could be I'm underestimating the effects of press hype about chrome on MS's strategy, but I think actually Microsoft's turn towards a stronger emphasis on standards support long preceded the release of Chrome. For example: http://blogs.msdn.com/ie/archive/2008/03/03/microsoft-s-interoperability-principles-and-ie8.aspx Given that IE8 was already in beta when Chrome was released, standard support in IE8 is mostly a product of decisions taken before that time. -- Benjamin Hawkes-Lewis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Will not report errors what can I do
Hey everyone I am still fighting the same problem that my script isn't working and its not reporting errors, when you click to view the work order it doesn't do anything, I have all kinds of error reporting turned on but nothing, do I have them syntax wrong? ?php include(inc/dbconn_open.php); error_reporting(E_ALL); ini_set('display_errors', '1'); error_log(errors.txt); if (empty($_SESSION['AdminLogin']) OR $_SESSION['AdminLogin'] 'OK' ){ header (Location: LogOut.php); } if (isset($_GET['AdminID']) !empty($_GET['AdminID'])){ $AdminID = $_GET['AdminID']; } else { header (Location: LogOut.php); } $query = SELECT ViewAllWorkOrders FROM admin WHERE AdminID='$AdminID'; $result = mysql_query ($query); $row = mysql_fetch_object ($result); if ($row-ViewProjects == NO) { header (Location: Welcome.php?AdminID=$AdminIDmsg=Sorry, you do not have access to that page.); } if (isset($_GET['WorkOrderID'])) {$WorkOrderID = $_GET['WorkOrderID'];} else {$WorkOrderID = '';} if (isset($_GET['ReturnPage'])) {$ReturnPage = $_GET['ReturnPage'];} else {$ReturnPage = 'Welcome.php';} $sql = SELECT FormName FROM workorders WHERE WorkOrderID='$WorkOrderID'; $result = mysql_query ($sql); $row = mysql_fetch_object ($result); if (mysql_num_rows($result) 0) { if ($row-FormName == WorkOrder) { header (Location: ViewWorkOrder.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == PD_Coupon) { header (Location: ViewPD_Coupon.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == PD_TextAd) { header (Location: ViewPD_TextAd.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == PD_Enhanced) { header (Location: ViewPD_Enhanced.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == HS_Builder) { header (Location: ViewHomescape_Builder.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == HS_SpecHome) { header (Location: ViewHomescape_SpecHome.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); } else { header (Location: Welcome.php?AdminID=$AdminIDmsg=Nothing works Does it); } } else { header (Location: Welcome.php?AdminID=$AdminIDmsg=Nothing Works..g); } ?
RE: [PHP] IE8 and HTML5
-Original Message- From: Benjamin Hawkes-Lewis [mailto:[EMAIL PROTECTED] Sent: Thursday, December 04, 2008 4:15 PM To: Richard Heyes Cc: php List Subject: Re: [PHP] IE8 and HTML5 Richard Heyes wrote: From a recent IEBlog post: http://blogs.msdn.com/ie/archive/2008/12/03/compatibility-view- improvements-to-come-in-ie8.aspx ...and our start on HTML5 support. Does this mean canvas support? Not in IE8. http://blogs.msdn.com/ie/archive/2008/11/19/ie8-what-s-after-beta- 2.aspx#9129600 Everyone has their favorite unstandardized feature they'd love IE to support. (Personally I'd be delighted by -ms-border-radius and content:uri() support.) Experimental support for Canvas and other unstandardized features might be a good thing; I know the spec editors would welcome implementor feedback. It would be a shame, however, if we were locked into a technically poor solution thanks to the most popular browser implementing an early version of the specification, websites beginning to rely on that behaviour, and subsequent versions of the specification being forced to mandate such behaviour. I haven't used Canvas much, but it seems to me there a lot of areas of Canvas where there's room for further evolution, e.g. proper text width calculations? an accessible Canvas example? what about 3D? Is it as a direct result of Chrome being released and MS realising (finally) they are going to have to remain competitive? Given Chrome's poor rate of take-up and tendency to canibalize the userbases of non-MS browsers, I somewhat doubt it. http://blog.statcounter.com/2008/09/chrome-whos-losing/ Regardless of Chrome's technical merits, it seems to me that it's Firefox's growing userbase, tailed by the other popular browsers in some markets, that has long represented the market challenge to IE. http://www.upsdell.com/BrowserNews/stat.htm Could be I'm underestimating the effects of press hype about chrome on MS's strategy, but I think actually Microsoft's turn towards a stronger emphasis on standards support long preceded the release of Chrome. For example: http://blogs.msdn.com/ie/archive/2008/03/03/microsoft-s- interoperability-principles-and-ie8.aspx Given that IE8 was already in beta when Chrome was released, standard support in IE8 is mostly a product of decisions taken before that time. Well, as far as canvas / in IE, you can fake it with Javascript: http://me.eae.net/archive/2005/12/29/canvas-in-ie/ Yes, this is another patchwork circumvention routine to drag IE, kicking and screaming, into the world of web browsing that exists outside of Quirks Mode... but it works. HTH, // Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Will not report errors what can I do
On Thu, 2008-12-04 at 16:20 -0600, Terion Miller wrote: Hey everyone I am still fighting the same problem that my script isn't working and its not reporting errors, when you click to view the work order it doesn't do anything, I have all kinds of error reporting turned on but nothing, do I have them syntax wrong? ?php include(inc/dbconn_open.php); error_reporting(E_ALL); ini_set('display_errors', '1'); error_log(errors.txt); if (empty($_SESSION['AdminLogin']) OR $_SESSION['AdminLogin'] 'OK' ){ header (Location: LogOut.php); } if (isset($_GET['AdminID']) !empty($_GET['AdminID'])){ $AdminID = $_GET['AdminID']; } else { header (Location: LogOut.php); } $query = SELECT ViewAllWorkOrders FROM admin WHERE AdminID='$AdminID'; $result = mysql_query ($query); $row = mysql_fetch_object ($result); if ($row-ViewProjects == NO) { header (Location: Welcome.php?AdminID=$AdminIDmsg=Sorry, you do not have access to that page.); } if (isset($_GET['WorkOrderID'])) {$WorkOrderID = $_GET['WorkOrderID'];} else {$WorkOrderID = '';} if (isset($_GET['ReturnPage'])) {$ReturnPage = $_GET['ReturnPage'];} else {$ReturnPage = 'Welcome.php';} $sql = SELECT FormName FROM workorders WHERE WorkOrderID='$WorkOrderID'; $result = mysql_query ($sql); $row = mysql_fetch_object ($result); if (mysql_num_rows($result) 0) { if ($row-FormName == WorkOrder) { header (Location: ViewWorkOrder.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == PD_Coupon) { header (Location: ViewPD_Coupon.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == PD_TextAd) { header (Location: ViewPD_TextAd.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == PD_Enhanced) { header (Location: ViewPD_Enhanced.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == HS_Builder) { header (Location: ViewHomescape_Builder.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == HS_SpecHome) { header (Location: ViewHomescape_SpecHome.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); } else { header (Location: Welcome.php?AdminID=$AdminIDmsg=Nothing works Does it); } } else { header (Location: Welcome.php?AdminID=$AdminIDmsg=Nothing Works..g); } ? Couple of things to check here: * is the web server working correctly? * do you have permission to set the reporting level (strange but not impossible) * are you sure it's not a logic error in your code rather than a syntax error I notice you're using a LOT of header(Location: ...); calls, which I'd advise against, but if you must use them, there are sometimes problems when you don't specify the full URL of the page you need to locate to. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE8 and HTML5
Recently, I installed IE8 beta 2 and whenever I start it, DEP comes in and says, this application is not secure... I haven't got it to run as yet. The reason I installed it was because a client reported problems with a web app written by me with IE8. Now I can't run IE altogether lol. Yeah, I knew before I installed it, that whenever M$ claim that it's beta, it more like a alpha release with version no 0.0001a and when they sell it it's beta... lol On Thu, Dec 4, 2008 at 9:45 PM, Richard Heyes [EMAIL PROTECTED] wrote: Hi, From a recent IEBlog post: http://blogs.msdn.com/ie/archive/2008/12/03/compatibility-view-improvements-to-come-in-ie8.aspx ...and our start on HTML5 support. Does this mean canvas support? Is it as a direct result of Chrome being released and MS realising (finally) they are going to have to remain competitive? Wouldn't that be nice? -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 29th) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Tim-Hinnerk Heuer http://www.ihostnz.com -- Web Design, Hosting and free Linux Support
Re: [PHP] Will not report errors what can I do
Terion Miller wrote: Hey everyone I am still fighting the same problem that my script isn't working and its not reporting errors, when you click to view the work order it doesn't do anything, I have all kinds of error reporting turned on but nothing, do I have them syntax wrong? ?php include(inc/dbconn_open.php); error_reporting(E_ALL); ini_set('display_errors', '1'); This is boolean, it should be ini_set('display_errors', 1); error_log(errors.txt); if (empty($_SESSION['AdminLogin']) OR $_SESSION['AdminLogin'] 'OK' ){ header (Location: LogOut.php); } if (isset($_GET['AdminID']) !empty($_GET['AdminID'])){ $AdminID = $_GET['AdminID']; } else { header (Location: LogOut.php); } $query = SELECT ViewAllWorkOrders FROM admin WHERE AdminID='$AdminID'; $result = mysql_query ($query); Not the best solution, but add this to the above line... $result = mysql_query ($query) or die(mysql_error()); $row = mysql_fetch_object ($result); This isn't going to work. Above in your select statement, you are only selecting the ViewAllWorkOrders column. But then here, you are trying to access a column/object called ViewProjects. Where do you think this column/object is coming from? It needs to exist in your previous select statement for it to work correctly, otherwise, what point is your first select statement? if ($row-ViewProjects == NO) { header (Location: Welcome.php?AdminID=$AdminIDmsg=Sorry, you do not have access to that page.); } if (isset($_GET['WorkOrderID'])) {$WorkOrderID = $_GET['WorkOrderID'];} else {$WorkOrderID = '';} if (isset($_GET['ReturnPage'])) {$ReturnPage = $_GET['ReturnPage'];} else {$ReturnPage = 'Welcome.php';} $sql = SELECT FormName FROM workorders WHERE WorkOrderID='$WorkOrderID'; $result = mysql_query ($sql); same thing for the error reporting here $result = mysql_query ($sql) or die(mysql_error()); The following line will through an error is you have no results $row = mysql_fetch_object ($result); put the previous mysql_fetch_object() call after the following if statement. if (mysql_num_rows($result) 0) { like this $row = mysql_fetch_object ($result); if ($row-FormName == WorkOrder) { header (Location: ViewWorkOrder.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == PD_Coupon) { header (Location: ViewPD_Coupon.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == PD_TextAd) { header (Location: ViewPD_TextAd.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == PD_Enhanced) { header (Location: ViewPD_Enhanced.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == HS_Builder) { header (Location: ViewHomescape_Builder.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == HS_SpecHome) { header (Location: ViewHomescape_SpecHome.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); } else { header (Location: Welcome.php?AdminID=$AdminIDmsg=Nothing works Does it); } } else { header (Location: Welcome.php?AdminID=$AdminIDmsg=Nothing Works..g); Put curly brackets around all variables in the preceding header() calls } ? and for the love of ?php echo $deity; ?, run mysql_real_escape_string() on your input before using it in a statement... Also, if you have a parse error within the page, or included pages, none of the error reporting you have set will make any difference. for you to ensure that error reporting in enabled, you need to have it set in the php.ini, the virtualhost block, or .htaccess files if they are an option. Hope this helps -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to fetch .DOC or .DOCX file in php
Jim Lucas wrote: Boyd, Todd M. wrote: -Original Message- From: Jagdeep Singh [mailto:[EMAIL PROTECTED] Sent: Thursday, December 04, 2008 8:39 AM To: php-general@lists.php.net Subject: [PHP] How to fetch .DOC or .DOCX file in php Importance: Low Hi ! I want to fetch text from .doc / .docx file and save it into database file. But when I tried to fetch text with fopen/fgets etc ... It gave me special characters with text. (With .txt files everything is fine) Only problem is with doc/docx files. I dont know whow to remove SPECIAL CHARACTERS from this text ... A.) This has been handled on this list several times. Please search the archives before posting a question. B.) Did you even TRY to Google for this? In the first 5 matches for php open ms word I found this: http://www.developertutorials.com/blog/php/extracting-text-from-word-doc uments-via-php-and-com-81/ You will need an MS Windows machine for this solution to work. If you're using *nix... well... good luck. // Todd Ah, not true about the MS requirement. If all you want is the clear/clean text (without any formatting), then I can do it with php on any platform. If this is what is needed, here is the code to do it. ?php $filename = './12345.doc'; if ( file_exists($filename) ) { if ( ($fh = fopen($filename, 'r')) !== false ) { $headers = fread($fh, 0xA00); # 1 = (ord(n)*1) ; Document has from 0 to 255 characters $n1 = ( ord($headers[0x21C]) - 1 ); # 1 = ((ord(n)-8)*256) ; Document has from 256 to 63743 characters $n2 = ( ( ord($headers[0x21D]) - 8 ) * 256 ); # 1 = ((ord(n)*256)*256) ; Document has from 63744 to 16775423 characters $n3 = ( ( ord($headers[0x21E]) * 256 ) * 256 ); # (((ord(n)*256)*256)*256) ; Document has from 16775424 to 4294965504 characters $n4 = ( ( ( ord($headers[0x21F]) * 256 ) * 256 ) * 256 ); # Total length of text in the document $textLength = ($n1 + $n2 + $n3 + $n4); $extracted_plaintext = fread($fh, $textLength); # if you want the plain text with no formatting, do this echo $extracted_plaintext; # if you want to see your paragraphs in a web page, do this echo nl2br($extracted_plaintext); } } ? Hope this helps. I am working on a set of php classes that will be able to read the text with the formatting included and convert it to a standard document format. The standard format that it will end up in has yet has yet... what? Are you O.K. Jim? Did you die while writing this? -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] syntax error (stumped)
This is acctualy a very simple code... But I dont know exactly what to do with line 18. It looks to be taking something from dox and redefining it as RES. There is some related code but with syntax is pretty much has to be this one. //Example// ? require include/bittorrent.php; dbconn(); if (!$CURUSER) { header(Location: .$BASEURL); die; } $filename = substr($_SERVER[PATH_INFO], strrpos($_SERVER[PATH_INFO], /) + 1); if (!$filename) stderr( _(Error), _(Filename missing) ); if (get_user_class() UC_POWER_USER filesize($DOXPATH/$filename) 1024*1024) stderr( _(Error), _(Sorry, you need to be a power user or higher to download files larger than 1.00 MB.) ); $filename = sqlesc($filename); $res = do_mysql_query(SELECT * FROM dox WHERE filename=$filename) or sqlerr(); $arr = mysql_fetch_assoc($res); if (!$arr) stderr( _(Error), _(File Not found)); do_mysql_query(UPDATE LOW_PRIORITY dox SET hits=hits+1 WHERE id=$arr[id]) or sqlerr(); $file = $DOXPATH/$arr[filename]; header(Content-Length: . filesize($file)); header(Content-Type: application/octet-stream); readfile($file); ? //end example// this is line 18 : $res = do_mysql_query(SELECT * FROM dox WHERE filename=$filename) or sqlerr(); Any Help would be great.. Im lost here Near as I can tell this should be legal.. but I not sure about hows its done. Thanks Sailor -- View this message in context: http://www.nabble.com/syntax-error-%28stumped%29-tp20846197p20846197.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] syntax error (stumped)
On Thu, Dec 4, 2008 at 8:32 PM, ddg2sailor [EMAIL PROTECTED] wrote: This is acctualy a very simple code... But I dont know exactly what to do with line 18. It looks to be taking something from dox and redefining it as RES. There is some related code but with syntax is pretty much has to be this one. [snip!] this is line 18 : $res = do_mysql_query(SELECT * FROM dox WHERE filename=$filename) or sqlerr(); What is the error? There are a ton of things wrong and bad with that script example, but for now, is it a customized error output by a user function `sqlerr` that outputs a MySQL error, or is it saying that `do_mysql_query` isn't even defined? -- /Daniel P. Brown http://www.parasane.net/ [EMAIL PROTECTED] || [EMAIL PROTECTED] 50% Off Hosting! http://www.pilotpig.net/specials.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] syntax error (stumped)
Sorry , I did mean to mention that... But I forgot. The original error is : Fatal error: Call to undefined function do_mysql_query() in C:\xampp\htdocs\getdox.php on line 18 Something to do with this // or sqlerr(); //? Thanks Daniel P. Brown-2 wrote: On Thu, Dec 4, 2008 at 8:32 PM, ddg2sailor [EMAIL PROTECTED] wrote: This is acctualy a very simple code... But I dont know exactly what to do with line 18. It looks to be taking something from dox and redefining it as RES. There is some related code but with syntax is pretty much has to be this one. [snip!] this is line 18 : $res = do_mysql_query(SELECT * FROM dox WHERE filename=$filename) or sqlerr(); What is the error? There are a ton of things wrong and bad with that script example, but for now, is it a customized error output by a user function `sqlerr` that outputs a MySQL error, or is it saying that `do_mysql_query` isn't even defined? -- /Daniel P. Brown http://www.parasane.net/ [EMAIL PROTECTED] || [EMAIL PROTECTED] 50% Off Hosting! http://www.pilotpig.net/specials.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- View this message in context: http://www.nabble.com/syntax-error-%28stumped%29-tp20846197p20846336.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] syntax error (stumped)
On Thu, Dec 4, 2008 at 6:44 PM, ddg2sailor [EMAIL PROTECTED] wrote: Sorry , I did mean to mention that... But I forgot. The original error is : Fatal error: Call to undefined function do_mysql_query() in C:\xampp\htdocs\getdox.php on line 18 likely something to do w/ do_mysql_query() not being defined ;) most likely, its in another file that hasnt been included by the time the invocation is reached. -nathan
Re: [PHP] syntax error (stumped)
I have been looking at this code all night and at one point I drew the same conclusion. But I havent been able to find it Il beg the moderators indulgence here.. But I really do need to add this code which calls the other code as a user hits a link. //dox.php// ? require include/bittorrent.php; dbconn(false); loggedinorreturn(); if (get_user_class() UC_USER) stderr(Error , Permission denied.); if ($_SERVER[REQUEST_METHOD] == POST) { $file = $_FILES['file']; if (!$file || $file[size] == 0 || $file[name] == ) stderr(Error, Nothing received! The selected file may have been too large. ); if (file_exists($DOXPATH/$file[name])) stderr(Error, A file with the name .htmlspecialchars($file['name']). already exists! ); $title = trim($_POST[title]); if ($title == ) { $title = substr($file[name], 0, strrpos($file[name], .)); if (!$title) $title = $file[name]; } $r = mysql_query(SELECT id FROM dox WHERE title= . sqlesc($title)) or sqlesc(); if (mysql_num_rows($r) 0) stderr(Error, A file with the title , .htmlspecialchars($title). already exists!); $url = $_POST[url]; if ($url != ) if (substr($url, 0, 7) != http://; substr($url, 0, 6) != ftp://;) stderr(Error, The URL , . htmlspecialchars($url) . does not seem to be valid.); if (!move_uploaded_file($file[tmp_name], $DOXPATH/$file[name])) stderr(Error, Failed to move uploaded file. You should contact an administrator about this error.); setcookie(doxurl, $url, 0x7fff); $title = sqlesc($title); $filename = sqlesc($file[name]); $uppedby = $CURUSER[id]; $size = $file[size]; $url = sqlesc($url); mysql_query(INSERT INTO dox (title, filename, added, uppedby, size, url) VALUES($title, $filename, NOW(), $uppedby, $size, $url)) or sqlerr(); header(Location: dox.php); die; } //if (get_user_class() = UC_MODERATOR || $a[uppedby] == $CURUSER[id]) //{ $delete = $HTTP_GET_VARS[delete]; if (is_valid_id($delete)) { $r = mysql_query(SELECT filename,uppedby FROM dox WHERE id=$delete) or sqlerr(__FILE__, __LINE__); if (mysql_num_rows($r) == 1) { $a = mysql_fetch_assoc($r); if (get_user_class() = UC_MODERATOR || $a[uppedby] == $CURUSER[id]) { mysql_query(DELETE FROM dox WHERE id=$delete) or sqlerr(__FILE__, __LINE__); if (!unlink($DOXPATH/$a[filename])) stderr(Warning, Unable to unlink file:, .$a['filename']. You should contact an administrator about this error.); } } } //} stdhead(Dox); //print(h1._(Dox)./h1\n); print(h1Dox/h1\n); $res = mysql_query(SELECT * FROM dox ORDER BY added DESC) or sqlerr(); if (mysql_num_rows($res) == 0) print(pSorry, nothing here pal :(/p); else { print(ptable border=1 cellspacing=0 width=750 cellpadding=5\n); print(trtd class=colhead align=leftTitle/tdtd class=colheadDate/tdtd class=colheadTime/tdtd class=colheadSize/tdtd class=colheadHits/tdtd class=colheadUpped by/td/tr\n); $mod = get_user_class() = UC_MODERATOR; while ($arr = mysql_fetch_assoc($res)) { $r = mysql_query(SELECT username FROM users WHERE id=$arr[uppedby]) or sqlerr(); $a = mysql_fetch_assoc($r); $FILELINK = $GLOBALS['DEFAULTBASEURL']./getdox.php/.str_replace( ,%20 , $arr[filename]); $title = td align=left .$FILELINK. . $arr[title] . . ($mod || $arr[uppedby] == $CURUSER[id] ? ?delete=$arr[id] [Delete] : ) ./td\n; $added = td . substr($arr[added], 0, 10) . /tdtd . substr($arr[added], 10) . /td\n; $size = td . mksize($arr['size']) . /td\n; $hits = td . number_format($arr['hits']) . /td\n; $uppedby = td .$GLOBALS['DEFAULTBASEURL']. $a[username] /td\n; print(tr$title$added$size$hits$uppedby/tr\n); } print(/table/p\n); print(pFiles are automatically deleted after 14 days...This is not in place.../p\n); } if (get_user_class() = UC_UPLOADER) { $url = $HTTP_COOKIE_VARS[doxurl]; $maxfilesize = ini_get(upload_max_filesize); begin_main_frame(); begin_frame(Upload, true); print(form enctype=multipart/form-data method=post action=?\n); print(table class=main border=1 cellspacing=0 width=700 cellpadding=5\n); print(trtd class=rowheadFile/tdtd align=leftinput type=file name=file size=60br(Maximum file size: .$maxfilesize.)/td/tr\n); print(trtd class=rowheadTitle/tdtd align=leftinput type=text name=title size=60br(Optional, taken from file name if not specified.)/td/tr\n); print(trtd
Re: [PHP] syntax error (stumped)
ddg2sailor wrote: I have been looking at this code all night and at one point I drew the same conclusion. But I havent been able to find it Il beg the moderators indulgence here.. But I really do need to add this code which calls the other code as a user hits a link. Find the file where do_mysql_query is defined and include it. It is not a native php function - someone made it up. Search your code for the function. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Will not report errors what can I do
On Thu, 2008-12-04 at 15:07 -0800, Jim Lucas wrote: Terion Miller wrote: Hey everyone I am still fighting the same problem that my script isn't working and its not reporting errors, when you click to view the work order it doesn't do anything, I have all kinds of error reporting turned on but nothing, do I have them syntax wrong? ?php include(inc/dbconn_open.php); error_reporting(E_ALL); ini_set('display_errors', '1'); This is boolean, it should be ini_set('display_errors', 1); Isn't 1 an integer and true a boolean? ;) Anyways, what I noticed is that error reporting is enabled after an include. Maybe the system is failing during the include. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to fetch .DOC or .DOCX file in php
Shawn McKenzie wrote: Jim Lucas wrote: Boyd, Todd M. wrote: -Original Message- From: Jagdeep Singh [mailto:[EMAIL PROTECTED] Sent: Thursday, December 04, 2008 8:39 AM To: php-general@lists.php.net Subject: [PHP] How to fetch .DOC or .DOCX file in php Importance: Low Hi ! I want to fetch text from .doc / .docx file and save it into database file. But when I tried to fetch text with fopen/fgets etc ... It gave me special characters with text. (With .txt files everything is fine) Only problem is with doc/docx files. I dont know whow to remove SPECIAL CHARACTERS from this text ... A.) This has been handled on this list several times. Please search the archives before posting a question. B.) Did you even TRY to Google for this? In the first 5 matches for php open ms word I found this: http://www.developertutorials.com/blog/php/extracting-text-from-word-doc uments-via-php-and-com-81/ You will need an MS Windows machine for this solution to work. If you're using *nix... well... good luck. // Todd Ah, not true about the MS requirement. If all you want is the clear/clean text (without any formatting), then I can do it with php on any platform. If this is what is needed, here is the code to do it. ?php $filename = './12345.doc'; if ( file_exists($filename) ) { if ( ($fh = fopen($filename, 'r')) !== false ) { $headers = fread($fh, 0xA00); # 1 = (ord(n)*1) ; Document has from 0 to 255 characters $n1 = ( ord($headers[0x21C]) - 1 ); # 1 = ((ord(n)-8)*256) ; Document has from 256 to 63743 characters $n2 = ( ( ord($headers[0x21D]) - 8 ) * 256 ); # 1 = ((ord(n)*256)*256) ; Document has from 63744 to 16775423 characters $n3 = ( ( ord($headers[0x21E]) * 256 ) * 256 ); # (((ord(n)*256)*256)*256) ; Document has from 16775424 to 4294965504 characters $n4 = ( ( ( ord($headers[0x21F]) * 256 ) * 256 ) * 256 ); # Total length of text in the document $textLength = ($n1 + $n2 + $n3 + $n4); $extracted_plaintext = fread($fh, $textLength); # if you want the plain text with no formatting, do this echo $extracted_plaintext; # if you want to see your paragraphs in a web page, do this echo nl2br($extracted_plaintext); } } ? Hope this helps. I am working on a set of php classes that will be able to read the text with the formatting included and convert it to a standard document format. The standard format that it will end up in has yet has yet... what? Are you O.K. Jim? Did you die while writing this? Sorry, still kickin' I was going to say that I haven't yet decided on what the final output format is going to be. Probably either rtf or OpenXML. How about I ask for suggestions on what would be the best format to store the final copy. I figured that this tool would mainly be used for .doc to web conversion, but I guess it could be used to also convert to other document formats too. But, I would like to have the ability to at least store the formating inline with the text. So, either some form of xml. Be it (x)HTML or plain XML or even OpenXML. A question to all then. How would you like to see the text, with formating, stored? All suggestions welcome! -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 5.2.7 Released
The PHP development team would like to announce the immediate availability of PHP 5.2.7. This release focuses on improving the stability of the PHP 5.2.x branch with over 170 bug fixes, several of which are security related. All users of PHP are encouraged to upgrade to this release. Security Enhancements and Fixes in PHP 5.2.7: * Upgraded PCRE to version 7.8 (Fixes CVE-2008-2371) * Fixed missing initialization of BG(page_uid) and BG(page_gid), reported by Maksymilian Arciemowicz. * Fixed a crash inside gd with invalid fonts (Fixes CVE-2008-3658). * Fixed a possible overflow inside memnstr (Fixes CVE-2008-3659). * Fixed incorrect php_value order for Apache configuration, reported by Maksymilian Arciemowicz. * Fixed safe_mode related security issues detailed in CVE-2008-2665 and CVE-2008-2666. * Crash with URI/file..php (filename contains 2 dots) (Fixes CVE-2008-3660) * IMAP toolkit crash: rfc822.c legacy routine buffer overflow. (Fixes CVE-2008-2829) Some of the key enhancements in PHP 5.2.7 include: * Fixed several memory leaks inside the readline and sqlite extensions * A number of corrections relating to date parsing inside the date extension * Fixed bugs relating to data retrieval in the PDO extension * A series of crashes in various areas of code were resolved * Several corrections were made to the strip_tags() function in terms of and ?XML handling * A number of bugs were fixed in extract() function when EXTR_REFS flag is being used * Added the ability to log PHP errors to the SAPI (Ex. Apache log) logging facility * Over 170 bug fixes. For users upgrading from PHP 5.0 and PHP 5.1, an upgrade guide is available here (http://www.php.net/migration52), detailing the changes between those releases and PHP 5.2.7. For a full list of changes in PHP 5.2.7, see the ChangeLog (http://www.php.net/ChangeLog-5.php#5.2.7). Ilia Alshanetsky 5.2 Release Master -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using DateTimeZone
Jochem Maas wrote: Lester Caine schreef: Lester Caine wrote: Lester Caine wrote: I'm looking to tidy up things a bit by clearing out a lot of old code and switching to using the internal DateTime functions. Information is stored in the databases UTC normalized, and we get around the problem of getting a real tz offset by getting the users to register it rather than simply relying on the browser. So dates and times are displayed either UTC or user local time. The server defaults are not relevant, as only the user details should be used. OK cracked the first bit - need an '@' in place of the U The thing that I am having a little trouble establishing is the correct way to take a UTC unix epoch timestamp from the data and display it with the users timezone offset. $dateTimeZoneUser = new DateTimeZone(user's setting); $dateTimeUser = new DateTime( date( U, $datetime_to_display ), $dateTimeZoneUser ); new DateTime( '@'.$datetime_to_display, $dateTimeZoneUser ); Completing the circle slowly $dateTimeUser = new DateTime( '@'.$datetime_to_display); $dateTimeUser-setTimeZone( $dateTimeZoneUser ); $date = $dateTimeUser-format( DATE_ATOM ); But of cause the bit of the jigsaw I forgot is that this needs translating to the correct language. format does not respect 'setlocale' setting? How do I get this translated to the users language as well as their timezone? DATE_ATOM is a locale independent format AFAICT. Documenting that may be useful ;) But I switched to other formats and the bottom line seems to be that like DATE_ATOM - '@'. is timezone independent, so one has to apply the required timezone AFTER loading the 'epoch'. $dateTimeZoneUser is only used if there is no 'timezone' information contained IN the supplied time? More missing information from the documentation? secondly, and I think this is rather odd, DateTime uses the same formatting code as date() ... which only does english, to quote: quote from=http://php.net/date To format dates in other languages, you should use the setlocale() and strftime() functions instead of date(). /quote Yep ... a right pain converting from ADOdb Date structure and format Along with the problem that DateTime does not handle genealogical dates either - which ADOdb::Date does. and seeing as you don't seem to be able to retrieve the timestamp that the DateTime object represents in order to feed it to strftime() you shit out of luck. ... well you could do something like the following but it makes me feel like maybe one should avoid DateTime until it's somewhat more flexible/complete: The problem is how to add daylight saving *TO* ADOdb dates That is without breaking anything else. ?php setlocale(LC_TIME, nl_NL.ISO8859-1); $d = new DateTime(); echo strftime(%A, %d %B %Y, strtotime($d-format(DATE_ATOM))), \n; ? BUT what I need is the GMT/BST flag - or the equivalent in that local :( I'm structuring a question on internals about the things that do not work right in DateTime ;) -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/lsces/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Will not report errors what can I do
On Fri, Dec 5, 2008 at 4:26 PM, Robert Cummings [EMAIL PROTECTED]wrote: On Thu, 2008-12-04 at 15:07 -0800, Jim Lucas wrote: Terion Miller wrote: Hey everyone I am still fighting the same problem that my script isn't working and its not reporting errors, when you click to view the work order it doesn't do anything, I have all kinds of error reporting turned on but nothing, do I have them syntax wrong? ?php include(inc/dbconn_open.php); error_reporting(E_ALL); ini_set('display_errors', '1'); This is boolean, it should be ini_set('display_errors', 1); Isn't 1 an integer and true a boolean? ;) Anyways, what I noticed is that error reporting is enabled after an include. Maybe the system is failing during the include. 1 and true can usually be used interchangeably in most programming languages because true is stored as something bigger than (or different to) 0 and false as 0. But it's clearer for the programmer to use true and false because it's clearer as what its semantics are. Important for computer science: The difference between syntax and semantics... Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Tim-Hinnerk Heuer http://www.ihostnz.com -- Web Design, Hosting and free Linux Support
Re: [PHP] Will not report errors what can I do
On Fri, 2008-12-05 at 17:44 +1300, German Geek wrote: On Fri, Dec 5, 2008 at 4:26 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Thu, 2008-12-04 at 15:07 -0800, Jim Lucas wrote: Terion Miller wrote: Hey everyone I am still fighting the same problem that my script isn't working and its not reporting errors, when you click to view the work order it doesn't do anything, I have all kinds of error reporting turned on but nothing, do I have them syntax wrong? ?php include(inc/dbconn_open.php); error_reporting(E_ALL); ini_set('display_errors', '1'); This is boolean, it should be ini_set('display_errors', 1); Isn't 1 an integer and true a boolean? ;) Anyways, what I noticed is that error reporting is enabled after an include. Maybe the system is failing during the include. 1 and true can usually be used interchangeably in most programming languages because true is stored as something bigger than (or different to) 0 and false as 0. But it's clearer for the programmer to use true and false because it's clearer as what its semantics are. Important for computer science: The difference between syntax and semantics... PHP does type juggling... '1' is coerced to true just as well as 1. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Will not report errors what can I do
HI Terion, Please put the error reporting on top of the page and try. If you have any errors in the include file, it won't execute the rest of commands. Make the changes to code as follows. ?php error_reporting(E_ALL); ini_set('display_errors', '1'); include(inc/dbconn_open.php); ? Regards, Johny John www.phpshore.com On Fri, Dec 5, 2008 at 3:50 AM, Terion Miller [EMAIL PROTECTED]wrote: Hey everyone I am still fighting the same problem that my script isn't working and its not reporting errors, when you click to view the work order it doesn't do anything, I have all kinds of error reporting turned on but nothing, do I have them syntax wrong? ?php include(inc/dbconn_open.php); error_reporting(E_ALL); ini_set('display_errors', '1'); error_log(errors.txt); if (empty($_SESSION['AdminLogin']) OR $_SESSION['AdminLogin'] 'OK' ){ header (Location: LogOut.php); } if (isset($_GET['AdminID']) !empty($_GET['AdminID'])){ $AdminID = $_GET['AdminID']; } else { header (Location: LogOut.php); } $query = SELECT ViewAllWorkOrders FROM admin WHERE AdminID='$AdminID'; $result = mysql_query ($query); $row = mysql_fetch_object ($result); if ($row-ViewProjects == NO) { header (Location: Welcome.php?AdminID=$AdminIDmsg=Sorry, you do not have access to that page.); } if (isset($_GET['WorkOrderID'])) {$WorkOrderID = $_GET['WorkOrderID'];} else {$WorkOrderID = '';} if (isset($_GET['ReturnPage'])) {$ReturnPage = $_GET['ReturnPage'];} else {$ReturnPage = 'Welcome.php';} $sql = SELECT FormName FROM workorders WHERE WorkOrderID='$WorkOrderID'; $result = mysql_query ($sql); $row = mysql_fetch_object ($result); if (mysql_num_rows($result) 0) { if ($row-FormName == WorkOrder) { header (Location: ViewWorkOrder.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == PD_Coupon) { header (Location: ViewPD_Coupon.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == PD_TextAd) { header (Location: ViewPD_TextAd.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == PD_Enhanced) { header (Location: ViewPD_Enhanced.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == HS_Builder) { header (Location: ViewHomescape_Builder.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); }elseif ($row-FormName == HS_SpecHome) { header (Location: ViewHomescape_SpecHome.php?AdminID=$AdminIDWorkOrderID=$WorkOrderIDReturnPage=$ReturnPage); } else { header (Location: Welcome.php?AdminID=$AdminIDmsg=Nothing works Does it); } } else { header (Location: Welcome.php?AdminID=$AdminIDmsg=Nothing Works..g); } ? -- Regards, Johny www.phpshore.com
Re: [PHP] Will not report errors what can I do
Johny John wrote: HI Terion, Please put the error reporting on top of the page and try. If you have any errors in the include file, it won't execute the rest of commands. Make the changes to code as follows. ?php error_reporting(E_ALL); ini_set('display_errors', '1'); include(inc/dbconn_open.php); ? Regards, Johny John This still doesn't address his possible parse error problem. If he has a parse error, it makes no difference where he places the above lines. Nothing is going to work. It should be done via one of the three methods that mention in my other email. Jim Lucas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using DateTimeZone
Lester Caine wrote: ?php setlocale(LC_TIME, nl_NL.ISO8859-1); $d = new DateTime(); echo strftime(%A, %d %B %Y, strtotime($d-format(DATE_ATOM))), \n; ? Does not work! Have to do date_default_timezone_set( $user_timezone ) ); if ( is_numeric( $user_time )) { $dateTimeUser = new DateTime( '@'.$user_time ); } else { $dateTimeUser = new DateTime( $user_time ); } $disptime = strtotime($dateTimeUser-format(DATE_W3C)); echo strftime( $format, $disptime ); Even to get the right day! But as yet I have not seen ANYTHING other than English text :( The next battle is to get it translated. -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/lsces/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Will not report errors what can I do
On Thu, 2008-12-04 at 21:28 -0800, Jim Lucas wrote: Johny John wrote: HI Terion, Please put the error reporting on top of the page and try. If you have any errors in the include file, it won't execute the rest of commands. Make the changes to code as follows. ?php error_reporting(E_ALL); ini_set('display_errors', '1'); include(inc/dbconn_open.php); ? Regards, Johny John This still doesn't address his possible parse error problem. If he has a parse error, it makes no difference where he places the above lines. Nothing is going to work. It should be done via one of the three methods that mention in my other email. It depends where the parse error exists. If it exists in inc/dbconn_open.php then this will catche it since the error reporting settings will take effect before the parse error causes a fatal during the include. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP - Jasper Report Integeration
Dear All, Do any one know how to integrate PHP with Jasper Reports. I tried it..but its says Unable to create Java Virtual Machine Please refer this link for more details. http://jagadmaya.com/integration-phpjasperreports.html -- Regards, Johny www.phpshore.com
Re: [PHP] PHP - Jasper Report Integeration
Johny John wrote: Dear All, Do any one know how to integrate PHP with Jasper Reports. I tried it..but its says Unable to create Java Virtual Machine Please refer this link for more details. http://jagadmaya.com/integration-phpjasperreports.html asking the same things multiple times will not help you get an answer.. maybe ask the author for help? -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] syntax error (stumped)
Its begining to look like this code was written for a newer sql The sysop came up with an older php file that fixxed this issue Samples enclosed. //the file I been working on all days - relevant lines only $filename = sqlesc($filename); $res = do_mysql_query(SELECT * FROM dox WHERE filename=$filename) or sqlerr(); $arr = mysql_fetch_assoc($res); //end //The swapped out code that works - relevant lines only: $filename = sqlesc($filename); $res = mysql_query(SELECT * FROM dox WHERE filename=$filename) or sqlerr(); $arr = mysql_fetch_assoc($res); //end Thats all she wrote... instead of do_mysql_query , mysql_query instead. Thanks for all your help.. I do however have another issue.. but thats another thread. Sailor chris smith-9 wrote: ddg2sailor wrote: I have been looking at this code all night and at one point I drew the same conclusion. But I havent been able to find it Il beg the moderators indulgence here.. But I really do need to add this code which calls the other code as a user hits a link. Find the file where do_mysql_query is defined and include it. It is not a native php function - someone made it up. Search your code for the function. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- View this message in context: http://www.nabble.com/syntax-error-%28stumped%29-tp20846197p20848455.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Will not report errors what can I do
Jim Lucas wrote: Johny John wrote: HI Terion, Please put the error reporting on top of the page and try. If you have any errors in the include file, it won't execute the rest of commands. Make the changes to code as follows. ?php error_reporting(E_ALL); ini_set('display_errors', '1'); include(inc/dbconn_open.php); ? Regards, Johny John This still doesn't address his possible parse error problem. If he has a parse error, it makes no difference where he places the above lines. Nothing is going to work. It should be done via one of the three methods that mention in my other email. Putting it in the file is ideal if he can't set up his server to do it via one of the other methods, however if he HAS set it up via other methods, you normally HAVE to restart the server processes so that they re-read the PHP.ini file so they actually will DO the changes that you have made to them. Otherwise you are just wasting more time. HTH, Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] error messaages - $DOXPath Wrong
Hi Here are the error messages: Warning: move_uploaded_file(C: mpp\htdocs\dox/th_dsc_076.jpg) [function.move-uploaded-file]: failed to open stream: Invalid argument in C:\xampp\htdocs\dox.php on line 40 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\xampp\tmp\php2F.tmp' to 'C: mpp\htdocs\dox/th_dsc_076.jpg' in C:\xampp\htdocs\dox.php on line 40 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\dox.php:40) in C:\xampp\htdocs\include\bittorrent.php on line 478 Il make this as painless as possiable I know the third error can be caused by a dangling white space.. this time it isnt. This happens when a user uploads a 'dox file. Now we can download them all we want. The file Uploads to the right dir : 'C:\xampp\tmp\php2F.tmp' But when It tries to copy.. it tries to copy from this dir: C: mpp\htdocs\dox/th_dsc_076.jpg And tries to copy to this dir : 'C: mpp\htdocs\dox/th_dsc_076.jpg' the correct dirs are c:\xampp\tmp and c:\xampp\dox //code that kicked my butt ? require include/bittorrent.php; dbconn(false); loggedinorreturn(); if (get_user_class() UC_USER) stderr(Error , Permission denied.); if ($_SERVER[REQUEST_METHOD] == POST) { $file = $_FILES['file']; if (!$file || $file[size] == 0 || $file[name] == ) stderr(Error, Nothing received! The selected file may have been too large. ); if (file_exists($DOXPATH/$file[name])) stderr(Error, A file with the name .htmlspecialchars($file['name']). already exists! ); $title = trim($_POST[title]); if ($title == ) { $title = substr($file[name], 0, strrpos($file[name], .)); if (!$title) $title = $file[name]; } $r = mysql_query(SELECT id FROM dox WHERE title= . sqlesc($title)) or sqlesc(); if (mysql_num_rows($r) 0) stderr(Error, A file with the title , .htmlspecialchars($title). already exists!); $url = $_POST[url]; if ($url != ) if (substr($url, 0, 7) != http://; substr($url, 0, 6) != ftp://;) stderr(Error, The URL , . htmlspecialchars($url) . does not seem to be valid.); if (!move_uploaded_file($file[tmp_name], $DOXPATH/$file[name])) stderr(Error, Failed to move uploaded file. You should contact an administrator about this error.); setcookie(doxurl, $url, 0x7fff); $title = sqlesc($title); $filename = sqlesc($file[name]); $uppedby = $CURUSER[id]; $size = $file[size]; $url = sqlesc($url); mysql_query(INSERT INTO dox (title, filename, added, uppedby, size, url) VALUES($title, $filename, NOW(), $uppedby, $size, $url)) or sqlerr(); header(Location: dox.php); die; } //if (get_user_class() = UC_MODERATOR || $a[uppedby] == $CURUSER[id]) //{ $delete = $HTTP_GET_VARS[delete]; if (is_valid_id($delete)) { $r = mysql_query(SELECT filename,uppedby FROM dox WHERE id=$delete) or sqlerr(__FILE__, __LINE__); if (mysql_num_rows($r) == 1) { $a = mysql_fetch_assoc($r); if (get_user_class() = UC_MODERATOR || $a[uppedby] == $CURUSER[id]) { mysql_query(DELETE FROM dox WHERE id=$delete) or sqlerr(__FILE__, __LINE__); if (!unlink($DOXPATH/$a[filename])) stderr(Warning, Unable to unlink file:, .$a['filename']. You should contact an administrator about this error.); } } } //} stdhead(Dox); //print(h1._(Dox)./h1\n); print(h1Dox/h1\n); $res = mysql_query(SELECT * FROM dox ORDER BY added DESC) or sqlerr(); if (mysql_num_rows($res) == 0) print(pSorry, nothing here pal :(/p); else { print(ptable border=1 cellspacing=0 width=750 cellpadding=5\n); print(trtd class=colhead align=leftTitle/tdtd class=colheadDate/tdtd class=colheadTime/tdtd class=colheadSize/tdtd class=colheadHits/tdtd class=colheadUpped by/td/tr\n); $mod = get_user_class() = UC_MODERATOR; while ($arr = mysql_fetch_assoc($res)) { $r = mysql_query(SELECT username FROM users WHERE id=$arr[uppedby]) or sqlerr(); $a = mysql_fetch_assoc($r); $FILELINK = $GLOBALS['DEFAULTBASEURL']./getdox.php/.str_replace( ,%20 , $arr[filename]); $title = td align=left .$FILELINK. . $arr[title] . . ($mod || $arr[uppedby] == $CURUSER[id] ? ?delete=$arr[id] [Delete] : ) ./td\n; $added = td . substr($arr[added], 0, 10) . /tdtd . substr($arr[added], 10) . /td\n; $size = td . mksize($arr['size']) . /td\n; $hits = td . number_format($arr['hits']) . /td\n;
Re: [PHP] error messaages - $DOXPath Wrong
This is line 40 if (!move_uploaded_file($file[tmp_name], $DOXPATH/$file[name])) Sailor -- View this message in context: http://www.nabble.com/error-messaages---%24DOXPath-Wrong-tp20848918p20848948.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using DateTimeZone
Lester Caine schreef: Lester Caine wrote: ?php setlocale(LC_TIME, nl_NL.ISO8859-1); $d = new DateTime(); echo strftime(%A, %d %B %Y, strtotime($d-format(DATE_ATOM))), \n; ? Does not work! it does, only there is nothing setting the timezone in that example. Have to do date_default_timezone_set( $user_timezone ) ); if ( is_numeric( $user_time )) { $dateTimeUser = new DateTime( '@'.$user_time ); } else { $dateTimeUser = new DateTime( $user_time ); } $disptime = strtotime($dateTimeUser-format(DATE_W3C)); echo strftime( $format, $disptime ); Even to get the right day! But as yet I have not seen ANYTHING other than English text :( The next battle is to get it translated. you have to use setlocale() with the relevant locale for the translation your looking for before strftime() will give up something in english. don't pity you in your date battles, date's are a pita :-P -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php