Re: [PHP] Strange server crash problem

2006-09-07 Thread Robert Cummings
On Fri, 2006-09-08 at 00:44 -0500, Larry Garfield wrote:
> On Friday 08 September 2006 00:35, Robert Cummings wrote:
> 
> > > The damned thing is, the 4KB mark is reached while outputting the
> > > left-side navigation bar.  The way the CMS is structured (I didn't write
> > > it), that happens before any page-specific content is even loaded.  There
> > > shouldn't be anything different about the code there yet.
> > >
> > > I've been unable to figure out why it happens.  Any idea what to check? 
> > > I'm stumped.
> > >
> > > The server itself is (get this) a Windows/IIS box running PHP 4.0.6 (yes,
> > > really) and MS SQL server via ODBC.  I unfortunately do not have direct
> > > access to the box, so I can't check server logs myself.
> >
> > Binary search using error_log() and __LINE__ output to track down where
> > the thing dies.
> 
> Binary search?  I must be using a different definition than you are, since I 
> don't know what a binary search would do for me when trying to track down a 
> problem with output. :-)

Binary search to track down a problem with output means you place log
info at three points in the code, 2 that you are certain lie outside the
error condition, and the 3rd to cut the problem space in two. Then
depending on what gets output you know in which half of the problem
space the error exists. Then you take again divide the problem space
until you find the exact location of the bug.

> I suppose it is possible that it's dying at some point other than where the 
> output is stopping.  I've localized where the output stops; it's always at 
> the end of a given loop iteration in the code that generates the sidebar; at 
> the end of the loop that passes the 4 KB mark, it seems.  

I didn't realize you had already tracked down the location. Have you
tried displaying errors? If you're worried about a production site you
could install a custom error handler that displays the error based on
the REMOTE_ADDR value. That won't help you though if a segfault is
occurring. Are the PHP versions the same between machines?

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] Directory Structure

2006-09-07 Thread Robert Cummings
On Fri, 2006-09-08 at 10:42 +0530, Manoj Singh wrote:
> Hello all,
> 
> I am developing a site in which i have to show the directory structure of
> any server i.e the admin will enter any site name and i have to show the dir
> structure of that site name.

Crawl baby, crawl! You need to load a page, grab the link references,
and then crawl each of those links. You will want to make sure you stay
on the same server (don't jump to URLs not matching the initial domain).
So that you don't bog down in recursion hell, I'd maintain a queue of
URLs still to be processed. And as you finish a page, grab the next
page. You are going to run into the problem of loops, in which case you
need a game plan for handling looped links. My suggestion is if the
target link already exists in your queue or processed list, then skip
it. So once you have all the links, just go ahead and split up the paths
into their respective parts and build the directory tree.

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] Directory Structure

2006-09-07 Thread Larry Garfield
On Friday 08 September 2006 00:12, Manoj Singh wrote:
> Hello all,
>
> I am developing a site in which i have to show the directory structure of
> any server i.e the admin will enter any site name and i have to show the
> dir structure of that site name.
>
> Please help me to fix this.

The following may prove useful:
http://us2.php.net/scandir
http://us2.php.net/manual/en/function.readdir.php
http://us2.php.net/manual/en/class.dir.php
http://us2.php.net/manual/en/spl (for very new PHP 5)

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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



Re: [PHP] Strange server crash problem

2006-09-07 Thread Larry Garfield
On Friday 08 September 2006 00:35, Robert Cummings wrote:

> > The damned thing is, the 4KB mark is reached while outputting the
> > left-side navigation bar.  The way the CMS is structured (I didn't write
> > it), that happens before any page-specific content is even loaded.  There
> > shouldn't be anything different about the code there yet.
> >
> > I've been unable to figure out why it happens.  Any idea what to check? 
> > I'm stumped.
> >
> > The server itself is (get this) a Windows/IIS box running PHP 4.0.6 (yes,
> > really) and MS SQL server via ODBC.  I unfortunately do not have direct
> > access to the box, so I can't check server logs myself.
>
> Binary search using error_log() and __LINE__ output to track down where
> the thing dies.

Binary search?  I must be using a different definition than you are, since I 
don't know what a binary search would do for me when trying to track down a 
problem with output. :-)

I suppose it is possible that it's dying at some point other than where the 
output is stopping.  I've localized where the output stops; it's always at 
the end of a given loop iteration in the code that generates the sidebar; at 
the end of the loop that passes the 4 KB mark, it seems.  

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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



Re: [PHP] Strange server crash problem

2006-09-07 Thread Robert Cummings
On Fri, 2006-09-08 at 00:05 -0500, Larry Garfield wrote:
> I'm not certain if this is a PHP problem per se, but as the problem manifests 
> itself in PHP I'll give it a go.
> 
> I've a PHP-based CMS for a site that I am maintaining.  It's a large site 
> with 
> a few thousand pages.  Most of them work fine.  However, twice now we've run 
> into a problem where a specific page will exhibit very odd behavior.
> 
> When building the page, the script will seemingly terminate after it outputs 
> about 4 KB of data.  It's not exactly 4 KB, but it's always about 4 KB of 
> data.  If I add debugging information to the page, it will still stop at 
> about 4 KB of data, which is then less "real" output.
> 
> The damned thing is, the 4KB mark is reached while outputting the left-side 
> navigation bar.  The way the CMS is structured (I didn't write it), that 
> happens before any page-specific content is even loaded.  There shouldn't be 
> anything different about the code there yet.  
> 
> I've been unable to figure out why it happens.  Any idea what to check?  I'm 
> stumped.
> 
> The server itself is (get this) a Windows/IIS box running PHP 4.0.6 (yes, 
> really) and MS SQL server via ODBC.  I unfortunately do not have direct 
> access to the box, so I can't check server logs myself.

Binary search using error_log() and __LINE__ output to track down where
the thing dies.

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



[PHP] Directory Structure

2006-09-07 Thread Manoj Singh

Hello all,

I am developing a site in which i have to show the directory structure of
any server i.e the admin will enter any site name and i have to show the dir
structure of that site name.

Please help me to fix this.

Thanks & Regards
Manoj


[PHP] IE session problem on one server only

2006-09-07 Thread Larry Garfield
Another issue. :-)  I've another site I've built that uses PHP sessions for 
user authentication.  When the user logs in with a user/pass, that is matched 
against a record in the database and, if found, that user object is stored in 
the session along with various other tracking data like the IP address, and 
the session key is stored in the user table.  Then when viewing a page, the 
systems compares the session key against the user table and the IP address of 
the request against the saved IP address.  If anything doesn't match up 
properly, the user is kicked out.

OK, all fine and dandy.  It works correctly in both IE and Firefox on our test 
server.  On the live site, however, it works only in Firefox.  In IE, it 
accepts the initial login and displays the first page, but then the next time 
the user clicks a link they are asked to login again, as if the session is 
not being sent or saved properly.  Both servers are running Linux and PHP 
4.3.x.

We had issues before with the session not working correctly in IE, but I fixed 
those with info from the php.net manual user comments.  I'm at a loss as to 
why it's only happening on the one server and not the other now.  If it were 
the other way around I wouldn't care, but the live site shouldn't break. :-)

Any idea what could be the problem?

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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



[PHP] Strange server crash problem

2006-09-07 Thread Larry Garfield
I'm not certain if this is a PHP problem per se, but as the problem manifests 
itself in PHP I'll give it a go.

I've a PHP-based CMS for a site that I am maintaining.  It's a large site with 
a few thousand pages.  Most of them work fine.  However, twice now we've run 
into a problem where a specific page will exhibit very odd behavior.

When building the page, the script will seemingly terminate after it outputs 
about 4 KB of data.  It's not exactly 4 KB, but it's always about 4 KB of 
data.  If I add debugging information to the page, it will still stop at 
about 4 KB of data, which is then less "real" output.

The damned thing is, the 4KB mark is reached while outputting the left-side 
navigation bar.  The way the CMS is structured (I didn't write it), that 
happens before any page-specific content is even loaded.  There shouldn't be 
anything different about the code there yet.  

I've been unable to figure out why it happens.  Any idea what to check?  I'm 
stumped.

The server itself is (get this) a Windows/IIS box running PHP 4.0.6 (yes, 
really) and MS SQL server via ODBC.  I unfortunately do not have direct 
access to the box, so I can't check server logs myself.

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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



Re: [PHP] PHP Access Violations

2006-09-07 Thread Christopher Watson

Following up on this now...

I have successfully installed Apache 2.0.59 (Win32), and configured
successfully for PHP 5.1.6 and MySQL 5.0.24.  The app is running fine,
but I ran a few manipulation queries from the SQLyog interface and
Apache did crash.  I'll have try to reproduce the problem again in
order to get the exception data.  This is looking more and more like a
SQLyog problem.  Maybe I should try another MySQL admin client.

-Christopher

On 9/6/06, Christopher Watson <[EMAIL PROTECTED]> wrote:

Spoke too soon.  After a reboot, I had only IE and Homesite open,
making changes to PHP code and running the app, and it hit an access
violation.  So SQLyog ain't it.

-Chris

On 9/6/06, Christopher Watson <[EMAIL PROTECTED]> wrote:
> Thanks for the input, Jon.  I'll get to the Apache and IIS restart
> suggestions soon.
>
> Meanwhile, I think I have a semi-repeatable recipe for getting the
> access violation to happen.  As far as I can tell, everything is cool
> until I open up SQLyog and do some sort of database manipulation
> within it.  Almost immediately after that, switching back to the
> browser and flying through the app a little more brings on the
> violation.  So far, my testing is indicating to me that the violation
> does not occur without SQLyog having done some work in the database.
>
> -Chris



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



RE: [PHP] Data validation at the db level

2006-09-07 Thread Jay Blanchard
[snip]
Jay Blanchard 
on Thursday, September 07, 2006 5:16 PM said:

> There are all sorts of ways to validate data at the DB level and this
> is a PHP question how?

Just because!
[/snip]

Oil changes to the right 

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



RE: [PHP] Data validation at the db level

2006-09-07 Thread Chris W. Parker
Jay Blanchard 
on Thursday, September 07, 2006 5:16 PM said:

> There are all sorts of ways to validate data at the DB level and this
> is a PHP question how?

Just because!

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



RE: [PHP] Data validation at the db level

2006-09-07 Thread Jay Blanchard
[snip]
Hey everyone,

Is there any work being done in the database world for data validation
at the db level?

It would be cool to just define a field as being an email address (of
length nn) instead of saying a TEXT field (of length nn) and validating
it in the application layer. Same goes for other things as well.

Sure, it's not really possible to account for all different types of
data, but the basics would be nice. (email, numbers only, letters only,
alphanumeric only, [a-z0-9#-] only, etc.)
[/snip]

There are all sorts of ways to validate data at the DB level and this is
a PHP question how? I only ask because validation at the DB level
removes the need to validate at the application level. 

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



Re: [PHP] Data validation at the db level

2006-09-07 Thread Stephen Edberg
On Thu, 7 Sep 2006, Chris W. Parker wrote:

> Hey everyone,
>
> Is there any work being done in the database world for data validation
> at the db level?
>
> It would be cool to just define a field as being an email address (of
> length nn) instead of saying a TEXT field (of length nn) and validating
> it in the application layer. Same goes for other things as well.
>
> Sure, it's not really possible to account for all different types of
> data, but the basics would be nice. (email, numbers only, letters only,
> alphanumeric only, [a-z0-9#-] only, etc.)
>

That would be what CHECK constraints are for; MySQL doesn't have them yet,
Postgresql does:

http://www.postgresql.org/docs/8.1/interactive/ddl-constraints.html#AEN1954

You could emulate them in MySQL5 using triggers and stored procedures.

If your database allowed user-defined column types, you could maybe define
one as 'email address' with the approriate restrictions.

steve

 ...
. Steve Edberg   [EMAIL PROTECTED] .
. Computer Consultant University of California, Davis .
.   (530)754-9127 .
...

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



[PHP] Data validation at the db level

2006-09-07 Thread Chris W. Parker
Hey everyone,

Is there any work being done in the database world for data validation
at the db level?

It would be cool to just define a field as being an email address (of
length nn) instead of saying a TEXT field (of length nn) and validating
it in the application layer. Same goes for other things as well.

Sure, it's not really possible to account for all different types of
data, but the basics would be nice. (email, numbers only, letters only,
alphanumeric only, [a-z0-9#-] only, etc.)



Chris.



 

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



Re: [PHP] Arabic

2006-09-07 Thread Frank Arensmeier

I would...

a) read the PDFlib manual
b) search the PDFlib list archives for information (this has been  
discussed previously, I am rather sure)

c) post your question to the PDFlib list

/frank

7 sep 2006 kl. 21.16 skrev Ronald Cole:


Hi,

I'm trying to use pdflib to generate Arabic.

Is this possible?

If so, what font should one use?

	Someone has told me that I may need to manipulate the unicode  
characters to change the order to right-to-left. Has anyone done  
this before?


Thanks,
Skip

Ronald "Skip" Cole
Program Officer
United States Institute of Peace (http://www.usip.org)
(202)457-1700 ext 4717

“The more you sweat in peace, the less you bleed in war” – Asian  
Proverb


--
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] Database.table issue

2006-09-07 Thread Chris

Steve Marquez wrote:

Greetings,

I have a script that uploads images to a directory and information into a
MySQL database. It works on an external server, but it does not work on our
in-house server. 


I am getting the following error:

Table Œphoto_archive.categories¹ doesn¹t exist

I know that the DB Œphoto_archive¹ and the Table Œcategories¹ exists. I have
been able to use the shell to insert info into the table and it works fine,
even on the in-house server.


Are you doing cross database queries? Just wondering why you're using 
'database.tablename' instead of just 'tablename'.


Are you connecting to the right database server?

Are you connecting as the right database user? Maybe the user you're 
using in PHP can't access the database because of user permissions.


Are the mysql versions the same?

--
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] Segfault problem [long]

2006-09-07 Thread Chris

Daniel A. Ramaley wrote:
Hello. I have been struggling for a few months to solve a problem with 
an Apache web server. First i'll try to describe the symptoms, then 
give details about the configuration and what i have tried so far. I 
would greatly appreciate any suggestions on how to diagnose and correct 
the problem.



Symptom 1:

After starting Apache during periods of high load the server appears to 
run fine for awhile ("awhile" is highly variable but on the order of 90 
minutes) then starts returning empty pages. When the empty pages start, 
Apache's error_log gets filled with lines like this:


[Thu Sep 07 09:09:11 2006] [notice] child pid 3579 exit signal 
Segmentation fault (11), possible coredump in /etc/httpd/core


These errors are very intermittent during periods of light load. I have 
had CoreDumpDirectory defined for awhile and have amassed quite a 
collection of core files. This is the first few lines of what gdb 
reports for one of them:


(gdb) bt
#0  0x002a99ff2492 in preg_replace_impl (ht=Variable "ht" is not 
available.)

at /usr/src/redhat/BUILD/php-4.3.9/ext/pcre/php_pcre.c:1154
#1  0x002a9a0ac255 in execute (op_array=0x552afe2798)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1640
#2  0x002a9a0a9386 in execute (op_array=0x552aff7fb8)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1684
#3  0x002a9a0a9386 in execute (op_array=0x552b0e26c8)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1684
#4  0x002a9a0a9386 in execute (op_array=0x552af80db8)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1684

Symptom 2:

A further symptom of problems is found in PostgreSQL's logs. The web 
applications the server runs rely on PostgreSQL, which logs several 
times per minute messages like this:


The php crash would probably explain the postgres problems.

You're probably better off asking the internals list, 
http://www.php.net/mailing-lists.php, because they write the C code 
behind PHP.


Have you run any hardware tests to make sure it's not memory/cpu related?

--
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] Query DBF records using PHP

2006-09-07 Thread Chris

Rahul S. Johari wrote:

Ave,

Let¹s say I have a DBF file residing on my somewhere. It has 20 fields, and
about 100 records. Is it possible for me to Query that DBF file, so I can
search that database for a record and Display the row using PHP?


Yes.

http://www.php.net/manual/en/ref.dbase.php

--
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] Database.table issue

2006-09-07 Thread Steve Marquez
Greetings,

I have a script that uploads images to a directory and information into a
MySQL database. It works on an external server, but it does not work on our
in-house server. 

I am getting the following error:

Table Œphoto_archive.categories¹ doesn¹t exist

I know that the DB Œphoto_archive¹ and the Table Œcategories¹ exists. I have
been able to use the shell to insert info into the table and it works fine,
even on the in-house server.

Does anyone know what this could be?

Thanks,

--
Steve Marquez


Re: [PHP] Format of Encrypted Password

2006-09-07 Thread Chris

Kevin Murphy wrote:
Yup, that's got it. It didn't occur to me that its a MySQL thing I'm 
used to doing this as a PHP thing and inserting an already encrypted 
password into MySQL.


Anyone have any thoughts one way or another as to if this mysql password 
function is better/worse than doing it all in PHP?


You're becoming reliant on mysql to do it all which means it would be a 
pain to port this to another database (may or may not be a problem, no 
idea).



You're actually sending the password across the wire in plain text in 
the sql query - that is php is sending password('your_password') to the 
mysql server. Not a problem if it's localhost but if it's a remote db 
server there is a possibility of it being captured (sniffer). If you 
encode it in php, you're sending across the hash 
(password='hashed_value_here').



Mysql passwords have changed between versions and may change again.

http://dev.mysql.com/doc/refman/5.1/en/password-hashing.html

Prior to MySQL 4.1, password hashes computed by the PASSWORD() function 
are 16 bytes long.


As of MySQL 4.1, the PASSWORD() function has been modified to produce a 
longer 41-byte hash value



The last one is probably the most important one.

--
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] Format of Encrypted Password

2006-09-07 Thread Kevin Murphy
Yup, that's got it. It didn't occur to me that its a MySQL thing  
I'm used to doing this as a PHP thing and inserting an already  
encrypted password into MySQL.


Anyone have any thoughts one way or another as to if this mysql  
password function is better/worse than doing it all in PHP?


--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada Community College
www.wncc.edu
775-445-3326


On Sep 7, 2006, at 12:50 PM, Eric Butera wrote:


On 9/5/06, Kevin Murphy <[EMAIL PROTECTED]> wrote:
$query = "select name from table where name = '$authuser' and
password = password('$auth_pw')";


If you haven't tried this you can probably create accounts yourself  
manually in MySQL like this:

INSERT INTO table (name, password) VALUES ('user', PASSWORD('pass'));




Re: [PHP] Arabic

2006-09-07 Thread Anas Mughal

I have not done this before. I am unsure of how this could be done. Here is
what comes to my mind:


  - I would think you would need to change the x-coordinate of the page
  to start from the top-right of the page -- instead of top-left.
  - The rendering of characters needs to be done from right to left.
  (Unless you do that already in your string generation code: basically flip
  the text.)
  - I wouldn't think you would need to manipulate anything with respect
  to the unicode characters.
  - The font needs to be provided or supported by pdflib.


Please do let me know if you find an answer to this interesting problem.
Regards.



On 9/7/06, Ronald Cole <[EMAIL PROTECTED]> wrote:


Hi,

I'm trying to use pdflib to generate Arabic.

Is this possible?

If so, what font should one use?

Someone has told me that I may need to manipulate the unicode
characters to change the order to right-to-left. Has anyone done this
before?

Thanks,
Skip

Ronald "Skip" Cole
Program Officer
United States Institute of Peace (http://www.usip.org)
(202)457-1700 ext 4717

"The more you sweat in peace, the less you bleed in war" – Asian Proverb

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





--
Anas Mughal


Re: [PHP] Format of Encrypted Password

2006-09-07 Thread Eric Butera

On 9/5/06, Kevin Murphy <[EMAIL PROTECTED]> wrote:


$query = "select name from table where name = '$authuser' and
password = password('$auth_pw')";




If you haven't tried this you can probably create accounts yourself manually
in MySQL like this:
INSERT INTO table (name, password) VALUES ('user', PASSWORD('pass'));


Re: [PHP] Format of Encrypted Password

2006-09-07 Thread Oscar Gosdinski

On 9/5/06, Kevin Murphy <[EMAIL PROTECTED]> wrote:

The only thing I can find anywhere in the code is this:

$auth_user = $_SERVER['PHP_AUTH_USER'];
$auth_pw = $_SERVER['PHP_AUTH_PW'];
$query = "select name from table where name = '$authuser' and
password = password('$auth_pw')";



You are using the password() function of mysql to 'encrypt' the password.

--
Saludos
Oscar

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



[PHP] Arabic

2006-09-07 Thread Ronald Cole

Hi,

I'm trying to use pdflib to generate Arabic.

Is this possible?

If so, what font should one use?

	Someone has told me that I may need to manipulate the unicode  
characters to change the order to right-to-left. Has anyone done this  
before?


Thanks,
Skip

Ronald "Skip" Cole
Program Officer
United States Institute of Peace (http://www.usip.org)
(202)457-1700 ext 4717

“The more you sweat in peace, the less you bleed in war” – Asian Proverb

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



[PHP] GD2

2006-09-07 Thread Steve Marquez
Does anyone know anything about the gd2 for imagecreatetruecolor?

I have written a script that uploads an image to a directory and displays a
thumbnail of the image to the viewer. It works when I am using the live
site, but on the testing server, on my machine, it does not work. We will be
using an in-house machine for future use and we were wondering if anyone has
run into this issue before.

Could it be that we need to create a module in the php.ini file?

I am kind of new to the back-end of PHP. You could probably tell. I
appreciate any help.

Thanks,

Steve Marquez


[PHP] Re: Spreadsheet Writer

2006-09-07 Thread Colin Guthrie

Jef Sullivan wrote:

Greeting all,

I have done some research on the web with no luck so far. 
I will continue to check some other options but I wanted

To check here as well.

I have used the Spreadsheet Excel Writer with PHP before 
With great success. What I need to do now is create some

Charts with this application.

Does any one know if that is possible?
If so, can you give me a reference for that information?


You could also look at Image_Graph:
http://pear.speedpartner.de/packages.php (examples)
http://pear.php.net/package/Image_Graph

Hope this helps.

Col

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



Re: [PHP] GD2

2006-09-07 Thread Kyle
It could be that the PHP you are using for testing does not have GD
support (whoever packaged it didn't have it compiled in).  The quick way
to check would be a quick phpinfo() script.  That should at least give
you somewhere to start.

Kyle

Steve Marquez wrote:
> Does anyone know anything about the gd2 for imagecreatetruecolor?
> 
> I have written a script that uploads an image to a directory and displays a
> thumbnail of the image to the viewer. It works when I am using the live
> site, but on the testing server, on my machine, it does not work. We will be
> using an in-house machine for future use and we were wondering if anyone has
> run into this issue before.
> 
> Could it be that we need to create a module in the php.ini file?
> 
> I am kind of new to the back-end of PHP. You could probably tell. I
> appreciate any help.
> 
> Thanks,
> 
> Steve Marquez
> 

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



Re: [PHP] php generated javascript

2006-09-07 Thread Shu Hung (Koala)

On 8/31/06, Curt Zirzow <[EMAIL PROTECTED]> wrote:


On 8/30/06, Shu Hung (Koala) <[EMAIL PROTECTED]> wrote:
> On 8/31/06, Peter Lauri <[EMAIL PROTECTED]> wrote:
> >
> > Koala,
> >
> > There is no difference with the php generated javascript and
javascript on
> > a
> > static html page.
> >
> > Take a look at the source code of the page that has been generated in
the
> > browser, and if that one looks as it should, it is probably your
> > javascript
> > that is not doing what it should :)
> >
> > And if that is the case you can join the [EMAIL PROTECTED] list
for
> > that
> > purpose.
> >
> > /Peter
> >
> >
> Petar,
>
> Thanks for your reply.
>
> I've used some server side cache for that javascript generation now.
> It works a lot better. Seems to me that it takes too long to generate
> the javascript. Sometimes browsers decided to ignores the javascript
> and just run.

You might want to be more elaborate than that... What is considered
longer, What do you mean it ignores the javascript?

> I used "document.write" in that javascript. When it isn't loaded
> completely, nothing shows. I wonder if there is any better way.

This i dont understand, perhaps an example of what you are doing?

Curt.



Curt,

I found the problem.
I have some "\n" inside a javascript variable sometimes.
That cause the error by chance and I thought that was
browser issue.

Thanks a lot.

Koala Yeung


[PHP] reading a PDF's title

2006-09-07 Thread Shu Hung (Koala)

Hello,

I know PDF files stores a "Title" somewhere.
I'm not sure if it is at meta data or elsewhere.

Does anyone have any method to get this "Title" out?

Thanks
Koala Yeung


[PHP] Re: Spreadsheet Writer

2006-09-07 Thread John Ellingsworth

Jef Sullivan wrote:

I have used the Spreadsheet Excel Writer with PHP before 
With great success. What I need to do now is create some

Charts with this application.

Does any one know if that is possible?
If so, can you give me a reference for that information?



JpGraph is a great tool for doing this:

http://www.aditus.nu/jpgraph/

Regards,

John

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



Re: [PHP] Accessing .mdb Ms Access file from Linux without ODBC

2006-09-07 Thread Fourat Zouari

trying this code :

--- BEGIN
Connect($dsn) or die('here');

$res = $sourceDB->Execute('SELECT * FROM Modelos;');
echo 'err: ';
echo $sourceDB->ErrorMsg();

$rows = $res->GetRows($res);

print_r($rows);
?>
--- END

i get this error :

*Warning*: odbc_connect()
[function.odbc-connect]:
SQL error: [unixODBC][Driver Manager]Data source name not found, and no
default driver specified, SQL state IM002 in SQLConnect in *
/var/www/classes/adodb/drivers/adodb-odbc.inc.php* on line *60*
here

On 9/7/06, Fourat Zouari <[EMAIL PROTECTED]> wrote:


i want to understand something : when using a dsn like this with adodb :

"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=/var/tmp/etiq.db"

should i have an ODBC layer or not ?


On 9/7/06, Joe Wollard <[EMAIL PROTECTED]> wrote:
>
> I think kOffice can read mdb files on Linux - maybe that would be a
> good starting point for research. Perhaps they have built a kind of
> API to allow other programs to do the same..then again, maybe not
> - but like I said, it's some place to start.
>
>
> On Sep 7, 2006, at 7:57 AM, Fourat Zouari wrote:
>
> > it's a PHP question : how can we access Ms Access mdb files without
> > ODBC ?
> >
> > On 9/7/06, Angelo Zanetti < [EMAIL PROTECTED]> wrote:
> >>
> >>
> >>
> >> Fourat Zouari wrote:
> >>
> >> > Hello all,
> >> > I need to create a script that can open a connection to a
> >> given .mdb
> >> file
> >> > (Microsoft Access) and do some light selects on it, anyway ...
> >> > The problem that i wont create an ODBC instance, i wont and cant
> >> install
> >> > ODBC support on the server for the unique purpose of doing that
> >> on the
> >> > mdb
> >> > file.
> >> > I'm seeking how to do such thing on a Linux env (no COM) and
> >> without
> >> > ODBC,
> >> > googling, i found that AdoDB doesnt do it (?) and PDO didnt got a
> >> support
> >> > for that (?)
> >> > Any helpers around ? thanks
> >> >
> >>
> >> what does this have to do with PHP?
> >>
> >> --
> >> -
> >> ---
> >> Angelo Zanetti
> >> Systems developer
> >> -
> >> ---
> >>
> >> *Telephone:* +27 (021) 469 1052
> >> *Mobile:*   +27 (0) 72 441 3355
> >> *Fax:*+27 (0) 86 681 5885
> >> *
> >> Web:* http://www.zlogic.co.za
> >> *E-Mail:* [EMAIL PROTECTED] 
> >>
>
>



Re: [PHP] Accessing .mdb Ms Access file from Linux without ODBC

2006-09-07 Thread Fourat Zouari

i want to understand something : when using a dsn like this with adodb :

"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=/var/tmp/etiq.db"

should i have an ODBC layer or not ?

On 9/7/06, Joe Wollard <[EMAIL PROTECTED]> wrote:


I think kOffice can read mdb files on Linux - maybe that would be a
good starting point for research. Perhaps they have built a kind of
API to allow other programs to do the same..then again, maybe not
- but like I said, it's some place to start.


On Sep 7, 2006, at 7:57 AM, Fourat Zouari wrote:

> it's a PHP question : how can we access Ms Access mdb files without
> ODBC ?
>
> On 9/7/06, Angelo Zanetti <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> Fourat Zouari wrote:
>>
>> > Hello all,
>> > I need to create a script that can open a connection to a
>> given .mdb
>> file
>> > (Microsoft Access) and do some light selects on it, anyway ...
>> > The problem that i wont create an ODBC instance, i wont and cant
>> install
>> > ODBC support on the server for the unique purpose of doing that
>> on the
>> > mdb
>> > file.
>> > I'm seeking how to do such thing on a Linux env (no COM) and
>> without
>> > ODBC,
>> > googling, i found that AdoDB doesnt do it (?) and PDO didnt got a
>> support
>> > for that (?)
>> > Any helpers around ? thanks
>> >
>>
>> what does this have to do with PHP?
>>
>> --
>> -
>> ---
>> Angelo Zanetti
>> Systems developer
>> -
>> ---
>>
>> *Telephone:* +27 (021) 469 1052
>> *Mobile:*   +27 (0) 72 441 3355
>> *Fax:*+27 (0) 86 681 5885
>> *
>> Web:* http://www.zlogic.co.za
>> *E-Mail:* [EMAIL PROTECTED] 
>>




[PHP] Segfault problem [long]

2006-09-07 Thread Daniel A. Ramaley
Hello. I have been struggling for a few months to solve a problem with 
an Apache web server. First i'll try to describe the symptoms, then 
give details about the configuration and what i have tried so far. I 
would greatly appreciate any suggestions on how to diagnose and correct 
the problem.


Symptom 1:

After starting Apache during periods of high load the server appears to 
run fine for awhile ("awhile" is highly variable but on the order of 90 
minutes) then starts returning empty pages. When the empty pages start, 
Apache's error_log gets filled with lines like this:

[Thu Sep 07 09:09:11 2006] [notice] child pid 3579 exit signal 
Segmentation fault (11), possible coredump in /etc/httpd/core

These errors are very intermittent during periods of light load. I have 
had CoreDumpDirectory defined for awhile and have amassed quite a 
collection of core files. This is the first few lines of what gdb 
reports for one of them:

(gdb) bt
#0  0x002a99ff2492 in preg_replace_impl (ht=Variable "ht" is not 
available.)
at /usr/src/redhat/BUILD/php-4.3.9/ext/pcre/php_pcre.c:1154
#1  0x002a9a0ac255 in execute (op_array=0x552afe2798)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1640
#2  0x002a9a0a9386 in execute (op_array=0x552aff7fb8)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1684
#3  0x002a9a0a9386 in execute (op_array=0x552b0e26c8)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1684
#4  0x002a9a0a9386 in execute (op_array=0x552af80db8)
at /usr/src/redhat/BUILD/php-4.3.9/Zend/zend_execute.c:1684

Symptom 2:

A further symptom of problems is found in PostgreSQL's logs. The web 
applications the server runs rely on PostgreSQL, which logs several 
times per minute messages like this:

Sep  7 10:16:09 sun12 postgres[7411]: [1-1] LOG:  unexpected EOF on 
client connection

PostgreSQL is configured to accept 256 connections, twice as many 
children as Apache should spawn.


Configuration:

The server is a Sun v40z, which is a dual Opteron box with 2 GB RAM. It 
is running Red Hat Linux Enterprise AS 4.4 64-bit, with Apache 2.0.52, 
PHP 4.3.9, and eAccelerator 0.9.4. The server's purpose is to run Horde 
and Imp, with the latest versions of those packages and a few other 
Horde components (Ingo, Passwd, and Turba).

Apache is installed with Red Hat's RPMs. PHP is compiled from Red Hat's 
source RPMs; i added mcrypt support which is not included by default 
(but needed to improve performance of Horde).

Below is a list of things i have tried that did not work. After each 
test that failed to provide results i reverted to the previous 
configuration.

1) Using Red Hat's RPMs even though they don't have mcrypt support. This 
did nothing.

2) Upgrading PHP to the latest 4.4.x (x==2 at the time i tried that), 
compiled from source. This had no effect.

3) Removed eAccelerator. Problems remained, but server responds to 
requests a bit slower (as would be expected).

4) Running with a uniprocessor kernel. No effect on the errors.

5) Switched Apache and PHP to 32-bit. The rest of the system is 64-bit. 
This also had no effect.

Over the last few months i have exchanged many messages on the Horde, 
Imp, and Apache users mailing lists trying to track down the problems. 
The consensus seems to be that i need to ask on the PHP forums. Does 
anyone recognize this problem? Do you know a solution for the problem?


Dan RamaleyDial Center 118, Drake University
Network Programmer/Analyst 2407 Carpenter Ave
+1 515 271-4540Des Moines IA 50311 USA

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



[PHP] Query DBF records using PHP

2006-09-07 Thread Rahul S. Johari

Ave,

Let¹s say I have a DBF file residing on my somewhere. It has 20 fields, and
about 100 records. Is it possible for me to Query that DBF file, so I can
search that database for a record and Display the row using PHP?

Basically what I want to do is pull out a record from that DBF file that
matches the ³Phone Number² entered by the user... And show that record on my
PHP page. 

What I¹m doing is importing all the DBF records in my mySQL database, and
then doing the search on that mySQL database and displaying records. I want
to eliminate the mySQL database and query the DBF file directly and display
records from it. 

There¹s very little that I find anywhere on the internet pertaining to the
dbase functions in php. I¹m easily able to open a DBF file, read all the
data and import it into mySQL using some functions I¹ve written. I just
don¹t know if I can search the Database or match a record and display it
without importing it into mySQL.

Any suggestions?

Rahul S. Johari
Supervisor, Internet & Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: [EMAIL PROTECTED]
http://www.informed-sources.com



Re: [PHP] Spreadsheet Writer

2006-09-07 Thread tedd

At 7:43 AM -0600 9/7/06, Jef Sullivan wrote:

Greeting all,

I have done some research on the web with no luck so far.
I will continue to check some other options but I wanted
To check here as well.

I have used the Spreadsheet Excel Writer with PHP before
With great success. What I need to do now is create some
Charts with this application.

Does any one know if that is possible?
If so, can you give me a reference for that information?


Is it possible to take Excel data and produce charts with php?

Yes.

You have to upload the data and then present it.

Uploaded example:

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

Chart example:

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

There are all sorts of references on doing this -- try Google for 
"php excel" and "php charts"


hth's

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

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



[PHP] Spreadsheet Writer

2006-09-07 Thread Jef Sullivan
Greeting all,

I have done some research on the web with no luck so far. 
I will continue to check some other options but I wanted
To check here as well.

I have used the Spreadsheet Excel Writer with PHP before 
With great success. What I need to do now is create some
Charts with this application.

Does any one know if that is possible?
If so, can you give me a reference for that information?


Thanks,

Jef

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



Re: [PHP] Accessing .mdb Ms Access file from Linux without ODBC

2006-09-07 Thread Joe Wollard
I think kOffice can read mdb files on Linux - maybe that would be a  
good starting point for research. Perhaps they have built a kind of  
API to allow other programs to do the same..then again, maybe not  
- but like I said, it's some place to start.



On Sep 7, 2006, at 7:57 AM, Fourat Zouari wrote:

it's a PHP question : how can we access Ms Access mdb files without  
ODBC ?


On 9/7/06, Angelo Zanetti <[EMAIL PROTECTED]> wrote:




Fourat Zouari wrote:

> Hello all,
> I need to create a script that can open a connection to a  
given .mdb

file
> (Microsoft Access) and do some light selects on it, anyway ...
> The problem that i wont create an ODBC instance, i wont and cant  
install
> ODBC support on the server for the unique purpose of doing that  
on the

> mdb
> file.
> I'm seeking how to do such thing on a Linux env (no COM) and  
without

> ODBC,
> googling, i found that AdoDB doesnt do it (?) and PDO didnt got a
support
> for that (?)
> Any helpers around ? thanks
>

what does this have to do with PHP?

--
- 
---

Angelo Zanetti
Systems developer
- 
---


*Telephone:* +27 (021) 469 1052
*Mobile:*   +27 (0) 72 441 3355
*Fax:*+27 (0) 86 681 5885
*
Web:* http://www.zlogic.co.za
*E-Mail:* [EMAIL PROTECTED] 



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



Re: [PHP] Accessing .mdb Ms Access file from Linux without ODBC

2006-09-07 Thread Angelo Zanetti



Fourat Zouari wrote:


it's a PHP question : how can we access Ms Access mdb files without ODBC ?

On 9/7/06, *Angelo Zanetti* <[EMAIL PROTECTED] 
> wrote:




Fourat Zouari wrote:

> Hello all,
> I need to create a script that can open a connection to a given
.mdb file
> (Microsoft Access) and do some light selects on it, anyway ...
> The problem that i wont create an ODBC instance, i wont and cant
install
> ODBC support on the server for the unique purpose of doing that
on the
> mdb
> file.
> I'm seeking how to do such thing on a Linux env (no COM) and without
> ODBC,
> googling, i found that AdoDB doesnt do it (?) and PDO didnt got
a support
> for that (?)


cool just wasnt sure... no harm intended

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



Re: [PHP] Accessing .mdb Ms Access file from Linux without ODBC

2006-09-07 Thread Fourat Zouari

it's a PHP question : how can we access Ms Access mdb files without ODBC ?

On 9/7/06, Angelo Zanetti <[EMAIL PROTECTED]> wrote:




Fourat Zouari wrote:

> Hello all,
> I need to create a script that can open a connection to a given .mdb
file
> (Microsoft Access) and do some light selects on it, anyway ...
> The problem that i wont create an ODBC instance, i wont and cant install
> ODBC support on the server for the unique purpose of doing that on the
> mdb
> file.
> I'm seeking how to do such thing on a Linux env (no COM) and without
> ODBC,
> googling, i found that AdoDB doesnt do it (?) and PDO didnt got a
support
> for that (?)
> Any helpers around ? thanks
>

what does this have to do with PHP?

--

Angelo Zanetti
Systems developer


*Telephone:* +27 (021) 469 1052
*Mobile:*   +27 (0) 72 441 3355
*Fax:*+27 (0) 86 681 5885
*
Web:* http://www.zlogic.co.za
*E-Mail:* [EMAIL PROTECTED] 



Re: [PHP] Accessing .mdb Ms Access file from Linux without ODBC

2006-09-07 Thread Rory Browne



what does this have to do with PHP?



I would assume that he's trying to do it on Linux through PHP.

http://mdbtools.sourceforge.net/
http://pecl.php.net/package/mdbtools


Re: [PHP] Accessing .mdb Ms Access file from Linux without ODBC

2006-09-07 Thread Angelo Zanetti



Fourat Zouari wrote:


Hello all,
I need to create a script that can open a connection to a given .mdb file
(Microsoft Access) and do some light selects on it, anyway ...
The problem that i wont create an ODBC instance, i wont and cant install
ODBC support on the server for the unique purpose of doing that on the 
mdb

file.
I'm seeking how to do such thing on a Linux env (no COM) and without 
ODBC,

googling, i found that AdoDB doesnt do it (?) and PDO didnt got a support
for that (?)
Any helpers around ? thanks



what does this have to do with PHP?

--

Angelo Zanetti
Systems developer


*Telephone:* +27 (021) 469 1052
*Mobile:*   +27 (0) 72 441 3355
*Fax:*+27 (0) 86 681 5885
*
Web:* http://www.zlogic.co.za
*E-Mail:* [EMAIL PROTECTED] 

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



[PHP] Accessing .mdb Ms Access file from Linux without ODBC

2006-09-07 Thread Fourat Zouari

Hello all,
I need to create a script that can open a connection to a given .mdb file
(Microsoft Access) and do some light selects on it, anyway ...
The problem that i wont create an ODBC instance, i wont and cant install
ODBC support on the server for the unique purpose of doing that on the mdb
file.
I'm seeking how to do such thing on a Linux env (no COM) and without ODBC,
googling, i found that AdoDB doesnt do it (?) and PDO didnt got a support
for that (?)
Any helpers around ? thanks


Re: [PHP] Sendmail_from

2006-09-07 Thread Stut

D Sledge wrote:

 OS:  Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
 web server:  Apache 2.0
php version:  4.3.9

When I use the function mail(), the the from email address that is used is 
apache@.  I
tried setting the sendmail_from directive in php.ini and the ServerAdmin 
directive in httpd.conf
to something different but it still keeps using the same address.  Is the a 
different directive
I'm supposed to be setting to change the default from address?
  


Since there is a comment above the sendmail_from line in the default 
php.ini that says "For Win32 only" I'm guessing it won't have any effect 
on RHEL. This is also repeated in the manual.


Look into the optional 5th parameter to mail. Assuming the apache user 
has the required permissions to do it, this allows you to add arguments 
to the sendmail command. The one you want is [EMAIL PROTECTED] - see 
example 3 on the PHP manual page for mail.


-Stut

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