[PHP] Fatal error: Call to undefined function preg_match()

2006-03-20 Thread Evert
Hi all!

Recently I am getting the following error on some of my PHP-enabled websites. I 
think it started when I went from PHP4 - PHP5.

Here is an example (from http://wos.poboxes.info/) :


Fatal error: Call to undefined function preg_match() in 
/var/www/wos.poboxes.info/htdocs/classes/ConfigData.php on line 114


What causes this? How can I fix it?
FYI: I use Cherokee (not Apache...)



Regards,
Evert

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



[PHP] Re: Fatal error: Call to undefined function preg_match()

2006-03-20 Thread Barry

Evert wrote:

Hi all!

Recently I am getting the following error on some of my PHP-enabled websites. I 
think it started when I went from PHP4 - PHP5.

Here is an example (from http://wos.poboxes.info/) :


Fatal error: Call to undefined function preg_match() in 
/var/www/wos.poboxes.info/htdocs/classes/ConfigData.php on line 114


What causes this? How can I fix it?
FYI: I use Cherokee (not Apache...)



Regards,
Evert

On some pages?
So it works on the other pages on the same webserver?

Probably you have unset the function, or some file/php/include/script does.
Best way to test that is to put preg_match at the first line.

Is a htaccess causing trouble probably?
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



[PHP] Re: Fatal error: Call to undefined function preg_match()

2006-03-20 Thread M. Sokolewicz

Barry wrote:

Evert wrote:


Hi all!

Recently I am getting the following error on some of my PHP-enabled 
websites. I think it started when I went from PHP4 - PHP5.


Here is an example (from http://wos.poboxes.info/) :


Fatal error: Call to undefined function preg_match() in 
/var/www/wos.poboxes.info/htdocs/classes/ConfigData.php on line 114



What causes this? How can I fix it?
FYI: I use Cherokee (not Apache...)



Regards,
Evert


On some pages?
So it works on the other pages on the same webserver?

Probably you have unset the function, or some file/php/include/script does.
Best way to test that is to put preg_match at the first line.

Is a htaccess causing trouble probably?


Since when can you unset functions from within php scripts?? (except 
with specialized modules, which we'll just ignore for now).


My guess here is that the PCRE-library was disabled during compilation 
of your PHP5 tree (check phpinfo for that). If so, you'll need to 
compile it in to have the functions.


- tul

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



[PHP] Re: Fatal error: Call to undefined function preg_match()

2006-03-20 Thread Barry

M. Sokolewicz wrote:
Since when can you unset functions from within php scripts?? (except 
with specialized modules, which we'll just ignore for now).

Why ignore them for now?
Doesn't make sense for me ...

Recently I am getting the following error on some of my PHP-enabled
websites. I think it started when I went from PHP4 - PHP5.

He went from 4 to 5, do you know what 4 had compiled in? no you don't.
Why don't just ignore he went from 4 to 5.
So we can see this post as i installed php 5 and got error X

Sorry, i think that's big nonsense.

Greets
Barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



[PHP] Re: Fatal error: Call to undefined function preg_match()

2006-03-20 Thread Evert


M. Sokolewicz wrote:
 Barry wrote:
 Evert wrote:

 Hi all!

 Recently I am getting the following error on some of my PHP-enabled
 websites. I think it started when I went from PHP4 - PHP5.

 Here is an example (from http://wos.poboxes.info/) :


 Fatal error: Call to undefined function preg_match() in
 /var/www/wos.poboxes.info/htdocs/classes/ConfigData.php on line 114


 What causes this? How can I fix it?
 FYI: I use Cherokee (not Apache...)



 Regards,
 Evert

 On some pages?
 So it works on the other pages on the same webserver?

 Probably you have unset the function, or some file/php/include/script
 does.
 Best way to test that is to put preg_match at the first line.

 Is a htaccess causing trouble probably?
 
 Since when can you unset functions from within php scripts?? (except
 with specialized modules, which we'll just ignore for now).
 
 My guess here is that the PCRE-library was disabled during compilation
 of your PHP5 tree (check phpinfo for that). If so, you'll need to
 compile it in to have the functions.

You're right!  :-)

It turned out that php5 was compiled without pcre-support. I have recompiled 
it, and now it works like a charm! :-)
Thanks for the help!  :-)

Regards,
  Evert

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



Re: [PHP] Re: Fatal error: Call to undefined function preg_match()

2006-03-20 Thread Jochem Maas

Barry wrote:

M. Sokolewicz wrote:

Since when can you unset functions from within php scripts?? (except 
with specialized modules, which we'll just ignore for now).


Why ignore them for now?
Doesn't make sense for me ...


If the OP is capable of installing and using the runkit extension
them he would never have had ask the list why 'preg_match() is not defined' -
it's a fairly basic problem to solve - anyone with enough skill and experience
to use runkit would know how to solve it.

obviously Barry you are very experienced and use the runkit extension all
the time ... because evidently you seem to think 'unsetting' function
is a completely normal activity inside a php script.



 Recently I am getting the following error on some of my PHP-enabled
 websites. I think it started when I went from PHP4 - PHP5.

He went from 4 to 5, do you know what 4 had compiled in? no you don't.
Why don't just ignore he went from 4 to 5.


given that he says 'I think' (i.e. he's too lazy to check and know for sure)
ignoring the fact that he upgraded is actually quite sane.

the OPs problem is an undefined function which can only really mean that
an extension was not loaded (and/or not compiled in) - nothing to do with the
fact that he upgraded as such (he could jsut as well have got this error
if he had created a completely fresh php install)

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



[PHP] Get class name in static method

2006-03-20 Thread Stut

Hi all,

I'm wanting to define a static method on a base class that then 
instantiates and returns an object of the type the static method was 
called on. I've searched the docs and Googled but everything I find says 
it's not possible and I just wanna check to make sure before I admit defeat.


Say I have the following...

   class Foo
   {
   public static function  Create()
   {
  $classname = ???;
  return new $classname;
   }
   }

   class Bar extends Foo { }

   $obj = Bar::Create();

What do I put where the ???s are? I've tried __CLASS__ and get_class() 
but both give me the base class name. Short of passing the classname to 
the static function I'm at a loss as to how to do this. However, 
Bar::Create('Bar') is a bit too sucky for me to be happy with it and 
kinda defeats the object.


Thanks.

-Stut

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



Re: [PHP] Get class name in static method

2006-03-20 Thread Jochem Maas

Stut wrote:

Hi all,

I'm wanting to define a static method on a base class that then 
instantiates and returns an object of the type the static method was 
called on. I've searched the docs and Googled but everything I find says 
it's not possible and I just wanna check to make sure before I admit 
defeat.


Say I have the following...

   class Foo
   {
   public static function  Create()
   {
  $classname = ???;
  return new $classname;
   }
   }

   class Bar extends Foo { }

   $obj = Bar::Create();

What do I put where the ???s are? I've tried __CLASS__ and get_class() 
but both give me the base class name. Short of passing the classname to 
the static function I'm at a loss as to how to do this. However, 
Bar::Create('Bar') is a bit too sucky for me to be happy with it and 
kinda defeats the object.


(purpose not object ;-)

either suck on it or use another language :-P.
this _PROBLEM_ exists since day 1 of php5 - there is no decent solution.

there has been discussion of this problem on the internals mailing list,
most of them seem to agree something is required here but no definite
fix has been implemented.

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



[PHP] IntVal(float) Returns Different Values (Porting Delphi code to mix a block of data)

2006-03-20 Thread Bruce
I am having trouble porting some code originally written in Borland Delphi
to PHP. The Delphi code expects certain behavior on integer overflows that I
can only duplicate on some PHP systems. For example:

$BB = -2181087916;
$AA = (int)$BB;
$AA = intval($BB);

On some systems, $AA will be (int)-2147483648, however, on most systems, $AA
will be (int)2113879380, which is the same value truncated at 32 bits. It is
this latter behavior that I need to properly port the Delphi code.

Can someone suggest a way to do this that is consistent on all platforms?
For reference, I am attaching the Delphi code and my PHP port.

Thanks...

--Bruce

{quick (block) mixer routine}
procedure MixBlock(const Matrix : T128bit; var Block; Encrypt : Boolean);

const
  CKeyBox : array [False..True, 0..3, 0..2] of LongInt =

(((0, 3, 1), (2, 1, 3), (1, 0, 2), (3, 2, 0)),
((3, 2, 0), (1, 0, 2), (2, 1, 3), (0, 3, 1)));

var
  Blocks : array [0..1] of LongInt absolute Block;
  Work : LongInt;
  Right : LongInt;
  Left : LongInt;

  R : LongInt;
  AA, BB : LongInt;
  CC, DD : LongInt;

begin
  Right := Blocks[0];
  Left := Blocks[1];

  for R := 0 to 3 do begin
  {transform the right side}
AA := Right;
BB := Matrix[CKeyBox[Encrypt, R, 0]];

CC := Matrix[CKeyBox[Encrypt, R, 1]];
DD := Matrix[CKeyBox[Encrypt, R, 2]];

AA := AA + DD; DD := DD + AA; AA := AA xor (AA shr 7);
BB := BB + AA; AA := AA + BB; BB := BB xor (BB shl 13);

CC := CC + BB; BB := BB + CC; CC := CC xor (CC shr 17);
DD := DD + CC; CC := CC + DD; DD := DD xor (DD shl 9);

AA := AA + DD; DD := DD + AA; AA := AA xor (AA shr 3);
BB := BB + AA; BB := BB xor (BB shl 7);

CC := CC + BB;
CC := CC xor (DD shr 15);
DD := DD + CC;
DD := DD xor (DD shl 11);

Work := Left xor DD;
Left := Right;
Right := Work;
  end;

  Blocks[0] := Left;

  Blocks[1] := Right;
end;

Here is my PHP port:

 ?php
function zeroFill($a, $b)
{
  $z = hexdec(8000);
  if ($z  $a)
  {
$a = 1;
$a = (~ $z);
$a |= 0x4000;
$a = ($b-1);
  }
  else
  {
$a = $b;
  }
  return $a;
}

function MixBlock($AKey, $ACode, $Encrypt)
{
  $CKeyBox = array(array(3, 2, 0), array(1, 0, 2), array( 2, 1, 3), array(0 ,
3, 1));

  $Right = $ACode[0];
  $Left = $ACode[1];

  for ($R=0; $R= 3; $R++)
  {
$AA = $Right;
if ($Encrypt)
{
  $BB = $AKey[$CKeyBox[ $R][0]];
  $CC = $AKey[$CKeyBox[ $R][1]];
  $DD = $AKey[$CKeyBox[ $R][2]];
}
else
{
  $BB = $AKey[$CKeyBox[ 3-$R][0]];
  $CC = $AKey[$CKeyBox[ 3-$R][1]];
  $DD = $AKey[$CKeyBox[ 3-$R][2]];
}

$AA = (int)$AA + (int)$DD;
$DD = (int)$DD + (int)$AA;
$AA = (int)$AA ^ zeroFill( $AA, 7);
$BB = (int)$BB + (int)$AA;
$AA = (int)$AA + (int)$BB;

$BB = (int)$BB ^ ((int)$BB  13);
$CC = (int)$CC + (int)$BB; $BB = (int)$BB + (int)$CC;
$CC = (int)$CC ^ zeroFill( $CC, 17);
$DD = (int)$DD + (int)$CC; $CC = (int)$CC + (int)$DD;
$DD = (int)$DD ^ ((int)$DD  9);

$AA = (int)$AA + (int)$DD; $DD = (int)$DD + (int)$AA;
$AA = (int)$AA ^ zeroFill( $AA, 3);
$BB = (int)$BB + (int)$AA;
$BB = (int)$BB ^ (int)((int)$BB  7);
$CC = (int)$CC + (int)$BB;
$CC = (int)$CC ^ zeroFill( $DD, 15);
$DD = (int)$DD + (int)$CC;
$DD = (int)$DD ^ (int)((int)$DD  11);

$Work = $Left ^ $DD;
$Left = $Right;
$Right = $Work;
  }

  $ACode[0] = $Left;
  $ACode[1] = $Right;
}
?


RE: [PHP] print page from php

2006-03-20 Thread Reinhart Viane
Thx Miles and Jay

-Oorspronkelijk bericht-
Van: Miles Thompson [mailto:[EMAIL PROTECTED] 
Verzonden: vrijdag 17 maart 2006 22:35
Aan: php-general@lists.php.net
Onderwerp: Re: [PHP] print page from php

At 09:57 AM 3/17/2006, Reinhart Viane wrote:

All,

I have a web page with the results from several database queries.
Now this page has an undefined horizontal and vertical size.

Does anyone know if there is a php script available that will automatically
split the webpage into parts that can fit on an A4 page?

Or do I have to set boundaries on the size of the tables the queried data
will be shown in.

Hope this makes any sense,

Thanks in advance,

Reinhart Viane

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


CSS is probably the best solution
 http://www.w3.org/TR/REC-CSS2/page.html#q16
found whle googling
 
http://www.google.ca/search?hl=enq=printing+CSS+mediabtnG=Google+Search

This is a good article:
http://css-discuss.incutio.com/?page=PrintStylesheets
and as always, A List Apart has CSS Design: going to Print at 
http://www.alistapart.com/stories/goingtoprint/

I have seen examples of two-column pages, but do not know if the pages 
broke correctly when the matter was longer than one page.

Alternately, display in tables and make certain you have a TH so your 
header can repeat.

Hope this steers you in the right direction - Miles. 


-- 
Internal Virus Database is out-of-date.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 268.2.1/279 - Release Date: 3/10/2006

-- 
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: want authentic branded goods?

2006-03-20 Thread Barry
2006-03-20 23:19:13 wrote:
 This is a kind business letter,if bothered you,pls send your email to us,we 
 will sure cancled your email address from our email list.
 
Nah ;)
This is kind of Spam Mail!

   
 Gurantee your 100% absolutely safe ''Door to Door'' delivery!!
Front door or back door?
I like to have my deliveries delivered indoor.
Outdoor is cold!

 We supplying authentic branded stocklots incl shoes, handbags, clothes, 
 wallets, glasses, belts.We can produce for you under your authorized paper,or 
 source them from official authorized factory stocklots  markets. We supply 
 authentic cards and paperwork.
Should i be some kind of amazed now?


 Supply Door to Door delivery, and 100% Guarantee Customs Clear by EMS 
 Now!!!
 We will simply send,send,send.. and resend until you get them!!!
 All for free
Omg you send,send,send and don't stop? aww ;_;
Even if i don't want them? _

 Prices CIF in USD incl goods cost, shipping cost, and insurance already!!!
 We dropship goods to your cutomers directly from us!!! So what you need 
 to do is only find them and tell them what you can give them!!
 Accept Western Union/Moneygram/bank account, but don't accept paypal for now.
Haha yeah find me xD *hides*
Wut no paypal? SHAME ON YOU! xD

 1.Place orders on our website;
Sorry my Packet doesn't fit in my monitor _
 2.Use msn:[EMAIL PROTECTED]; or 
To send my package?
Uhm , i wonder if it fits into an email -_-
 3.Wirte to [EMAIL PROTECTED] 
Isn't that the same as #2? :)
 Any way, let us know your payment info and your address with a phone call 
 number
Anyway man your english sucks a lot ;)

-- 
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] Paypal IPN and PHP

2006-03-20 Thread Curt Zirzow
On Sun, Mar 19, 2006 at 06:41:54PM +, Richard Davey wrote:
 On 19 Mar 2006, at 18:32, Leonard Burton wrote:
 
 I am putting together an site and will accept payments via Paypal's
 IPN.  I have came across many classes for this so I am curious if
 anyone has any recommendations?
 
 Isn't there a full proper PayPal API now? IPN hasn't changed in ages,  
 but I don't think it is their preferred way of accessing PayPal any  
 more, and certainly isn't the most streamlined.

Yeah, they have their new Payment Pro system which has a gateway
API. I dont think they have any preference over the other.  

One of the biggest advantages with IPN is you dont have to worry
about handling credit card numbers and how you are securily
handling them.  But then again like you said it is a bit clunkly to
add to a payment system, and if paypal somehow fails you have to
jump through hoops to figure out what happened and what to do next.


Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] Paypal IPN and PHP

2006-03-20 Thread Manuel Amador (Rudd-O)

Curt Zirzow wrote:



Isn't there a full proper PayPal API now? IPN hasn't changed in ages,  
but I don't think it is their preferred way of accessing PayPal any  
more, and certainly isn't the most streamlined.
   

You kidding?  IPN support is ridiculously easy to develop.  If you're 
interested, I've got a mini software sales system for WordPress.




Yeah, they have their new Payment Pro system which has a gateway
API. I dont think they have any preference over the other.  


One of the biggest advantages with IPN is you dont have to worry
about handling credit card numbers and how you are securily
handling them.  But then again like you said it is a bit clunkly to
add to a payment system, and if paypal somehow fails you have to
jump through hoops to figure out what happened and what to do next.
 


Not really.  The state of a transaction can be easily verified.



Curt.
 



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



Re: [PHP] Paypal IPN and PHP

2006-03-20 Thread Richard Davey

On 20 Mar 2006, at 16:26, Manuel Amador (Rudd-O) wrote:

Isn't there a full proper PayPal API now? IPN hasn't changed in  
ages,  but I don't think it is their preferred way of accessing  
PayPal any  more, and certainly isn't the most streamlined.


You kidding?  IPN support is ridiculously easy to develop.  If  
you're interested, I've got a mini software sales system for  
WordPress.


Easy, yes. That wasn't the point really though. Their true API offers  
you a truly site integrated experience, IPN does not.


Cheers,

Rich
--
http://www.corephp.co.uk
Zend Certified Engineer
PHP Development Services

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



Re: [PHP] Get class name in static method

2006-03-20 Thread Stut

Jochem Maas wrote:


Stut wrote:

What do I put where the ???s are? I've tried __CLASS__ and 
get_class() but both give me the base class name. Short of passing 
the classname to the static function I'm at a loss as to how to do 
this. However, Bar::Create('Bar') is a bit too sucky for me to be 
happy with it and kinda defeats the object.


(purpose not object ;-)


I mean object as short for objective, but whatever ;-).


either suck on it or use another language :-P.
this _PROBLEM_ exists since day 1 of php5 - there is no decent solution.

there has been discussion of this problem on the internals mailing list,
most of them seem to agree something is required here but no definite
fix has been implemented.


I thought as much. Shame really, I had a really elegant solution planned 
for this problem. Oh well, I'll just have to create a throwaway instance 
whenever I use these methods... such is life.


-Stut

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



Re: [PHP] Paypal IPN and PHP

2006-03-20 Thread Curt Zirzow
On Mon, Mar 20, 2006 at 11:26:34AM -0500, Manuel Amador (Rudd-O) wrote:
 Curt Zirzow wrote:
 
 
 Isn't there a full proper PayPal API now? IPN hasn't changed in ages,  
 ...
 
 
 Yeah, they have their new Payment Pro system which has a gateway
 API. I dont think they have any preference over the other.  
 
 One of the biggest advantages with IPN is you dont have to worry
 about handling credit card numbers and how you are securily
 handling them.  But then again like you said it is a bit clunkly to
 add to a payment system, and if paypal somehow fails you have to
 jump through hoops to figure out what happened and what to do next.
  
 
 Not really.  The state of a transaction can be easily verified.

Considering the way a typical ipn transation works there are
several steps involved in the whole transaction that could be the
problem.

  1. You send user to paypal, with item and amount for item.
  2. paypal veryifies user and the amount the user is going to pay.
  3. paypal contacts your callback script that should validate the
 transaction.
  4. paypal provides a link to the user to return to your site with
 data related to the transaction.

There are several problems in which are hard to tracedown:
  - Network problems
. Paypal is unreachable
. Paypal can't resolve your callback script
. Your site is unreachable when the user finishes with paypal.

  - Script problems
. Paypal doesn't ever call your callback script
. Your callback script has a logic error/parse error, so you
  can't verify the transaction but yet paypal still transfers 
  the funds.
. Paypal changes their API to post data to their system
. Paypal doesn't post transaction related data back to your
  script.

  - User problems
. User modifies a price for a product that is being posted to
  paypal, instead of paying $100.00 they change the value to
  $1.00.
. Any Network problem or Script problem causes the user to get
  frustrated with your system.
. User never clicks the 'Return to site' button so you never
  really know if they've completed the transaction or their
  browser crashed somewhere.


If you use a gateway to process funds within your script, it is
much easier to catch these points of failures.  Since this system
can keep track exactly at what point something failed it can 
gracefully respond to the the user of the status.


Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] IntVal(float) Returns Different Values (Porting Delphi code to mix a block of data)

2006-03-20 Thread Curt Zirzow
On Mon, Mar 20, 2006 at 10:13:21AM -0500, Bruce wrote:
 I am having trouble porting some code originally written in Borland Delphi
 to PHP. The Delphi code expects certain behavior on integer overflows that I
 can only duplicate on some PHP systems. For example:
 
 $BB = -2181087916;
 $AA = (int)$BB;
 $AA = intval($BB);
 
 On some systems, $AA will be (int)-2147483648, however, on most systems, $AA
 will be (int)2113879380, which is the same value truncated at 32 bits. It is
 this latter behavior that I need to properly port the Delphi code.

Two modules that come to mind:

  http://php.net/bcmath
  http://php.net/gmp


Since your code does some or and xoring gmp sounds like the GMP
method will be the  best one. The down fall is it will add the
requirement to add the library and rebuild php with it.

Curt.
-- 
cat .signature: No such file or directory

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



[PHP] Accessing data posted from a different URL

2006-03-20 Thread René Fournier
I have a script that periodically sends an email that includes  form  
post to a script, which is meant to do something with the posted data.


My problem is that apparently some PHP security measure is not  
permitting the externally posted data to be access via $_POST. I  
assume this is due to cross-site scripting issues, but in this case,  
I want to do just that. Any ideas?


...Rene

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



RE: [PHP] Accessing data posted from a different URL

2006-03-20 Thread Jay Blanchard
[snip]
I have a script that periodically sends an email that includes  form  
post to a script, which is meant to do something with the posted data.

My problem is that apparently some PHP security measure is not  
permitting the externally posted data to be access via $_POST. I  
assume this is due to cross-site scripting issues, but in this case,  
I want to do just that. Any ideas?
[/snip]

http://www.php.net/curl

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



Re: [PHP] Accessing data posted from a different URL

2006-03-20 Thread René Fournier

Hmm, perhaps I didn't explain clearly. To put it another:

1. A script sends an email to a user with sign-in details.
2. The user clicks a [submit] button in the email message called  
Quick Sign In
3. A web browsers opens to http://www.website.com/signin.php (from  
the form method=post action=http://www.website.com/sign.php; in  
the email)

4. Signin.php looks for $_POST[signindetails] and auto-fills the form.

Except the form post is not posting signindetails...


On 20-Mar-06, at 2:57 PM, Jay Blanchard wrote:


[snip]
I have a script that periodically sends an email that includes  form
post to a script, which is meant to do something with the posted data.

My problem is that apparently some PHP security measure is not
permitting the externally posted data to be access via $_POST. I
assume this is due to cross-site scripting issues, but in this case,
I want to do just that. Any ideas?
[/snip]

http://www.php.net/curl





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



[PHP] Re: Accessing data posted from a different URL

2006-03-20 Thread Manuel Lemos
Hello,

on 03/20/2006 06:52 PM René Fournier said the following:
 I have a script that periodically sends an email that includes  form
 post to a script, which is meant to do something with the posted data.
 
 My problem is that apparently some PHP security measure is not
 permitting the externally posted data to be access via $_POST. I assume
 this is due to cross-site scripting issues, but in this case, I want to
 do just that. Any ideas?

I have no knowledge of such PHP restriction. I suspect the problem is
something else.

Make sure you have included tags like form method=POST
action=http://www.domain.com/full_form_processing_script_url.php;
/form .

Some people insist on making everything XHTML compliant just they assume
that otherwise it would not be Web standards compliant. That is a
silly claim that only leads to all sorts of problems.

For instance, if you use method=post because XHTML specification says
everything should be in lower case, you will have problems with some
browsers and e-mail programs that only accept POST in upper case and
fallback to GET when they find something else.

Also, keep in mind that you can't use Javascript in HTML e-mail messages.

These may not be your actual problems, but at least you have something
to start checking.

-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

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

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



RE: [PHP] Accessing data posted from a different URL

2006-03-20 Thread Jay Blanchard
[snip]
Hmm, perhaps I didn't explain clearly. To put it another:

1. A script sends an email to a user with sign-in details.
2. The user clicks a [submit] button in the email message called  
Quick Sign In
3. A web browsers opens to http://www.website.com/signin.php (from  
the form method=post action=http://www.website.com/sign.php; in  
the email)
4. Signin.php looks for $_POST[signindetails] and auto-fills the form.

Except the form post is not posting signindetails...
[/snip]

Have you tried print_r($_POST) ?

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



Re: [PHP] Re: Accessing data posted from a different URL

2006-03-20 Thread Manuel Amador (Rudd-O)

Manuel Lemos wrote:


Some people insist on making everything XHTML compliant just they assume
that otherwise it would not be Web standards compliant. That is a
silly claim that only leads to all sorts of problems.
 


That assertion is 100% untrue.

First of all, XHTML is an excellent idea.  Having been based in XML 
(which is easier to parse than SGML - the markup base for HTML), XHTML 
is a much, much more interoperable standard.  Second of all, the spec 
has made a number of clarifications which should result in more 
cross-browser predictability.



For instance, if you use method=post because XHTML specification says
everything should be in lower case, you will have problems with some
browsers and e-mail programs that only accept POST in upper case and
fallback to GET when they find something else.
 

Oh, for God's sake, stop selling snake oil.  I'm willing to bet $100 
that you haven't even read the specification and are inventing crap as 
you go.


For the record, the specification does not say that attribute values 
need to be lowercase, only attribute *names*.  You can put PoST or 
pOST if you feel like it, and the markup validation status will not 
change a bit.



Also, keep in mind that you can't use Javascript in HTML e-mail messages.
 


That's evidently true, I cannot argue with that.


These may not be your actual problems, but at least you have something
to start checking.
 

The original poster's problem may be related to the fact that, perhaps, 
he's checking for the value of a button in the POST variable, when it's 
a very well known fact that the browser only sends the value of the 
button if the user *clicks* the button, but not if the user hits ENTER 
in one of the form fields.


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



Re: [PHP] Accessing data posted from a different URL

2006-03-20 Thread Manuel Amador (Rudd-O)

Jay Blanchard wrote:


[snip]
Hmm, perhaps I didn't explain clearly. To put it another:

1. A script sends an email to a user with sign-in details.
2. The user clicks a [submit] button in the email message called  
Quick Sign In
3. A web browsers opens to http://www.website.com/signin.php (from  
the form method=post action=http://www.website.com/sign.php; in  
the email)

4. Signin.php looks for $_POST[signindetails] and auto-fills the form.

Except the form post is not posting signindetails...
 

The e-mail client may very well be ignoring the POST request.  To 
diagnose this, you can use Ethereal or some other packet sniffing 
software.  That will also tell you the contents of fields submitted in 
the POST/GET request.


Most certainly, what you want to do is not possible.  I say this because 
Hi5 has eschewed that technique in favor of placing a hyperlink with an 
argument that contains a validation code.  Thus, when you click on the 
link (which has the validation code embedded), you're directed to the 
page in question and automatically logged in.  To implement that, you'd 
need a table that correlates validation codes with user IDs on your Web 
application.



[/snip]

Have you tried print_r($_POST) ?

 



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



Re: [PHP] Accessing data posted from a different URL

2006-03-20 Thread Richard Lynch
#1. Show us the FORM.

#2. Show us the email itself

#3. Show us the code that processes the POST data.

Without that, we're just guessing in the dark.

Can you make the form work on your server, WITHOUT the email involved?

Check your httpd.conf carefully.  There is no inherent reason why this
shouldn't work, but it would be trivial for you to configure
httpd.conf to make it NOT work if you wanted it that way.

What version of PHP are you running?  Is it so old that $_POST is
really $HTTP_POST_VARS ?  Yikes.  Upgrade!

Add this as the first line to your processing script:

?php phpinfo();?

Now use your email to POST to it.

What do you see in the output about POST and involving your INPUTs in
the form?

On Mon, March 20, 2006 4:03 pm, René Fournier wrote:
 Hmm, perhaps I didn't explain clearly. To put it another:

 1. A script sends an email to a user with sign-in details.
 2. The user clicks a [submit] button in the email message called
 Quick Sign In
 3. A web browsers opens to http://www.website.com/signin.php (from
 the form method=post action=http://www.website.com/sign.php; in
 the email)
 4. Signin.php looks for $_POST[signindetails] and auto-fills the
 form.

 Except the form post is not posting signindetails...


 On 20-Mar-06, at 2:57 PM, Jay Blanchard wrote:

 [snip]
 I have a script that periodically sends an email that includes  form
 post to a script, which is meant to do something with the posted
 data.

 My problem is that apparently some PHP security measure is not
 permitting the externally posted data to be access via $_POST. I
 assume this is due to cross-site scripting issues, but in this case,
 I want to do just that. Any ideas?
 [/snip]

 http://www.php.net/curl




 --
 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] Re: Accessing data posted from a different URL

2006-03-20 Thread Jay Blanchard
[snip]
Some people insist on making everything XHTML compliant just they
assume
that otherwise it would not be Web standards compliant. That is a
silly claim that only leads to all sorts of problems.
  

That assertion is 100% untrue.

First of all, XHTML is an excellent idea.  Having been based in XML 
(which is easier to parse than SGML - the markup base for HTML), XHTML 
is a much, much more interoperable standard.  Second of all, the spec 
has made a number of clarifications which should result in more 
cross-browser predictability.
[/snip]

All of these, XML, HTML, XHTML are subsets of SGML.

[snip]
For instance, if you use method=post because XHTML specification says
everything should be in lower case, you will have problems with some
browsers and e-mail programs that only accept POST in upper case and
fallback to GET when they find something else.
  

Oh, for God's sake, stop selling snake oil.  I'm willing to bet $100 
that you haven't even read the specification and are inventing crap as 
you go.
[/snip]

Easy there sport, no need to fling words like 'crap' around and make
assertions about posters, especially when you do not know them.

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



Re: [PHP] IntVal(float) Returns Different Values (Porting Delphi code to mix a block of data)

2006-03-20 Thread Richard Lynch
You probably want to use BC_MATH or that new-fangled thing like it if
you want to deal in INT larger than 32 bit.

Or you could buy 64-bit hardware.

On Mon, March 20, 2006 9:13 am, Bruce wrote:
 I am having trouble porting some code originally written in Borland
 Delphi
 to PHP. The Delphi code expects certain behavior on integer overflows
 that I
 can only duplicate on some PHP systems. For example:

 $BB = -2181087916;
 $AA = (int)$BB;
 $AA = intval($BB);

 On some systems, $AA will be (int)-2147483648, however, on most
 systems, $AA
 will be (int)2113879380, which is the same value truncated at 32 bits.
 It is
 this latter behavior that I need to properly port the Delphi code.

 Can someone suggest a way to do this that is consistent on all
 platforms?
 For reference, I am attaching the Delphi code and my PHP port.

 Thanks...

 --Bruce

 {quick (block) mixer routine}
 procedure MixBlock(const Matrix : T128bit; var Block; Encrypt :
 Boolean);

 const
   CKeyBox : array [False..True, 0..3, 0..2] of LongInt =

 (((0, 3, 1), (2, 1, 3), (1, 0, 2), (3, 2, 0)),
 ((3, 2, 0), (1, 0, 2), (2, 1, 3), (0, 3, 1)));

 var
   Blocks : array [0..1] of LongInt absolute Block;
   Work : LongInt;
   Right : LongInt;
   Left : LongInt;

   R : LongInt;
   AA, BB : LongInt;
   CC, DD : LongInt;

 begin
   Right := Blocks[0];
   Left := Blocks[1];

   for R := 0 to 3 do begin
   {transform the right side}
 AA := Right;
 BB := Matrix[CKeyBox[Encrypt, R, 0]];

 CC := Matrix[CKeyBox[Encrypt, R, 1]];
 DD := Matrix[CKeyBox[Encrypt, R, 2]];

 AA := AA + DD; DD := DD + AA; AA := AA xor (AA shr 7);
 BB := BB + AA; AA := AA + BB; BB := BB xor (BB shl 13);

 CC := CC + BB; BB := BB + CC; CC := CC xor (CC shr 17);
 DD := DD + CC; CC := CC + DD; DD := DD xor (DD shl 9);

 AA := AA + DD; DD := DD + AA; AA := AA xor (AA shr 3);
 BB := BB + AA; BB := BB xor (BB shl 7);

 CC := CC + BB;
 CC := CC xor (DD shr 15);
 DD := DD + CC;
 DD := DD xor (DD shl 11);

 Work := Left xor DD;
 Left := Right;
 Right := Work;
   end;

   Blocks[0] := Left;

   Blocks[1] := Right;
 end;

 Here is my PHP port:

  ?php
 function zeroFill($a, $b)
 {
   $z = hexdec(8000);
   if ($z  $a)
   {
 $a = 1;
 $a = (~ $z);
 $a |= 0x4000;
 $a = ($b-1);
   }
   else
   {
 $a = $b;
   }
   return $a;
 }

 function MixBlock($AKey, $ACode, $Encrypt)
 {
   $CKeyBox = array(array(3, 2, 0), array(1, 0, 2), array( 2, 1, 3),
 array(0 ,
 3, 1));

   $Right = $ACode[0];
   $Left = $ACode[1];

   for ($R=0; $R= 3; $R++)
   {
 $AA = $Right;
 if ($Encrypt)
 {
   $BB = $AKey[$CKeyBox[ $R][0]];
   $CC = $AKey[$CKeyBox[ $R][1]];
   $DD = $AKey[$CKeyBox[ $R][2]];
 }
 else
 {
   $BB = $AKey[$CKeyBox[ 3-$R][0]];
   $CC = $AKey[$CKeyBox[ 3-$R][1]];
   $DD = $AKey[$CKeyBox[ 3-$R][2]];
 }

 $AA = (int)$AA + (int)$DD;
 $DD = (int)$DD + (int)$AA;
 $AA = (int)$AA ^ zeroFill( $AA, 7);
 $BB = (int)$BB + (int)$AA;
 $AA = (int)$AA + (int)$BB;

 $BB = (int)$BB ^ ((int)$BB  13);
 $CC = (int)$CC + (int)$BB; $BB = (int)$BB + (int)$CC;
 $CC = (int)$CC ^ zeroFill( $CC, 17);
 $DD = (int)$DD + (int)$CC; $CC = (int)$CC + (int)$DD;
 $DD = (int)$DD ^ ((int)$DD  9);

 $AA = (int)$AA + (int)$DD; $DD = (int)$DD + (int)$AA;
 $AA = (int)$AA ^ zeroFill( $AA, 3);
 $BB = (int)$BB + (int)$AA;
 $BB = (int)$BB ^ (int)((int)$BB  7);
 $CC = (int)$CC + (int)$BB;
 $CC = (int)$CC ^ zeroFill( $DD, 15);
 $DD = (int)$DD + (int)$CC;
 $DD = (int)$DD ^ (int)((int)$DD  11);

 $Work = $Left ^ $DD;
 $Left = $Right;
 $Right = $Work;
   }

   $ACode[0] = $Left;
   $ACode[1] = $Right;
 }
 ?



-- 
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] Re: Accessing data posted from a different URL

2006-03-20 Thread Manuel Amador (Rudd-O)

Jay Blanchard wrote:

   



All of these, XML, HTML, XHTML are subsets of SGML.
 

Your point being?  Because my point is centered around the simple fact 
that XML is easier to parse than generic SGML.  XML and SGML aren't 
fully compatible, if you really want to spot on the differences.  XML is 
stricter, meaning there are fewer possible character representations of 
the same document, which eases parseability and machine-to-machine 
interoperability.



Easy there sport, no need to fling words like 'crap' around and make
assertions about posters, especially when you do not know them.
 

Okay, I'm sorry.  Dude, you touched a soft spot.  It's important, to me, 
that people respect standards.  The wealth of information and 
communication possibilities that exist today is, in no small part, 
fueled by the adoption of international standards.


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



RE: [PHP] Re: Accessing data posted from a different URL

2006-03-20 Thread Jay Blanchard
[snip]
Okay, I'm sorry.  Dude, you touched a soft spot.  It's important, to me,

that people respect standards.  The wealth of information and 
communication possibilities that exist today is, in no small part, 
fueled by the adoption of international standards.
[/snip]

That's cool. As far as web development is concerned there are no
'standards', only 'recommendations'. If we had standards we would have
fewer problems with differences between browsers. 

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



Re: [PHP] Re: Accessing data posted from a different URL

2006-03-20 Thread John Nichel

Manuel Amador (Rudd-O) wrote:
snip
Okay, I'm sorry.  Dude, you touched a soft spot.  It's important, to me, 
that people respect standards.  The wealth of information and 
communication possibilities that exist today is, in no small part, 
fueled by the adoption of international standards.




Jay didn't touch your 'soft spot' (I never knew that about you Jay). 
Jay was responding to your flame of another poster (Manuel).


--
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] Re: Accessing data posted from a different URL

2006-03-20 Thread Manuel Amador (Rudd-O)

Jay Blanchard wrote:


[snip]
Okay, I'm sorry.  Dude, you touched a soft spot.  It's important, to me,

that people respect standards.  The wealth of information and 
communication possibilities that exist today is, in no small part, 
fueled by the adoption of international standards.

[/snip]

That's cool. As far as web development is concerned there are no
'standards', only 'recommendations'. If we had standards we would have
fewer problems with differences between browsers. 
 

Sometimes I wish we did have mandatory standards.  Punishable by hanging 
nonconforming implementations implementors' by their thumbs. :-)  But 
then I close Internet Explorer, and I suddenly feel well again.


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



RE: [PHP] Re: Accessing data posted from a different URL

2006-03-20 Thread Jay Blanchard
[snip]
Jay didn't touch your 'soft spot' (I never knew that about you Jay). 
Jay was responding to your flame of another poster (Manuel).
[/snip]

True dat, but I have touched.um.er been in touch with my
feminine side. I am comfortable with who I am, or something like that. 

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



Re: [PHP] Re: Accessing data posted from a different URL

2006-03-20 Thread Manuel Lemos
Hello,

on 03/20/2006 07:16 PM Manuel Amador (Rudd-O) said the following:
 Some people insist on making everything XHTML compliant just they assume
 that otherwise it would not be Web standards compliant. That is a
 silly claim that only leads to all sorts of problems.
  

 That assertion is 100% untrue.
 
 First of all, XHTML is an excellent idea.  Having been based in XML
 (which is easier to parse than SGML - the markup base for HTML), XHTML
 is a much, much more interoperable standard.  Second of all, the spec
 has made a number of clarifications which should result in more
 cross-browser predictability.

That has nothing to do with what I said. Read again.



 For instance, if you use method=post because XHTML specification says
 everything should be in lower case, you will have problems with some
 browsers and e-mail programs that only accept POST in upper case and
 fallback to GET when they find something else.
  

 Oh, for God's sake, stop selling snake oil.  I'm willing to bet $100
 that you haven't even read the specification and are inventing crap as
 you go.

Put that gun down. I am not interested in flame wars. If you do not know
how to discuss something that you disagree in a civilized manner without
departing to personal insult, sorry I can not justify giving you any
further attention.


 For the record, the specification does not say that attribute values
 need to be lowercase, only attribute *names*.  You can put PoST or
 pOST if you feel like it, and the markup validation status will not
 change a bit.

That is not what the W3C validator thinks. Try entering the following
HTML in the W3C markup validator page and see for yourself why people
are using post in lowercase because they think being XHTML compliant is
a good thing.

http://validator.w3.org/#validate-by-input

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
titleNever mind/title
/head
body
form method=POST action=
/form
/body
/html



-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

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

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



Re: [PHP] Re: Fatal error: Call to undefined function preg_match()

2006-03-20 Thread Richard Lynch
On Mon, March 20, 2006 4:58 am, Barry wrote:
 M. Sokolewicz wrote:
 Since when can you unset functions from within php scripts??
 (except
 with specialized modules, which we'll just ignore for now).
 Why ignore them for now?
 Doesn't make sense for me ...

Because the number of people who have installed the RTI module, so
they can re-wire the guts of PHP on the fly, and completely screw up
their system on purpose in the process, is a very very very very small
number.

And the odds that the OP actually installed RTI, *and* managed to do
what it would take to un-define preg_match with it, and still have his
system doing anything else useful, are slim to none, and Slim's out of
town.

:-)

  Recently I am getting the following error on some of my PHP-enabled
  websites. I think it started when I went from PHP4 - PHP5.

 He went from 4 to 5, do you know what 4 had compiled in? no you don't.
 Why don't just ignore he went from 4 to 5.
 So we can see this post as i installed php 5 and got error X

 Sorry, i think that's big nonsense.

What exactly is nonsense?

That installing PHP5 and messing up ./configure to not have PCRE is a
very very very common mistake?

The previous advice given is almost-for-sure 100% correct:

PCRE didn't get complied in -- it's not there -- install it

-- 
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] Re: Accessing data posted from a different URL

2006-03-20 Thread Jay Blanchard
[snip]
Sometimes I wish we did have mandatory standards.  Punishable by hanging

nonconforming implementations implementors' by their thumbs. :-)  But 
then I close Internet Explorer, and I suddenly feel well again.
[/snip]

It would make life for web developers a lot easier. BTW

[Amador]
XML and SGML aren't fully compatible, if you really want to spot on the
differences.
[/Amador]

Here is a more complete exploration of the subject, since we have
strayed so far off-course.

http://www.w3.org/TR/NOTE-sgml-xml.html

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



Re: [PHP] Re: Accessing data posted from a different URL

2006-03-20 Thread Manuel Amador (Rudd-O)

Manuel Lemos wrote:


That is not what the W3C validator thinks. Try entering the following
HTML in the W3C markup validator page and see for yourself why people
are using post in lowercase because they think being XHTML compliant is
a good thing.
 


The validator said:

value of attribute method cannot be POST; must be one of get, post.

so it means you're right.  Perhaps the companion DTD to the standard 
demands either get or post.  Would you like to elaborate on which 
browsers have trouble interpreting lowercase actions in form tags?



http://validator.w3.org/#validate-by-input

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
titleNever mind/title
/head
body
form method=POST action=
/form
/body
/html



 



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



Re: [PHP] array_search function bugged?

2006-03-20 Thread Richard Lynch
On Sun, March 19, 2006 4:46 pm, je killen wrote:
 The following code does not produce the correct results (for my
 purposes):

 function code($str, $match, $formula)
   {
 for($i = 0; $i  count($str); $i++)
   {
 $formula[$i] = array_search($str[$i], $str);// ==|| no bueno
//print $formula[$i]; not right
   if($formula[$i]  $i)
{$str[$i] = '';}
}
   //print'br'; //- etc (lots more code)---

 The code takes a string of ascii letters forming a word and is
 supposed
 to create a list of indexes
 in the proper sequence for reconstructing the word. The object of the
 code in context is to take
 any word and create an array of unique letters with no repeats so that
 gd can be used to produce
 images of each letter.

Almost for sure, this function could be used instead:
http://www.php.net/manual/en/function.count-chars.php

You'll be throwing away the information about how many of each letter.

I really don't understand, though, why you are doing things the way
you describe...

 The letters are then reassembled in the browser
 to form the word. The
 $formula above is supposed to tell the browser in what sequence to
 display each letter, including
 using the same letter image in repeat locations. For this it fails
 miserably.

 These are the results of test steps:

 dissatisfaction (the test word)
 Processed input string:   dissatisfaction (code output at key step to
 verify)
 at creation of formula:012245128410511314 (formula sampled at ' no
 bueno' line in code)
 from browser source array:012245128410511314 (formula pasted from
 browser javascript source)

 The letter images spell out:
 disstfisntidfiiait  which is in accordance with the formula as far as
 I
 can tell.

How do you distinguish in:
012245128410511314
between one-digit and two-digit integers?

dissatisfaction
  1
012345678901234

0-d
1-i
2-s
3-NULL (2 is 's')
4-a
5-t
6-NULL (1 is 'i')
7-NULL (2 is 's')
8-f
9-NULL (4 is 'a')
10-c
11-NULL (5 is 't')
12-NULL (1 is 'i')
13-o
14-n

Going from just the numbers, now I get:
012245128410511314
dissatisfaidtiiNULLia

So, given the input 012245128410511314, you are never going to get the
original word back from just that...

I don't think your formula makes sense in the first place...

If you just want to represent each character as a GD image, and not
duplicate, so the browser can cache images, you can just do:

?php
for ($i = 0, $len = strlen($word); $i  $len; $i++){
  $char = $string[$i];
  ?img src=drawchar.php/char=?php echo $char? /?php
}
?

You can then use $_SYSTEM['PATH_INFO'] (or whatever it's called) to
get 'char=?' and do like:
list($key, $value) = explode('=', $_SYSTEM['PATHINFO']);
$$key = $value;

 There is one other weakness I've discovered, if arrays are created in
 one code sequence and are called
 to print in loops more than once or processed in different code
 sections. The second time the same array
 is called it has significantly degraded, loosing values from index
 positions.

If you are using list/each or something like that, there is an
internal pointer in the array which you are mucking with, and most
likely confusing yourself with.

Try using 'foreach' which does not use that internal pointer.

 the seems to be no bug report accommodation in the php.net site so I'm
 posting here.

Posting here FIRST is good, especially since you have not encountered
an actual bug yet :-)

After that, though, there *IS* a place to search for, and ultimately
report bugs:
http://bugs.php.net

But please don't clog that with reports before checking them out
thoroughly, so you really ARE reporting bugs in 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] SNMP problem is TCP

2006-03-20 Thread Richard Lynch
You're not showing enough code...

What does function zamiana look like?

And is the code you gave us porty_set.php line 70?

Or is that some other code we haven't seen?

Is 'pliki' a PHP software package you got somewhere else?  They may
have a more focussed forum / mailing list / whatever that can help you
faster than we can here...

On Sun, March 19, 2006 4:08 pm, wood-gd wrote:
 Hello
 // I sorry my english
 //my script is control TCP protocol 

 $ip=83.190.177.45;  // IP
 $community=public; //community (password)
 echo $stan = '12'; // deletetcb - del connect

  $LocalAddress =
 snmpwalk($ip,$community,tcp.tcpConnTable.tcpConnEntry.tcpConnLocalAddre
 ss);
  $LocalPort =
 snmpwalk($ip,$community,tcp.tcpConnTable.tcpConnEntry.tcpConnLocalPort
 );
  $RemAddress =
 snmpwalk($ip,$community,tcp.tcpConnTable.tcpConnEntry.tcpConnRemAddress
 );
  $RemPort =
 snmpwalk($ip,$community,tcp.tcpConnTable.tcpConnEntry.tcpConnRemPort);

  echo
 $wynik='1.3.6.1.2.1.6.13.1.'.zamiana($LocalAddress[$id],IpAddress:
 ).'.'.$LocalPort[$id].'.'.zamiana($RemAddress[$id], IpAddress:
 ).'.'.$RemPort[$id];

  snmpset($ip, $community, $wynik, i, $stan);

 //-- zamiana($LocalAddress[$id],IpAddress: ) this is function
 //-- Is error

 12
 1.3.6.1.2.1.6.13.1.0.0.0.0.135.0.0.0.0.0
 Warning: snmpset(): Could not add variable:
 system.sysUpTime.6.1.2.1.6.13.1.0.0.0.0.135.0.0.0.0.0 i 12 in
 e:\program
 files\apache group\apache\users\snmp\pliki\porty_set.php on line 70

 //-- hellp Me. My e-mail [EMAIL PROTECTED]

 --
 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] Accessing data posted from a different URL

2006-03-20 Thread René Fournier

On 20-Mar-06, at 3:05 PM, Jay Blanchard wrote:


[snip]
Hmm, perhaps I didn't explain clearly. To put it another:

1. A script sends an email to a user with sign-in details.
2. The user clicks a [submit] button in the email message called
Quick Sign In
3. A web browsers opens to http://www.website.com/signin.php (from
the form method=post action=http://www.website.com/sign.php; in
the email)
4. Signin.php looks for $_POST[signindetails] and auto-fills the  
form.


Except the form post is not posting signindetails...
[/snip]

Have you tried print_r($_POST) ?


Yes. And to answer a few other questions: The script, the email, the  
server—everything is on the same computer, running on top  of the  
same Apache/PHP installation (v 4.3.11). The form is essentially:


form method=POST target=SI action=http:// 
www.website.cominput type=hidden name=signindetails  
value=serialized and htmlentitized array values...input  
type=submit name=submit value=Fill/form


I've narrowed it down a little farther:

1. If I copy the form from the email into the destination php page  
(ProcessSignin.php), and click Submit, it works—I get can see the  
$_POST[signindetails]


2. If I copy the form from the email into the original php page  
(MakeandSendSignin.php), and click Submit (with  
action=ProcessSignIn.php), it works—I can see the $_POST 
[signindetails]


3. ONLY if I click the Submit FROM the email—email client Mac OS X  
Mail.app or Outlook Excell—does it fail. The destination php page  
(ProcessSignin.php) appears, but print_r($_POST) reveals no $_POST 
[signindetails].


So, it appears that the email clients are stripping the POST data on  
Submit.


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



Re: [PHP] Mail function problems

2006-03-20 Thread Richard Lynch

On Windows, you need SMTP set.

If you can't set it in php.ini, you might try .htaccess, but I suspect
that is locked down and you can't...

You could try things like:

Install Pegasus email client, and use it from http://php.net/exec to
send email.

Install some kind of class from http://phpclasses.org that lets you
choose your own SMTP server, and the PHP code in that class handles
the mail protocol rather than using PHP's builtin code (which is tied
to php.ini settings)

Note that the built-in code will be faster but the mail() function
is never suitable for mass high-volume emails.

On Sun, March 19, 2006 3:50 pm, Paul Goepfert wrote:
 Hi all,

 Has anyone had this problem before?  I have a web server that resides
 on a windows platform (According to phpinfo()).  I used the php mail
 function to send out a test message to make sure that the mail
 function would work when needed.  I sent out the test message and I
 didn't get an email sent to me.  This is what I did, I created the
 following variables:

 $to = [EMAIL PROTECTED];
 $subject =Test;
 $message =This is a test
 $headers = From: Paul  .
   [EMAIL PROTECTED]\r\n;
 $headers .= X-Sender:  [EMAIL PROTECTED]\r\n;
 $headers .=X-Mailer: PHP\r\n;
 $headers .=Return-Path: [EMAIL PROTECTED]\r\n;

 I put them in the mail function as parameters
 mail($to,$subject,$message,$headers).


 Ok now this is what is found in phpinfo():

 sendmail_from no value no value
 sendmail_path no value no value
 SMTP no value no value
 smtp_port25   25

 Do these values need to be set?  if so, how do that on a remote
 server?  I don't think I have access to the httpd config file or
 php.ini file.

 Thanks
 Paul

 --
 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] Get class name in static method

2006-03-20 Thread Grant Young

Not sure about PHP5, but for PHP4 I found this hack solution at:
http://passivedigressive.com/archives/2005-02/php-static-class-name-solution/

There are probably all sorts of issues with this approach, but it solved 
the problem at the time...


HTH.  Grant

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



Re: [PHP] Re: Accessing data posted from a different URL

2006-03-20 Thread Richard Lynch
On Mon, March 20, 2006 4:16 pm, Manuel Amador (Rudd-O) wrote:
 The original poster's problem may be related to the fact that,
 perhaps,
 he's checking for the value of a button in the POST variable, when
 it's
 a very well known fact that the browser only sends the value of the
 button if the user *clicks* the button, but not if the user hits ENTER
 in one of the form fields.

That's actually browser-dependent behaviour...

I think it was Netscape that sent the name/value just as if the user
clicked the button, but IE that didn't.

Or maybe vice-versa.

There is something to be said for not trying to make your code XHTML
compliant, though...

I'm more worried about works in all browsers compliant, which,
unfortunately, is not a documented standard anywhere. :-v

-- 
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] Accessing data posted from a different URL

2006-03-20 Thread Richard Lynch
On Mon, March 20, 2006 5:04 pm, René Fournier wrote:
 form method=POST target=SI action=http://
 www.website.cominput type=hidden name=signindetails
 value=serialized and htmlentitized array values...input

What does this value actually look like?

How long is it?

Is mail wrapping it to 72 characters with a newline, thereby breaking
the data up?

Though you would still get some POST data, just not what you thought...

 type=submit name=submit value=Fill/form

 I've narrowed it down a little farther:

 1. If I copy the form from the email into the destination php page
 (ProcessSignin.php), and click Submit, it works—I get can see the
 $_POST[signindetails]

 2. If I copy the form from the email into the original php page
 (MakeandSendSignin.php), and click Submit (with
 action=ProcessSignIn.php), it works—I can see the $_POST
 [signindetails]

 3. ONLY if I click the Submit FROM the email—email client Mac OS X
 Mail.app or Outlook Excell—does it fail. The destination php page
 (ProcessSignin.php) appears, but print_r($_POST) reveals no $_POST
 [signindetails].

 So, it appears that the email clients are stripping the POST data on
 Submit.

Possibly.

Here's an idea:

Take all that signindetail you want and cram it into a database table,
with a unique random key field to look it up.

You can then use method=GET or even a simple link like:
http://example.com/signin?key=345kjh46kjn345984y3569078v9

For those of us who don't even READ html-enhanced (cough, cough)
email, it's better anyway. :-)

-- 
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] Merging two partially-transparent images results in black pixels

2006-03-20 Thread Richard Lynch
On Sat, March 18, 2006 9:16 pm, Jason Young wrote:
 I have an image that uses partial transparency for borders and such.
 At first, I tried using the whole image; creating a truecolor 'holder'
 image, then imagecopymerge-ing it, but that resulted in the outside
 transparent areas (the ones that would instead show the 'holder'
 image)
 were black, while the portions of transparency on the inside (these
 are
 rounded-squares) that had actual other images below them were white.

I think you maybe need to allocate a color in the holder image as the
background color...

 Then, I made two images. One having the outside transparency, and
 setting imagesavealpha to make it work as intended... then adding the
 needed images, then adding the 'window'-type transparent image on top.
 This gives the best result, but the 'window' image also has partial
 transparency, and is instead showing in black.

Again, try doing:
$white = imagecolorallocate($image, 255, 255, 255);

to 'set' the background color.

I think this behaviour change in different GD versions, though.

 I'm pretty much at wit's end. Everything's imagecopymerge'd, I've
 tried
 just about everything I could think of.

 Can you actually not have two transparent images on top of one
 another?

I'm almost certain you can, but keep in mind that any overlap in
them will probably come out darker than you think...

Each of the alpha blends will kick in consecutively to darken things.

At least, that was my experience with this, in my brief toying with it.

 Is there something else I can try?
 And as an offshoot question, why won't any transparent images natively
 load/import as transparent? I always seem to have to call
 imagecolortransparent on portions that are definitely transparent in
 Photoshop, etc.

Just the way it is, I think...

-- 
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] no newline after ? in the resulting HTML

2006-03-20 Thread Richard Lynch
On Sat, March 18, 2006 12:36 pm, Rostislav Krasny wrote:
  pHello World/p
  /body

  pHello World/p/body

 Why there is no newline afer  pHello World/p ?
 Is it a PHP bug or the tutorial should be updated?

The tutorial is imprecise, and glosses over this detail.

For very good reasons, ?[newline] ignores the trailing [newline]
character.

If you want the newline, you should do:

?php
  echo pHello World/p\n;
?

As for WHY the [newline] after ? is ignored, it just turns out that
there are more times when you want it that way than the other, *AND*
it's trivial to insert a \n into your output, *AND* it would be very
hard to come up with a way to make the newline NOT appear if the
default was to have it appear, *AND* a *TON* of things would go wrong
if the extra newline appeared where you don't want it, but it's pretty
unimportant if a newline is missing at that point in the tutorial and
in most real-world cases (IE, HTML output) where you have ?[newline]

It's not a bug ; It's a feature

-- 
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] no newline after ? in the resulting HTML

2006-03-20 Thread Richard Lynch
On Sat, March 18, 2006 1:23 pm, Adrian wrote:
 Is there a way to circumvent this?
 My template engine compiles templates to PHP files and this feature
 makes the output html code look awful sometimes.

You could:

1. Add \n after all the lines of output where it matters.
2. Use TWO newlines after ? tags

?php echo Test;?

newline

I *believe* this will output:
Test
newline

PHP only eats *ONE* newline after ?, not multiple newlines,
almost-for-sure.

-- 
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] Re: no newline after ? in the resulting HTML

2006-03-20 Thread Richard Lynch
On Sat, March 18, 2006 3:32 pm, Rostislav Krasny wrote:
 On Sat, 18 Mar 2006 19:37:48 +
 [EMAIL PROTECTED] (James Benson) wrote:

 I get the same results, I doubt it's a bug, the person who wrote the
 article maybe never tried what it would output since they probably
 know
 how the echo construct works,

 I think it is a bug. That part of the article could been written with
 very old version of PHP. By the way, ASP does not delete a newline
 after its %.

It's a documented feature, not a bug. :-)

And, honestly, what ASP (blech) does is about as relevant as the price
of tea in China.

Nobody, not even Bill Gates, has enough money to pay me to use ASP again.

-- 
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] Updating a single line in a file

2006-03-20 Thread Richard Lynch
Put it all in a database, and write out the file whenever it changes?

Only half-joking.

Virtually all your problems mentioned go away if it's in a database,
and it's not that tricky to set things up so you can write out the
file from the db when you need to.

On Sat, March 18, 2006 4:01 am, smr78 wrote:
 Hi,
 What is the best method to update a single line in a text file?
 I have a file made of identifiers, that is pointed on by a htaccess
 file and
 used by a server to give access to a web site.
 The file content is like this :
 login1:pass1\r\n
 login2:pass2\r\n
 
 loginn:passn\r\n
 loginn1:passn1\r\n
 
 lastlogin:lastpass\r\n

 This file can be modified in three ways
 update a single line when a user updates its profile
 delete a single line when the webmaster makes a user inactive
 append a line when the webmaster makes a user active

 the difficulties are :
 there is not the same number of users and lines in this file,
 we dont know at which line are the identifiers of a user,
 when updating identifiers, we must keep new line characters at the
 end.

 So what are the best functions to use to read and rewrite the file?

 file() which puts all the content in an array, including the new line
 characters? (if so, we need to use array_search() or array_keys() to
 find
 where are the identifiers

 fread() or file_get_contents() which puts all the content in a string?
 I
 tried this way and use eregi_replace() to find where are the
 identifiers,
 replace them by new value. But sometimes, I get errors where the new
 line
 characters are suppressed between two users identifiers or where an
 identifier is repeated like this :

 loginx:passx\r\n
 loginx:passx\r\n
 loginn:passnloginn1:passn1\r\n
 loginn2:passn2\r\n

 Here is my code :
 ? php
 //reading the actual file content
 $length=filesize($filename);
 $fp=fopen($filename,r);
 $str=fread($fp,$length);
 fclose($fp);

 //in case of updating
 $str=eregi_replace($oldlogin.:.$oldpass,$newlogin.:.$newpass,$str);
 //in case of deleting
 $str=eregi_replace($oldlogin.:.$oldpass,,$str);

 //rewriting the file
 $handle = fopen($filename,w+)
 fwrite($handle,$str,strlen($str))

 //in case of inserting a new user

 $str=$newlogin.:.$newpass.\r\n;
 $handle = fopen($filename,a)
 fwrite($handle,$str,strlen($str))
 ?
 I know in deleting case, the eregi_replace pattern is so that the
 new line
 characters will not be removed, but this is not a problem

 I'll try to use file() function and array_keys() and let you know.
 Thanks

 --
 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] Accessing data posted from a different URL

2006-03-20 Thread René Fournier


On 20-Mar-06, at 4:40 PM, Richard Lynch wrote:


On Mon, March 20, 2006 5:04 pm, René Fournier wrote:

form method=POST target=SI action=http://
www.website.cominput type=hidden name=signindetails
value=serialized and htmlentitized array values...input


What does this value actually look like?

How long is it?

Is mail wrapping it to 72 characters with a newline, thereby breaking
the data up?

Though you would still get some POST data, just not what you  
thought...



Actually, neither the form, nor the data seems to matter. I've copied  
in simple forms from elsewhere, and the only determining factor so  
far is:


If the form is submitted from a web browser, the POSTed data IS  
available/visible (print_r) in the new web page.
If the form--that is, any form--is submitted from an email client  
(any email client), the POSTed data IS NOT available/visible in the  
new web page.


So... I can think of three explanations:
1. The email client (Mail or Outlook Express) is stripping the POST  
data on Submit.
2. The web browser (Safari, Firefox) is stripping incoming POST data  
if it's coming from outside the application.
3. PHP somehow knows if the form data is being POSTed from inside the  
web browser or not (and fails on the latter).


Weird.

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



Re: [PHP] Re: Printing library in PHP ?

2006-03-20 Thread robert mena
Boban,

I do not know what noobie is but thanks for the reply.  I know that the
effect I want can be achieved using CSS but the question was there is a
printing llibrary so some of the trouble would be solved by this library
and not myself


On 3/14/06, Bogdan Ribic [EMAIL PROTECTED] wrote:

 This is more of an HTML question than it has to do with PHP, and you
 sound like a noobie :)

 Only useful info I can give you is to use THEAD in tables to hold
 headers, browsers put that row first on every page when breaking large
 table on several pages.

 Boban.

 robert mena wrote:

  For example:
  I have a specific report I have to add a header to each page
  I have another one with tabular data that when the result is larger than
 a
  page I should break the table and start at the next page so the table
  headers can be seen again...
 
  In both I'd need a way to decide/find out how many pages will be
 necessary
  (given the size of the paper sheet) so I could generate the HTML
 correctly.
 


 --

Open source PHP code generator for DB operations
http://sourceforge.net/projects/bfrcg/

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




Re: [PHP] Re: Printing library in PHP ?

2006-03-20 Thread robert mena
Hi Burhan,

Thanks. I'll try that but even tough my clients now uses windows I generally
do not like to be too commited to a single platform.

-rm


On 3/15/06, Burhan [EMAIL PROTECTED] wrote:

 robert mena wrote:
  Hi Manuel,
 
  I am trying to print from the client side.  The client will be windows.

 Use ActiveX if you can get them to stick with IE (shouldn't be a problem).

 Google for 'ScriptX.cab' -- a free printing control that lets to fine
 tune printing.



[PHP] Will PHP6 have threads (yet)?

2006-03-20 Thread Daevid Vincent
It would be fantastic if PHP 6 was multi-threaded so you could spin threads
to do simultaneous tasks. Is there any plans for this?

It would also be great if you could exec() or system() a program to run
without blocking on a return. Sometimes I just want some other task to
happen independantly without waiting (for example, call a program that *IS*
threaded).

Many other languages including JAVA, Perl, Python and Ruby are all
multi-threaded, and it's a continuing source of frustration that PHP isn't.

D.Vin

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



Re: [PHP] Printing library in PHP ?

2006-03-20 Thread robert mena
Hi Steve,

This seems to be a good alternative.  I've found pdflib($), ezPDF (dead?) e
this fpdf as different ways to generate pdf.

One drawback is that I'd have to construct all my documents 'by hand'.  For
trully dynamic this is no problem but for those that only differs at the
name of the client that would represent too much work for a little gain.

After some research it seems that there is a tool called docbook that allows
me to convert it's format (a XML based?) into a lot of things, PDF included.

Well, I have two ways now:
- use a pdf library for those dynamic reports
- convert my word documents into docbook (using an editor), put some
placeholders and using PHP to replace the placeholders with actual data
(such as name, price) and call docbook to generate the pdf.

- rm

On 3/14/06, Steve Brown [EMAIL PROTECTED] wrote:

  I am currently migrating an application originally written with Delphi
 to
  PHP.  Everything is going fine except the printing of the reports that
 does
  not produce the same visual result (i.e does not look the same or has
 some
  aligmment issues).

 We generate all of our printed reports using FPDF
 (http://www.fpdf.org) to generate PDF files.  Its very flexible, can
 do must of what you are aksing for, and unlike some alternatives, its
 free.PDFs are going to be the easiest way to get total control of
 the output.

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




[PHP] Security in php/ajax scripts

2006-03-20 Thread robert mena
Hi,

I am slowly converting my webapps to use the 'ajax' technology.  I'd like to
know what 'best practices' should I use when it comes to authenticate,
identify the requests in a more restricted context.

So far I've migrated some 'open' areas where the user, without having to
identify himself can perform searches. But I need to allow/deny him to do
insert/delete/update actions.

In the traditional webapp I'd create a login page where the user. password
would be checked against a database and a session variable would be set with
a authenticate code.  Further access to restricted pages are allowed/denied
based on the existance of this authenticate code.

What would be a good alternative in my ajax-enabled webapp?  I cant use
session in my php scripts (those called by the XMLHttpRequest.open) right?


Re: [PHP] Security in php/ajax scripts

2006-03-20 Thread Robert Cummings
On Mon, 2006-03-20 at 20:24, robert mena wrote:
 Hi,
 
 I am slowly converting my webapps to use the 'ajax' technology.  I'd like to
 know what 'best practices' should I use when it comes to authenticate,
 identify the requests in a more restricted context.
 
 So far I've migrated some 'open' areas where the user, without having to
 identify himself can perform searches. But I need to allow/deny him to do
 insert/delete/update actions.
 
 In the traditional webapp I'd create a login page where the user. password
 would be checked against a database and a session variable would be set with
 a authenticate code.  Further access to restricted pages are allowed/denied
 based on the existance of this authenticate code.
 
 What would be a good alternative in my ajax-enabled webapp?  I cant use
 session in my php scripts (those called by the XMLHttpRequest.open) right?

Sure you can.

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

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



Re: [PHP] Security in php/ajax scripts

2006-03-20 Thread Philip Hallstrom

I am slowly converting my webapps to use the 'ajax' technology.  I'd like to
know what 'best practices' should I use when it comes to authenticate,
identify the requests in a more restricted context.

So far I've migrated some 'open' areas where the user, without having to
identify himself can perform searches. But I need to allow/deny him to do
insert/delete/update actions.

In the traditional webapp I'd create a login page where the user. password
would be checked against a database and a session variable would be set with
a authenticate code.  Further access to restricted pages are allowed/denied
based on the existance of this authenticate code.

What would be a good alternative in my ajax-enabled webapp?  I cant use
session in my php scripts (those called by the XMLHttpRequest.open) right?


Why not?  Not that I've tried it, but your browser is going to be making 
the call and I would imagine it would send along any cookies it has just 
like it normally does...


Try it and see if it sends the session cookie along...

-philip

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



[PHP] PERL Caller equivalent function

2006-03-20 Thread sgsweb

Hi,

Perl has a function named caller with the following signature and return 
values:


   ($package, $filename, $line, $subroutine,
$hasargs, $wantarray, $evaltext, $is_require) = caller($i);

This function returns information pertaining to the calling routine, 
such as the name of the function and package that called this function.  
Is there such a function for PHP?


Please let me know.

thanks,
sgs.

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



Re: [PHP] PERL Caller equivalent function

2006-03-20 Thread Chris

sgsweb wrote:

Hi,

Perl has a function named caller with the following signature and return 
values:


   ($package, $filename, $line, $subroutine,
$hasargs, $wantarray, $evaltext, $is_require) = caller($i);

This function returns information pertaining to the calling routine, 
such as the name of the function and package that called this function.  
Is there such a function for PHP?


debug_backtrace returns an array of how the function got called (ie the 
complete path that was taken from the start to get to this function).


http://www.php.net/debug_backtrace

--
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] Retrieve large amounts of binary data from MySQL database in pieces

2006-03-20 Thread Michael Thomsen
Hi, I was wondering if anyone knew how to retrieve large amounts of
binary data from a MySQL database without having it loaded all at once
into a PHP data structure. I'd like to be able to iterate over the
result, pulling out 16kb or so of data at a time and feed it to the
browser. Any suggestions?

Thanks,

Mike

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



Re: [PHP] Re: Accessing data posted from a different URL

2006-03-20 Thread Manuel Lemos
Hello,

on 03/20/2006 07:52 PM Manuel Amador (Rudd-O) said the following:
 That is not what the W3C validator thinks. Try entering the following
 HTML in the W3C markup validator page and see for yourself why people
 are using post in lowercase because they think being XHTML compliant is
 a good thing.
  

 The validator said:
 
 value of attribute method cannot be POST; must be one of get, post.
 
 so it means you're right.  Perhaps the companion DTD to the standard
 demands either get or post.  Would you like to elaborate on which
 browsers have trouble interpreting lowercase actions in form tags?

I do not recall, but I think there was a problem with some Opera versions.

-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

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

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



[PHP] is there a guide for pda friendly web pages

2006-03-20 Thread Rick Lim
is there a guide for pda friendly web pages.

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



[PHP] PEAR::SOAP on Windows not working

2006-03-20 Thread Peter Lauri
Hi,

I have been searching for directions of how to get PEAR::SOAP to work on my
Windows Machine, but without success. I have downloaded the package and
unzipped it to a subfolder to my main web folder.

This is my error message:

--
Warning: main(HTTP/Request.php): failed to open stream: No such file or
directory in C:\Documents and Settings\Peter Lauri\My Documents\DWS
Asia\webserver\xl\SOAP\WSDL.php on line 27

Fatal error: main(): Failed opening required 'HTTP/Request.php'
(include_path='.;C:\php4\PEAR\pear') in C:\Documents and Settings\Peter
Lauri\My Documents\DWS Asia\webserver\xl\SOAP\WSDL.php on line 27
--

However, when I make a search for the file Request.php in my file system, I
can not find it. 

Have I missed any step in the installation procedure? Maybe some other
package that I need to install before?

Best regards,
Peter Lauri

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



Re: [PHP] PEAR::SOAP on Windows not working

2006-03-20 Thread T.Lensselink
Peter Lauri said:
 Hi,

 I have been searching for directions of how to get PEAR::SOAP to work on
 my
 Windows Machine, but without success. I have downloaded the package and
 unzipped it to a subfolder to my main web folder.

 This is my error message:

 --
 Warning: main(HTTP/Request.php): failed to open stream: No such file or
 directory in C:\Documents and Settings\Peter Lauri\My Documents\DWS
 Asia\webserver\xl\SOAP\WSDL.php on line 27

 Fatal error: main(): Failed opening required 'HTTP/Request.php'
 (include_path='.;C:\php4\PEAR\pear') in C:\Documents and Settings\Peter
 Lauri\My Documents\DWS Asia\webserver\xl\SOAP\WSDL.php on line 27
 --

 However, when I make a search for the file Request.php in my file system,
 I
 can not find it.

 Have I missed any step in the installation procedure? Maybe some other
 package that I need to install before?

 Best regards,
 Peter Lauri

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



For PEAR::SOAP to function properly you have to install some more PEAR
packages. PEAR::SOAP is dependend on the following packages as i remember.

HTTP
HTTP_Request
Net_Socket
Net_URL

And needs some of the following also:

Mail_Mime
Net_DIME

Hope it helps..

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



[PHP] SOAP PEAR/NuSOAP

2006-03-20 Thread T.Lensselink
I'm working on a small webservice. When started this project i used the
NuSOAP library. And it does the job perfectly. But last weekend i was
playing around with the PEAR::SOAP package. This seems to be a lot more
stable. And for sure a llot faster.

Only in NuSOAP i could do the following to get to a secured page.

$client-setCredentials(USERNAME, PASSWORD, AUTHTYPE);

Now i wanna do the same in PEAR::SOAP but can't figure out a way to do it.
Main is i just want Basic HTTP authentication. Maybe somebody knows?


grtz,
Thijs

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



Re: [PHP] SOAP PEAR/NuSOAP

2006-03-20 Thread chris smith
On 3/21/06, T.Lensselink [EMAIL PROTECTED] wrote:
 I'm working on a small webservice. When started this project i used the
 NuSOAP library. And it does the job perfectly. But last weekend i was
 playing around with the PEAR::SOAP package. This seems to be a lot more
 stable. And for sure a llot faster.

 Only in NuSOAP i could do the following to get to a secured page.

 $client-setCredentials(USERNAME, PASSWORD, AUTHTYPE);

 Now i wanna do the same in PEAR::SOAP but can't figure out a way to do it.
 Main is i just want Basic HTTP authentication. Maybe somebody knows?

You might get a faster response on the pear list:

http://pear.php.net/support/lists.php

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

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



Re: [PHP] SOAP PEAR/NuSOAP

2006-03-20 Thread T.Lensselink
chris smith said:
 On 3/21/06, T.Lensselink [EMAIL PROTECTED] wrote:
 I'm working on a small webservice. When started this project i used the
 NuSOAP library. And it does the job perfectly. But last weekend i was
 playing around with the PEAR::SOAP package. This seems to be a lot more
 stable. And for sure a llot faster.

 Only in NuSOAP i could do the following to get to a secured page.

 $client-setCredentials(USERNAME, PASSWORD, AUTHTYPE);

 Now i wanna do the same in PEAR::SOAP but can't figure out a way to do
 it.
 Main is i just want Basic HTTP authentication. Maybe somebody knows?

 You might get a faster response on the pear list:

 http://pear.php.net/support/lists.php

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



Yes after i posted was thinking the same... Still to early :)

Thnx anyway!

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