[PHP] phpEditIni has moved to phpeditini.net

2006-05-11 Thread Jeremy C O'Connor
The new browser based editor of PHP.INI files on Windows, phpEditIni, has
moved to a new site: http://phpeditini.net Download it today!

--
info at phpeditini dot net

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



[PHP] SimpleXML is creating nodes when it shouldn't...

2006-05-11 Thread D. Dante Lorenso
I've recently upgraded to PHP 5.1.4 from 5.1.2 and noticed that in 5.1.3 
there were changes made to SimpleXML.  Now, when I touch an element 
which didn't used to exist, instead of acting like it didn't exist, it 
creates it!  That's horrible!


Well, this used to work:

1";
$xml = simplexml_load_string($xmlstr);
print_r($xml);

foreach ($xml->nonexist as $nonexist) {
   // do nothing
}
print_r($xml);
?>

But now, the output of the print_r is different when I do it the second 
time because the foreach statement created nodes:


SimpleXMLElement Object
(
   [item] => 1
)
SimpleXMLElement Object
(
   [item] => 1
   [nonexist] => SimpleXMLElement Object
   (
   )
)

I think that's a bug and not a feature.  Why was this changed?

Dante

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



Re: [PHP] Does PECL install modify my php.ini? or even look at it?

2006-05-11 Thread Chris

D. Dante Lorenso wrote:

All,

I installed an extension via PECL and it seems to have plopped the 
extension into it's own extension directory instead of the one in my 
PHP.ini file.


   > pecl install memcache
   /usr/lib/php/extensions/no-debug-non-zts-20050922/memcache.so

But my PHP.ini file says to use:

   > grep extension_dir php.ini
   extension_dir = "/www/webaps/phpext"

So, I'm guessing that pecl installs where it wants to install and just 
ignores my php.ini settings? 


I think that /usr/lib/php/... path comes from the php build and it 
doesn't use the extension_dir in the php.ini file.


http://www.php.net/manual/en/function.dl.php tells how you it gets that 
directory. Don't know why it doesn't use the extension_dir though.


Well, if I install a new extension, do I 
still need to edit the php.ini by hand and tell PHP where to find it?


Think so :(

Since the newly installed memcache.so extension was placed into that 
other directory '/usr/lib/php/extensions/no-debug-non-zts-20050922/', 
will PHP find it automatically?  Is there an 'include and activate all 
pecl-installed extensions' directive which is being run before or after 
my INI settings?


It won't be found automatically.

--
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] Re: include_path and absolute paths in include functions

2006-05-11 Thread D. Dante Lorenso
If you are using PHP 5, you might have some fun with the __autoload() 
function.  I use something like this in production:


//--
function __autoload($class_name) {
   require_once ($class_name.".php");
}

function push_libs() {
   $paths = func_get_args();
   foreach ($paths as $path) {
   $ipath = 
ini_get("include_path").":".dirname(__FILE__)."/".$path;

   ini_set("include_path", $ipath);
   }
}

// where are the class files?
push_libs("lib", "lib/application", "lib/db", "lib/ui", "lib/util", 
"lib/xmlrpc");


//--

This code assumes that all the included library paths are relative to 
the file which contains this code.


Dante

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



[PHP] Re: include_path and absolute paths in include functions

2006-05-11 Thread Steven Stromer

I am now needing to switch to absolute paths:
include_once ("/lib/included.php");


why do you need to do that? that include will bypass the include_path
and only look in the /lib dir on your machine - which is not what you 
want I think.


Thanks everyone for your great responses. What was my rationale for 
wanting to use a leading '/'?


A fair question. A flickering memory of a vague warning on some web page 
that using anything but absolute paths in include functions creates a 
security risk. Also, some unclear documentation in a certain, popular 
PHP/MySQL book (I won't name names) that I got started with a few years 
back.


My misunderstanding was that there is a concatenation taking place 
between include_path and the argument being passed to include(). I 
believe that I am now understanding correctly that the two options are:


a. Creating a relative path to the include, for instance:
include_once ("lib/included.php");

or

b. Putting the include into a directory listed in include_path, which 
basically has the same effect as using absolute paths - the effect being 
that if the file containing the include() call is moved to a different 
directory, the included file will still be found successfully, without 
having to keep the path relationship between the two files intact.


Further, I read (in the same PHP book) that it is best to refer to 
included files within the same directory like so:

include_once ("./included.php");

However, this would make the path relative, and would thus break if the 
file containing the include() call were to be moved, as I understand 
UNIX directory naming. Is there any benefit to doing this that would 
override my wish to be able to move files around with more freedom?


Finally, is there any greater security risk in using one or the other of 
relative versus 'include_path'-based paths?  I know that putting a 
variable into the path is a no-no, but any other considerations?


Thanks again all!

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



[PHP] Parsing a stdClass Object created with mimeDecode

2006-05-11 Thread Graham Anderson

Hi

I am trying to get the body text from a number of different emails  
using mimeDecode [Pear]
Unfortunately, it appears that the body text could be in any number  
of locations in the stdClass Object depending on which email is  
processed.
At this point, I can only access the node by looking at the print_r 
($structure) directly :(


Out of the three different emails I parsed, I got three different  
locations for the 'body' node

$structure->parts[0]->parts[0]->parts[0]->body;
$structure->body;
$structure->parts[0]->body;



Question:
Is there a way to generically traverse the entire object generated  
from Mail_mimeDecode and  search  for the correct node ?


In my case, these conditions need to be met .

if (trim($part->ctype_primary)== "text" && trim($part- 
>ctype_secondary) == "plain")

{
$body = $part->body;
echo "the body text  is: $body";
}
}

I am a bit new to stdClass Object  and Mail_mimeDecode so any help is  
appreciated
This script was taken from a previous example on http:// 
www.troywolf.com/articles/php/class_xml/



The script currently is:

include('Mail/mimeDecode.php');

$filename = "email_multi.txt";
$message  = fread(fopen($filename, 'r'), filesize($filename));

header('Content-Type: text/plain');
header('Content-Disposition: inline; filename="stuff.txt"');

$params = array(
'input'  => $message,
'crlf'   => "\r\n",
'include_bodies' => TRUE,
'decode_headers' => TRUE,
'decode_bodies'  => TRUE
);

$structure = Mail_mimeDecode::decode($params);

// This only works if you know specifically where there node/Object  
lives :(

foreach($structure->parts[0]->parts[0]->parts as $part)
{

//for debugging
echo $part->ctype_primary."|".$part->ctype_secondary."\n\r";

// if these conditions are met, we found the right node
if (trim($part->ctype_primary)== "text" && trim($part- 
>ctype_secondary) == "plain")

{
$body = $part->body;
echo "body is: $body";
}
}

?>

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



Re: [PHP] Parsing images

2006-05-11 Thread Robert Cummings
On Thu, 2006-05-11 at 18:11, Richard Lynch wrote:
> On Thu, May 11, 2006 1:03 pm, Robert Cummings wrote:
> > Edge detection, noise suppression, and data analysis don't quite
> > equate
> > to recognition. Also 30 years of OCR still requires that the sample be
> > good quality and conform to fairly detectable patterns. If this is so
> > trivial, I await the release of your captcha parser. The spammers
> > would
> > probably pay you millions for it. Where exactly is this bleeding edge,
> > and where can I read more about it? I think you're quite
> > wholeheartedly
> > being naive about the complexity of visual recognition. Prove me
> > wrong.
> 
> Hey, I don't need millions, and I can't claim to solve ALL CAPTCHA
> implementations, but show me the hundreds (maybe thousands) and the
> *ONE* CAPTCHA impelementation, and I'll give it my best shot.
> 
> I already broke one of them, admittedly a pretty bad stupid one.

This was my point... Tedd indicated this stuff was trivial, the fact
that you can't write it generically suggest otherwise. And as you admit,
the one you broke was a pretty bad stupid one :) Now that's not to say
that an expert in the field of visual recognition won't do better... but
again I'll say, I think it's naive to think that captcha parsing in the
generic is not trivial. IMHO, those sites that offer an audio option,
probably provide an easier way to break through. I'm pretty sure audio
recognition is simpler than visual recognition due to the smaller set (I
imagine anyways) of variables.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Sending a lot of data to remote site

2006-05-11 Thread Ryan A
Hey,
Thanks for replying.



> Ok dude, braindump coming up - just some random
> thoughts and ideas,
> no concrete answers:

Thats ok, still in the planning stage, not a line of
code written so am open to ideas instead of just
concrete answers.


> 
> 5000 * 100 = 50 bytes - i.e. on average about
> half a meg,
> that less than many image uploads. so a POST could
> be acceptable.
> serialize will add to the ammount sent (and there is
> the
> security issue of unserlizing data) but you can POST
> serialized
> data as easily as anything else...


Ok after looking at this more carefully I see that
I can actually throttle the data...
eg: 1/10 of 5000, so send just a string of 500


 
> what options do you have for the having over the
> data?
> what is the structure of the data you need to send?

The _closest_ I can describe the data is like just
plain usernames, no passwords, so the array would  be
something like:

('hugo_the_boss','james007bond','max_power','etc')
in "peak season" I expect the array to go upto 5k
entries but very unlikely as I will be transferring
data every minute of only new entries.

Still, its better to be over protected and plan for a
higher volume than plan for lower and then be
surprised.






> send( join('|', $arr) );
> 
> // instead of
> 
> send( serialize($arr) );


Interesting...


> yuo could consider JSON notation (probably more
> compact than serialize) -
> and in the process maybe even be the first guy to
> use JSON for server to
> server comms :-P

Yep, and the first to run into any problems ;-D

 
> you could setup an XML feed that they can request at
> their leasure.

Good idea! See? I didnt think of that.

> you could also skip the webserver and go directly to
> using FTP or SCP
> or something like that (would require a line or 2 of
> shellscript - using gzip
> to compact the data can also be very helpful

Cant do that, no idea how the clients machine will be
setup and need to make this as compatable as possible
as I wont have access to the remote machines, the
clients have to install the scripts by themselves.



> the question as too whether this is alot to send
> depends on how
> often you need to send it 

Every 2 mins max, usually every min.


> > Can you suggest the best method of doing this?
> 
> well the answer is probably not pigeons. or
> hedgehogs ;-)

Damn! there go my TOP 2 ideas.. killjoy... :-)




Cheers!
Ryan







--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
-
Fight back spam! Download the Blue Frog.
http://www.bluesecurity.com/register/s?user=bXVzaWNndTc%3D

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] Sending a lot of data to remote site

2006-05-11 Thread Jochem Maas

Ryan A wrote:

Hi,

I need to send an array of data to a remote site from
my script, the array will contain anything from 1 to
5000 entries of less than 150 alpha numeric characters


Ok dude, braindump coming up - just some random thoughts and ideas,
no concrete answers:

5000 * 100 = 50 bytes - i.e. on average about half a meg,
that less than many image uploads. so a POST could be acceptable.
serialize will add to the ammount sent (and there is the
security issue of unserlizing data) but you can POST serialized
data as easily as anything else...

what options do you have for the having over the data?
what is the structure of the data you need to send?

you might consider a custom 'serialization' that minimizes the
ammount of extra data being sent e.g:

$arr = array('123', '456', '789');

send( join('|', $arr) );

// instead of

send( serialize($arr) );

yuo could consider JSON notation (probably more compact than serialize) -
and in the process maybe even be the first guy to use JSON for server to
server comms :-P

you could setup an XML feed that they can request at their leasure.

you could also skip the webserver and go directly to using FTP or SCP
or something like that (would require a line or 2 of shellscript - using gzip
to compact the data can also be very helpful

the question as too whether this is alot to send depends on how
often you need to send it - at once a day 1/2 a meg is peanuts in terms
of traffic between 2 servers hanging on the backbone (or there abouts -
by which I mean neither server is stuck behind some puny dial up or similar
connection)

whatever you do plan time to test alternative strategies before going full on
and building a fully functional 'whatever'

each.

Can you suggest the best method of doing this?


well the answer is probably not pigeons. or hedgehogs ;-)



Am looking at serialize() or a normal POST using some
of the publicly available classes, but before i take a
big step and regret it I would like to know your
suggestions, recommednations and warnings.

Thanks in advance.
-Ryan


--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
-
Fight back spam! Download the Blue Frog.
http://www.bluesecurity.com/register/s?user=bXVzaWNndTc%3D

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



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



[PHP] Sending a lot of data to remote site

2006-05-11 Thread Ryan A
Hi,

I need to send an array of data to a remote site from
my script, the array will contain anything from 1 to
5000 entries of less than 150 alpha numeric characters
each.

Can you suggest the best method of doing this?

Am looking at serialize() or a normal POST using some
of the publicly available classes, but before i take a
big step and regret it I would like to know your
suggestions, recommednations and warnings.

Thanks in advance.
-Ryan


--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
-
Fight back spam! Download the Blue Frog.
http://www.bluesecurity.com/register/s?user=bXVzaWNndTc%3D

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



[PHP] Does PECL install modify my php.ini? or even look at it?

2006-05-11 Thread D. Dante Lorenso

All,

I installed an extension via PECL and it seems to have plopped the 
extension into it's own extension directory instead of the one in my 
PHP.ini file.


   > pecl install memcache
   /usr/lib/php/extensions/no-debug-non-zts-20050922/memcache.so

But my PHP.ini file says to use:

   > grep extension_dir php.ini
   extension_dir = "/www/webaps/phpext"

So, I'm guessing that pecl installs where it wants to install and just 
ignores my php.ini settings?  Well, if I install a new extension, do I 
still need to edit the php.ini by hand and tell PHP where to find it?


   > grep memcache php.ini
   extension=memcache.so

Since the newly installed memcache.so extension was placed into that 
other directory '/usr/lib/php/extensions/no-debug-non-zts-20050922/', 
will PHP find it automatically?  Is there an 'include and activate all 
pecl-installed extensions' directive which is being run before or after 
my INI settings?


Dante

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



Re: [PHP] Parsing images

2006-05-11 Thread Richard Lynch
On Thu, May 11, 2006 1:03 pm, Robert Cummings wrote:
> Edge detection, noise suppression, and data analysis don't quite
> equate
> to recognition. Also 30 years of OCR still requires that the sample be
> good quality and conform to fairly detectable patterns. If this is so
> trivial, I await the release of your captcha parser. The spammers
> would
> probably pay you millions for it. Where exactly is this bleeding edge,
> and where can I read more about it? I think you're quite
> wholeheartedly
> being naive about the complexity of visual recognition. Prove me
> wrong.

Hey, I don't need millions, and I can't claim to solve ALL CAPTCHA
implementations, but show me the hundreds (maybe thousands) and the
*ONE* CAPTCHA impelementation, and I'll give it my best shot.

I already broke one of them, admittedly a pretty bad stupid one.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Paged Results Set in MySQL DB with one result

2006-05-11 Thread Richard Lynch
On Thu, May 11, 2006 1:20 pm, tedd wrote:
>>  > Does this qualify?
>>>
>>>  http://xn--ovg.com/ajax_page
>>
>>Well, on page 1, I can't get it to re-size at all...
>>
>>So, no, it doesn't qualify. :-)
>
>
> You didn't say it must be re-sizable.
>
> Okay, let me get this right.
>
> If the page could be resized, and the text would dynamically fill the
> space, and the user could step through the text like a reader, then
> would that qualify?
>
> Keep in mind that you can have it one of two ways (mutually
> exclusive).
>
> One, static page -- a page is what you see and each time to return to
> that page it's exactly as it looked before.
>
> Two, dynamic page -- when you re-size the page, "One" is no longer
> applicable.
>
> I just gave you "One", now you want "Two"?

I believe the OP wanted "Three":

Show only as much text as nicely fits in the browser, with "more" for
the next page...

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] include_path and absolute paths in include functions

2006-05-11 Thread Richard Lynch
On Thu, May 11, 2006 3:17 pm, Steven Stromer wrote:
> For years I was lulled into thinking I understood php include
> functions...
>
> I have always used relative paths in my include and related functions,
> for instance:
> include_once ("lib/included.php");
>
> However, I am now needing to switch to absolute paths:
> include_once ("/lib/included.php");

This would require that your have something like this on your server:

/bin
/root
/lib/included.php

> This doesn't work. Generates error:
>
> Warning: main(/lib/included.php) [function.main.html]: failed to open
> stream: No such file or directory in /var/www/sites/sitename/index.php
> on line 8
>
> Warning: main() [function.include.html]: Failed opening
> '/lib/included.php' for inclusion
> (include_path='.:/var/www/sites/sitename') in
> /var/www/sites/sitename/index.php on line 8
>
> I would think I need to correct the include_path in php.ini, but the
> include_path seems right. The file I want to include does exist at:
> /var/www/sites/sitename/lib/included.php
>
> I always believed that the include_path and the path in the include()
> function were simply concatenated, but I now think that I am just
> plain
> wrong, as the error is reproducible on OS X, Fedora and everywhere
> else
> I test it.

Don't put the '/' in the front, and they are concatenated.

Put a '/' on the front, and PHP assumes you are giving a COMPLETE and
ABSOLUTE path in the file-system.

> Am I not taking into account some other directive that affects
> include_path, like 'doc_root' in php.ini, or 'DocumentRoot' or
> 'ServerRoot' in httpd.conf? Or is this a permissions issue of some
> sort?

include 'lib/included.php';

should have worked in the first place.

Go back to that, and then double-check spelling and include_path from
within the PHP script.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] include_path and absolute paths in include functions

2006-05-11 Thread D. Dante Lorenso


Steven Stromer wrote:
For years I was lulled into thinking I understood php include 
functions...
I have always used relative paths in my include and related functions, 
for instance:

include_once ("lib/included.php");
However, I am now needing to switch to absolute paths:
include_once ("/lib/included.php");
This doesn't work. Generates error:
Warning: main(/lib/included.php) [function.main.html]: failed to open 
stream: No such file or directory in /var/www/sites/sitename/index.php 
on line 8
Warning: main() [function.include.html]: Failed opening 
'/lib/included.php' for inclusion 
(include_path='.:/var/www/sites/sitename') in 
/var/www/sites/sitename/index.php on line 8


You are confusing the web server's DOCUMENT_ROOT with your server's unix 
file system root directory '/'.



I would think I need to correct the include_path in php.ini, but the 
include_path seems right. The file I want to include does exist at:

/var/www/sites/sitename/lib/included.php

I always believed that the include_path and the path in the include() 
function were simply concatenated, but I now think that I am just 
plain wrong, as the error is reproducible on OS X, Fedora and 
everywhere else I test it.


Am I not taking into account some other directive that affects 
include_path, like 'doc_root' in php.ini, or 'DocumentRoot' or 
'ServerRoot' in httpd.conf? Or is this a permissions issue of some sort?


If you want to include a file which stems from the DOCUMENT_ROOT, try 
something like this:


   * include_once($_SERVER['DOCUMENT_ROOT']."/lib/included.php");

Since absolute paths are relative to the server root, this will 
correctly map the full path.  Very likely from what you stated above, 
this is true:


   * $_SERVER['DOCUMENT_ROOT'] == "/var/www/sites/sitename"

Dante

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



Re: [PHP] include_path and absolute paths in include functions

2006-05-11 Thread Jochem Maas

Steven Stromer wrote:

For years I was lulled into thinking I understood php include functions...

I have always used relative paths in my include and related functions, 
for instance:

include_once ("lib/included.php");


this is what should work given you ini path. maybe check the file
permissions are in order.


However, I am now needing to switch to absolute paths:
include_once ("/lib/included.php");


why do you need to do that? that include will bypass the include_path
and only look in the /lib dir on your machine - which is not what you want I 
think.

...

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



[PHP] PECL / PEAR confusion (with memcache)

2006-05-11 Thread D. Dante Lorenso

All,

I'm really having a hard time making sense of PECL and PEAR.  My 
understanding is that PECL is for PHP extensions (written in C using the 
extension API) and that PEAR is a repository of PHP modules (classes 
written in PHP using the PEAR-approved "framework").


PEAR VS PECL COMMANDS

On my linux box, I find two separate commands:

   * /usr/bin/pear
   * /usr/bin/pecl

But these are actually shell scripts which just invoke PHP on the 
following files:


   * php ... /usr/lib/php/pearcmd.php
   * php ... /usr/lib/php/peclcmd.php

But, when I dig even further, it looks like 'peclcmd.php' is just a 
wrapper around 'pearcmd.php' and the only thing that is different is the 
one-line define:


   * define('PEAR_RUNTYPE', 'pecl');

So, basically at this point, everything is using the same script and a 
small flag toggles the behavior.  OK, that's fine. 


SEARCH FOR MEMCACHE

I'm looking at an extension 'memcache' that I want to install.  So I see 
if there is either a class (PEAR) or and extension (PECL), right?


   * pear search memcache
 Retrieving data...0%50%no packages found that match
 pattern "memcache"

   * pecl search memcache
 Retrieving data...0%50%Matched packages, channel pecl.php.net:
 ===
 Package  Stable/(Latest)  Local
 memcache 2.0.1/(2.0.1 stable)   memcached extension

So there's a PECL extension, but not a PEAR module. That's fine.

INSTALL MEMCACHE

   * pear install memcache
 No releases available for package "pear.php.net/memcache" -
 package pecl/memcache can be installed with "pecl install memcache"
 Cannot initialize 'memcache', invalid or missing package file
 Package "memcache" is not valid
 install failed

Right, I can't 'pear' install because this is a PECL thing, not a 'pear' 
thing.  Got it.


   * pecl install memcache
 ...
 install ok: channel://pear.php.net/memcache-2.0.1

Ok, that a little bit confusing because I did a PECL install, not a pear 
install, but maybe pear and pecl both share the same domain name.  I'll 
ignore seeing pear in that URL, moving on...


CHECKING THAT IT'S INSTALLED

   * pecl list
 (no packages installed from channel pecl.php.net)

What?  I JUST installed it, why isn't it in my list?  Hmmm... I have 
another idea:


   * pear list
 Installed packages, channel pear.php.net:
 =
 Package Version State
 Archive_Tar 1.3.1   stable
 Console_Getargs 1.3.1   stable
 Console_Getopt  1.2 stable
 PEAR1.4.6   stable
 memcache2.0.1   stable

Huh?  I see my 'memcache' thing in the 'pear' list but not in the 'pecl' 
list.  So, did I install a PEAR thing or a PECL thing before?  This is 
weird.  Let's go look at the file system:


   * find /usr/lib/php -name 'memcache*'
 /usr/lib/php/.registry/memcache.reg
 /usr/lib/php/extensions/no-debug-non-zts-20050922/memcache.so
 /usr/lib/php/doc/memcache

Well, it looks like memcache was installed successfully as a linux .so 
(shared object), so it must be a pecl extension.  No idea why it shows 
up in the PEAR list and not the PECL list.  I'm thinking it might have 
something to do with that URL.  Any insights you can provide?


Dante

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



Re: [PHP] SMS E-Mail and other oddities

2006-05-11 Thread Richard Lynch
On Thu, May 11, 2006 3:16 pm, Jay Blanchard wrote:
> I am attempting to send SMS via an e-mail messageand it works!
> *phew* @sms.myserver.com
>
> Problem is that the reply to or from field on the device always shows
> [EMAIL PROTECTED] regardless of what I have set the Replay-To: or
> From: headers. PHP runs as nobody, so this makes sensekinda'. So I
> tried ini_set() and regardless of that the From: is always nobody. How
> can I fix this? I am trying many things right now, but my stomach
> hurts
> and my eyes are buggin'...if anyone can help let me know!

First:
Does it work with regular email going to a regular account?
Almost-for-sure it will, but let's be methodical about eliminating
"D'oh" mistakes.

Next:
Is there an SMS spec somewhere with some OTHER header they want for
"From" / "Reply-to" / "Error-to" / "X-SMS-From" or something?
You have to put in effort on this to eliminate the possibility that
you're just missing some goofy SMS header.

Next:
Try it with different SMS clients and devices and...
Maybe it's just one SMS client/device/server

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Mktime formatting problems

2006-05-11 Thread Ryan A
Hey Rich,

> > 1) read the files from a directory, discard the
> files
> > with a  .php extention and the directories (eg: .
> and
> > .. )
> >
> > 2) put the files into an array ($the_files[])
> >
> > 3) put it into a while loop and display the files
> like
> > so:
> 
> //Only do files over 2 hours old:
> if ((time() - filectime($dir...[$i])) > 60*60*2){
> 
> > echo $the_files[$i] . date("F d Y H:i:s.",
> > filectime($directory_with_files.$the_files[$i]));
> 
> }
> 
> You may need a '/' in there...
> 


Thanks for replying, solved it,  I am using Stuts
suggestion/code (all credit to him) like so:

$threshold = strtotime('-1 hours');
(for or while loop comes here){

if (file_exists($directory_with_files.$the_files[$i]))

{

if (filectime($directory_with_files.$the_files[$i])
< $threshold)
{
   echo "".$the_files[$i] ." - ". date("F d Y
H:i:s.",
filectime($directory_with_files.$the_files[$i]))."
".$file_time_details[0]."";
}
}

}


And it works perfectly if you see anything wrong
with the above or would like to suggest a change, feel
free to tell me, am feeling "brain low" so it is
possible i missed something.

For now I am doing a simple echo, will be changing
that to some manipulation of the files as the project
goes along. One step at a time...

Cheers!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
-
Fight back spam! Download the Blue Frog.
http://www.bluesecurity.com/register/s?user=bXVzaWNndTc%3D

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: [PHP] Mktime formatting problems

2006-05-11 Thread Jef Sullivan
Here is what I have used for mktime..

$unix_date_33 = mktime(0,0,0,date("m"),date("d")-33,date("Y"));

I am getting the current month, day, and year from the system.
I am subtracting 33 days from the current day.
The result is compared to a date value from the database.



Jef
-Original Message-
From: Ryan A [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 11, 2006 2:38 PM
To: php php
Subject: [PHP] Mktime formatting problems

Hey,

So far this is what I have done:
-
1) read the files from a directory, discard the files
with a  .php extention and the directories (eg: . and
.. )

2) put the files into an array ($the_files[])

3) put it into a while loop and display the files like
so:

echo $the_files[$i] . date("F d Y H:i:s.",
filectime($directory_with_files.$the_files[$i]));
-


The next step is, I want to only echo the files that
are over x minutes (or x hours) old, ignore anything
below, I am using mktime() along with date() to format
it accordingly...but am unable to do so.



Can someone kindly give me a quick example on how to
do this? sitting too long on the comp, I think i'm
losing it :-(

If you want the php file that i have written please
tell me and will send it to you offlist.

Thanks!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
-
Fight back spam! Download the Blue Frog.
http://www.bluesecurity.com/register/s?user=bXVzaWNndTc%3D

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
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



Re: [PHP] Paged Results Set in MySQL DB with one result

2006-05-11 Thread Porpoise


""Richard Lynch"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

On Thu, May 11, 2006 10:09 am, tedd wrote:

At 8:35 PM -0500 5/4/06, Richard Lynch wrote:



But maybe I've just missed the boat.  Has been known to happen. :-)



Does this qualify?

http://xn--ovg.com/ajax_page


Well, on page 1, I can't get it to re-size at all...

So, no, it doesn't qualify. :-)


hmmm well, I can get it to resize but it resizes the whole iframe and 
doesn't re-flow the text to retain iframe size - so it messes up the screen 
layout somewhat. 


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



Re: [PHP] Mktime formatting problems

2006-05-11 Thread Richard Lynch
On Thu, May 11, 2006 3:37 pm, Ryan A wrote:
> So far this is what I have done:
> -
> 1) read the files from a directory, discard the files
> with a  .php extention and the directories (eg: . and
> .. )
>
> 2) put the files into an array ($the_files[])
>
> 3) put it into a while loop and display the files like
> so:

//Only do files over 2 hours old:
if ((time() - filectime($dir...[$i])) > 60*60*2){

> echo $the_files[$i] . date("F d Y H:i:s.",
> filectime($directory_with_files.$the_files[$i]));

}

You may need a '/' in there...

> -
>
>
> The next step is, I want to only echo the files that
> are over x minutes (or x hours) old, ignore anything
> below, I am using mktime() along with date() to format
> it accordingly...but am unable to do so.
>
>
>
> Can someone kindly give me a quick example on how to
> do this? sitting too long on the comp, I think i'm
> losing it :-(
>
> If you want the php file that i have written please
> tell me and will send it to you offlist.
>
> Thanks!
> Ryan
>
> --
> - The faulty interface lies between the chair and the keyboard.
> - Creativity is great, but plagiarism is faster!
> - Smile, everyone loves a moron. :-)
> -
> Fight back spam! Download the Blue Frog.
> http://www.bluesecurity.com/register/s?user=bXVzaWNndTc%3D
>
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] include_path and absolute paths in include functions

2006-05-11 Thread Steven Stromer

For years I was lulled into thinking I understood php include functions...

I have always used relative paths in my include and related functions, 
for instance:

include_once ("lib/included.php");

However, I am now needing to switch to absolute paths:
include_once ("/lib/included.php");

This doesn't work. Generates error:

Warning: main(/lib/included.php) [function.main.html]: failed to open 
stream: No such file or directory in /var/www/sites/sitename/index.php 
on line 8


Warning: main() [function.include.html]: Failed opening 
'/lib/included.php' for inclusion 
(include_path='.:/var/www/sites/sitename') in 
/var/www/sites/sitename/index.php on line 8


I would think I need to correct the include_path in php.ini, but the 
include_path seems right. The file I want to include does exist at:

/var/www/sites/sitename/lib/included.php

I always believed that the include_path and the path in the include() 
function were simply concatenated, but I now think that I am just plain 
wrong, as the error is reproducible on OS X, Fedora and everywhere else 
I test it.


Am I not taking into account some other directive that affects 
include_path, like 'doc_root' in php.ini, or 'DocumentRoot' or 
'ServerRoot' in httpd.conf? Or is this a permissions issue of some sort?


Thanks for any help in advance!

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



Re: [PHP] Re: Upload File (binary files?)

2006-05-11 Thread Jochem Maas

tedd wrote:

At 1:02 AM +1000 5/11/06, Peter Hoskin wrote:


Despite common belief, SQL is not suited to the storage of binary files.
SQL is based on ASCII.
Store your files on the filesystem, not SQL.



How is it not suited?

I stopped using mySQL to store images because of browser refresh 
problems, but other than that -- I didn't find any major problems with 
using it.


Plus, moving images from one system to another was much easier because 
you just moved the dB and you don't have to worry about the file system 
and breaking links.


In addition, if you are using multiple hosts, who require the same 
images, then using mySQL is far superior than trying to keep all the 
images in different file systems synchronized.


Furthermore, according to Paul DuBois (author of MySQL Cookbook, great 
book btw) who says "If you store images on the file system, directory 
look-up my become slow" in his comparing file system to mySQL for image 
storage.


Additionally, transactional behavior is more difficult with a file 
system than it is with mySQL.


Granted, if you use mySQL for storing images, then you bloat the tables 
and approach your system limits faster than using a file system. But for 
a limited amount of images, there isn't any real problems.


And granted, pulling images from mySQL to be used in web sites are 
slightly slower and present refresh differences between some browsers, 
but that's certainly not a reason to say that mySQL is categorically not 
suited for the storage of binary files -- like with everything else, 
there are trade-offs. Do you not see that?




I think you make interesting points Tedd, it's given me stuff to think about 
anyway.
leveraging a Db for image storage can have advantages but implementing it 
correctly
takes a stack more knowledge and more work to do it correctly, therefore the 
recommendation
for those starting out in php should, I feel, remain 'use the filesystem' - if 
only
because understanding and using the filesystem properly is one of the 
foundations
of the craft. no?

with regard to the refresh issues I believe this can be dealt with by outputting
correct last-modified headers with the image data (which can also be
stored in the DB ;-)

with regard to increasing speed: what I often end up doing, mostly because I 
allow
dynamic resizing of images (i.e. the thumbnail and the 'large' image come
from a single stored source) is to use a memory based cache where previously
outputted images are stored for as long as possible (i.e. until the source 
changes
or the server is restarted or the cache is full or whatever).

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



[PHP] Re: extract text from pdf

2006-05-11 Thread Porpoise


"cajbecu" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

Hello,

Is there any posibility to extract all text from a PDF file? (I have
read all the documentation about PHP PDF-Lib but no answer...)



If it is in the form of text within the PDF file then yes. If it's in the 
form of an image within the PDF file then you basically need OCR. 


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



Re: [PHP] Mktime formatting problems

2006-05-11 Thread Ryan A
Hey,

First, thank you Eric and Stut, your answers and this
article that I found on the web
http://www.phpbuilder.com/columns/akent2610.php3?print_mode=1

put my mind back on the right tracksometimes its
so damn silly how things you use for ages suddenly get
"muddled" up in the head.

Thanks again,
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
-
Fight back spam! Download the Blue Frog.
http://www.bluesecurity.com/register/s?user=bXVzaWNndTc%3D

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] Another Shell Caught

2006-05-11 Thread Jochem Maas

Wolf wrote:

Google: c99 r57 tung and PHP shell scripts

They are hack scripts for your servers to try to take them over.  Since
modifying my upload area in November I have caught 4 separate shell
scripts and have been using them to harden my apache and php installs.


hi Wolf,

Im sure Im not the only one interested to know how you have been catching
them and how you have been hardening your setup as a result. care to give
a little synopsis?



Wolf



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



RE: [PHP] SMS E-Mail and other oddities

2006-05-11 Thread Jay Blanchard
[snip]
$fromaddress = '[EMAIL PROTECTED]';
mail($to, $subject, $message, $headers, '-f'.$fromaddress);
[/snip]

Cool...worked like a champeene race dog! (Say it with a Southern drawl)

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



Re: [PHP] Mktime formatting problems

2006-05-11 Thread Eric Butera

On 5/11/06, Ryan A <[EMAIL PROTECTED]> wrote:

Hey,

So far this is what I have done:
-
1) read the files from a directory, discard the files
with a  .php extention and the directories (eg: . and
.. )

2) put the files into an array ($the_files[])

3) put it into a while loop and display the files like
so:

echo $the_files[$i] . date("F d Y H:i:s.",
filectime($directory_with_files.$the_files[$i]));
-


The next step is, I want to only echo the files that
are over x minutes (or x hours) old, ignore anything
below, I am using mktime() along with date() to format
it accordingly...but am unable to do so.



Can someone kindly give me a quick example on how to
do this? sitting too long on the comp, I think i'm
losing it :-(

If you want the php file that i have written please
tell me and will send it to you offlist.

Thanks!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
-
Fight back spam! Download the Blue Frog.
http://www.bluesecurity.com/register/s?user=bXVzaWNndTc%3D

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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




One thing you could do:

$old_time = time() - 60*15;

echo "old time: ". $old_time;

foreach (glob("*.php") as $filename) {
   echo "file ({$filename}) time ". filectime($filename);
  ///echo "$filename size " . filesize($filename) . "\n";

  if (filectime($filename) <= $old_time) {
   echo "--showing: ". $filename;
  }
}

Filectime is just a unix timestamp as is time().  So just subtract the
number of seconds you want to show and compare on that.

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



Re: [PHP] Mktime formatting problems

2006-05-11 Thread Stut

Ryan A wrote:

echo $the_files[$i] . date("F d Y H:i:s.",
filectime($directory_with_files.$the_files[$i]));

The next step is, I want to only echo the files that
are over x minutes (or x hours) old, ignore anything
below, I am using mktime() along with date() to format
it accordingly...but am unable to do so.


$threshold = strtotime('-10 minutes');
if (filectime($directory_with_files.$the_files[$i]) < $threshold)
echo that snippet above


Something like that should do it, except with the looping after the 
threshold is set.


-Stut

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



Re: [PHP] SMS E-Mail and other oddities

2006-05-11 Thread Stut

Jay Blanchard wrote:

$poot = ini_set("sendmail_from", '[EMAIL PROTECTED]');
$smsTo 	 = $_POST['smsPhone'] . '@sms.myserver.com'; 
$to  = 	$smsTo;

$subject =  $_POST['smsSubject'];
$message =  $_POST['smsMessage'];
$headers =  'From: '. $poot . "\r\n" .
'Reply-To: '. $poot . "\r\n";
echo $to;
mail($to, $subject, $message, $headers);


What platform are you on? If you're on a UNIX variant you want to use 
the secret 5th parameter of mail like so...


$fromaddress = '[EMAIL PROTECTED]';
mail($to, $subject, $message, $headers, '-f'.$fromaddress);

If you're on Windows AFAIK you're stuffed unless you use a class to send 
the mail directly - see phpclasses et al for that sort of thing.


-Stut

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



[PHP] Mktime formatting problems

2006-05-11 Thread Ryan A
Hey,

So far this is what I have done:
-
1) read the files from a directory, discard the files
with a  .php extention and the directories (eg: . and
.. )

2) put the files into an array ($the_files[])

3) put it into a while loop and display the files like
so:

echo $the_files[$i] . date("F d Y H:i:s.",
filectime($directory_with_files.$the_files[$i]));
-


The next step is, I want to only echo the files that
are over x minutes (or x hours) old, ignore anything
below, I am using mktime() along with date() to format
it accordingly...but am unable to do so.



Can someone kindly give me a quick example on how to
do this? sitting too long on the comp, I think i'm
losing it :-(

If you want the php file that i have written please
tell me and will send it to you offlist.

Thanks!
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
-
Fight back spam! Download the Blue Frog.
http://www.bluesecurity.com/register/s?user=bXVzaWNndTc%3D

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] SMS E-Mail and other oddities

2006-05-11 Thread Eric Butera

On 5/11/06, Jay Blanchard <[EMAIL PROTECTED]> wrote:

[snip]
Send us some source code and we can help you out!
[/snip]

Always reply to the list and please do not top post.

$poot = ini_set("sendmail_from", '[EMAIL PROTECTED]');
$smsTo   = $_POST['smsPhone'] . '@sms.myserver.com';
$to  =  $smsTo;
$subject =  $_POST['smsSubject'];
$message =  $_POST['smsMessage'];
$headers =  'From: '. $poot . "\r\n" .
'Reply-To: '. $poot . "\r\n";
echo $to;
mail($to, $subject, $message, $headers);

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




Try

$additional = "-f ". $poot;
mail($to, $subject, $message, $headers, $additional);

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



RE: [PHP] SMS E-Mail and other oddities

2006-05-11 Thread Jay Blanchard
[snip]
Send us some source code and we can help you out!
[/snip]

Always reply to the list and please do not top post.

$poot = ini_set("sendmail_from", '[EMAIL PROTECTED]');
$smsTo   = $_POST['smsPhone'] . '@sms.myserver.com'; 
$to  =  $smsTo;
$subject =  $_POST['smsSubject'];
$message =  $_POST['smsMessage'];
$headers =  'From: '. $poot . "\r\n" .
'Reply-To: '. $poot . "\r\n";
echo $to;
mail($to, $subject, $message, $headers);

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



[PHP] SMS E-Mail and other oddities

2006-05-11 Thread Jay Blanchard
I am attempting to send SMS via an e-mail messageand it works!
*phew* @sms.myserver.com

Problem is that the reply to or from field on the device always shows
[EMAIL PROTECTED] regardless of what I have set the Replay-To: or
From: headers. PHP runs as nobody, so this makes sensekinda'. So I
tried ini_set() and regardless of that the From: is always nobody. How
can I fix this? I am trying many things right now, but my stomach hurts
and my eyes are buggin'...if anyone can help let me know!

Thanks!

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



Re: [PHP] Good Answers

2006-05-11 Thread Wolf
Yeah, to think we used to have English Majors as the wait-staff in
restaurants and drive-thrus so you at least were understood when giving
your food and drink order...

Richard Lynch wrote:

> PHP *has* lowered the "entry barrier" ridiculously low, to the point
> where we've got "idiots and English majors" writing really cool
> software -- complete with a total lack of any security features
> whatsoever.
> 
> We've made it so damn easy -- Isn't it our responsibility, to some
> degree, to warn users that they really do need to buy those trigger
> guards and locked cabinets and store the ammo separately from the
> weapon?


> I sometimes think PHP is a like a loaded gun in the hands of a child,
> it's just too damn easy to use and to get yourself into serious
> trouble SO quickly and easily.
> 

Yeah, though you know you can require things and make them mandatory
when giving someone the weapon, but you sure can't make them use them.

But I agree 100%.  I know I used to write some crappy code, but I am
definitely trying to get better about it all.

Wolf

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



Re: [PHP] remove html tags in text?

2006-05-11 Thread Dave Goodchild

strip_tags

On 11/05/06, Bing Du <[EMAIL PROTECTED]> wrote:


Hello everyone,

Say, if I have a paragraph like this:

==
John Smith

Dr. Smith is the directory of http://some.center.com";>Some
Center .  His research interests include Wireless Security
==

Any functions that can help remove all the HTML tags in it?  What about
just removing selected tags, like ?

Thanks in advance for any ideas,

Bing

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





--
http://www.web-buddha.co.uk

dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css)

look out for project karma, our new venture, coming soon!


Re: [PHP] Another Shell Caught

2006-05-11 Thread Wolf
Google: c99 r57 tung and PHP shell scripts

They are hack scripts for your servers to try to take them over.  Since
modifying my upload area in November I have caught 4 separate shell
scripts and have been using them to harden my apache and php installs.

Wolf

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



Re: [PHP] Good Answers

2006-05-11 Thread Micky Hulse

Ligaya Turmelle wrote:

here is the link for the improved newbie doc -
http://zirzow.dyndns.org/php-general/NEWBIE



Might be nice to see a link to the NEWBIE information in the footer of 
the PHP list emails... know what I mean?




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



Re: [PHP] Paged Results Set in MySQL DB with one result

2006-05-11 Thread tedd

 > Does this qualify?


 http://xn--ovg.com/ajax_page


Well, on page 1, I can't get it to re-size at all...

So, no, it doesn't qualify. :-)



You didn't say it must be re-sizable.

Okay, let me get this right.

If the page could be resized, and the text would dynamically fill the 
space, and the user could step through the text like a reader, then 
would that qualify?


Keep in mind that you can have it one of two ways (mutually exclusive).

One, static page -- a page is what you see and each time to return to 
that page it's exactly as it looked before.


Two, dynamic page -- when you re-size the page, "One" is no longer applicable.

I just gave you "One", now you want "Two"?

tedd

--

http://sperling.com

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



[PHP] Re: Good Answers

2006-05-11 Thread Richard Lynch
It turns out that what I want is sort of there...

http://catb.org/~esr/faqs/smart-questions.html#id266392

However, put me down for +1 on adding Security section of php.net
and/or phpsec.org to the NEWBIE doc. :-)

I still think we, as a community, should focus on giving better
answers as documented in the URL referenced above.

Not that we're doing BADLY, mind you, but let's aim for "better" as a
group, eh?

Anybody who has not read that URL recently, the few paragraphs in that
# anchor are worth a review, especially by experts.

It's the "Smart Answers" section.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Parsing images

2006-05-11 Thread Robert Cummings
On Thu, 2006-05-11 at 13:48, tedd wrote:
> At 12:11 PM -0400 5/11/06, Robert Cummings wrote:
> >On Thu, 2006-05-11 at 11:47, tedd wrote:
> >>  At 9:28 AM +0300 5/11/06, Dotan Cohen wrote:
> >>  >Hey all, it is possible to parse capcha's in php? I'm not asking how
> >>  >to do it, nor have I any need, it's just something that I was
> >>  >discussing with a friend. My stand was that ImageMagik could crack
> >>  >them. She says no way. What are your opinions?
> >>  >
> >>  >Thanks.
> >>  >
> >>  >Dotan Cohen
> >>  >http://what-is-what.com
> >>
> >  > Of course -- it's trivial.
> >>
> >>  All images can be broken down into signals and analyzed as such. If
> >>  you have any coherent data, it will show up. If it has to conform to
> >>  glyphs, it most certainly can be identified.
> >>
> >>  You want something that's not trivial, take a look at medical imaging
> >>  and analysis thereof.
> >
> >Extracting passcodes from captcha text is not what I'd call trivial.
> >It's one thing to pull trends out of an image, it's quite another to
> >know that a curvy line is the morphed vertical base of the capital
> >letter T. Similarly knowing that the intensity of red in an area is
> >related to the existence of some radioacive tracer agent, isn't quite
> >the same as knowing that the curvy letter T might be red, yellow, green,
> >yellow blended to green,. etc etc. The human eye and brain are amazing
> >accomplishments, and while someday we may match their ability in code, I
> >don't think it's this year.
> 
> We've been doing edge detection, noise suppression, data analysis, 
> and OCR for over 30 years. While it may not be obvious, it's still 
> trivial in the overall scheme of things. The bleeding edge is far 
> beyond this technology.

Edge detection, noise suppression, and data analysis don't quite equate
to recognition. Also 30 years of OCR still requires that the sample be
good quality and conform to fairly detectable patterns. If this is so
trivial, I await the release of your captcha parser. The spammers would
probably pay you millions for it. Where exactly is this bleeding edge,
and where can I read more about it? I think you're quite wholeheartedly
being naive about the complexity of visual recognition. Prove me wrong.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



RE: [PHP] Another Shell Caught

2006-05-11 Thread Richard Lynch
On Thu, May 11, 2006 12:44 pm, Chris W. Parker wrote:
> Wolf 
> on Thursday, May 11, 2006 8:01 AM said:
>
>> If any of you guys want to know when I get another shell caught on
>> my
>> site, email me off-list and I'll set you up as a mailing list
>> personally.
>>
>> This new one is the r57shell and is picked up by Symantec
>
> What is a shell and why is being "caught"?

I assumed he meant some kind of evil shell script thingies that was
spamming us, collecting our emails, or spreading viruses and other
nasties...

Though I suppose we could be talking about a nice shell collection
from the beach... :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] remove html tags in text?

2006-05-11 Thread Jochem Maas



obviously by now you know the function strip_tags().

given that your a university student don't you think we
could expect a little more research ability on your part?

I already knew the strip_tags() function but for fun I typed
in an arbitrary search into google and look what popped up
at position number one:

http://www.google.com/search?&q=remove+tags+from+string+php

attempting to solve your own problems before asking others
for a solution is good for you both because it makes you more
credible to those that might answer your question AND it will
increase *your* understanding of the problem and solution - in
short solving your own problems (or really trying to) will make
you a better programmer.

not to mention the satisfaction of doing it on your own.



:-)

Bing Du wrote:

Hello everyone,

Say, if I have a paragraph like this:

==
John Smith

Dr. Smith is the directory of http://some.center.com";>Some
Center .  His research interests include Wireless Security
==

Any functions that can help remove all the HTML tags in it?  What about
just removing selected tags, like ?

Thanks in advance for any ideas,

Bing



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



Re: [PHP] Parsing images

2006-05-11 Thread tedd

At 12:11 PM -0400 5/11/06, Robert Cummings wrote:

On Thu, 2006-05-11 at 11:47, tedd wrote:

 At 9:28 AM +0300 5/11/06, Dotan Cohen wrote:
 >Hey all, it is possible to parse capcha's in php? I'm not asking how
 >to do it, nor have I any need, it's just something that I was
 >discussing with a friend. My stand was that ImageMagik could crack
 >them. She says no way. What are your opinions?
 >
 >Thanks.
 >
 >Dotan Cohen
 >http://what-is-what.com


 > Of course -- it's trivial.


 All images can be broken down into signals and analyzed as such. If
 you have any coherent data, it will show up. If it has to conform to
 glyphs, it most certainly can be identified.

 You want something that's not trivial, take a look at medical imaging
 and analysis thereof.


Extracting passcodes from captcha text is not what I'd call trivial.
It's one thing to pull trends out of an image, it's quite another to
know that a curvy line is the morphed vertical base of the capital
letter T. Similarly knowing that the intensity of red in an area is
related to the existence of some radioacive tracer agent, isn't quite
the same as knowing that the curvy letter T might be red, yellow, green,
yellow blended to green,. etc etc. The human eye and brain are amazing
accomplishments, and while someday we may match their ability in code, I
don't think it's this year.


We've been doing edge detection, noise suppression, data analysis, 
and OCR for over 30 years. While it may not be obvious, it's still 
trivial in the overall scheme of things. The bleeding edge is far 
beyond this technology.


tedd
--

http://sperling.com

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



RE: [PHP] Another Shell Caught

2006-05-11 Thread Chris W. Parker
Wolf 
on Thursday, May 11, 2006 8:01 AM said:

> If any of you guys want to know when I get another shell caught on my
> site, email me off-list and I'll set you up as a mailing list
> personally. 
> 
> This new one is the r57shell and is picked up by Symantec

What is a shell and why is being "caught"?



Chris.

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



Re: [PHP] Re: Upload File (binary files?)

2006-05-11 Thread tedd

At 1:02 AM +1000 5/11/06, Peter Hoskin wrote:

Despite common belief, SQL is not suited to the storage of binary files.
SQL is based on ASCII.
Store your files on the filesystem, not SQL.


How is it not suited?

I stopped using mySQL to store images because of 
browser refresh problems, but other than that -- 
I didn't find any major problems with using it.


Plus, moving images from one system to another 
was much easier because you just moved the dB and 
you don't have to worry about the file system and 
breaking links.


In addition, if you are using multiple hosts, who 
require the same images, then using mySQL is far 
superior than trying to keep all the images in 
different file systems synchronized.


Furthermore, according to Paul DuBois (author of 
MySQL Cookbook, great book btw) who says "If you 
store images on the file system, directory 
look-up my become slow" in his comparing file 
system to mySQL for image storage.


Additionally, transactional behavior is more 
difficult with a file system than it is with 
mySQL.


Granted, if you use mySQL for storing images, 
then you bloat the tables and approach your 
system limits faster than using a file system. 
But for a limited amount of images, there isn't 
any real problems.


And granted, pulling images from mySQL to be used 
in web sites are slightly slower and present 
refresh differences between some browsers, but 
that's certainly not a reason to say that mySQL 
is categorically not suited for the storage of 
binary files -- like with everything else, there 
are trade-offs. Do you not see that?


---

At 1:53 AM +1000 5/11/06, Peter Hoskin wrote:

So, if ASCII and Binary are both codesets... which does SQL use to store
its data?


Is ASCII stored differently than binary on a hard drive?

From my limited experience in using a hex editor, 
the data all looks the same to me. If it wasn't 
for my hex editor, I would be looking at 1's and 
0's, right?


After all, isn't an image in a file system stored 
on a hard drive the exact same fashion as an 
image stored on a hard drive via mySQL?


The only difference I can see is in overhead -- 
but then again, I may be a Moron or an Idiot like 
Rory Browne suggests.


Perhaps someone might enlighten me as to why 
mySQL is not suited to store images -- and prove 
it.


And for goodness sake NO, Google is NOT always 
right -- it's only a collection of everyone's 
view. When did Google replace valid research? I 
can see tomorrow's mother's saying to their 
children "If Google jumped off a bridge, would 
you do it?"


Let's get real about what Google can offer. 
Specificity is inversely proportional to the 
number of people voicing an opinion. I would 
guess that even Morons and Idiots know that.


tedd

Typical disclaimers apply -- I did not mean to 
offend anyone nor to imply that anyone is an 
Idiot or a Moron. Your mileage may vary. No 
warranties expressed or implied. This is not a 
solicitation for an investment opportunity. 
Consult you doctor before applying.  No hable 
inglés.


--

http://sperling.com

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



RE: [PHP] BDC to ASCII Conversion

2006-05-11 Thread Jay Blanchard
[snip]
> In dog we trust 

Am partial to "Dog is my co-pilot"
[/snip]

You must be a member of the First United Universal House of Dog

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



Re: [PHP] php parsing and db content

2006-05-11 Thread Richard Lynch
On Wed, May 10, 2006 9:32 pm, Schalk wrote:
> I have the following problem. I load certain links and breadcrumbs
> from
> the database into a external .php file which I include on various
> pages
> within the site. Due to this I have defined a constant '_root' and
> precede all links with this to ensure that the links will work no
> matter
> from where inside the site structure they are called.
>
> My problem is this, when I load these links from the database into the
> external .php file and the load the page that includes this, the line
>  is not parsed and shows up in the links, for
> example:
>
> /our_work//our_work/index.php when it should be
> /site_root/our_work/index.php
>
> How can I ensure that these calls to  are parsed
> before sent to the browser?

You probably should have gotten that parsed before it got INTO the
database.

If that's truly impossible, http://php.net/eval will do it -- But you
want to avoid eval as a General Principle for various reasons.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] getting $_GET params from iFrame window to parent

2006-05-11 Thread Richard Lynch
On Wed, May 10, 2006 10:49 pm, blackwater dev wrote:
> I have a small site which provides search functionalities.  My search
> sites
> are framed in my clients sites via iframe.  I have a client who would
> like
> to put the search form somewhere else on their site (it is currenly
> all on
> my page within the iframe) and then call their search page to do the
> search,
> so in essence I need a way to grab the $_REQUEST params from the
> calling
> site if they exist...is this possible?
>
>
> 
>  **How do I see these params from within the iFrame?
>
> 
>  I, of course, can see these params fine as this is my site
> 

If they don't send the params to you, you can't get them, I don't think.

Maybe maybe maybe something like:
parent.location in javaScript, but you're in the wrong place for that.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Parsing images

2006-05-11 Thread Richard Lynch
On Thu, May 11, 2006 1:28 am, Dotan Cohen wrote:
> Hey all, it is possible to parse capcha's in php? I'm not asking how
> to do it, nor have I any need, it's just something that I was
> discussing with a friend. My stand was that ImageMagik could crack
> them. She says no way. What are your opinions?

My opinion is that I have done it for a really bad CAPTCHA already :-)

So it obviously CAN be done, to some degree of success, depending on
how good your OCR and AI can be tuned to the CAPTCHA.

I doubt that anybody could write any kind of script to grab any random
CAPTCHA implementation and crack it, but if you focus on just one
CAPTCHA, and if you have the time/resources/skills, you can PROBABLY
break it, at least often enough to hammer your way through whatever
it's keeping you out of.

Oh yeah:  I used GD, not ImageMagick:
http://php.net/imagecolorat

HTH
YMMV
NAIAA

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Paged Results Set in MySQL DB with one result

2006-05-11 Thread Richard Lynch
On Thu, May 11, 2006 10:09 am, tedd wrote:
> At 8:35 PM -0500 5/4/06, Richard Lynch wrote:
>>
>>  > Synopsis:
>>>  You could just Javascript and browser info to dynamically layout
>>  > text to "fit" available space and word-wrap nicely.
>>
>>Find me anybody on the planet who has actually successfully done
>> this.
>>
>>Even easier:  Point to ONE existing website that successfully does
>> this.
>>
>>Cuz I can find about a thousand very sharp folks who tried, and
>> failed...
>>
>>And I don't think I've ever seen one who succeeded, in a
>>cross-platform way that actually works...
>>
>>But maybe I've just missed the boat.  Has been known to happen. :-)
>
>
> Does this qualify?
>
> http://xn--ovg.com/ajax_page

Well, on page 1, I can't get it to re-size at all...

So, no, it doesn't qualify. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] BDC to ASCII Conversion

2006-05-11 Thread Joe Henry
On Thursday 11 May 2006 10:08 am, Jim Moseby wrote:
> In dog we trust 

Am partial to "Dog is my co-pilot"
-- 
Joe Henry
www.celebrityaccess.com
[EMAIL PROTECTED]

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



RE: [PHP] BDC to ASCII Conversion

2006-05-11 Thread Jim Moseby
> Yes...typo...I am a dyslexic dog
> 

In dog we trust  ;)

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



Re: [PHP] Parsing images

2006-05-11 Thread Robert Cummings
On Thu, 2006-05-11 at 11:47, tedd wrote:
> At 9:28 AM +0300 5/11/06, Dotan Cohen wrote:
> >Hey all, it is possible to parse capcha's in php? I'm not asking how
> >to do it, nor have I any need, it's just something that I was
> >discussing with a friend. My stand was that ImageMagik could crack
> >them. She says no way. What are your opinions?
> >
> >Thanks.
> >
> >Dotan Cohen
> >http://what-is-what.com
> 
> Of course -- it's trivial.
> 
> All images can be broken down into signals and analyzed as such. If 
> you have any coherent data, it will show up. If it has to conform to 
> glyphs, it most certainly can be identified.
> 
> You want something that's not trivial, take a look at medical imaging 
> and analysis thereof.

Extracting passcodes from captcha text is not what I'd call trivial.
It's one thing to pull trends out of an image, it's quite another to
know that a curvy line is the morphed vertical base of the capital
letter T. Similarly knowing that the intensity of red in an area is
related to the existence of some radioacive tracer agent, isn't quite
the same as knowing that the curvy letter T might be red, yellow, green,
yellow blended to green,. etc etc. The human eye and brain are amazing
accomplishments, and while someday we may match their ability in code, I
don't think it's this year.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



RE: [PHP] BDC to ASCII Conversion

2006-05-11 Thread Jay Blanchard
[snip]
I haven't heard of BDC. Did you mean BCD (binary coded decimal)? Or 
possibly EBCDIC? (What platform is this data coming from?)

If it's EBCDIC data, there are plenty of translation tables you can use,

(but you won't find a one-to-one correspondence in their character
sets).
[/snip]

Yes...typo...I am a dyslexic dog


--J

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



Re: [PHP] BDC to ASCII Conversion

2006-05-11 Thread John Hicks

Jay Blanchard wrote:

I have been searching, but does anyone know of a BDC to ASCII conversion
tool for PHP right off the top of their head? If not, I'll have to write
one


I haven't heard of BDC. Did you mean BCD (binary coded decimal)? Or 
possibly EBCDIC? (What platform is this data coming from?)


If it's EBCDIC data, there are plenty of translation tables you can use, 
(but you won't find a one-to-one correspondence in their character sets).


--J

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



Re: [PHP] remove html tags in text?

2006-05-11 Thread Joe Henry
On Thursday 11 May 2006 9:51 am, Bing Du wrote:
> Any functions that can help remove all the HTML tags in it?  What about
> just removing selected tags, like ?

Looks like strip_tags() will do the trick for you:

http://us3.php.net/manual/en/function.strip-tags.php
-- 
Joe Henry
www.celebrityaccess.com
[EMAIL PROTECTED]

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



Re: [PHP] PHP URL query

2006-05-11 Thread tedd

At 5:43 PM +0100 5/10/06, IraqiGeek wrote:

Hi all,

I'm somewhat new to php, though I have played a bit with the 
language. I'm currently learning the language, and I'm having a 
problem passing variables through "URL query".



The following will show you how to do post and get :

http://www.weberdev.com/get_example-4345.html

hth's

tedd
--

http://sperling.com

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



Re: [PHP] remove html tags in text?

2006-05-11 Thread Stut

Bing Du wrote:


Say, if I have a paragraph like this:

==
John Smith

Dr. Smith is the directory of http://some.center.com";>Some
Center .  His research interests include Wireless Security
==

Any functions that can help remove all the HTML tags in it?  What about
just removing selected tags, like ?

Thanks in advance for any ideas,
 



Here's a novel idea for you... RTFM: http://php.net/strip_tags

-Stut

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



RE: [PHP] remove html tags in text?

2006-05-11 Thread Jim Moseby
> 
> Hello everyone,
> 
> Say, if I have a paragraph like this:
> 
> ==
> John Smith
> 
> Dr. Smith is the directory of http://some.center.com";>Some
> Center .  His research interests include Wireless 
> Security
> ==
> 
> Any functions that can help remove all the HTML tags in it?  
> What about
> just removing selected tags, like ?
> 

Sounds like a job for.


http://us2.php.net/strip_tags

JM

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



[PHP] remove html tags in text?

2006-05-11 Thread Bing Du
Hello everyone,

Say, if I have a paragraph like this:

==
John Smith

Dr. Smith is the directory of http://some.center.com";>Some
Center .  His research interests include Wireless Security
==

Any functions that can help remove all the HTML tags in it?  What about
just removing selected tags, like ?

Thanks in advance for any ideas,

Bing

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



Re: [PHP] Parsing images

2006-05-11 Thread tedd

At 9:28 AM +0300 5/11/06, Dotan Cohen wrote:

Hey all, it is possible to parse capcha's in php? I'm not asking how
to do it, nor have I any need, it's just something that I was
discussing with a friend. My stand was that ImageMagik could crack
them. She says no way. What are your opinions?

Thanks.

Dotan Cohen
http://what-is-what.com


Of course -- it's trivial.

All images can be broken down into signals and analyzed as such. If 
you have any coherent data, it will show up. If it has to conform to 
glyphs, it most certainly can be identified.


You want something that's not trivial, take a look at medical imaging 
and analysis thereof.


tedd
--

http://sperling.com

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



Re: [PHP] getting $_GET params from iFrame window to parent

2006-05-11 Thread John Hicks

blackwater dev wrote:


On 5/11/06, *John Hicks* <[EMAIL PROTECTED] 
> wrote:


blackwater dev wrote:
 > would like
 > to put the search form somewhere else on their site (it is
currenly all on
 > my page within the iframe) and then call their search page to do the
 > search,

(This is an html/DOM thing, not PHP.)

That's what the 'target' property of the  tag does: the response
from the request from that form is directed to a different window (or to
a different frame within the current frameset).  You give the receiving
window a name (when you create it) and refer to that name in the target
argument.

--John



> Sorry John,
>
> I thought this might not be a php issue so I'll do more research on 
it now.

>
> So I gave my iFrame a name:
>
>  frameBorder="0" src=" http://www.mysite.com"; width="100%"
> height="9000">
>
> Then on the parent page have a form:
>
> 
> 
> 
> 
>
> Can I really specify another target other than _parent, _self, etc?

No, it was a joke. I was kidding.

Maybe you will believe the FM: 
http://www.w3.org/TR/html4/present/frames.html#adef-target


Remember to post your replies to the list!!

--J

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



RE: [PHP] extract text from pdf

2006-05-11 Thread ray . hauge
If this is on a *nix box, I would suggest using the pdf2text command
within shell_exec.  It should work as long as the PDF isn't a scanned
image.  Obviously it won't get text off the images, and you'd want to
make sure that any input to filenames (if they're dynamic) are verified
and scrubbed first so people can't access different files on the
filesystem.

HTH,
Ray

>  Original Message 
> Subject: [PHP] extract text from pdf
> From: cajbecu <[EMAIL PROTECTED]>
> Date: Thu, May 11, 2006 1:45 am
> To: "'PHP General (E-mail)'" 
> 
> Hello,
> 
> Is there any posibility to extract all text from a PDF file? (I have
> read all the documentation about PHP PDF-Lib but no answer...)
> 
> Thanks in advance,
>   cajbecu
> 
> -- 
> 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



Re: [PHP] BDC to ASCII Conversion

2006-05-11 Thread tedd

At 10:03 AM -0500 5/11/06, Jay Blanchard wrote:

I have been searching, but does anyone know of a BDC to ASCII conversion
tool for PHP right off the top of their head? If not, I'll have to write
one


If you're on a Mac, just use the calculator.

If not, you might try version tracker:

http://www.versiontracker.com/php/search.php?mode=basic&action=search&str=ASCII&plt%5B%5D=windows&x=0&y=0


HTH's

tedd
--

http://sperling.com

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



Re: [PHP] Paged Results Set in MySQL DB with one result

2006-05-11 Thread tedd

At 8:35 PM -0500 5/4/06, Richard Lynch wrote:


 > Synopsis:

 You could just Javascript and browser info to dynamically layout

 > text to "fit" available space and word-wrap nicely.

Find me anybody on the planet who has actually successfully done this.

Even easier:  Point to ONE existing website that successfully does this.

Cuz I can find about a thousand very sharp folks who tried, and failed...

And I don't think I've ever seen one who succeeded, in a
cross-platform way that actually works...

But maybe I've just missed the boat.  Has been known to happen. :-)



Does this qualify?

http://xn--ovg.com/ajax_page

It's just the first seven pages of the Bible. If I could figure out 
how to upload the entire kjv into MySQL, I would.


tedd
--

http://sperling.com

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



[PHP] BDC to ASCII Conversion

2006-05-11 Thread Jay Blanchard
I have been searching, but does anyone know of a BDC to ASCII conversion
tool for PHP right off the top of their head? If not, I'll have to write
one

Thanks!

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



[PHP] Another Shell Caught

2006-05-11 Thread Wolf
If any of you guys want to know when I get another shell caught on my
site, email me off-list and I'll set you up as a mailing list personally.

This new one is the r57shell and is picked up by Symantec

Wolf


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



Re: [PHP] php parsing and db content [RESOLVED]

2006-05-11 Thread John Hicks

Schalk Neethling wrote:

Chris wrote:

Schalk wrote:

Chris wrote:


Chris wrote:



actually if it's only one variable, this might do it for you:

$content = str_replace('', _root, $content);

but that's still a bad way to do this.


Chris,

This works:

$breadcrumb = $row_pathway['pathway'];
$breadcrumb = str_replace('', _root, $breadcrumb);

echo $breadcrumb;

However, I would still like to know why this is a bad way to do this 
and hopefully find a better way. Still learning all the aspects of 
PHP so any input is appreciated.




Because you're including your config details in your data (I don't 
think you should do this, but others may disagree).


The str_replace method should be pretty fast and won't introduce any 
security issues like the 'eval' method I originally mentioned would.



Thank you for all of your help Chris. Much appreciated.



But how did you resolve it?

(You should have been able to include a file containing ?> directives and have them correctly interpreted.)


--John

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



Re: [PHP] getting $_GET params from iFrame window to parent

2006-05-11 Thread John Hicks

blackwater dev wrote:

would like
to put the search form somewhere else on their site (it is currenly all on
my page within the iframe) and then call their search page to do the 
search,


(This is an html/DOM thing, not PHP.)

That's what the 'target' property of the  tag does: the response 
from the request from that form is directed to a different window (or to 
a different frame within the current frameset).  You give the receiving 
window a name (when you create it) and refer to that name in the target 
argument.


--John

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



Re: [PHP] Parsing images

2006-05-11 Thread Jochem Maas

Dotan Cohen wrote:

On 5/11/06, Peter Hoskin <[EMAIL PROTECTED]> wrote:


There are often easier solutions due to poor design.

Seen many sites setting the value in cookies, or hidden form elements, 
etc.

Sites made by people who can't do their jobs in other words :)

Regards,
Peter Hoskin



I know what you mean. But we're not actually trying to crack anything-
we just want to know if php can process the image so far as to
understand the text. Ways around it aren't what is interesting us.

The idea came up because apparently there are photo-organising tools
available that can parse an image and add a tag based upon who is in
it.


in short it is possible to the extent that the givne captcha image is weak
enough to allow programmatic interpretation
to do it with any speed will obviously require an extension like imageMagick to
do the grunt work and possibly even a custom lib to do the analysis.

this site might be of interest to you:

http://ocr-research.org.ua/index.html




Dotan Cohen
http://gmail-com.com


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



[PHP] Re: extract text from pdf

2006-05-11 Thread Jo�o C�ndido de Souza Neto
Look at is that i found.

http://community.livejournal.com/php/295413.html

Hope help.

"cajbecu" <[EMAIL PROTECTED]> escreveu na mensagem 
news:[EMAIL PROTECTED]
> Hello,
>
> Is there any posibility to extract all text from a PDF file? (I have
> read all the documentation about PHP PDF-Lib but no answer...)
>
> Thanks in advance,
> cajbecu 

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



Re: [PHP] Failing FastCGI PHP

2006-05-11 Thread chris smith

On 5/11/06, Frank de Bot <[EMAIL PROTECTED]> wrote:

Hi,

I have made a apache setup with PHP running as FastCGI (apache 2.0.58,
mod_fastcgi 2.4.2, php 5.1.4)
PHP is called directly as FastCGI without a wrapper script.
On a given moment the PHP FastCGI application reaches
dynamicMaxClassProcs. After that happens the PHP FastCGI application
totally crashes and can only be recovered by restarting apache.

PHP Crashes with:

"terminated due to uncaught signal '10' ((null)), a core file may have
been generated. "


Are you able to get a core dump and what does it show? Here's some
doco on how to get a backtrace:

http://bugs.php.net/bugs-generating-backtrace.php

That will give us some clues on whether it's php or fastcgi..

--
Postgresql & php tutorials
http://www.designmagick.com/

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



[PHP] Failing FastCGI PHP

2006-05-11 Thread Frank de Bot

Hi,

I have made a apache setup with PHP running as FastCGI (apache 2.0.58, 
mod_fastcgi 2.4.2, php 5.1.4)

PHP is called directly as FastCGI without a wrapper script.
On a given moment the PHP FastCGI application reaches 
dynamicMaxClassProcs. After that happens the PHP FastCGI application 
totally crashes and can only be recovered by restarting apache.


PHP Crashes with:

"terminated due to uncaught signal '10' ((null)), a core file may have 
been generated. "


After that it only shows:

"has failed to remain running for 30 seconds given 3 attempts, its 
restart interval has been backed off to 600 seconds"


Is this a bug a php or fastcgi?


Regards,

Frank de Bot

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



RE: [PHP] Good Answers

2006-05-11 Thread Jay Blanchard
[snip]
Might I make a suggestion for an addition to the newbie email - in the 
"where to find more information" section - add a link either to the 
manual security section or phpsec.org
[/snip]

Cool idea, let's get that info together and I'll add it and throw it up
on my server...

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



Re: [PHP] php parsing and db content [RESOLVED]

2006-05-11 Thread Schalk Neethling

Chris wrote:

Schalk wrote:

Chris wrote:


Chris wrote:



actually if it's only one variable, this might do it for you:

$content = str_replace('', _root, $content);

but that's still a bad way to do this.


Chris,

This works:

$breadcrumb = $row_pathway['pathway'];
$breadcrumb = str_replace('', _root, $breadcrumb);

echo $breadcrumb;

However, I would still like to know why this is a bad way to do this 
and hopefully find a better way. Still learning all the aspects of 
PHP so any input is appreciated.




Because you're including your config details in your data (I don't 
think you should do this, but others may disagree).


The str_replace method should be pretty fast and won't introduce any 
security issues like the 'eval' method I originally mentioned would.



Thank you for all of your help Chris. Much appreciated.

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers
emotionalize.conceptualize.visualize.realize
Landlines
Tel: +27125468436
US Tel: (440) 499-5484
Fax: +27125468436
Web
email:[EMAIL PROTECTED]
Global: www.volume4.com
Messenger
Yahoo!: v_olume4
AOL: v0lume4
MSN: [EMAIL PROTECTED]

We support OpenSource
Get Firefox!- The browser reloaded - http://www.mozilla.org/products/firefox/

The information transmitted is intended solely for the individual or entity to 
which it is addressed and may contain confidential and/or privileged material. 
Any review, retransmission, dissemination or other use of or taking action in 
reliance upon this information by persons or entities other than the intended 
recipient is prohibited. If you have received this email in error, please 
contact the sender and please delete all traces of this material from all 
devices.

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



Re: [PHP] extract text from pdf

2006-05-11 Thread Rory Browne

I use twiki.

Twiki search sucks.

Someone wrote a Plucene based search engine.

They wanted to be able to search attachments.

Including Pdf files.

They used ...



something out of xpdf - pdf2text or pdftotext

On 5/11/06, George Pitcher <[EMAIL PROTECTED]> wrote:


Have a look at the iText java class. I use it in conjuction with php for
file splitting and concatenation, but it has a whole host of other
features.
It's accessible via sourceforge or from the author at
www.lowagie.com/iText/.

Hope it helps

George

> -Original Message-
> From: cajbecu [mailto:[EMAIL PROTECTED]
> Sent: 11 May 2006 9:46 am
> To: 'PHP General (E-mail)'
> Subject: [PHP] extract text from pdf
>
>
> Hello,
>
> Is there any posibility to extract all text from a PDF file? (I have
> read all the documentation about PHP PDF-Lib but no answer...)
>
> Thanks in advance,
>   cajbecu
>
> --
> 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




Re: [PHP] question about using temporary named pipe in the string for system

2006-05-11 Thread Robin Vickery

On 11/05/06, Jochem Maas <[EMAIL PROTECTED]> wrote:

Ginger Cheng wrote:
> Hello, PHP gurus,
> I have a command that I want to run using system function. The
> command exploits temporary named pipes in the place of temporary files.
>   my command is
> paste   <(cut -f1  file1)  <(cut -f2  file2)> final_file
>
>  It works perfectly well if I just type it in my interactive
> shell.  But if I do a
>
> 
> final_file";
> system($cmd);
> ?>
>
>  I got the syntax error msg as
> "sh: -c: line 1: syntax error near unexpected token `('".   I have tried

I notice that the 'sh' shell is being used according to your error output,
I'm guessing that maybe your interactive shell is running something like 'bash'
and that this discrepency might the root cause of the problem. just a guess -
I don't know how you would define another shell for php to use either :-/.


That's exactly what's causing it.

One thing the OP can do is invoke bash to run his command line:

  $cmd = '/bin/bash -c  "paste <(cut -f1 file1) <(cut -f2 file2) > file3"';

Alternatively, arrange the command line more efficiently:

  $cmd = 'paste file1 file2 | cut -f1,6 > file3';

(replacing the '6' with the correct field number)

-robin

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



RE: [PHP] extract text from pdf

2006-05-11 Thread George Pitcher
Have a look at the iText java class. I use it in conjuction with php for
file splitting and concatenation, but it has a whole host of other features.
It's accessible via sourceforge or from the author at
www.lowagie.com/iText/.

Hope it helps

George

> -Original Message-
> From: cajbecu [mailto:[EMAIL PROTECTED]
> Sent: 11 May 2006 9:46 am
> To: 'PHP General (E-mail)'
> Subject: [PHP] extract text from pdf
>
>
> Hello,
>
> Is there any posibility to extract all text from a PDF file? (I have
> read all the documentation about PHP PDF-Lib but no answer...)
>
> Thanks in advance,
>   cajbecu
>
> --
> 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] extract text from pdf

2006-05-11 Thread cajbecu
Hello,

Is there any posibility to extract all text from a PDF file? (I have
read all the documentation about PHP PDF-Lib but no answer...)

Thanks in advance,
cajbecu

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



Re: [PHP] Parsing images

2006-05-11 Thread Dotan Cohen

On 5/11/06, Peter Hoskin <[EMAIL PROTECTED]> wrote:

There are often easier solutions due to poor design.

Seen many sites setting the value in cookies, or hidden form elements, etc.
Sites made by people who can't do their jobs in other words :)

Regards,
Peter Hoskin



I know what you mean. But we're not actually trying to crack anything-
we just want to know if php can process the image so far as to
understand the text. Ways around it aren't what is interesting us.

The idea came up because apparently there are photo-organising tools
available that can parse an image and add a tag based upon who is in
it.

Dotan Cohen
http://gmail-com.com


Re: [PHP] Re: Browser displays blank page, while request still being handled

2006-05-11 Thread Rolf Wouters

Edward Vermillion wrote:


On May 10, 2006, at 10:54 AM, Rolf Wouters wrote:


Yet another update.

Strange thing happened.  I fixed the problem...  It's not a clean 
solution, it's not the right solution, but for now, it'll (have to) 
do :-)


I changed my little test-script to include directives like 
max_input_time, set_time_limit(0) etc.  Than I thought, why not try 
to generate some output when copying files!??!  So I did...  and you 
know what, all of a sudden I'm seeing my response page every single 
time I call my script :-D


So our quick-n-dirty-but-we-know-its-wrong-solution is gonna be to 
have the script generate some output (a single space) for each file 
it has copied (i.e. print(" ")).
After testing it with the problem-app, we feel confident this is a 
viable, temporary, solution.  At least untill we complete our PHP5 
rewrite of the Photofresher :-)


I would like to thank all of you for your time, patience and advice.

If anyone has any ideas on why this is working, feel free to let me 
know :-)




Wild guess is the browser is receiving *something* before it times out?

It doesn't seem like the browser is actually timing out.


I've only been following this off and on so slap me if I say something 
stupid, but as I understand it the script you're having problems with 
creates a 'gallery/page/something' for photogs by copying a lot of 
files around?
MMYes...  kind of like that.  The photos are copied from the working-dir 
to the online dir, some XML-files are generated which are then read by a 
Flash-film, which is responsible for loading and displaying the photos.
Why are you just outputting a space then? Why not output something 
useful to the person sitting and staring at their screen, like "Image 
so-and-so processed...\n" so they have a clue as to what's going 
on behind the scenes and an idea of how long it's going to take to 
finish? Just a thought.
I'm only using the print(" "); because all other output is being 
accumulated in a string-variable $result.  At the end of the request, 
that variable is put into $_REQUEST and read by the result-page, which 
displays the content $result.


I'm not sure why the original developers of the did it like this, and do 
agree with you that it would make more sense to show some kind of 
progress output.
But we are re-writing the app for php5, and there will be some major 
changes, so maybe this will be one of them :-)


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



Re: [PHP] Re: Browser displays blank page, while request still being handled

2006-05-11 Thread Rolf Wouters

Others have mentioned that the browser timeout could be a problem.  So
I'm wondering if your script really was completing all the way, but
the browser just gave up on waiting.  Could you try a little test to
take the spaces back out, and write the output of
connection_status() 
http://us2.php.net/manual/en/function.connection-status.php
to a file to see during each of the copies to see if the browser does 
go away?
Browser timeout was indeed mentioned as a possible problem.  However, 
I've tried prolonging those timeouts in Firefox, without result.


This little test of yours sounded like an interesting idea, so I took 
the spaces back out, and wrote the output of connection_status() to a file.
For each of the 700 files I'm copying, I get connection_status() = 0, 
which means the connection between browser and server is still alive.

Just for my curiosity... do you know for a fact that the script didn't
finish all the way before outputting data?
When the browser displays the blank page, the script is still running.  
I've checked this by looking in my connection-file at the moment the 
blank page pops up.  At that time, only 600 of the expected  700 entries 
are there.  When I wait a little while (say a minute, or so) and look 
again at the content of the file, all 700 entries are there, all showing 
connection_status() = 0.
Previously I've checked this by examing the content of the destination 
directory, which also showed me an incomplete result.  Files were still 
being copied to the destination, while the browser was displaying the 
blank page.

If you've spent too much time on this already that is fine, I was just
curious for future reference. :) 
I don't mind putting in some more time on this problem, and it would 
satisfy my own curiousity to know what the problem exactly is.  And like 
I mentioned before, I know my solution is a really, really bad one, but 
it works (for now :-s ).


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



Re: [PHP] Parsing images

2006-05-11 Thread Peter Hoskin
There are often easier solutions due to poor design.

Seen many sites setting the value in cookies, or hidden form elements, etc.
Sites made by people who can't do their jobs in other words :)

Regards,
Peter Hoskin

Dan Harrington wrote:
> Using ImageMagick, ray tracing algorithms, an OCR library, and fourier
> transforms, I bet that you could parse Capchas.
>
> Dan
>
> -Original Message-
> From: Dotan Cohen [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, May 11, 2006 12:29 AM
> To: PHP General (E-mail)
> Subject: [PHP] Parsing images
>
> Hey all, it is possible to parse capcha's in php? I'm not asking how to do
> it, nor have I any need, it's just something that I was discussing with a
> friend. My stand was that ImageMagik could crack them. She says no way. What
> are your opinions?
>
> Thanks.
>
> Dotan Cohen
> http://what-is-what.com
>
>   

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