[PHP] working on a template system...

2006-06-27 Thread sempsteen

hi, i'm working on a template system. Basically i'm building raw
contents in arrays and then put them in templates by some special
tags.

for loop systems my basic array structure is like this:
$array['key'][]['keyword'] = ...

for example, for a bulletin board system, array structure for
categories is something like this:
$array['categories'][]['text_category_name'] = ...

it is looped through database recordset, so final array for 2 categories can be:
$array['categories'][0]['text_category_name'] = 'programming'
$array['categories'][1]['text_category_name'] = 'life'

template file structure for loops is something like this (ex, categories):


  [$text_category_name$]



i can easily loop this template and replace [$text_category_name] for
every category set in the array. after removing the comment tags i get
the final content:


  programming


  life


But i'm stuck with nested loops. For example i want to put related
forums after each categories.

array structure is:
$array['categories'][0]['text_category_name'] = programming
$array['categories'][0]['forums'][0]['text_forum_name'] = php
$array['categories'][0]['forums'][1]['text_forum_name'] = ruby

$array['categories'][1]['text_category_name'] = life
$array['categories'][1]['forums'][0]['text_forum_name'] = music
$array['categories'][1]['forums'][1]['text_forum_name'] = sports

template structure is:


  [$text_category_name$]



  [$text_forum_name$]




i've written some functions, used them recursively but it didn't work.
actually i couldn't find the true logic. note that it isn't a limited
array. it can have messages under each forums, peoples under each
messages, so on..

help me find the true approach to handle this. thank you.

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



[PHP] Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs...

2006-06-27 Thread j . kuehne
Hello 

I am pleased if someone could explain me the behaviour since is wrong the 
following function call: ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, 
$_SESSION["searchFormVars"]["offset"]+$rowCounter));
as you will find them on the bottom of the email. By the way, fetchRow() is a 
method from class DB(.php). However mysql_fetch_row() should have same 
functionality but the argument resp. the identity is different. I hardly try to 
do not mix up functionality from mysql- with db- members. 

 
mysql_select_db("knowledge", $link);

$query = setupQuery($_SESSION["searchFormVars"]["search"]); 



 
 
   for ( $rowCounter = 0;
($rowCounter < SEARCH_ROWS) &&
(( $rowCounter + $_SESSION["searchFormVars"]["offset"]) <  
mysql_num_rows($result))  && 
   ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, 
$_SESSION["searchFormVars"]["offset"]+$rowCounter));
   $rowCounter++)
  {   


Error message:
Fatal error: Call to a member function fetchRow() on a non-object in 
C:\Xampp\xampp\htdocs\www2\knowledge_db\searchnew.php on line


best regards, Georg


Re: [PHP] Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs...

2006-06-27 Thread Chris


Hmm. I wonder if his mail server is stuffed.

Can we get this guy removed from the list? This is getting annoying :/

--
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] Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs...

2006-06-27 Thread j . kuehne
Hello 

I am pleased if someone could explain me the behaviour since is wrong the 
following function call: ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, 
$_SESSION["searchFormVars"]["offset"]+$rowCounter));
as you will find them below. By the way, fetchRow() is a method from class 
DB(.php). However mysql_fetch_row() should have same functionality but the 
argument resp. the identity is different. I hardly try to do not mix up 
functionality from mysql- with db- members. 

 
mysql_select_db("knowledge", $link);

$query = setupQuery($_SESSION["searchFormVars"]["search"]); 

$result=mysql_query($query);

 
 
   for ( $rowCounter = 0;
($rowCounter < SEARCH_ROWS) &&
(( $rowCounter + $_SESSION["searchFormVars"]["offset"]) <  
mysql_num_rows($result))  && 
   ($row = $result->fetchRow(DB_FETCHMODE_ASSOC, 
$_SESSION["searchFormVars"]["offset"]+$rowCounter));
   $rowCounter++)
  {   


Error message:
Fatal error: Call to a member function fetchRow() on a non-object in 
C:\Xampp\xampp\htdocs\www2\knowledge_db\searchnew.php on line ...

I am not shure that something should be wrong with the $result parameter since 
I have seen it in the PHP declaration and definition, see 
http://de.php.net/mysql_query below. I now that the return value of mysql_query 
is a boolean resp. a resource handler. In any case, I need the fetchRow 
functionality for correct work as listening to the rows on different pages. 




Another shorter possibility to print options of an ENUM as -tag:
 WHERE field=\'\'');
while ($row=mysql_fetch_row($result))
{
   foreach(explode("','",substr($row[1],6,-2)) as $v)
   {
 print("$v");
   }
}
?> 




best regards, Georg


Re: [PHP] Fatal error: Call to a member function fetchRow() on a non-object in C:\Xampp\xampp\htdocs...

2006-06-27 Thread Jochem Maas
[EMAIL PROTECTED] wrote:
> Hello 
> 
> I am pleased if someone could explain me the behaviour since is wrong the 
> following function call: ($row = & $result->fetchRow(DB_FETCHMODE_ASSOC, 
> $_SESSION["searchFormVars"]["offset"]+$rowCounter));

I am pleased if you'd  off with the broken record (pun intended) georg
- you have had the answer 6 times or more now.


> 

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



[PHP] Controlling a scanner with PHP

2006-06-27 Thread George Pitcher
Hi,

I have been asked to look at extending one of my CMS systems to incorporate
integration to a library management system, as well as LDAP and Active
Directory. The requirement also asks for scanning and OCR of documents to be
controlled by the CMS.

Does anyone have any experience of implementing the scanning into a PHP
application?

MTIA

George

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



RE: [PHP] Controlling a scanner with PHP

2006-06-27 Thread Peter Lauri
Probably nobody, as PHP is a Server Side Scripting Language.

-Original Message-
From: George Pitcher [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 27, 2006 7:16 PM
To: php-general@lists.php.net
Subject: [PHP] Controlling a scanner with PHP

Hi,

I have been asked to look at extending one of my CMS systems to incorporate
integration to a library management system, as well as LDAP and Active
Directory. The requirement also asks for scanning and OCR of documents to be
controlled by the CMS.

Does anyone have any experience of implementing the scanning into a PHP
application?

MTIA

George

-- 
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] Controlling a scanner with PHP

2006-06-27 Thread Jay Blanchard
[snip]
I have been asked to look at extending one of my CMS systems to
incorporate
integration to a library management system, as well as LDAP and Active
Directory. The requirement also asks for scanning and OCR of documents
to be
controlled by the CMS.

Does anyone have any experience of implementing the scanning into a PHP
application?
[/snip]

Will the scanner be connected to a server running PHP?

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



RE: [PHP] Controlling a scanner with PHP

2006-06-27 Thread Peter Lauri
Maybe JavaScript can do it for you?

-Original Message-
From: George Pitcher [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 27, 2006 8:01 PM
To: Peter Lauri
Subject: RE: [PHP] Controlling a scanner with PHP

Peter,

I take it you have spoken to everyone on the list then?

I know that PHP is a server side language, but that doesn't mean that nobody
has been able to do what I need to do, just that they've used other non-php
tools.

George

> -Original Message-
> From: Peter Lauri [mailto:[EMAIL PROTECTED]
> Sent: 27 June 2006 8:56 am
> To: 'George Pitcher'; php-general@lists.php.net
> Subject: RE: [PHP] Controlling a scanner with PHP
>
>
> Probably nobody, as PHP is a Server Side Scripting Language.
>
> -Original Message-
> From: George Pitcher [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 27, 2006 7:16 PM
> To: php-general@lists.php.net
> Subject: [PHP] Controlling a scanner with PHP
>
> Hi,
>
> I have been asked to look at extending one of my CMS systems to
> incorporate
> integration to a library management system, as well as LDAP and Active
> Directory. The requirement also asks for scanning and OCR of
> documents to be
> controlled by the CMS.
>
> Does anyone have any experience of implementing the scanning into a PHP
> application?
>
> MTIA
>
> George
>
> --
> 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] FTP Problems

2006-06-27 Thread James Nunnerley
I'm trying to create some functionality which requires FTPing onto another
server, using the php functions.

Doing the following comes up with a successful login, but cannot display the
current directory; yet when I FTP directory from the server which is serving
the php pages, it works fine.

// set up basic connection
$conn_id = ftp_connect($ftp_server, 21);
ftp_pasv($conn_id, true);

// login with username and password
$login_result = ftp_login($conn_id, $username, $password);

// check connection
if ((!$conn_id) || (!$login_result)) {

echo "FTP connection has failed!";
echo "Attempted to connect to $ftp_server for user $username";
exit;

} else {

echo "Connected to $ftp_server, for user $username";

}

echo(ftp_pwd($conn_id).""); # Comes back with /

$buff = ftp_nlist($conn_id,"");

// close the FTP stream
ftp_close($conn_id); 

var_dump($buff); => comes back with bool(false)

exit;

Can anyone see what could be wrong?


Cheers

Nunners



Re: [PHP] Controlling a scanner with PHP

2006-06-27 Thread Stut

Peter Lauri wrote:

Probably nobody, as PHP is a Server Side Scripting Language.


If there's one thing I hate it's needless pigeonholing. PHP is not a 
"Server Side Scripting Language". It is a scripting language for sure, 
but is by no means limited to being used on a server never mind on a web 
server.


As to the OPs question, assuming you are aware that PHP cannot control 
anything on the client-side if used on a web server, and assuming you 
are talking about a Windows-based machine, you will probably find there 
are COM objects you can use to control scanners. From the PHP side check 
here: http://php.net/com. For the actual interface to scanners I suggest 
you Google.


Sounds like a fun project, enjoy.

-Stut

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



Re: [PHP] FTP Problems

2006-06-27 Thread nicolas figaro

I had many troubles with ftp_nlist since I discovered the "-a" option.

try this :

$buff = ftp_nlist($conn_id,"-a");


N F

James Nunnerley a écrit :

I'm trying to create some functionality which requires FTPing onto another
server, using the php functions.

Doing the following comes up with a successful login, but cannot display the
current directory; yet when I FTP directory from the server which is serving
the php pages, it works fine.

// set up basic connection
$conn_id = ftp_connect($ftp_server, 21);
ftp_pasv($conn_id, true);

// login with username and password
$login_result = ftp_login($conn_id, $username, $password);

// check connection
if ((!$conn_id) || (!$login_result)) {

echo "FTP connection has failed!";
echo "Attempted to connect to $ftp_server for user $username";
exit;

} else {

echo "Connected to $ftp_server, for user $username";

}

echo(ftp_pwd($conn_id).""); # Comes back with /

$buff = ftp_nlist($conn_id,"");

// close the FTP stream
ftp_close($conn_id); 


var_dump($buff); => comes back with bool(false)

exit;

Can anyone see what could be wrong?


Cheers

Nunners


  



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

Re: [PHP] Controlling a scanner with PHP

2006-06-27 Thread chris smith

On 6/27/06, George Pitcher <[EMAIL PROTECTED]> wrote:

Hi,

I have been asked to look at extending one of my CMS systems to incorporate
integration to a library management system, as well as LDAP and Active
Directory. The requirement also asks for scanning and OCR of documents to be
controlled by the CMS.

Does anyone have any experience of implementing the scanning into a PHP
application?


There *might* be something on the gtk side of things:

http://gtk.php.net/

I highly doubt it, but worth a look.

That's not going to help you do anything from a web server though,
php-gtk apps run from a desktop.

--
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] FTP Problems

2006-06-27 Thread James Nunnerley
Nope - unfortunately, no change, still the same problems, logging in but no
ftp_nlist or indeed ftp_rawlist

Cheers
Nunners

-Original Message-
From: nicolas figaro [mailto:[EMAIL PROTECTED] 
Sent: 27 June 2006 14:12
To: James Nunnerley
Cc: php-general@lists.php.net
Subject: Re: [PHP] FTP Problems

I had many troubles with ftp_nlist since I discovered the "-a" option.

try this :

$buff = ftp_nlist($conn_id,"-a");


N F

James Nunnerley a écrit :
> I'm trying to create some functionality which requires FTPing onto another
> server, using the php functions.
>
> Doing the following comes up with a successful login, but cannot display
the
> current directory; yet when I FTP directory from the server which is
serving
> the php pages, it works fine.
>
> // set up basic connection
> $conn_id = ftp_connect($ftp_server, 21);
> ftp_pasv($conn_id, true);
>
> // login with username and password
> $login_result = ftp_login($conn_id, $username, $password);
>
> // check connection
> if ((!$conn_id) || (!$login_result)) {
>
> echo "FTP connection has failed!";
> echo "Attempted to connect to $ftp_server for user $username";
> exit;
>
> } else {
>
> echo "Connected to $ftp_server, for user $username";
>
> }
>
> echo(ftp_pwd($conn_id).""); # Comes back with /
>
> $buff = ftp_nlist($conn_id,"");
>
> // close the FTP stream
> ftp_close($conn_id); 
>
> var_dump($buff); => comes back with bool(false)
>
> exit;
>
> Can anyone see what could be wrong?
>
>
> Cheers
>
> Nunners
>
>
>   

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



Re: [PHP] FTP Problems

2006-06-27 Thread chris smith

On 6/27/06, James Nunnerley <[EMAIL PROTECTED]> wrote:

I'm trying to create some functionality which requires FTPing onto another
server, using the php functions.

Doing the following comes up with a successful login, but cannot display the
current directory; yet when I FTP directory from the server which is serving
the php pages, it works fine.

// set up basic connection
$conn_id = ftp_connect($ftp_server, 21);
ftp_pasv($conn_id, true);

// login with username and password
$login_result = ftp_login($conn_id, $username, $password);

// check connection
if ((!$conn_id) || (!$login_result)) {

echo "FTP connection has failed!";
echo "Attempted to connect to $ftp_server for user $username";
exit;

} else {

echo "Connected to $ftp_server, for user $username";

}

echo(ftp_pwd($conn_id).""); # Comes back with /

$buff = ftp_nlist($conn_id,"");


ftp_nlist requires a directory name. A blank string is not a directory name.

http://au.php.net/ftp_nlist

--
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] FTP Problems

2006-06-27 Thread nicolas figaro

James Nunnerley a écrit :

Nope - unfortunately, no change, still the same problems, logging in but no
ftp_nlist or indeed ftp_rawlist

  

even with a pathname ?
ftp_nlist($conn_id, "-a /")

do you have any log on the server ?
( you can also sniff the network to watch what php sends).

NF

Cheers
Nunners
  



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

RE: [PHP] FTP Problems

2006-06-27 Thread James Nunnerley
Thanks for the reply Chris.

How would you suggest displaying the current "home" directory for the user?
I've tried / and indeed the "real" directory name on that particular server.

Funnily enough, I've also just tried a generic php/ftp script tool, and it
works on a third party server into the one I'm trying to connect to, but not
from the server I'm working on!

Is there anyway in which php needs configuring for certain connections?

-Original Message-
From: chris smith [mailto:[EMAIL PROTECTED] 
Sent: 27 June 2006 14:16
To: James Nunnerley
Cc: php-general@lists.php.net
Subject: Re: [PHP] FTP Problems

On 6/27/06, James Nunnerley <[EMAIL PROTECTED]> wrote:
> I'm trying to create some functionality which requires FTPing onto another
> server, using the php functions.
>
> Doing the following comes up with a successful login, but cannot display
the
> current directory; yet when I FTP directory from the server which is
serving
> the php pages, it works fine.
>
> // set up basic connection
> $conn_id = ftp_connect($ftp_server, 21);
> ftp_pasv($conn_id, true);
>
> // login with username and password
> $login_result = ftp_login($conn_id, $username, $password);
>
> // check connection
> if ((!$conn_id) || (!$login_result)) {
>
> echo "FTP connection has failed!";
> echo "Attempted to connect to $ftp_server for user $username";
> exit;
>
> } else {
>
> echo "Connected to $ftp_server, for user $username";
>
> }
>
> echo(ftp_pwd($conn_id).""); # Comes back with /
>
> $buff = ftp_nlist($conn_id,"");

ftp_nlist requires a directory name. A blank string is not a directory name.

http://au.php.net/ftp_nlist

-- 
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] FTP Problems

2006-06-27 Thread James Nunnerley
Just tried that, and still the same result - I think it's the server - going
to ask the server admin now!

-Original Message-
From: nicolas figaro [mailto:[EMAIL PROTECTED] 
Sent: 27 June 2006 14:19
To: PHP List
Subject: Re: [PHP] FTP Problems

James Nunnerley a écrit :
> Nope - unfortunately, no change, still the same problems, logging in but
no
> ftp_nlist or indeed ftp_rawlist
>
>   
even with a pathname ?
ftp_nlist($conn_id, "-a /")

do you have any log on the server ?
( you can also sniff the network to watch what php sends).

NF
> Cheers
> Nunners
>   

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



Re: [PHP] working on a template system...

2006-06-27 Thread Martin Marques

Why not try to use one of the template systems that already exist? 
HTML_Template_IT, Smarty, etc.

On Tue, 27 Jun 2006 10:22:42 +0300, sempsteen <[EMAIL PROTECTED]> wrote:
> hi, i'm working on a template system. Basically i'm building raw
> contents in arrays and then put them in templates by some special
> tags.
> 
> for loop systems my basic array structure is like this:
> $array['key'][]['keyword'] = ...
> 
> for example, for a bulletin board system, array structure for
> categories is something like this:
> $array['categories'][]['text_category_name'] = ...
> 
> it is looped through database recordset, so final array for 2 categories
> can be:
> $array['categories'][0]['text_category_name'] = 'programming'
> $array['categories'][1]['text_category_name'] = 'life'
> 
> template file structure for loops is something like this (ex, categories):
> 
> 
>[$text_category_name$]
> 
> 
> 
> i can easily loop this template and replace [$text_category_name] for
> every category set in the array. after removing the comment tags i get
> the final content:
> 
> 
>programming
> 
> 
>life
> 
> 
> But i'm stuck with nested loops. For example i want to put related
> forums after each categories.
> 
> array structure is:
> $array['categories'][0]['text_category_name'] = programming
> $array['categories'][0]['forums'][0]['text_forum_name'] = php
> $array['categories'][0]['forums'][1]['text_forum_name'] = ruby
> 
> $array['categories'][1]['text_category_name'] = life
> $array['categories'][1]['forums'][0]['text_forum_name'] = music
> $array['categories'][1]['forums'][1]['text_forum_name'] = sports
> 
> template structure is:
> 
> 
>[$text_category_name$]
> 
> 
> 
>[$text_forum_name$]
> 
> 
> 
> 
> i've written some functions, used them recursively but it didn't work.
> actually i couldn't find the true logic. note that it isn't a limited
> array. it can have messages under each forums, peoples under each
> messages, so on..
> 
> help me find the true approach to handle this. thank you.
> 
> 
-
Lic. Martín Marqués |   SELECT 'mmarques' || 
Centro de Telemática|   '@' || 'unl.edu.ar';
Universidad Nacional|   DBA, Programador, 
del Litoral |   Administrador
-

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



Re: [PHP] FTP Problems

2006-06-27 Thread Jochem Maas
James Nunnerley wrote:
> Thanks for the reply Chris.
> 
> How would you suggest displaying the current "home" directory for the user?
> I've tried / and indeed the "real" directory name on that particular server.

you could try '~/' (or maybe just'~') as the dir name which equates to the
'the current users homedir' when you in a shell - no idea whether that is even 
allowable
when going in via ftp but might be worth a shot though - given what you have
been saying in your thread one would hazard to guess that the ftp server your
working with is a little borked (but that a gut feeling).


> 
> Funnily enough, I've also just tried a generic php/ftp script tool, and it
> works on a third party server into the one I'm trying to connect to, but not
> from the server I'm working on!
> 
> Is there anyway in which php needs configuring for certain connections?
> 
> -Original Message-
> From: chris smith [mailto:[EMAIL PROTECTED] 
> Sent: 27 June 2006 14:16
> To: James Nunnerley
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] FTP Problems
> 
> On 6/27/06, James Nunnerley <[EMAIL PROTECTED]> wrote:
>> I'm trying to create some functionality which requires FTPing onto another
>> server, using the php functions.
>>
>> Doing the following comes up with a successful login, but cannot display
> the
>> current directory; yet when I FTP directory from the server which is
> serving
>> the php pages, it works fine.
>>
>> // set up basic connection
>> $conn_id = ftp_connect($ftp_server, 21);
>> ftp_pasv($conn_id, true);
>>
>> // login with username and password
>> $login_result = ftp_login($conn_id, $username, $password);
>>
>> // check connection
>> if ((!$conn_id) || (!$login_result)) {
>>
>> echo "FTP connection has failed!";
>> echo "Attempted to connect to $ftp_server for user $username";
>> exit;
>>
>> } else {
>>
>> echo "Connected to $ftp_server, for user $username";
>>
>> }
>>
>> echo(ftp_pwd($conn_id).""); # Comes back with /
>>
>> $buff = ftp_nlist($conn_id,"");
> 
> ftp_nlist requires a directory name. A blank string is not a directory name.
> 
> http://au.php.net/ftp_nlist
> 

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



Re: [PHP] Controlling a scanner with PHP

2006-06-27 Thread Miles Thompson


George,

You always have the interesting challenges served to you.

Is this at the client or the server end? Controlled through the browser? 
Only at the browser on the server?

I think there's a discussion about .com objects in the manual.

Have fun - Miles

At 09:16 AM 6/27/2006, George Pitcher wrote:


Hi,

I have been asked to look at extending one of my CMS systems to incorporate
integration to a library management system, as well as LDAP and Active
Directory. The requirement also asks for scanning and OCR of documents to be
controlled by the CMS.

Does anyone have any experience of implementing the scanning into a PHP
application?

MTIA

George

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



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.9.5/376 - Release Date: 6/26/2006

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



[PHP] modify xml before parse

2006-06-27 Thread weetat

Hi all,

  I need to read xml file before it was parsed by PHP DOM functions.
  The xml file have some encrypted value as shown below :



  Anybody have any suggestion how to do it ?

Thanks.

- weetat

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



RE: [PHP] FTP Problems

2006-06-27 Thread James Nunnerley
Thanks all - it would seem that php is failing to set the passive mode to
true - I can get around it temporarily, but need to find a more permanent
option.

Does anyone have any experience as to why setting ftp_pasv to true fails?

-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: 27 June 2006 14:29
To: James Nunnerley
Cc: 'chris smith'; php-general@lists.php.net
Subject: Re: [PHP] FTP Problems

James Nunnerley wrote:
> Thanks for the reply Chris.
> 
> How would you suggest displaying the current "home" directory for the
user?
> I've tried / and indeed the "real" directory name on that particular
server.

you could try '~/' (or maybe just'~') as the dir name which equates to the
'the current users homedir' when you in a shell - no idea whether that is
even allowable
when going in via ftp but might be worth a shot though - given what you have
been saying in your thread one would hazard to guess that the ftp server
your
working with is a little borked (but that a gut feeling).


> 
> Funnily enough, I've also just tried a generic php/ftp script tool, and it
> works on a third party server into the one I'm trying to connect to, but
not
> from the server I'm working on!
> 
> Is there anyway in which php needs configuring for certain connections?
> 
> -Original Message-
> From: chris smith [mailto:[EMAIL PROTECTED] 
> Sent: 27 June 2006 14:16
> To: James Nunnerley
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] FTP Problems
> 
> On 6/27/06, James Nunnerley <[EMAIL PROTECTED]> wrote:
>> I'm trying to create some functionality which requires FTPing onto
another
>> server, using the php functions.
>>
>> Doing the following comes up with a successful login, but cannot display
> the
>> current directory; yet when I FTP directory from the server which is
> serving
>> the php pages, it works fine.
>>
>> // set up basic connection
>> $conn_id = ftp_connect($ftp_server, 21);
>> ftp_pasv($conn_id, true);
>>
>> // login with username and password
>> $login_result = ftp_login($conn_id, $username, $password);
>>
>> // check connection
>> if ((!$conn_id) || (!$login_result)) {
>>
>> echo "FTP connection has failed!";
>> echo "Attempted to connect to $ftp_server for user $username";
>> exit;
>>
>> } else {
>>
>> echo "Connected to $ftp_server, for user $username";
>>
>> }
>>
>> echo(ftp_pwd($conn_id).""); # Comes back with /
>>
>> $buff = ftp_nlist($conn_id,"");
> 
> ftp_nlist requires a directory name. A blank string is not a directory
name.
> 
> http://au.php.net/ftp_nlist
> 

-- 
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] FTP Problems

2006-06-27 Thread James Nunnerley
Ah - whoops - just worked out why - you need to set the passive mode after
you login, not after a connect! Silly solution!

-Original Message-
From: James Nunnerley [mailto:[EMAIL PROTECTED] 
Sent: 27 June 2006 14:37
To: 'Jochem Maas'
Cc: 'chris smith'; php-general@lists.php.net
Subject: RE: [PHP] FTP Problems

Thanks all - it would seem that php is failing to set the passive mode to
true - I can get around it temporarily, but need to find a more permanent
option.

Does anyone have any experience as to why setting ftp_pasv to true fails?

-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: 27 June 2006 14:29
To: James Nunnerley
Cc: 'chris smith'; php-general@lists.php.net
Subject: Re: [PHP] FTP Problems

James Nunnerley wrote:
> Thanks for the reply Chris.
> 
> How would you suggest displaying the current "home" directory for the
user?
> I've tried / and indeed the "real" directory name on that particular
server.

you could try '~/' (or maybe just'~') as the dir name which equates to the
'the current users homedir' when you in a shell - no idea whether that is
even allowable
when going in via ftp but might be worth a shot though - given what you have
been saying in your thread one would hazard to guess that the ftp server
your
working with is a little borked (but that a gut feeling).


> 
> Funnily enough, I've also just tried a generic php/ftp script tool, and it
> works on a third party server into the one I'm trying to connect to, but
not
> from the server I'm working on!
> 
> Is there anyway in which php needs configuring for certain connections?
> 
> -Original Message-
> From: chris smith [mailto:[EMAIL PROTECTED] 
> Sent: 27 June 2006 14:16
> To: James Nunnerley
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] FTP Problems
> 
> On 6/27/06, James Nunnerley <[EMAIL PROTECTED]> wrote:
>> I'm trying to create some functionality which requires FTPing onto
another
>> server, using the php functions.
>>
>> Doing the following comes up with a successful login, but cannot display
> the
>> current directory; yet when I FTP directory from the server which is
> serving
>> the php pages, it works fine.
>>
>> // set up basic connection
>> $conn_id = ftp_connect($ftp_server, 21);
>> ftp_pasv($conn_id, true);
>>
>> // login with username and password
>> $login_result = ftp_login($conn_id, $username, $password);
>>
>> // check connection
>> if ((!$conn_id) || (!$login_result)) {
>>
>> echo "FTP connection has failed!";
>> echo "Attempted to connect to $ftp_server for user $username";
>> exit;
>>
>> } else {
>>
>> echo "Connected to $ftp_server, for user $username";
>>
>> }
>>
>> echo(ftp_pwd($conn_id).""); # Comes back with /
>>
>> $buff = ftp_nlist($conn_id,"");
> 
> ftp_nlist requires a directory name. A blank string is not a directory
name.
> 
> http://au.php.net/ftp_nlist
> 

-- 
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Controlling a scanner with PHP

2006-06-27 Thread Paul Scott
On Tue, 2006-06-27 at 10:31 -0300, Miles Thompson wrote:
> George,
> 
> You always have the interesting challenges served to you.
> 
> Is this at the client or the server end? Controlled through the browser? 
> Only at the browser on the server?
> I think there's a discussion about .com objects in the manual.
> 

I did a solution a few years back controlling barcode scanners with dio
PHP extension. You can also use a combo of text files and parsing from
stdin through something like minicom, but with image scanners that may
be a bit too tricky.

Sounds cool though, wish I had some time to play

--Paul

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



RE: [PHP] Controlling a scanner with PHP

2006-06-27 Thread Peter Lauri
Stut,

You are correct. PHP can be used in much more extent, but my tiny box where
I use PHP has never touched that area though :) I did truly enjoy the
continuing of the thread, because I learned that PHP is much more then a Web
Server Scripting Language :)

/Peter



-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 27, 2006 8:11 PM
To: Peter Lauri
Cc: 'George Pitcher'; php-general@lists.php.net
Subject: Re: [PHP] Controlling a scanner with PHP

Peter Lauri wrote:
> Probably nobody, as PHP is a Server Side Scripting Language.

If there's one thing I hate it's needless pigeonholing. PHP is not a 
"Server Side Scripting Language". It is a scripting language for sure, 
but is by no means limited to being used on a server never mind on a web 
server.

As to the OPs question, assuming you are aware that PHP cannot control 
anything on the client-side if used on a web server, and assuming you 
are talking about a Windows-based machine, you will probably find there 
are COM objects you can use to control scanners. From the PHP side check 
here: http://php.net/com. For the actual interface to scanners I suggest 
you Google.

Sounds like a fun project, enjoy.

-Stut

-- 
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] FTP Problems

2006-06-27 Thread Jochem Maas
James Nunnerley wrote:
> Ah - whoops - just worked out why - you need to set the passive mode after
> you login, not after a connect! Silly solution!

sharing the fix was anything but silly - :-)

> 
> -Original Message-
> From: James Nunnerley [mailto:[EMAIL PROTECTED] 
> Sent: 27 June 2006 14:37
> To: 'Jochem Maas'
> Cc: 'chris smith'; php-general@lists.php.net
> Subject: RE: [PHP] FTP Problems
> 
> Thanks all - it would seem that php is failing to set the passive mode to
> true - I can get around it temporarily, but need to find a more permanent
> option.
> 
> Does anyone have any experience as to why setting ftp_pasv to true fails?
> 

...

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



RE: [PHP] Controlling a scanner with PHP

2006-06-27 Thread Arno Kuhl
-Original Message-
From: Stut [mailto:[EMAIL PROTECTED]
Sent: 27 June 2006 03:11
To: Peter Lauri
Cc: 'George Pitcher'; php-general@lists.php.net
Subject: Re: [PHP] Controlling a scanner with PHP


Peter Lauri wrote:
> Probably nobody, as PHP is a Server Side Scripting Language.

If there's one thing I hate it's needless pigeonholing. PHP is not a
"Server Side Scripting Language". It is a scripting language for sure,
but is by no means limited to being used on a server never mind on a web
server.


-Stut
-


Stut, that's an interesting point you raised. I know it's moving off the
original topic, but when you say "by no means limited to being used on a
server never mind on a web server", what is it that interprets the code and
where does the output go to, or the input come from? I also thought it
always had to be run under a web server, and would be interested to know
what the other options/opportunities are.

Cheers
Arno

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



Re: [PHP] Controlling a scanner with PHP

2006-06-27 Thread Brad Bonkoski



Arno Kuhl wrote:


-Original Message-
From: Stut [mailto:[EMAIL PROTECTED]
Sent: 27 June 2006 03:11
To: Peter Lauri
Cc: 'George Pitcher'; php-general@lists.php.net
Subject: Re: [PHP] Controlling a scanner with PHP


Peter Lauri wrote:
 


Probably nobody, as PHP is a Server Side Scripting Language.
   



If there's one thing I hate it's needless pigeonholing. PHP is not a
"Server Side Scripting Language". It is a scripting language for sure,
but is by no means limited to being used on a server never mind on a web
server.


-Stut
-


Stut, that's an interesting point you raised. I know it's moving off the
original topic, but when you say "by no means limited to being used on a
server never mind on a web server", what is it that interprets the code and
where does the output go to, or the input come from? I also thought it
always had to be run under a web server, and would be interested to know
what the other options/opportunities are.

Cheers
Arno

 

On example of a none web-server based application is kind of as a perl 
(or insert other scripting language here) substitute
i.e. it can run from the command line as a cron job for instance to spit 
out reports based on database data, and then stream it into an XML 
document to send *data feeds*


There are also some plug-ins or one-offs that use PHP to create VB-like 
applications that run on end user desktops..

http://winbinder.org/index.php

Just a few of many examples I suppose.
-brad

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



RE: [PHP] Controlling a scanner with PHP

2006-06-27 Thread Chris Boget
> I also thought it always had to be run under a web server, 
> and would be interested to know what the other options/
> opportunities are.

You can run it from the command line.  See

http://us3.php.net/manual/en/features.commandline.php

thnx,
Chris

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



Re: [PHP] Controlling a scanner with PHP

2006-06-27 Thread Stut

Arno Kuhl wrote:

Stut, that's an interesting point you raised. I know it's moving off the
original topic, but when you say "by no means limited to being used on a
server never mind on a web server", what is it that interprets the code and
where does the output go to, or the input come from? I also thought it
always had to be run under a web server, and would be interested to know
what the other options/opportunities are.
  


You can run it from the command line 
(http://php.net/manual/en/features.commandline.php). I use it all the 
time for everything from cron'd admin scripts to mail processing 
systems. PHP is an extremely powerful language in any environment.


As for where the output goes and where input comes from it's up to you. 
Anything you print/echo/output in any way from a CLI script will be 
displayed on the screen, but this can be redirected if needed. Input can 
come interactively from the user (http://php.net/readline), from a file 
or from a number of other sources. When you're thinking about PHP as a 
general programming language it's no different from any other language 
in terms of how it deals with input and output.


As somebody else has already mentioned, GUI functionality can come from 
GTK (http://gtk.php.net/) or you can do a certain amount with the 
win32std PECL extension (http://pecl.php.net/package/win32std).


Hope that encourages you to consider PHP for use outside the web 
environment.


-Stut

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



RE: [PHP] Controlling a scanner with PHP

2006-06-27 Thread Miles Thompson

At 11:33 AM 6/27/2006, Arno Kuhl wrote:


-Original Message-
From: Stut [mailto:[EMAIL PROTECTED]
Sent: 27 June 2006 03:11
To: Peter Lauri
Cc: 'George Pitcher'; php-general@lists.php.net
Subject: Re: [PHP] Controlling a scanner with PHP


Peter Lauri wrote:
> Probably nobody, as PHP is a Server Side Scripting Language.

If there's one thing I hate it's needless pigeonholing. PHP is not a
"Server Side Scripting Language". It is a scripting language for sure,
but is by no means limited to being used on a server never mind on a web
server.


-Stut
-


Stut, that's an interesting point you raised. I know it's moving off the
original topic, but when you say "by no means limited to being used on a
server never mind on a web server", what is it that interprets the code and
where does the output go to, or the input come from? I also thought it
always had to be run under a web server, and would be interested to know
what the other options/opportunities are.

Cheers
Arno


Arno,

You can do the cron job thing and call it from the command line.

You can also write GUI apps using PHP-GTK+. It's sort of in transition now 
between version 1 and version 2.


Did this for a client as there was some database work we wanted to do on 
the local machine, fetching information from time to time from the database 
on the web. Works quite well and is saving them a lot of time.


By now we're way OT on the scanner question. 

Cheers - Miles Thompson




--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.9.5/376 - Release Date: 6/26/2006

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



Re: [PHP] Preventing double-clicks APPEARS TO WORK FINE

2006-06-27 Thread John Meyer

Jay Blanchard wrote:

[snip]
JavaScript can't be used for such things, or at least it can't be relied

upon. What if the user has disabled JavaScript? Or what if the user has 
specifically disabled the JavaScript behaviour you are relying on?

[/snip]

Egg Zachary. That was why I wanted a PHP method. Since the SESSION data
is set for the activation receipt I do not have to query the database
again, save for the initial query to check and see if the data exists.



You're still doing two round-trips to the server, which seems very 
inefficent to regulate user behavior.


--
Online library -- http://pueblonative.110mb.com
138 books and counting.

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



RE: [PHP] Controlling a scanner with PHP

2006-06-27 Thread Jay Blanchard
[snip]
You can do the cron job thing and call it from the command line.
[/snip]

You can also execute a 'command line' php script from other applications
as well. Even though 'command line' PHP scripting has some additional
features we used to run PHP scripts from the command line before the
'command line' version came out.

YMMV

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



[PHP] Re: modify xml before parse

2006-06-27 Thread Adam Zey

weetat wrote:

Hi all,

  I need to read xml file before it was parsed by PHP DOM functions.
  The xml file have some encrypted value as shown below :



  Anybody have any suggestion how to do it ?

Thanks.

- weetat


$xmlfile = file_get_contents("http://urloffile.com/filename.xml";);

I mean, that is what you asked, how to read the xml file...

Regards, Adam Zey.

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



[PHP] how can I decode such a string ?

2006-06-27 Thread nicolas figaro

Hi,

I'd like to convert a string generated by a mail client like the 
following one : 
"test nf =?ISO-8859-15?Q?=E9_123456789012?="


back to the original one
"test nf é 123456789012".

Is there a (simple) way to do this ?

thanks

N F


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

[PHP] Re: PHP 5, Windows, and MySQL

2006-06-27 Thread Jeremy Schreckhise
 I ran into the same problems; here is how I solved them.

1.  Install MySQL 5
2.  Install PHP 5
3.  Modify php.ini extensions directive to point to php_mysql.dll (the
one that was packaged with php 5)
4.  Here is the tricky one make sure mysql is finding the libmysql.dll
packaged WITH MYSQL NOT PHP; 
5.  net stop mysql
6.  net start mysql
7.  work hard; play hard


-Original Message-
From: João Cândido de Souza Neto [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 26, 2006 8:13 PM
To: php-general@lists.php.net
Subject: [PHP] Re: PHP 5, Windows, and MySQL

I've got it running fine on my windows.

Mysql 5.0.19
PHP 5.1.4

I just activate php_mysql.dll and php_mysqli.dll.

Which versions of php and mysql are you using?

""Beauford"" <[EMAIL PROTECTED]> escreveu na mensagem
news:!&!AAAYAFzLTDhDwWBHpzgX5w1qDiPigAAAEJiz/MDHLf9Fmsyy
[EMAIL PROTECTED]
> Aside from my previous gd problems, here's another problem. It appears 
> that
> PHP5 (for Windows anyways) does not support MySQL (which in itself is 
> riduculous), but here's my problem. I have a script I just downloaded 
> that works perfectly on Linux/Apche/MySQL/PHP5, but when I run it on 
> Windows 2000 with PHP 4.4 I get a page full of errors. Lets forget 
> about the errors, does anyone have any idea how to get PHP5 and MySQL 
> to work on Windows. I have already tried 100 different variations of 
> things from information I found searching out this problem, but maybe 
> someone has a new idea.
>
> If it were me I'd just run this site on Linux, but this is for a 
> friend who wants to use IIS. If your curious the errors are below.
>
> Thanks
>
> B
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php 
> on line 207
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php 
> on line 218
>
> Warning: session_start(): Cannot send session cookie - headers already 
> sent by (output started at
> G:\Websites\Webtest\caalogin\include\database.php:207)
> in G:\Websites\Webtest\caalogin\include\session.php on line 46
>
> Warning: session_start(): Cannot send session cache limiter - headers 
> already sent (output started at
> G:\Websites\Webtest\caalogin\include\database.php:207) in 
> G:\Websites\Webtest\caalogin\include\session.php on line 46
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php 
> on line 218
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php 
> on line 207
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php 
> on line 218

--
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] Re: A variable inside a variable?

2006-06-27 Thread Jeremy Schreckhise
 
I ran into the same problems; here is how I solved them.

1.  Install MySQL 5
2.  Install PHP 5
3.  Modify php.ini extensions directive to point to php_mysql.dll (the
one that was packaged with php 5)
4.  Here is the tricky one make sure mysql is finding the libmysql.dll
packaged WITH MYSQL NOT PHP; 
5.  net stop mysql
6.  net start mysql
7.  work hard; play hard

-Original Message-
From: João Cândido de Souza Neto [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 26, 2006 4:13 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Re: A variable inside a variable?

Please excuse-me.

That $ was putted by mistake.

I´sorry...

<[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
> You were on the right track, but this isn't going to work.. for a 
> couple
> reasons:
>
> $var = 1; # this is fine
> $var2 = "$var";  # $var2 == 1 at this point echo $$var2; # you're 
> going to echo $1
>
> Putting $var in double quotes makes PHP evaluate it before assigning 
> it to $var2, so you won't get $var but the value of $var (1).
>
> If you did use single quotes, you'd get this:
>
> $var = 1; # this is fine
> $var2 = '$var';  # $var2 == '$var' (literal) echo $$var2; # you're 
> going to echo $$var
>
> It seems like you might get $var2 evaluate to $var..  then with $$var 
> have it evaluate to 1, but doesn't look like PHP digs that deeply.  
> When I ran it, I got NULL back.
>
> This might be what you were aiming for:
>
> $var = 1; # this is fine
> $var2 = 'var';  # remove the $..  then you can use single or double 
> quotes echo $$var2; # $var == var,  $var == 1, this should output 
> correctly
>
> Good lesson in 'gotchas' though.
>
> -TG
>
> = = = Original message = = =
>
> $var=1;
> $var2="$var";
> echo $$var2;
>
> It~ll echo the $var~s value.
>
> Hope it~ll help you.
>
>
> ___
> Sent by ePrompter, the premier email notification software.
> Free download at http://www.ePrompter.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] Re: PHP 5, Windows, and MySQL

2006-06-27 Thread Jeremy Schreckhise
Here is the direct download portal for the two corrected crucial .dlls.


 http://dev.mysql.com/downloads/connector/php/

-Original Message-
From: Jeremy Schreckhise [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 27, 2006 10:14 AM
To: php-general@lists.php.net
Subject: [PHP] Re: PHP 5, Windows, and MySQL

 I ran into the same problems; here is how I solved them.

1.  Install MySQL 5
2.  Install PHP 5
3.  Modify php.ini extensions directive to point to php_mysql.dll (the
one that was packaged with php 5)
4.  Here is the tricky one make sure mysql is finding the libmysql.dll
packaged WITH MYSQL NOT PHP; 
5.  net stop mysql
6.  net start mysql
7.  work hard; play hard


-Original Message-
From: João Cândido de Souza Neto [mailto:[EMAIL PROTECTED]
Sent: Monday, June 26, 2006 8:13 PM
To: php-general@lists.php.net
Subject: [PHP] Re: PHP 5, Windows, and MySQL

I've got it running fine on my windows.

Mysql 5.0.19
PHP 5.1.4

I just activate php_mysql.dll and php_mysqli.dll.

Which versions of php and mysql are you using?

""Beauford"" <[EMAIL PROTECTED]> escreveu na mensagem
news:!&!AAAYAFzLTDhDwWBHpzgX5w1qDiPigAAAEJiz/MDHLf9Fmsyy
[EMAIL PROTECTED]
> Aside from my previous gd problems, here's another problem. It appears 
> that
> PHP5 (for Windows anyways) does not support MySQL (which in itself is 
> riduculous), but here's my problem. I have a script I just downloaded 
> that works perfectly on Linux/Apche/MySQL/PHP5, but when I run it on 
> Windows 2000 with PHP 4.4 I get a page full of errors. Lets forget 
> about the errors, does anyone have any idea how to get PHP5 and MySQL 
> to work on Windows. I have already tried 100 different variations of 
> things from information I found searching out this problem, but maybe 
> someone has a new idea.
>
> If it were me I'd just run this site on Linux, but this is for a 
> friend who wants to use IIS. If your curious the errors are below.
>
> Thanks
>
> B
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 207
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 218
>
> Warning: session_start(): Cannot send session cookie - headers already 
> sent by (output started at
> G:\Websites\Webtest\caalogin\include\database.php:207)
> in G:\Websites\Webtest\caalogin\include\session.php on line 46
>
> Warning: session_start(): Cannot send session cache limiter - headers 
> already sent (output started at
> G:\Websites\Webtest\caalogin\include\database.php:207) in 
> G:\Websites\Webtest\caalogin\include\session.php on line 46
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 218
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 207
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 218

--
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: how can I decode such a string ?

2006-06-27 Thread Al

nicolas figaro wrote:

Hi,

I'd like to convert a string generated by a mail client like the 
following one : "test nf =?ISO-8859-15?Q?=E9_123456789012?="


back to the original one
"test nf é 123456789012".

Is there a (simple) way to do this ?

thanks

N F




Yes, with a regex expression

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



[PHP] php 4.4.2 spec

2006-06-27 Thread Paul Aviles

Does anyone have a 4.4.2 spec file that works for creating an rpm?

Regards

-pa

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



RE: [PHP] Re: PHP 5, Windows, and MySQL

2006-06-27 Thread Beauford
Done all this, I spent another two hours last night and have gone back to
PHP 4.4 which works perfect. I have followed every article I could find to
the 'T' and it just refuses to work. I have version 4.1.15 of MySQL. I'm
afraid to upgrade that as who know what mess it will cause. 

libmysql.dll is in /winnt, /system, /sytem32, /php and php is in my path. If
it can't find it it ain't looking hard enough.

I'll just keep it the way it is for now - can't afford anymore time on it.

Thanks

-Original Message-
From: Jeremy Schreckhise [mailto:[EMAIL PROTECTED] 
Sent: June 27, 2006 11:14 AM
To: php-general@lists.php.net
Subject: [PHP] Re: PHP 5, Windows, and MySQL

 I ran into the same problems; here is how I solved them.

1.  Install MySQL 5
2.  Install PHP 5
3.  Modify php.ini extensions directive to point to php_mysql.dll (the
one that was packaged with php 5)
4.  Here is the tricky one make sure mysql is finding the libmysql.dll
packaged WITH MYSQL NOT PHP; 
5.  net stop mysql
6.  net start mysql
7.  work hard; play hard


-Original Message-
From: João Cândido de Souza Neto [mailto:[EMAIL PROTECTED]
Sent: Monday, June 26, 2006 8:13 PM
To: php-general@lists.php.net
Subject: [PHP] Re: PHP 5, Windows, and MySQL

I've got it running fine on my windows.

Mysql 5.0.19
PHP 5.1.4

I just activate php_mysql.dll and php_mysqli.dll.

Which versions of php and mysql are you using?

""Beauford"" <[EMAIL PROTECTED]> escreveu na mensagem
news:!&!AAAYAFzLTDhDwWBHpzgX5w1qDiPigAAAEJiz/MDHLf9Fmsyy
[EMAIL PROTECTED]
> Aside from my previous gd problems, here's another problem. It appears 
> that
> PHP5 (for Windows anyways) does not support MySQL (which in itself is 
> riduculous), but here's my problem. I have a script I just downloaded 
> that works perfectly on Linux/Apche/MySQL/PHP5, but when I run it on 
> Windows 2000 with PHP 4.4 I get a page full of errors. Lets forget 
> about the errors, does anyone have any idea how to get PHP5 and MySQL 
> to work on Windows. I have already tried 100 different variations of 
> things from information I found searching out this problem, but maybe 
> someone has a new idea.
>
> If it were me I'd just run this site on Linux, but this is for a 
> friend who wants to use IIS. If your curious the errors are below.
>
> Thanks
>
> B
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 207
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 218
>
> Warning: session_start(): Cannot send session cookie - headers already 
> sent by (output started at
> G:\Websites\Webtest\caalogin\include\database.php:207)
> in G:\Websites\Webtest\caalogin\include\session.php on line 46
>
> Warning: session_start(): Cannot send session cache limiter - headers 
> already sent (output started at
> G:\Websites\Webtest\caalogin\include\database.php:207) in 
> G:\Websites\Webtest\caalogin\include\session.php on line 46
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 218
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 207
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 218

--
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: PHP 5, Windows, and MySQL

2006-06-27 Thread Jeremy Schreckhise
But is libmysql.dll the dll from mysql; the one packaged with php 5 will not
work.

Jeremy Schreckhise, M.B.A 

-Original Message-
From: Beauford [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 27, 2006 10:33 AM
To: php-general@lists.php.net
Subject: RE: [PHP] Re: PHP 5, Windows, and MySQL

Done all this, I spent another two hours last night and have gone back to
PHP 4.4 which works perfect. I have followed every article I could find to
the 'T' and it just refuses to work. I have version 4.1.15 of MySQL. I'm
afraid to upgrade that as who know what mess it will cause. 

libmysql.dll is in /winnt, /system, /sytem32, /php and php is in my path. If
it can't find it it ain't looking hard enough.

I'll just keep it the way it is for now - can't afford anymore time on it.

Thanks

-Original Message-
From: Jeremy Schreckhise [mailto:[EMAIL PROTECTED]
Sent: June 27, 2006 11:14 AM
To: php-general@lists.php.net
Subject: [PHP] Re: PHP 5, Windows, and MySQL

 I ran into the same problems; here is how I solved them.

1.  Install MySQL 5
2.  Install PHP 5
3.  Modify php.ini extensions directive to point to php_mysql.dll (the
one that was packaged with php 5)
4.  Here is the tricky one make sure mysql is finding the libmysql.dll
packaged WITH MYSQL NOT PHP; 
5.  net stop mysql
6.  net start mysql
7.  work hard; play hard


-Original Message-
From: João Cândido de Souza Neto [mailto:[EMAIL PROTECTED]
Sent: Monday, June 26, 2006 8:13 PM
To: php-general@lists.php.net
Subject: [PHP] Re: PHP 5, Windows, and MySQL

I've got it running fine on my windows.

Mysql 5.0.19
PHP 5.1.4

I just activate php_mysql.dll and php_mysqli.dll.

Which versions of php and mysql are you using?

""Beauford"" <[EMAIL PROTECTED]> escreveu na mensagem
news:!&!AAAYAFzLTDhDwWBHpzgX5w1qDiPigAAAEJiz/MDHLf9Fmsyy
[EMAIL PROTECTED]
> Aside from my previous gd problems, here's another problem. It appears 
> that
> PHP5 (for Windows anyways) does not support MySQL (which in itself is 
> riduculous), but here's my problem. I have a script I just downloaded 
> that works perfectly on Linux/Apche/MySQL/PHP5, but when I run it on 
> Windows 2000 with PHP 4.4 I get a page full of errors. Lets forget 
> about the errors, does anyone have any idea how to get PHP5 and MySQL 
> to work on Windows. I have already tried 100 different variations of 
> things from information I found searching out this problem, but maybe 
> someone has a new idea.
>
> If it were me I'd just run this site on Linux, but this is for a 
> friend who wants to use IIS. If your curious the errors are below.
>
> Thanks
>
> B
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 207
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 218
>
> Warning: session_start(): Cannot send session cookie - headers already 
> sent by (output started at
> G:\Websites\Webtest\caalogin\include\database.php:207)
> in G:\Websites\Webtest\caalogin\include\session.php on line 46
>
> Warning: session_start(): Cannot send session cache limiter - headers 
> already sent (output started at
> G:\Websites\Webtest\caalogin\include\database.php:207) in 
> G:\Websites\Webtest\caalogin\include\session.php on line 46
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 218
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 207
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 218

--
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 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] PHP LDAP - Single Sign On

2006-06-27 Thread Adrian Bruce

Hi all

Sorry if this has been asked before but i am currently drawing a blank 
STW etc.. is there any way of retrieving the user name of a user 
(through the browser) that has logged on to a network (windows OS).  I 
have used php with LDAP before and made the user log into the website, 
however i would really like to have a Single Sign On (SSO) environment.  
Is this possible? PHP is my preferred language but if you know of any 
way of doing this i would be greatful.


TIA

Ade

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



RE: [PHP] PHP LDAP - Single Sign On

2006-06-27 Thread Jay Blanchard
[snip]
Sorry if this has been asked before but i am currently drawing a blank 
STW etc.. is there any way of retrieving the user name of a user 
(through the browser) that has logged on to a network (windows OS).  I 
have used php with LDAP before and made the user log into the website, 
however i would really like to have a Single Sign On (SSO) environment.

Is this possible? PHP is my preferred language but if you know of any 
way of doing this i would be greatful.
[/snip]

http://www.pocket.com/ldap
http://httpd.apache.org/docs/2.0/mod/mod_auth_ldap.html

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



[PHP] Re: how can I decode such a string ?

2006-06-27 Thread M. Sokolewicz

Al wrote:

nicolas figaro wrote:


Hi,

I'd like to convert a string generated by a mail client like the 
following one : "test nf =?ISO-8859-15?Q?=E9_123456789012?="


back to the original one
"test nf é 123456789012".

Is there a (simple) way to do this ?

thanks

N F




Yes, with a regex expression

excuse me? How would one do that? please explain... (really interested now).

As to answer the question; your string is in a so-called 
'quoted-printable' format. (usually used in emails, among others). In 
PHP there are a couple of functions you could use to decode this back to 
an ISO-8859-15 string (as per your example), please have a look at 
http://www.php.net/quoted_printable_decode for more info


- tul

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



RE: [PHP] PHP 5, Windows, and MySQL

2006-06-27 Thread Beauford
I have done everything that everyone has suggested here, and 1000 other
variations that I have found along the way. So if I'm doing something wrong
- please let me know, 'cause I don't see it.

MySQL 4.1 has been working great for 4 years and PHP4.4 gives me no
problems. Anything 5 and above won't work. Windows is 2000 SP4. PHP is
installed as an ISAPI module. 

;cgi.force_redirect = 1

libmysql.dll is in /winnt, /system, /sytem32, /php and php is in my path. If
it can't find it it ain't looking hard enough. I've also tried many
variations of this.

The error below is similar to what I got. I was also getting memory errors,
but don't have that one to post.

Results:
Warning: PHP Startup: Unable to load dynamic library
'c:/php/ext/php_mysql.dll' - The specified procedure could not be found. in
Unknown on line 0
Content-type: text/html X-Powered-By: PHP/5.0.0 
php running
Fatal error: Call to undefined function mysql_connect() in
c:\Inetpub\wwwroot\CAFGPHP\test.php on line 4
PHP Warning: PHP Startup: Unable to load dynamic library
'c:/php/ext/php_mysql.dll' - The specified procedure could not be found. in
Unknown on line 0 

Thanks

-Original Message-
From: Janet Valade [mailto:[EMAIL PROTECTED] 
Sent: June 26, 2006 7:43 PM
To: Beauford
Subject: Re: [PHP] PHP 5, Windows, and MySQL

Well, I don't know what you mean by a known issue. All your message says is
that PHP 5 does not support MySQL. Yes, it does. It has no problem. I have
installed it and used it a million times. So, you are doing something wrong.

Did you test PHP 5 by itself, to make sure that it works without accessing
MySQL? Did you test MySQL by itself, to be sure the server is running
correctly when it is accessed outside of PHP 5.

Did you install MysQL using its installer? That's the best way. What version
of MySQL? What Windows?

Did you turn cgi.force_redirect off in the php.ini file? You have to do that
if you are using IIS.

What error do you get?

Janet


Beauford wrote:

>>From what I have been reading this is a known issue with PHP5. There 
>>is
> something in the php_mysql.dll which is not compatible. 
> 
> I wasted 3 hours today trying all the tips and tricks I could find, 
> but the bottom line is that it won't work.
> 
> This was my reason for posting to this group to see if anyone has any
ideas.
> 
> Here is one of the many links I was looking at to try and solve this. 
> http://codewalkers.com/forum/index.php?action=displaythread&forum=php
> elp&id
> =370&realm=default
> 
> Thanks
> 
> -Original Message-
> From: Janet Valade [mailto:[EMAIL PROTECTED]
> Sent: June 26, 2006 4:08 PM
> To: Beauford
> Subject: Re: [PHP] PHP 5, Windows, and MySQL
> 
> Activating MySQL in PHP 5 is pretty simple. Open the php.ini file and 
> uncomment the line for the extension that you want to 
> use--php_mysql.dll or php_mysqli.dll. Restart the web server.
> 
> Using the mysql functions is described in the php documentation. 
> http://us3.php.net/manual/en/ref.mysql.php or 
> http://us3.php.net/manual/en/ref.mysqli.php
> 
> Janet
> 
> Beauford wrote:
> 
> 
>>Aside from my previous gd problems, here's another problem. It appears 
>>that
>>PHP5 (for Windows anyways) does not support MySQL (which in itself is 
>>riduculous), but here's my problem. I have a script I just downloaded 
>>that works perfectly on Linux/Apche/MySQL/PHP5, but when I run it on 
>>Windows 2000 with PHP 4.4 I get a page full of errors. Lets forget 
>>about the errors, does anyone have any idea how to get PHP5 and MySQL 
>>to work on Windows. I have already tried 100 different variations of 
>>things from information I found searching out this problem, but maybe
> 
> someone has a new idea.
> 
>>If it were me I'd just run this site on Linux, but this is for a 
>>friend who wants to use IIS. If your curious the errors are below.
>>
>>Thanks
>>
>>B
>>
>>Warning: mysql_numrows(): supplied argument is not a valid MySQL 
>>result resource in G:\Websites\Webtest\caalogin\include\database.php
>>on line 207
>>
>>Warning: mysql_numrows(): supplied argument is not a valid MySQL 
>>result resource in G:\Websites\Webtest\caalogin\include\database.php
>>on line 218
>>
>>Warning: session_start(): Cannot send session cookie - headers already 
>>sent by (output started at
>>G:\Websites\Webtest\caalogin\include\database.php:207)
>>in G:\Websites\Webtest\caalogin\include\session.php on line 46
>>
>>Warning: session_start(): Cannot send session cache limiter - headers 
>>already sent (output started at
>>G:\Websites\Webtest\caalogin\include\database.php:207) in 
>>G:\Websites\Webtest\caalogin\include\session.php on line 46
>>
>>Warning: mysql_numrows(): supplied argument is not a valid MySQL 
>>result resource in G:\Websites\Webtest\caalogin\include\database.php
>>on line 218
>>
>>Warning: mysql_numrows(): supplied argument is not a valid MySQL 
>>result resource in G:\Websites\Webtest\caalogin\include\database.php
>>on line 207
>>
>>Warning: mysql_numrows(): supplied argument is not a 

[PHP] Ereg problem

2006-06-27 Thread Beauford
One more in my recent woes. The last elseif does not work in the code below
- even if the string is correct it always says it's incorrect. Even if I
remove everything else and just have the ereg satement is doesn't work
either.

The code below is in a function and $_POST['password1'] is passed to the
function. 

  $field = "password1";  //Use field name for password

  if(!$subpass){
 $form->setError($field, " Password not entered");
  }
elseif(strlen($subpass) < 6) {
$form->setError($field, " Too Short");
}
elseif(strlen($subpass) > 10) {
$form->setError($field, " Too Long");
}
  elseif(!ereg('[^A-Za-z0-9]', trim($subpass))) {
$form->setError($field, " Not alphanumeric"); 
}

Thanks

B

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



RE: [PHP] Re: PHP 5, Windows, and MySQL

2006-06-27 Thread Beauford
Neither one will work.

-Original Message-
From: Jeremy Schreckhise [mailto:[EMAIL PROTECTED] 
Sent: June 27, 2006 11:37 AM
To: 'Beauford'; php-general@lists.php.net
Subject: RE: [PHP] Re: PHP 5, Windows, and MySQL

But is libmysql.dll the dll from mysql; the one packaged with php 5 will not
work.

Jeremy Schreckhise, M.B.A 

-Original Message-
From: Beauford [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 27, 2006 10:33 AM
To: php-general@lists.php.net
Subject: RE: [PHP] Re: PHP 5, Windows, and MySQL

Done all this, I spent another two hours last night and have gone back to
PHP 4.4 which works perfect. I have followed every article I could find to
the 'T' and it just refuses to work. I have version 4.1.15 of MySQL. I'm
afraid to upgrade that as who know what mess it will cause. 

libmysql.dll is in /winnt, /system, /sytem32, /php and php is in my path. If
it can't find it it ain't looking hard enough.

I'll just keep it the way it is for now - can't afford anymore time on it.

Thanks

-Original Message-
From: Jeremy Schreckhise [mailto:[EMAIL PROTECTED]
Sent: June 27, 2006 11:14 AM
To: php-general@lists.php.net
Subject: [PHP] Re: PHP 5, Windows, and MySQL

 I ran into the same problems; here is how I solved them.

1.  Install MySQL 5
2.  Install PHP 5
3.  Modify php.ini extensions directive to point to php_mysql.dll (the
one that was packaged with php 5)
4.  Here is the tricky one make sure mysql is finding the libmysql.dll
packaged WITH MYSQL NOT PHP; 
5.  net stop mysql
6.  net start mysql
7.  work hard; play hard


-Original Message-
From: João Cândido de Souza Neto [mailto:[EMAIL PROTECTED]
Sent: Monday, June 26, 2006 8:13 PM
To: php-general@lists.php.net
Subject: [PHP] Re: PHP 5, Windows, and MySQL

I've got it running fine on my windows.

Mysql 5.0.19
PHP 5.1.4

I just activate php_mysql.dll and php_mysqli.dll.

Which versions of php and mysql are you using?

""Beauford"" <[EMAIL PROTECTED]> escreveu na mensagem
news:!&!AAAYAFzLTDhDwWBHpzgX5w1qDiPigAAAEJiz/MDHLf9Fmsyy
[EMAIL PROTECTED]
> Aside from my previous gd problems, here's another problem. It appears 
> that
> PHP5 (for Windows anyways) does not support MySQL (which in itself is 
> riduculous), but here's my problem. I have a script I just downloaded 
> that works perfectly on Linux/Apche/MySQL/PHP5, but when I run it on 
> Windows 2000 with PHP 4.4 I get a page full of errors. Lets forget 
> about the errors, does anyone have any idea how to get PHP5 and MySQL 
> to work on Windows. I have already tried 100 different variations of 
> things from information I found searching out this problem, but maybe 
> someone has a new idea.
>
> If it were me I'd just run this site on Linux, but this is for a 
> friend who wants to use IIS. If your curious the errors are below.
>
> Thanks
>
> B
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 207
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 218
>
> Warning: session_start(): Cannot send session cookie - headers already 
> sent by (output started at
> G:\Websites\Webtest\caalogin\include\database.php:207)
> in G:\Websites\Webtest\caalogin\include\session.php on line 46
>
> Warning: session_start(): Cannot send session cache limiter - headers 
> already sent (output started at
> G:\Websites\Webtest\caalogin\include\database.php:207) in 
> G:\Websites\Webtest\caalogin\include\session.php on line 46
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 218
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 207
>
> Warning: mysql_numrows(): supplied argument is not a valid MySQL 
> result resource in G:\Websites\Webtest\caalogin\include\database.php
> on line 218

--
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 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: how can I decode such a string ?

2006-06-27 Thread Al

nicolas figaro wrote:

Hi,

I'd like to convert a string generated by a mail client like the 
following one : "test nf =?ISO-8859-15?Q?=E9_123456789012?="


back to the original one
"test nf é 123456789012".

Is there a (simple) way to do this ?

thanks

N F



I'm short of time, but, this should get you started

preg_match("%_(\d+)\?=%", $str, $result);

$output= 'test nf é ' . $result[1];

$result[1] gets all the digits between the underscore and the "?="

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



Re: [PHP] Ereg problem

2006-06-27 Thread Robert Cummings
On Tue, 2006-06-27 at 12:14, Beauford wrote:
> One more in my recent woes. The last elseif does not work in the code below
> - even if the string is correct it always says it's incorrect. Even if I
> remove everything else and just have the ereg satement is doesn't work
> either.
> 
> The code below is in a function and $_POST['password1'] is passed to the
> function. 
> 
>   $field = "password1";  //Use field name for password
> 
>   if(!$subpass){
>  $form->setError($field, " Password not entered");
>   }
>   elseif(strlen($subpass) < 6) {
>   $form->setError($field, " Too Short");
>   }
>   elseif(strlen($subpass) > 10) {
>   $form->setError($field, " Too Long");
>   }
>   elseif(!ereg('[^A-Za-z0-9]', trim($subpass))) {
>   $form->setError($field, " Not alphanumeric"); 
>   }

You're double negating. You check the negative return of ereg() and ereg
checks for the pattern NOT existing.



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

2006-06-27 Thread Alex Major
Hi there list. 
Thanks for your help with my other questions.

I was carrying on working through, and stumbled across a problem when trying
to times something by the 'power' of something. By this I mean..in maths you
can write 3 * (2 ^ 3), the answer to which would be 24. (as 2 ^ 3 = 8).

The reason that I need this, is because I'm trying to double a variable x
amount of times (x is set by another variable).

For example my code is:

$cost = $farm_cost * (2 ^ $farm_level);

Any ideas how I would go about changing my calculation, as php dosn't seem
to recognise ^ meaning 'to the power of'.

Regards, 
Alex.

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



Re: [PHP] Calculations

2006-06-27 Thread Frank M. Kromann
Take a look at the pow() function

http://php.net/pow

- Frank

> Hi there list. 
> Thanks for your help with my other questions.
> 
> I was carrying on working through, and stumbled across a problem when
trying
> to times something by the 'power' of something. By this I mean..in maths
you
> can write 3 * (2 ^ 3), the answer to which would be 24. (as 2 ^ 3 = 8).
> 
> The reason that I need this, is because I'm trying to double a variable
x
> amount of times (x is set by another variable).
> 
> For example my code is:
> 
> $cost = $farm_cost * (2 ^ $farm_level);
> 
> Any ideas how I would go about changing my calculation, as php dosn't
seem
> to recognise ^ meaning 'to the power of'.
> 
> Regards, 
> Alex.
> 
> -- 
> 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] Re: Calculations

2006-06-27 Thread Adam Zey

Alex Major wrote:
Hi there list. 
Thanks for your help with my other questions.


I was carrying on working through, and stumbled across a problem when trying
to times something by the 'power' of something. By this I mean..in maths you
can write 3 * (2 ^ 3), the answer to which would be 24. (as 2 ^ 3 = 8).

The reason that I need this, is because I'm trying to double a variable x
amount of times (x is set by another variable).

For example my code is:

$cost = $farm_cost * (2 ^ $farm_level);

Any ideas how I would go about changing my calculation, as php dosn't seem
to recognise ^ meaning 'to the power of'.

Regards, 
Alex.


... The manual is your friend. Seriously, don't come here looking for 
all the answers before you checked the manual. I searched for "power", 
and the first result was the function you want. RTFM.


Regards, Adam Zey.

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



Re: [PHP] Calculations

2006-06-27 Thread tedd
At 6:26 PM +0100 6/27/06, Alex Major wrote:
>Hi there list.
>Thanks for your help with my other questions.
>
>I was carrying on working through, and stumbled across a problem when trying
>to times something by the 'power' of something. By this I mean..in maths you
>can write 3 * (2 ^ 3), the answer to which would be 24. (as 2 ^ 3 = 8).
>
>The reason that I need this, is because I'm trying to double a variable x
>amount of times (x is set by another variable).
>
>For example my code is:
>
>$cost = $farm_cost * (2 ^ $farm_level);
>
>Any ideas how I would go about changing my calculation, as php dosn't seem
>to recognise ^ meaning 'to the power of'.
>
>Regards,
>Alex.


Try:

pow(2,3)  //8

$cost = $farm_cost * (pow(2,$farm_level));

tedd
-- 

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

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



Re: [PHP] Calculations

2006-06-27 Thread tg-php
Try:

pow($base, $exp);

http://us2.php.net/manual/en/function.pow.php

Not sure why PHP doesn't use the ^.. havn't looked to see if it's already used 
for something else.

-TG

= = = Original message = = =

Hi there list. 
Thanks for your help with my other questions.

I was carrying on working through, and stumbled across a problem when trying
to times something by the 'power' of something. By this I mean..in maths you
can write 3 * (2 ^ 3), the answer to which would be 24. (as 2 ^ 3 = 8).

The reason that I need this, is because I'm trying to double a variable x
amount of times (x is set by another variable).

For example my code is:

$cost = $farm_cost * (2 ^ $farm_level);

Any ideas how I would go about changing my calculation, as php dosn't seem
to recognise ^ meaning 'to the power of'.

Regards, 
Alex.


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



RE: [PHP] Calculations

2006-06-27 Thread Jay Blanchard
[snip]
Any ideas how I would go about changing my calculation, as php dosn't
seem
to recognise ^ meaning 'to the power of'.
[/snip]

The first thing I would do is read http://www.php.net/math and follow
the link to http://www.php.net/manual/en/ref.bc.php which would have me
arriving at http://www.php.net/manual/en/function.bcpow.php

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



Re: [PHP] Calculations

2006-06-27 Thread tedd
At 1:45 PM -0400 6/27/06, <[EMAIL PROTECTED]> wrote:
>Try:
>
>pow($base, $exp);
>
>http://us2.php.net/manual/en/function.pow.php
>
>Not sure why PHP doesn't use the ^.. havn't looked to see if it's already used 
>for something else.
>
>-TG
>

Yes, I found that surprising myself. BUT, I did find the answer in the manual.

tedd
-- 

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

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



Re: [PHP] Calculations

2006-06-27 Thread tg-php
When my level of free time matches my level of curiousity, I'll have to 
research it further.  For now, I'm ok with not knowing unless someone posts the 
answer here. hah

-TG

= = = Original message = = =

At 1:45 PM -0400 6/27/06, <[EMAIL PROTECTED]> wrote:
>Try:
>
>pow($base, $exp);
>
>http://us2.php.net/manual/en/function.pow.php
>
>Not sure why PHP doesn't use the ^.. havn't looked to see if it's already used 
>for something else.
>
>-TG
>

Yes, I found that surprising myself. BUT, I did find the answer in the manual.

tedd


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



[PHP] PHP sounds (part two)

2006-06-27 Thread tedd
Hi gang:

Hopefully, you kind people will indulge me again.

I think I have my sound problem solved. Please review and report:

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

It's just a test -- click the corresponding button and I'll receive your 
answer, your browser, and your OS. No need to do anything other than visit and 
click.

When I finish the project, I'll post the solution.

Thanks.

tedd
-- 

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

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



Re: [PHP] Ereg problem

2006-06-27 Thread John Nichel

Beauford wrote:

Please turn of your mail client's request for return receipts when 
sending to a mailing list.


--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] Calculations

2006-06-27 Thread Kristen G. Thorson

> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 27, 2006 2:11 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Calculations
> 
> When my level of free time matches my level of curiousity, I'll have
to
> research it further.  For now, I'm ok with not knowing unless someone
> posts the answer here. hah
> 
> -TG
> 


Lucky day. ;)

http://www.php.net/manual/en/language.operators.bitwise.php




kgt

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



RE: [PHP] Calculations

2006-06-27 Thread tg-php
Ahh.. thanks from the lazy programmer :)   I knew I had seen it somewhere.  
Guess they ran out of symbols and decided XOR was more important than 
exponential operations. hah

My vote would have been for ^ to remain for exponents and something overly 
complicated like |X| for xor..hah

-TG

= = = Original message = = =

> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 27, 2006 2:11 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Calculations
> 
> When my level of free time matches my level of curiousity, I'll have
to
> research it further.  For now, I'm ok with not knowing unless someone
> posts the answer here. hah
> 
> -TG
> 


Lucky day. ;)

http://www.php.net/manual/en/language.operators.bitwise.php




kgt


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



RE: [PHP] Calculations

2006-06-27 Thread tedd
At 2:30 PM -0400 6/27/06, Kristen G. Thorson wrote:
> > -Original Message-
>> From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, June 27, 2006 2:11 PM
>> To: php-general@lists.php.net
>> Subject: Re: [PHP] Calculations
>>
>> When my level of free time matches my level of curiousity, I'll have
>to
>> research it further.  For now, I'm ok with not knowing unless someone
>> posts the answer here. hah
>>
>> -TG
>>
>
>
>Lucky day. ;)
>
>http://www.php.net/manual/en/language.operators.bitwise.php
>
>kgt


Thanks.

I wonder why that's true for php when it's common to use ^ in many other 
languages for powers? I can't remember the last time I used a bitwise operator 
for anything, but I have commonly used powers for the type of work I've done. 
But then again, I may be an exception.

tedd
-- 

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

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



Re: [PHP] Calculations

2006-06-27 Thread Adam Zey

tedd wrote:

At 2:30 PM -0400 6/27/06, Kristen G. Thorson wrote:

-Original Message-
From: [EMAIL PROTECTED]

[mailto:[EMAIL PROTECTED]

Sent: Tuesday, June 27, 2006 2:11 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Calculations

When my level of free time matches my level of curiousity, I'll have

to

research it further.  For now, I'm ok with not knowing unless someone
posts the answer here. hah

-TG



Lucky day. ;)

http://www.php.net/manual/en/language.operators.bitwise.php

kgt



Thanks.

I wonder why that's true for php when it's common to use ^ in many other 
languages for powers? I can't remember the last time I used a bitwise operator 
for anything, but I have commonly used powers for the type of work I've done. 
But then again, I may be an exception.

tedd


Lots of functions still use bit-based flags in PHP. Which is where OR 
comes in handy. Can't say I've used the others recently. XOR is handy on 
occasion, but doesn't really need an operator.


Regards, Adam.

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



Re: [PHP] Question regarding OS

2006-06-27 Thread Ligaya Turmelle

Jochem Maas wrote:

Mayank Maheshwary wrote:


Hi,

Is there a function that can detect the OS on which the script is running?



yes.

php_uname()

read about it here http://php.net/manual/en/function.php-uname.php
and then read 10 pages either side just for fun :-)



Thank you.

M.





Ha - never heard of that function... Thanks.

--

life is a game... so have fun.

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

Re: [PHP] Controlling a scanner with PHP

2006-06-27 Thread Richard Lynch
On Tue, June 27, 2006 7:16 am, George Pitcher wrote:
> I have been asked to look at extending one of my CMS systems to
> incorporate
> integration to a library management system, as well as LDAP and Active
> Directory.

http://php.net/ldap should help, though I understand that there is
some stupid "gotcha" with Active Directory that trips up every user
and they have to Google to find out how to fix it.

> The requirement also asks for scanning and OCR of documents
> to be
> controlled by the CMS.
>
> Does anyone have any experience of implementing the scanning into a
> PHP
> application?

I think if you Google for "PHP COM Port" you'll find hacks to control
the data going out to an old-school COM Port scanner.  You're on your
own with fancy new USB ones.

As far as the OCR goes, you could probably exec() gocr/jocr or Omni if
you can afford it and it runs on your OS.

If not, you could roll your own with GD, http://php.net/imagecolorat,
and about 10 years of effort.

I assume you realize that there is no friggin' way you can mess with
the client's (browser-computer) scanner and that you need the scanner
hooked up to the web-server for any of this to be meaningful.

-- 
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] FTP Problems

2006-06-27 Thread Chris

James Nunnerley wrote:

Thanks for the reply Chris.

How would you suggest displaying the current "home" directory for the user?
I've tried / and indeed the "real" directory name on that particular server.

Funnily enough, I've also just tried a generic php/ftp script tool, and it
works on a third party server into the one I'm trying to connect to, but not
from the server I'm working on!

Is there anyway in which php needs configuring for certain connections?


Even though you have this fixed..

"." means the current directory so you could:

ftp_nlist($connection, ".");

to display this directory and go from there.

In this case:
ftp_nlist($connection, "/");

Whether "/" means system level (ie so you'd see /proc, /etc and so on) 
or whether it takes you back to the base for that ftp account depends on 
the ftp server setup. Some lock you in to your /home type folder and 
some don't.


--
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] php 4.4.2 spec

2006-06-27 Thread Chris

Paul Aviles wrote:

Does anyone have a 4.4.2 spec file that works for creating an rpm?


There should be one in the tarball from the php site.

It's called "php4.spec.in"

--
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] Controlling a scanner with PHP

2006-06-27 Thread Richard Lynch
On Tue, June 27, 2006 9:33 am, Arno Kuhl wrote:
> Stut, that's an interesting point you raised. I know it's moving off
> the
> original topic, but when you say "by no means limited to being used on
> a
> server never mind on a web server", what is it that interprets the
> code and
> where does the output go to, or the input come from? I also thought it
> always had to be run under a web server, and would be interested to
> know
> what the other options/opportunities are.

Well...

Here are a couple interesting non-web applications I know of...

There was this guy who used to attend Chicago PHP User Group meetings
who builds custom cabinets (like for your kitchen).

He was all impressed about his website having page after page of FORMs
to let him know exactly what to build for them...

I found the fact that he AUTOMATICALLY send the output from all the
FORMs into the ASCII input on his PROGRAMMABLE TABLE SAW, so the shop
worker would literally just follow the on-screen instructions to throw
the right chunk of wood up, and the web-site *drove* the table saw,
for all intents and purposes, to be far more interesting, personally.
:-)


Another one that I'm not sure it's all THAT interesting is in my sound
booth which is not a web server, but has a several PHP scripts to
control the conversion of raw .wav files to MP3s and upload them to a
back-end caching server system behind:
http://uncommonground.com/radio_hifi.m3u
so that our web radio works.

The website doesn't REALLY have 150 Gigs of server space for MP3s --
It just seems like it does :-)

PHP GTK alone has all kinds of nifty possible applications with no
webserver in sight.

-- 
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] PHP 5, Windows, and MySQL

2006-06-27 Thread Chris

Beauford wrote:

I have done everything that everyone has suggested here, and 1000 other
variations that I have found along the way. So if I'm doing something wrong
- please let me know, 'cause I don't see it.

MySQL 4.1 has been working great for 4 years and PHP4.4 gives me no
problems. Anything 5 and above won't work. Windows is 2000 SP4. PHP is
installed as an ISAPI module. 


;cgi.force_redirect = 1

libmysql.dll is in /winnt, /system, /sytem32, /php and php is in my path. If
it can't find it it ain't looking hard enough. I've also tried many
variations of this.

The error below is similar to what I got. I was also getting memory errors,
but don't have that one to post.

Results:
Warning: PHP Startup: Unable to load dynamic library
'c:/php/ext/php_mysql.dll' - The specified procedure could not be found. in
Unknown on line 0


It's not that the file can't be found, it's something inside the file 
breaking. Otherwise it would just say "unable to find php_mysql.dll".


I'd say it's finding the mysql4 version of the dll and trying to include 
it which ain't going to work if you want to talk to a mysql5 server.


http://bugs.php.net/bug.php?id=24621

--
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] If statement question

2006-06-27 Thread Richard Lynch
On Mon, June 26, 2006 1:23 pm, Robert Cummings wrote:
> I can't think of any language that processes the contents of a
> conditional block when the test condition fails.

I believe that PHP with Runkit would let you set that up to happen, if
it was something you actually wanted... :-)

And Common Lisp will cheerfully let you re-define NIL so that all the
truth-values come out quite differently from what you expect, if you
want to be intentionally obfuscating code.

These are not, however, what one would consider "normal operations"

-- 
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] Array to String

2006-06-27 Thread Richard Lynch
On Mon, June 26, 2006 2:06 am, Jochem Maas wrote:
>>   if (!get_magic_quotes_gpc()) {
>> if (isset($_POST)) {
>> foreach ($_POST as $key => $value) {
>> $_POST[$key] = trim(addslashes($value));
>> }
>> }
>>
>> if (isset($_GET)) {
>> foreach ($_GET as $key => $value) {
>> $_GET[$key] = trim(addslashes($value));
>> }
>> }
>> }

If this is all your code is trying to do, then you might as well turn
on Magic Quotes GPC in the first place, which means you've got bigger
problems than this already...

If it's just some legacy code you need to get running, fine and dandy.

If this is a new project you are starting on, find a more recent
tutorial about Magic Quotes and SQL Injection attacks before you go
any further.

-- 
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] Ereg problem

2006-06-27 Thread Beauford


-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: June 27, 2006 12:58 PM
To: Beauford
Cc: PHP-General
Subject: Re: [PHP] Ereg problem

On Tue, 2006-06-27 at 12:14, Beauford wrote:
> One more in my recent woes. The last elseif does not work in the code 
> below
> - even if the string is correct it always says it's incorrect. Even if 
> I remove everything else and just have the ereg satement is doesn't 
> work either.
> 
> The code below is in a function and $_POST['password1'] is passed to 
> the function.
> 
>   $field = "password1";  //Use field name for password
> 
>   if(!$subpass){
>  $form->setError($field, " Password not entered");
>   }
>   elseif(strlen($subpass) < 6) {
>   $form->setError($field, " Too Short");
>   }
>   elseif(strlen($subpass) > 10) {
>   $form->setError($field, " Too Long");
>   }
>   elseif(!ereg('[^A-Za-z0-9]', trim($subpass))) {
>   $form->setError($field, " Not alphanumeric"); 
>   }

You're double negating. You check the negative return of ereg() and ereg
checks for the pattern NOT existing.



Ahhh, I was thinking of it the other way round.  Thanks.

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



Re: [PHP] working on a template system...

2006-06-27 Thread Ligaya Turmelle

Martin Marques wrote:

Why not try to use one of the template systems that already exist? 
HTML_Template_IT, Smarty, etc.

On Tue, 27 Jun 2006 10:22:42 +0300, sempsteen <[EMAIL PROTECTED]> wrote:


hi, i'm working on a template system. Basically i'm building raw
contents in arrays and then put them in templates by some special
tags.

for loop systems my basic array structure is like this:
$array['key'][]['keyword'] = ...

for example, for a bulletin board system, array structure for
categories is something like this:
$array['categories'][]['text_category_name'] = ...

it is looped through database recordset, so final array for 2 categories
can be:
$array['categories'][0]['text_category_name'] = 'programming'
$array['categories'][1]['text_category_name'] = 'life'

template file structure for loops is something like this (ex, categories):


  [$text_category_name$]



i can easily loop this template and replace [$text_category_name] for
every category set in the array. after removing the comment tags i get
the final content:


  programming


  life


But i'm stuck with nested loops. For example i want to put related
forums after each categories.

array structure is:
$array['categories'][0]['text_category_name'] = programming
$array['categories'][0]['forums'][0]['text_forum_name'] = php
$array['categories'][0]['forums'][1]['text_forum_name'] = ruby

$array['categories'][1]['text_category_name'] = life
$array['categories'][1]['forums'][0]['text_forum_name'] = music
$array['categories'][1]['forums'][1]['text_forum_name'] = sports

template structure is:


  [$text_category_name$]



  [$text_forum_name$]




i've written some functions, used them recursively but it didn't work.
actually i couldn't find the true logic. note that it isn't a limited
array. it can have messages under each forums, peoples under each
messages, so on..

help me find the true approach to handle this. thank you.




-
Lic. Martín Marqués |   SELECT 'mmarques' || 
Centro de Telemática|   '@' || 'unl.edu.ar';
Universidad Nacional|   DBA, Programador, 
del Litoral |   Administrador

-


Or just use PHP...

--

life is a game... so have fun.

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

Re: [PHP] uploading...

2006-06-27 Thread BBC
> BBC wrote:
> > OK John
> > I'm sorry if my question was not specific
> > - The out put error was:
> > "Fatal error: call to a member function an o non object in
/url/data.php
> > on line 34"
> > - And the lines are:
> > 34.   $db->query("INSERT INTO `products`
>
> $db isn't an object. Does it connect to the database without any problems?
Yes it does. I use it in other page and it can connect to the database
properly.
Are you suggesting me to change $db, Chris?

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



Re: [PHP] uploading...

2006-06-27 Thread Chris

BBC wrote:

BBC wrote:

OK John
I'm sorry if my question was not specific
- The out put error was:
"Fatal error: call to a member function an o non object in

/url/data.php

on line 34"
- And the lines are:
34.   $db->query("INSERT INTO `products`

$db isn't an object. Does it connect to the database without any problems?

Yes it does. I use it in other page and it can connect to the database
properly.
Are you suggesting me to change $db, Chris?


No, I'm suggesting you work out why it's not an object.

Put this randomly through the page:

echo "at line " . __LINE__ . "; db is " . gettype($db) . "";

and see where it goes from being an object to being something else.

--
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] Cookie Question

2006-06-27 Thread Richard Lynch
Because their clock is set wrong on their computer...

Better to set a very long timeout and then handle the expiration
yourself.

Sorry.

On Fri, June 23, 2006 5:26 pm, Tom Ray [Lists] wrote:
> I've run into something rather odd with cookies today. I'm working
> with
> this admin section on a site and I'm setting a cookie that is supposed
> to be good for one hour. So in the cookie I have time()+3600 and all
> was
> well or that was until someone fired up IE. It seems that IE refused
> to
> set the cookie. After much swearing at IE, I found that if I set it to
> time()+7200 the cookie would be set.
>
> Not if that wasn't odd enough, in Firefox if I logged in at 6PM the
> cookie said it would expire at 8PM which is correct. However, when I
> logged in via IE at 6PM it said the cookie would expire at 23:00 hours
> (11PM for those who don't know)...so my question is...why is this
> happening and why does IE do this? I checked in Opera, Mozilla and
> Netscape and they all work the same as Firefox.
>
> --
> 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



Re: [PHP] PHP 5, Windows, and MySQL

2006-06-27 Thread David Robley
Chris wrote:

> Beauford wrote:
>> I have done everything that everyone has suggested here, and 1000 other
>> variations that I have found along the way. So if I'm doing something
>> wrong - please let me know, 'cause I don't see it.
>> 
>> MySQL 4.1 has been working great for 4 years and PHP4.4 gives me no
>> problems. Anything 5 and above won't work. Windows is 2000 SP4. PHP is
>> installed as an ISAPI module.
>> 
>> ;cgi.force_redirect = 1
>> 
>> libmysql.dll is in /winnt, /system, /sytem32, /php and php is in my path.
>> If it can't find it it ain't looking hard enough. I've also tried many
>> variations of this.
>> 
>> The error below is similar to what I got. I was also getting memory
>> errors, but don't have that one to post.
>> 
>> Results:
>> Warning: PHP Startup: Unable to load dynamic library
>> 'c:/php/ext/php_mysql.dll' - The specified procedure could not be found.
>> in Unknown on line 0
> 
> It's not that the file can't be found, it's something inside the file
> breaking. Otherwise it would just say "unable to find php_mysql.dll".
> 
> I'd say it's finding the mysql4 version of the dll and trying to include
> it which ain't going to work if you want to talk to a mysql5 server.
> 
> http://bugs.php.net/bug.php?id=24621
> 

There is a nice tool called dependencywalker which can help you resolve
problems with loading dlls

http://www.dependencywalker.com


Cheers
-- 
David Robley

It's okay to be ugly...but aren't you overdoing it?
Today is Prickle-Prickle, the 33rd day of Confusion in the YOLD 3172. 

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



Re: [PHP] uploading...

2006-06-27 Thread Richard Lynch




On Tue, June 27, 2006 9:23 pm, BBC wrote:
>> BBC wrote:
>> > OK John
>> > I'm sorry if my question was not specific
>> > - The out put error was:
>> > "Fatal error: call to a member function an o non object in
> /url/data.php
>> > on line 34"
>> > - And the lines are:
>> > 34.   $db->query("INSERT INTO `products`
>>
>> $db isn't an object. Does it connect to the database without any
>> problems?
> Yes it does. I use it in other page and it can connect to the database
> properly.
> Are you suggesting me to change $db, Chris?

In the other page it might be an object.

It ain't in this one.  That's what the error message SAYS.

You'll have to backtrack $db to see where it's not what you expect,
and reason out WHY it's not an object, in THIS script, even though it
worked fine elsewhere.

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