[PHP] Deactivate COM/.NET Extension on Windows Server

2009-05-11 Thread Matthias Burtscher
Hello out there!

We are experiencing a problem with one of our PHP products (a community
builder solution) on Windows Servers running PHP 5.

We use the classname com in our application, COM/.NET extension uses
the same classname. This is the conflict. Rewriting our application to
not use the com classname is not a very attractive solution for us.

Is there any chance to disable a compiled-in extension like COM/.NET? Or
do we have to compile PHP on ourselves without COM/.NET extension?

I'm asking myself why an extension like COM/.NET is built-in? How much
people need this extension, I can't understand that ...

Thanks in advance!

Kind regards,
Matthias

-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss 
für nur 17,95 Euro/mtl.!* 
http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Watermarking of images

2009-05-11 Thread Lenin
I haven't used GD lib yet. But I can suggest one thing, that is
printing a layer of color under the text to be printed could be a
saver.

I dont know how translucency is made but thats another way to make
better WaterMarks as well.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] New to PHP question

2009-05-11 Thread Robert Cummings
On Wed, 2009-01-28 at 23:42 +, Ashley Sheridan wrote:

 I hate div'itis as well. Some people seem to think it's a big faux pas
 to use table tags now, when that couldn't be more wrong. Use tables for
 tabular data, CSS for the rest (with as few exceptions - and there are
 always some eh - as you can manage.) I've seen people try to rebuild a
 table of data, that you might represent in a spreadsheet, as a
 collection of div's. Bad form, as the data has now lost all meaning.
 This is the same as replacing all your h1 tags with div
 class=header1 or strong with span class=bold. Silly idea, slap
 on the wrist, don't do it again.
 
 Personally, CSS is my preferred way of working now. I can define a whole
 bunch of elements, semantically as possible, and then can redefine the
 look as often as I wish afterwards with CSS. Look at the CSS Zen Garden
 if you don't believe how useful this is. Rather than going through a
 bunch of page to replaces tables, or PHP code to change the output
 layout, you can redefine your CSS to alter the look. It's not a black
 art, it just needs a little practise. Remember how bad we all were when
 we first started using HTML? It's exactly the same thing here!

I thought I'd dredge up this old, old topic to add some comments about
some recent stuff I did since this thread (or many similar to it) were
in the back of mind. Specifically I was creating a new look and feel for
my MUD hobby website and I wanted to make use of lots of PNG images with
alpha transparency. Additionally I wanted variable width. I felt tables
were the best approach for this because div based sliding door
techniques and multi-level div containers don't work when the alpha
transparency will reveal the underlying sliding or container background.
I just don't think I could accomplish the same results using divs and
floats.

http://www.wocmud.org/welcome.php

Comments?

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] Watermarking of images

2009-05-11 Thread Robert Cummings
On Mon, 2009-05-11 at 00:04 -0700, Michael A. Peters wrote:
 I need to know the best way to dynamically watermark images via gd.
 
 This is an example of what I currently have:
 
 http://www.shastaherps.org/images/66-3.jpg
 
 That's using Lucida Mono. A really nice monospace font (very similar to 
 Apple's Monaco), the font I like to use in text editors, but perhaps not 
 the best font for watermarking.
 
 This is an example of a much better watermark:
 
 http://www.naherp.com/vouchers/24116-24060.jpg
 
 I'm not sure what font that is (anyone know ??) but that site looks like 
 it somehow adds a black border around the font, making the watermark 
 much better.
 
 With mine, on certain backgrounds the watermark has to moved from one 
 corner to another or the color has to be changed in order for it to 
 properly show.
 
 That site is also coded in php so I'm guessing that the watermark is 
 added using a php technology.
 
 Can someone enlighten me on how that is done?
 
 Also, while not php related, could someone enlighten me of a really good 
 font to use for watermarking images?

I did something similar to this a long time ago. The trick was to print
the text 5 times. 4 times with black. 1 time with white. The 4 black
prints are done with a 1 pixel offset in each direction of the compass.
This will produce the nice black outline that has the shape of the font
itself and ensures the text can be seen on any background.

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] Watermarking of images

2009-05-11 Thread Michael A. Peters

Robert Cummings wrote:



I did something similar to this a long time ago. The trick was to print
the text 5 times. 4 times with black. 1 time with white. The 4 black
prints are done with a 1 pixel offset in each direction of the compass.
This will produce the nice black outline that has the shape of the font
itself and ensures the text can be seen on any background.


Thanks!

That worked out perfectly.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Watermarking of images

2009-05-11 Thread Michael A. Peters

Robert Cummings wrote:



I did something similar to this a long time ago. The trick was to print
the text 5 times. 4 times with black. 1 time with white. The 4 black
prints are done with a 1 pixel offset in each direction of the compass.
This will produce the nice black outline that has the shape of the font
itself and ensures the text can be seen on any background.


The results of the suggestion -

http://www.shastaherps.org/images/9-2.jpg

You can see how that would be a problem w/o the outline with the text in 
lower right hand corner, and see how the outline works wonders.


I'm happy :)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Watermarking of images

2009-05-11 Thread Lenin
Thanks to Robert and congrats Michael :)

Robert could you suggest about the transperency or translucency in GD?

I also have interest in using Bangla Font through GD, but I dont know
why it doesn't support it. if anyone had suggestions ...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Deactivate COM/.NET Extension on Windows Server

2009-05-11 Thread Bastien Koert
On Mon, May 11, 2009 at 3:00 AM, Matthias Burtscher 
matthias.burtsc...@gmx.at wrote:

 Hello out there!

 We are experiencing a problem with one of our PHP products (a community
 builder solution) on Windows Servers running PHP 5.

 We use the classname com in our application, COM/.NET extension uses
 the same classname. This is the conflict. Rewriting our application to
 not use the com classname is not a very attractive solution for us.

 Is there any chance to disable a compiled-in extension like COM/.NET? Or
 do we have to compile PHP on ourselves without COM/.NET extension?

 I'm asking myself why an extension like COM/.NET is built-in? How much
 people need this extension, I can't understand that ...

 Thanks in advance!

 Kind regards,
 Matthias

 --
 Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate +
 Telefonanschluss für nur 17,95 Euro/mtl.!*
 http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


Depending on the windows server version, you may be able to disallow .NET by
going in to the IIS Manager, clicking on the Web Service Extension link to
bring up the extensions in the right handle panel. Choose the .NET option
and click the 'PROHIBIT' button.

Another option may be to use GREP and search/replace to change all the
instances of the word COM



-- 

Bastien

Cat, the other other white meat


Re: [PHP] Watermarking of images

2009-05-11 Thread Robert Cummings
On Mon, 2009-05-11 at 20:06 +0600, Lenin wrote:
 Thanks to Robert and congrats Michael :)
 
 Robert could you suggest about the transperency or translucency in GD?

Is this what you're looking for?

http://www.php.net/manual/en/image.examples.merged-watermark.php

 I also have interest in using Bangla Font through GD, but I dont know
 why it doesn't support it. if anyone had suggestions ...

What kind of font is it? Your PHP may not have support for true type
fonts.

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] Watermarking of images

2009-05-11 Thread Lenin
I'm talking about  Unicode TTF fonts(OpenType).

The characters Like this   অ আ ক খ

Fonts in  www.omicronlab.com  or www.ekushey.org

Thanks

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Mail subject encoding breaks

2009-05-11 Thread Thodoris

Hi gang,
   I am using phpmailer to send some mail notifications in an intranet 
I've made. This is a sample code:


?php
// Include PHP Mailer
require 'class/class.phpmailer.php';

// Instantiate the mailer
$e = new phpmailer();

$e-From = aco...@host.gr;
$e-FromName = Test;
$e-Mailer = mail;
$e-Subject = This is δφκξγκδφη garbidge κηδφκξγσ;
$e-CharSet = UTF-8;
$e-Body = H εργασία id: 122 έκλεισε με σχόλια.;


$e-AddReplyTo(supp...@kinetix.gr);
$e-AddAddress(t...@kinetix.gr);
// $e-to = array(t...@kinetix.gr);


if ($e-Send()) {
   print Mail has been sent successfully.;
} else {
   print Failed to send mail.br.$e-ErrorInfo;
}
?

Where mailer class is:

?php
require 'class.phpmailer.php';
class mailer extends phpmailer {
   var $From = aco...@host.gr;
   var $FromName = Test;
   var $Mailer   = mail;
   var $WordWrap = 200;
   var $CharSet = UTF-8;
   var $Encoding = quoted-printable;
   // var $Encoding = base64;
}
?

This script seems to work ok in a freebsd development server I have but 
a linux production machine breaks the subject's encoding for some 
unexpected reason. The subject has a mix of English and Greek characters 
that FreeBSD seems to handle like a charm.


Both machines have the same php version (5.2.9) and the scripts encoding 
is UTF-8. Iconv and mbstring are configured the same way in php.ini 
(although I am not aware whether phpmailer uses iconv or mbstring).


Has anyone had a similar experience? Is it possible that sendmail (which 
is the underlying tool) breaks the mail encoding?


Please any help would be appreciated because this is really driving me 
crazy.


--
Thodoris


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mail subject encoding breaks

2009-05-11 Thread Ian
On 11 May 2009 at 18:25, Thodoris wrote:

 Hi gang,
 I am using phpmailer to send some mail notifications in an intranet
 I've made. This is a sample code:

 $e-Subject = This is δφκξγκδφη garbidge κηδφκξγσ;

Hi,

I have had success with this in the past:

$subject= This is δφκξγκδφη garbidge κηδφκξγσ;
$e-Subject = mb_encode_mimeheader($subject, UTF-8, Q) ;

Regards

Ian
--



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mail subject encoding breaks

2009-05-11 Thread Thodoris



On 11 May 2009 at 18:25, Thodoris wrote:

  

Hi gang,
I am using phpmailer to send some mail notifications in an intranet 
I've made. This is a sample code:



  

$e-Subject = This is δφκξγκδφη garbidge κηδφκξγσ;



Hi,

I have had success with this in the past:

$subject= This is δφκξγκδφη garbidge κηδφκξγσ;  
$e-Subject  = mb_encode_mimeheader($subject, UTF-8, Q) ;

Regards

Ian
  


Thanks Ian this works in most cases but there are times that still 
breaks the subject. I have experimented with:


mb_encode_mimeheader($subject, UTF-8, B)

as well but nothing seems to be working without problems.

I think that this solved my problems since I noticed that it works fine 
until this moment.


function mail_utf8($to, $subject = '(No subject)', $message = '', $header = '') 
{
 $header_ = 'MIME-Version: 1.0' . \r\n . 'Content-type: text/plain; charset=UTF-8' . 
\r\n;
 mail($to, =?UTF-8?B?.base64_encode($subject).'?=', $message, $header_ . 
$header);
}


--
Thodoris



[PHP] Can includes be used for head tags?

2009-05-11 Thread Gary
I was thinking of creating a php include for the meta tags for a site.  Is 
this possible?

Gary 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Can includes be used for head tags?

2009-05-11 Thread Daniel Brown
On Mon, May 11, 2009 at 12:41, Gary gwp...@ptd.net wrote:
 I was thinking of creating a php include for the meta tags for a site.  Is
 this possible?

Of course it would be.

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Watermarking of images

2009-05-11 Thread tedd

At 12:04 AM -0700 5/11/09, Michael A. Peters wrote:
That site is also coded in php so I'm guessing that the watermark is 
added using a php technology.


Can someone enlighten me on how that is done?

Also, while not php related, could someone enlighten me of a really 
good font to use for watermarking images?



Michael:

Here's an example with code:

http://webbytedd.com/b/watermark/

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Can includes be used for head tags?

2009-05-11 Thread Jay Blanchard
[snip]
I was thinking of creating a php include for the meta tags for a site.
Is 
this possible?
[/snip]

Here is one model...

?php
session_start();
 
 include(inc/dataConnect.inc);
 
/* see if anyone has logged in, if not call the login form */
if( == $_SESSION['user']){
include(head_of_file.php);
include(login.php);
include(tail_of_file.php);
} else {
/* display head of file */
include(head_of_file.php);

/* now use cases to display proper forms */
switch ($_GET['form']){
case foo:
include(foo.php);
break;

case bar:
include(bar.php);
break;

case glorp:
include (glorp.php);
break;
}
/* case is chosen, display tail of file */
include(tail_of_file.php);
}
?

Hear is head_of_file.php

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
   http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

html xmlns=http://www.w3.org/1999/xhtml; lang=en_US
xml:lang=en_US
head
title/title
link rel=stylesheet href=css/primary.css
type=text/css /
script type=text/javascript
src=inc/jquery-1.1.3.1.js/script   
/head

body
div id=content

div id=headernbsp;/div!-- /header --

div id=leftContent/div!-- /leftContent
--

div id=rightContent

Here is tail_of_file.php

/div!-- /rightContent --
 /div!-- /content --
div id=footer
p style=text-align: right; font-size: 0.7em;
font-weight: bold;Copyright copy;2007/p
/div!-- /footer --
/body
/html

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Can includes be used for head tags?

2009-05-11 Thread tedd

At 12:41 PM -0400 5/11/09, Gary wrote:

I was thinking of creating a php include for the meta tags for a site.  Is
this possible?

Gary


Gary:

Certainly -- I do that with my sperling.com site.

Every page has it's own set of meta tags.

Cheers,

tedd



--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Watermarking of images

2009-05-11 Thread Michael A. Peters

tedd wrote:

At 12:04 AM -0700 5/11/09, Michael A. Peters wrote:
That site is also coded in php so I'm guessing that the watermark is 
added using a php technology.


Can someone enlighten me on how that is done?

Also, while not php related, could someone enlighten me of a really 
good font to use for watermarking images?



Michael:

Here's an example with code:

http://webbytedd.com/b/watermark/

Cheers,

tedd



This is what I'm doing, it seems to work -

$im=imagecreatefromjpeg($impath);
$text_font=LT_51250.TTF;
imageantialias($im, true);
$imw=imagesx($im);
$imy=imagesy($im);
$string=©  . $somestring;
$lbox=imageftbbox($fontsize, 0, $text_font, $string);
$color = imagecolorallocate ($im, 255,255,255);
$bcolor = imagecolorallocate ($im, 0,0,0);

imagefttext($im,$fontsize,0,($xcord - 1),$ycord,$bcolor,$text_font,$string);

imagefttext($im,$fontsize,0,($xcord + 1),$ycord,$bcolor,$text_font,$string);

imagefttext($im,$fontsize,0,$xcord,($ycord - 1),$bcolor,$text_font,$string);

imagefttext($im,$fontsize,0,$xcord,($ycord + 1),$bcolor,$text_font,$string);

imagefttext($im,$fontsize,0,$xcord,$ycord,$color,$text_font,$string);

header (Content-type: image/jpeg);
imagejpeg($im);
imagedestroy($im);

where $impath is the filesystem path to where image is stored, $xcord is 
x coordinate, $ycord is y coordinate.


It does it very nicely.
(I changed font to helvetica - it seems to work a little better for this 
than lucida mono, largely because it isn't monospace).


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Watermarking of images

2009-05-11 Thread Robert Cummings
On Mon, 2009-05-11 at 10:39 -0700, Michael A. Peters wrote:
 tedd wrote:
  At 12:04 AM -0700 5/11/09, Michael A. Peters wrote:
  That site is also coded in php so I'm guessing that the watermark is 
  added using a php technology.
 
  Can someone enlighten me on how that is done?
 
  Also, while not php related, could someone enlighten me of a really 
  good font to use for watermarking images?
  
  
  Michael:
  
  Here's an example with code:
  
  http://webbytedd.com/b/watermark/
  
  Cheers,
  
  tedd
  
 
 This is what I'm doing, it seems to work -
 
 $im=imagecreatefromjpeg($impath);
 $text_font=LT_51250.TTF;
 imageantialias($im, true);
 $imw=imagesx($im);
 $imy=imagesy($im);
 $string=©  . $somestring;
 $lbox=imageftbbox($fontsize, 0, $text_font, $string);
 $color = imagecolorallocate ($im, 255,255,255);
 $bcolor = imagecolorallocate ($im, 0,0,0);
 
 imagefttext($im,$fontsize,0,($xcord - 1),$ycord,$bcolor,$text_font,$string);
 
 imagefttext($im,$fontsize,0,($xcord + 1),$ycord,$bcolor,$text_font,$string);
 
 imagefttext($im,$fontsize,0,$xcord,($ycord - 1),$bcolor,$text_font,$string);
 
 imagefttext($im,$fontsize,0,$xcord,($ycord + 1),$bcolor,$text_font,$string);
 
 imagefttext($im,$fontsize,0,$xcord,$ycord,$color,$text_font,$string);
 
 header (Content-type: image/jpeg);
 imagejpeg($im);
 imagedestroy($im);
 
 where $impath is the filesystem path to where image is stored, $xcord is 
 x coordinate, $ycord is y coordinate.
 
 It does it very nicely.
 (I changed font to helvetica - it seems to work a little better for this 
 than lucida mono, largely because it isn't monospace).

Note that the 1 pixel offset is optional. You could use 2 or more and
get a thicker black border. It might even be nicer looking if you did
all eight directions.

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] Watermarking of images

2009-05-11 Thread Robert Cummings
On Mon, 2009-05-11 at 13:01 -0400, tedd wrote:
 At 12:04 AM -0700 5/11/09, Michael A. Peters wrote:
 That site is also coded in php so I'm guessing that the watermark is 
 added using a php technology.
 
 Can someone enlighten me on how that is done?
 
 Also, while not php related, could someone enlighten me of a really 
 good font to use for watermarking images?
 
 
 Michael:
 
 Here's an example with code:
 
 http://webbytedd.com/b/watermark/

I can't read the text over the dog's nose... ;)

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] Watermarking of images

2009-05-11 Thread Daevid Vincent
 -Original Message-
 From: Robert Cummings [mailto:rob...@interjinn.com] 
 Sent: Monday, May 11, 2009 10:27 AM
 To: tedd
 Cc: php-general@lists.php.net; Michael A. Peters
 Subject: Re: [PHP] Watermarking of images
 
 On Mon, 2009-05-11 at 13:01 -0400, tedd wrote:
  At 12:04 AM -0700 5/11/09, Michael A. Peters wrote:
  That site is also coded in php so I'm guessing that the 
 watermark is 
  added using a php technology.
  
  Can someone enlighten me on how that is done?
  
  Also, while not php related, could someone enlighten me of 
 a really 
  good font to use for watermarking images?
  
  
  Michael:
  
  Here's an example with code:
  
  http://webbytedd.com/b/watermark/
 
 I can't read the text over the dog's nose... ;)

You're lucky. I don't see ANYTHING (as mentioned weeks ago already)...

XP. FF 3.0.10 and IE 6. 

BOTH do not work.

FF console says startup is not defined and unknown property 'zoom'.
declaration dropped.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] CURL problems still

2009-05-11 Thread Miller, Terion
I'm back.  I thought I had this script working but it seems to always stop
at the end of the C's, so I can get it to go thru pages A-C then it stops, I
have tried setting the time-out to a very large amount but it never
continues to run past the same spot, it gathers all records to the end of C,
then quits...any ideas?

Script: 

?php

ini_set('display_errors',
1);
include(inc/dbconn_open.php);

include(inc/dom.php);

error_reportin
g(E_ALL);

$TESTING = TRUE;


 $targets[a] =
http://www.greenecountymo.org/sheriff/warrants.php?search=A;;

$targets[b] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=B;;

$targets[c] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=C;;

$targets[d] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=D;;

$targets[e] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=E;;

$targets[f] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=F;;

$targets[g] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=G;;

$targets[h] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=H;;

$targets[i] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=I;;

$targets[j] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=J;;

$targets[k] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=K;;

$targets[l] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=L;;

$targets[m] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=M;;

$targets[n] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=N;;

$targets[o] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=O;;

$targets[p] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=P;;

$targets[q] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=Q;;

$targets[r] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=R;;

$targets[s] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=S;;

$targets[t] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=T;;

$targets[u] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=U;;

$targets[v] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=V;;

$targets[w] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=W;;

$targets[x] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=X;;

$targets[y] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=Y;;

$targets[z] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=Z;;
 
 foreach
($targets as $target_url){

echo $target_url;

$userAgent = 'Googlebot/2.1
(http://www.googlebot.com/bot.html)';


$ch = curl_init();
curl_setopt($ch,
CURLOPT_USERAGENT, $userAgent);
curl_setopt($ch,
CURLOPT_URL,$target_url);
curl_setopt($ch, CURLOPT_FAILONERROR,
true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch,
CURLOPT_AUTOREFERER, true);
curl_setopt($ch,
CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_TIMEOUT,
6000);

$html = curl_exec($ch);

if (!$html) {
echo br /cURL error
number: .curl_errno($ch);
echo br /cURL error: . curl_error($ch);

exit;
}


// Create DOM from URL or file
$html =
file_get_html($target_url);

// Find table
foreach($html-find('table') as
$table)
{
foreach($table-find('tr') as $tr)
{
   
   

// Grab children
   $cells = $tr-children();
  

if($cells[0]-plaintext != Name)
{

for ($i =
0; $i  count($cells); $i++)
{
 

switch ($i){
 case 0: // Name
 $name =
$cells[$i]-plaintext;
 echo $cells[$i]-plaintext;

break;
 case 1: // Age
 $age =
$cells[$i]-plaintext;
 break;
 case 2:
// Warrant type
 $warrant = $cells[$i]-plaintext;

break;
 case 3: // Bond amount
 $bond =
$cells[$i]-plaintext;
 break;
 case 4:
// Warrant number
 $wnumber = $cells[$i]-plaintext;

break;
 case 5: // Offence description

$crime = $cells[$i]-plaintext;
 break;

Default:
 echo Uh-ohbr /;
 }

 
 
}

   

}
   

 // Build your INSERT statement here

// Build your INSERT statement here
  
$query = INSERT
into warrants (wid, name, age, warrant, bond, wnumber, crime) VALUES (;

$query .=  '$wid', '$name', '$age', '$warrant', '$bond', '$wnumber',
'$crime' );
//$wid = mysql_insert_id();

echo
$query;

// run query
 mysql_query($query) or die
(mysql_error());
}
   
  }


}


?



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RES: [PHP] CURL problems still

2009-05-11 Thread Jônatas Zechim
Hey Guy, try to change the 'max_execution_time'

ini_set('max_execution_time','1800');



-Mensagem original-
De: Miller, Terion [mailto:tmil...@springfi.gannett.com] 
Enviada em: segunda-feira, 11 de maio de 2009 16:41
Para: PHP-General List
Assunto: [PHP] CURL problems still 

I'm back.  I thought I had this script working but it seems to always stop
at the end of the C's, so I can get it to go thru pages A-C then it stops, I
have tried setting the time-out to a very large amount but it never
continues to run past the same spot, it gathers all records to the end of C,
then quits...any ideas?

Script: 

?php

ini_set('display_errors',
1);
include(inc/dbconn_open.php);

include(inc/dom.php);

error_reportin
g(E_ALL);

$TESTING = TRUE;


 $targets[a] =
http://www.greenecountymo.org/sheriff/warrants.php?search=A;;

$targets[b] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=B;;

$targets[c] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=C;;

$targets[d] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=D;;

$targets[e] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=E;;

$targets[f] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=F;;

$targets[g] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=G;;

$targets[h] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=H;;

$targets[i] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=I;;

$targets[j] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=J;;

$targets[k] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=K;;

$targets[l] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=L;;

$targets[m] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=M;;

$targets[n] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=N;;

$targets[o] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=O;;

$targets[p] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=P;;

$targets[q] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=Q;;

$targets[r] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=R;;

$targets[s] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=S;;

$targets[t] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=T;;

$targets[u] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=U;;

$targets[v] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=V;;

$targets[w] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=W;;

$targets[x] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=X;;

$targets[y] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=Y;;

$targets[z] = 
http://www.greenecountymo.org/sheriff/warrants.php?search=Z;;
 
 foreach
($targets as $target_url){

echo $target_url;

$userAgent = 'Googlebot/2.1
(http://www.googlebot.com/bot.html)';


$ch = curl_init();
curl_setopt($ch,
CURLOPT_USERAGENT, $userAgent);
curl_setopt($ch,
CURLOPT_URL,$target_url);
curl_setopt($ch, CURLOPT_FAILONERROR,
true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch,
CURLOPT_AUTOREFERER, true);
curl_setopt($ch,
CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_TIMEOUT,
6000);

$html = curl_exec($ch);

if (!$html) {
echo br /cURL error
number: .curl_errno($ch);
echo br /cURL error: . curl_error($ch);

exit;
}


// Create DOM from URL or file
$html =
file_get_html($target_url);

// Find table
foreach($html-find('table') as
$table)
{
foreach($table-find('tr') as $tr)
{
   
   

// Grab children
   $cells = $tr-children();
  

if($cells[0]-plaintext != Name)
{

for ($i =
0; $i  count($cells); $i++)
{
 

switch ($i){
 case 0: // Name
 $name =
$cells[$i]-plaintext;
 echo $cells[$i]-plaintext;

break;
 case 1: // Age
 $age =
$cells[$i]-plaintext;
 break;
 case 2:
// Warrant type
 $warrant = $cells[$i]-plaintext;

break;
 case 3: // Bond amount
 $bond =
$cells[$i]-plaintext;
 break;
 case 4:
// Warrant number
 $wnumber = $cells[$i]-plaintext;

break;
 case 5: // Offence description

$crime = $cells[$i]-plaintext;
 break;

Default:
 echo Uh-ohbr /;
 }

 
 
}

   

}
   

 // Build your INSERT statement here

// Build your INSERT statement here
  
$query = INSERT
into warrants (wid, name, age, warrant, bond, wnumber, crime) VALUES (;

$query .=  '$wid', '$name', '$age', '$warrant', '$bond', '$wnumber',
'$crime' );
//$wid = mysql_insert_id();

echo
$query;

// run 

[PHP] Re: Can includes be used for head tags?

2009-05-11 Thread Gary
Thank you to everyone again for your help...

Gary


Gary gwp...@ptd.net wrote in message 
news:52.b9.21821.82558...@pb1.pair.com...
I was thinking of creating a php include for the meta tags for a site. 
Is this possible?

 Gary
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Watermarking of images

2009-05-11 Thread Ashley Sheridan
On Mon, 2009-05-11 at 12:27 -0700, Daevid Vincent wrote:
  -Original Message-
  From: Robert Cummings [mailto:rob...@interjinn.com] 
  Sent: Monday, May 11, 2009 10:27 AM
  To: tedd
  Cc: php-general@lists.php.net; Michael A. Peters
  Subject: Re: [PHP] Watermarking of images
  
  On Mon, 2009-05-11 at 13:01 -0400, tedd wrote:
   At 12:04 AM -0700 5/11/09, Michael A. Peters wrote:
   That site is also coded in php so I'm guessing that the 
  watermark is 
   added using a php technology.
   
   Can someone enlighten me on how that is done?
   
   Also, while not php related, could someone enlighten me of 
  a really 
   good font to use for watermarking images?
   
   
   Michael:
   
   Here's an example with code:
   
   http://webbytedd.com/b/watermark/
  
  I can't read the text over the dog's nose... ;)
 
 You're lucky. I don't see ANYTHING (as mentioned weeks ago already)...
 
 XP. FF 3.0.10 and IE 6. 
 
 BOTH do not work.
 
 FF console says startup is not defined and unknown property 'zoom'.
 declaration dropped.
 
 
Not sure where the zoom bit comes from (one of your browser plugins
maybe?) but the startup is something which is called from the body
onload attribute, but the script which looks like it would contain that
function (a.js) does not exist.


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: RES: [PHP] CURL problems still

2009-05-11 Thread Miller, Terion
The error I get is from my INSERT statement 
It does insert the records up to C page though...
The problem area:

   // Build your INSERT statement here  $query = INSERT into 
warrants (wid, name, age, warrant, bond, wnumber, crime) VALUES (;$query 
.=  '$wid', '$name', '$age', '$warrant', '$bond', '$wnumber', '$crime' ); 
   $wid = mysql_insert_id();echo $query;// run 
query mysql_query($query) or die (mysql_error());

The Error message


Notice: Undefined variable: wid in 
/var/www/vhosts/getpublished.news-leader.com/httpdocs/Warrants/loopScrape1.php 
on line 124

Notice: Undefined variable: name in 
/var/www/vhosts/getpublished.news-leader.com/httpdocs/Warrants/loopScrape1.php 
on line 124

Notice: Undefined variable: age in 
/var/www/vhosts/getpublished.news-leader.com/httpdocs/Warrants/loopScrape1.php 
on line 124

Notice: Undefined variable: warrant in 
/var/www/vhosts/getpublished.news-leader.com/httpdocs/Warrants/loopScrape1.php 
on line 124

Notice: Undefined variable: bond in 
/var/www/vhosts/getpublished.news-leader.com/httpdocs/Warrants/loopScrape1.php 
on line 124

Notice: Undefined variable: wnumber in 
/var/www/vhosts/getpublished.news-leader.com/httpdocs/Warrants/loopScrape1.php 
on line 124

Notice: Undefined variable: crime in 
/var/www/vhosts/getpublished.news-leader.com/httpdocs/Warrants/loopScrape1.php 
on line 124



On 5/11/09 2:45 PM, Jônatas Zechim zechim@gmail.com wrote:




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Can includes be used for head tags?

2009-05-11 Thread Nathan Rixham

Gary wrote:

Thank you to everyone again for your help...

Gary


Gary gwp...@ptd.net wrote in message 
news:52.b9.21821.82558...@pb1.pair.com...
I was thinking of creating a php include for the meta tags for a site. 
Is this possible?


Gary






just an idea.. if you ran the content of the page through a semantic 
extractor such as open calais or yahoo term extraction, then that'd be 
100%(ish) accurate meta keywords without you worrying.


but as everybody else said - yes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Trying to create a colortable - what am I missing here?

2009-05-11 Thread Nathan Rixham

דניאל דנון wrote:

I've tried to make a color table, but I am missing something. not in the
color-table-code itself, but in somewhere else... I just can't find...


untested but try..

// 4096*4096 = 16777216 = FF+1
$im = imagecreate(4096, 4096);
$white = imagecolorallocate($im, 0, 0, 0);
$r = $g = $b = $x = $y =  0;
$max = 255;
while ($r = $max) {
  while ($g = $max) {
while ($b = $max) {
  $n = imagecolorallocate($im, $r, $g, $b);
  imagesetpixel($im, $x, $y, $n);
  $x = $x == 4096 ? 0 : $x+1;
  $y = $y == 4096 ? 0 : $y+1;
  $b++;
}
   $b = 0;
   $g++;
  }
  $g = 0;
  $r++;
}
header(Content-Type: image/png);
imagepng($im);
imagedestroy($im);


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: RES: [PHP] CURL problems still

2009-05-11 Thread Phpster



On May 11, 2009, at 16:01, Miller, Terion tmil...@springfi.gannett.com 
 wrote:



The error I get is from my INSERT statement 
It does insert the records up to C page though...
The problem area:

  // Build your INSERT statement here  $query = INSERT  
into warrants (wid, name, age, warrant, bond, wnumber, crime) VALUES  
(;$query .=  '$wid', '$name', '$age', '$warrant', '$bond',  
'$wnumber', '$crime' );$wid =  
mysql_insert_id();echo $query;// run  
query mysql_query($query) or die (mysql_error());


The Error message


Notice: Undefined variable: wid in /var/www/vhosts/getpublished.news- 
leader.com/httpdocs/Warrants/loopScrape1.php on line 124


Notice: Undefined variable: name in /var/www/vhosts/ 
getpublished.news-leader.com/httpdocs/Warrants/loopScrape1.php on  
line 124


Notice: Undefined variable: age in /var/www/vhosts/getpublished.news- 
leader.com/httpdocs/Warrants/loopScrape1.php on line 124


Notice: Undefined variable: warrant in /var/www/vhosts/ 
getpublished.news-leader.com/httpdocs/Warrants/loopScrape1.php on  
line 124


Notice: Undefined variable: bond in /var/www/vhosts/ 
getpublished.news-leader.com/httpdocs/Warrants/loopScrape1.php on  
line 124


Notice: Undefined variable: wnumber in /var/www/vhosts/ 
getpublished.news-leader.com/httpdocs/Warrants/loopScrape1.php on  
line 124


Notice: Undefined variable: crime in /var/www/vhosts/ 
getpublished.news-leader.com/httpdocs/Warrants/loopScrape1.php on  
line 124




On 5/11/09 2:45 PM, Jônatas Zechim zechim@gmail.com wrote:




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Try Imitliazing the variables at the top of the loop to empty strings  
or zeros


Bastien 
--

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Mail subject encoding breaks

2009-05-11 Thread Manuel Lemos
Hello,

on 05/11/2009 12:25 PM Thodoris said the following:
 This script seems to work ok in a freebsd development server I have but
 a linux production machine breaks the subject's encoding for some
 unexpected reason. The subject has a mix of English and Greek characters
 that FreeBSD seems to handle like a charm.
 
 Both machines have the same php version (5.2.9) and the scripts encoding
 is UTF-8. Iconv and mbstring are configured the same way in php.ini
 (although I am not aware whether phpmailer uses iconv or mbstring).
 
 Has anyone had a similar experience? Is it possible that sendmail (which
 is the underlying tool) breaks the mail encoding?

I am not sure what you mean by breaking the mail encoding. I use the
MIME message class and it works perfectly with any encoding, even
multibyte character sets. Take a look at the examples test_email_message
and test_multibyte_message.php .

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: RES: [PHP] CURL problems still

2009-05-11 Thread Miller, Terion


Bastien, could you give me an example of what you mean?
would it be $Name = 

like that?

Thanks for the ideas everyone!







 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


Try Imitliazing the variables at the top of the loop to empty strings
or zeros

Bastien



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: RES: [PHP] CURL problems still

2009-05-11 Thread Phpster



On May 11, 2009, at 17:53, Miller, Terion tmil...@springfi.gannett.com 
 wrote:





Bastien, could you give me an example of what you mean?
would it be $Name = 

like that?

Thanks for the ideas everyone!








--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Try Imitliazing the variables at the top of the loop to empty strings
or zeros

Bastien




Yep, that's it

$_thing = '';


Bastien

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php