Re: [PHP] OOP Newbie - why does this not work?

2005-10-21 Thread Jesper Gran

On 2005-10-21 06:17, Stephen Leaf wrote:


most likely var is depreciated in php5. (can someone confirm this?)
 


Well, if I try to use Var in a class i get this message:

Strict Standards: var: Deprecated. Please use the 
public/private/protected modifiers in C:\code\test\var.php on line 3*


/*Jesper*
*

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



Re: [PHP] OOP Newbie - why does this not work?

2005-10-21 Thread Jochem Maas

Bob,

'wrapping' you class definition within HTML like you have done is
not only weird but down right ugly. I recommend sticking each class
you write in a seperate file and using include_once() or require_once()
before you output anything to the browser. basically try to
seperate you code into 'stages' (for want of a better word) e.g.:

1. setup an environment (includes loading classes)
2. process the request
3. redirect or output a page

Bob Hartung wrote:

Hi all,


...



/head
body
br
  PThis is outside the php code block/P
br
?php
  echo Start defining the class here: BR ;
/*  class Test
  {

function __constructor()

 {
   var $saying ;


'var' doesn't belong here. it belongs directly in the body of class def.


$saying = Im in the Test Class ;
 }
   
 function get()

 {
   return $saying ;



there is a missing '}' here.
also you should be returning and setting $this-saying


   
  }

  var $liveclass ;


drop the 'var' - it's only for php4 and then only for
defining the properties of classes/objects:

class Test {
var $myProperty;
}


  $liveclass = new Test ;
  echo $liveclass-get() ;
  echo BR ;
 echo This is in the php code block ;
*/
?

/body
/html



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



Re: [PHP] PHP and files Upload

2005-10-21 Thread Andy Pieters
Hi

As a security precaution, all uploaded files are automatically deleted when 
the script goes out of scope.

Use the move_uploaded_file function to move the file somewhere else before 
your script ends.

There are various other security precautions you have to consider.  And by all 
means don't expect the browser to adhere to the limitations you set in the 
form, like mime type and max sizes, also know that it is fairly easy for 
someone to directly connect to the socket and upload a file, bypassing the 
browser altogheter.

The php documentation site covers file uploads in depth (www.php.net)


HTH



With kind regards



Andy

On Wednesday 19 October 2005 00:36, feiticeir0 wrote:
 hello all.

 I've managed to create files uploads pages in the past (dont remember if
 alredy with php 5).

 till now, i havent need for testing or using.
 today, i've tried to test an upload page (a very simple one) with php 5.0.5
 and i was unable to do it.

 the script always says it was sucessful to upload the file, but the
 destination directory was always empty...
 even when checking the $_FILES global

 $_FILES['var_name']['tmp_name'] and
 $_FILES['var_name']['name'] and
 $_FILES['var_name']['size'], the vars alwyas return empty values...

 is there any issue with php5 about files uploads ?

 in php.ini i set the temp directory to /tmp and still nothing works...

 Cheers,

 Bruno Santos

 --
 Open WebMail Project (http://openwebmail.org)


 --
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.

-- 
Now listening to Top! Radio Live www.topradio.be/stream on amaroK
Geek code: www.vlaamse-kern.com/geek
Registered Linux User No 379093
If life was for sale, what would be its price?
www.vlaamse-kern.com/sas/ for free php utilities
--


pgp2zJjHn44KV.pgp
Description: PGP signature


Re: [PHP] How can I count the usage of mail function in scripts?

2005-10-21 Thread Andy Pieters
Hi

While it *is* possible to do what you ask for, it would be worthless.

I can write from scratch a php script that 
* looks up the mx record for a given email address
* connects to the mail server looked up
* send the message.

Since the SMTP protocol is fairly simple, I am sure many others can and will 
use this to circumvent your limitations.


With kind regards



Andy

On Tuesday 18 October 2005 11:45, Cristea Adrian wrote:
 Hello peoples!

 short question: How can I count the usage of mail function in scripts?

 long description :D

 I have a webserver, and I want to limit the usage of mail function for
 each host I have there.. Notice that i have a couple of hundrest of
 virtual hosts (domains and subdomains) there, and i want to limit
 them, let`s say.. 100 mails per day.. there is any solution to do
 that? (i know there is, i saw that in a nwebhosting company) .. can
 you guide me find this solution?

 thanks in advance!

 cheers, cajbecu

-- 
Now listening to Top! Radio Live www.topradio.be/stream on amaroK
Geek code: www.vlaamse-kern.com/geek
Registered Linux User No 379093
If life was for sale, what would be its price?
www.vlaamse-kern.com/sas/ for free php utilities
--


pgpCA6RiR5PNi.pgp
Description: PGP signature


[PHP] Preference for User Permissions system

2005-10-21 Thread Richard Davey
Hi php-general,

  I'm interested to know what everyones preference is for user
  permissions / roles in php apps? For example do you employ a Unix
  style groups system, is there a ready-rolled class or package you
  use, or have you just built your own and stick with it?

Cheers,

Rich
-- 
Zend Certified Engineer
http://www.launchcode.co.uk

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



Re: [PHP] LDAP and a pain in my neck

2005-10-21 Thread Jochem Maas

André Medeiros wrote:

Check your webserver logs. If PHP couldn't use the extension, it will
accuse that in the logs.


probably the best use of the word 'accuse'   ever

(with a slight nod to commercials for Carlsberg lager :-)



On 10/20/05, Jay Blanchard [EMAIL PROTECTED] wrote:


[snip]


Call to undefined function: ldap_connect()

What am I missing? TIA.



Did you uncomment (and properly define) the 'extension_dir' directive
in your php.ini?
[/snip]

Yep.

--
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: Preference for User Permissions system

2005-10-21 Thread James Benson

What I do is have different classes that build upon each other,


authentication  permissions class,
common database access extending PEAR DB.

then i have a custom class for specific actions like editing pages, my 
database is just either either an email or username and password then 
another table has permission levels in, permissions for every user are 
defined in their DB table in a comma seperated list, that way i can 
create many groups and have a user belong many groups, then page editng 
for instance can be restricted to specific users or groups, I designed 
it all to be flexible enough to reuse for all my websites I hope :)




Regards,
James




Richard Davey wrote:

Hi php-general,

  I'm interested to know what everyones preference is for user
  permissions / roles in php apps? For example do you employ a Unix
  style groups system, is there a ready-rolled class or package you
  use, or have you just built your own and stick with it?

Cheers,

Rich


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



Re: [PHP] php 5.0.5 segfaults apache2 on ubuntu, 5.0.4 ok

2005-10-21 Thread Jon Hill

I think this could be related to your _destruct method
Can't you just rely on the parent class destruct method?
Sorry to be a bit vague, I'll look into it a little further.

Jon

I've just installed php 5.0.5 to newest ubuntu breezy and apache2
started (sometimes) segfaulting (teste two computers with ubuntu hoary
and ubuntu breezy - same results).

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



[PHP] Designing a complicated multipage form with sessions

2005-10-21 Thread Andy Pieters
Hi List

I am quite experienced in PHP.  I have been asked to design a complicated form 
in php that spans multiple pages and has many subitems.  For instance if they 
select one checkbox, more details are required in the form of a dropdown list 
or radio buttons.

It would allow browsing the different pages randomly, and final validation is 
only to be performed on the last page.  In case of errors, it would load the 
page where the first error is found and display a message and highlight the 
faults.

I currently made a list of all vars in an xml file, and associated a page 
number for each.  Now when the page loads it looks up the vars used on that 
page and loads them from post (if present and stores them in session right 
away) or loads them from session if no post is present.

Any ideas for improvements, common pitfalls, etc are highly appreciated.


With kind regards


Andy

-- 
Now listening to Top! Radio Live www.topradio.be/stream on amaroK
Geek code: www.vlaamse-kern.com/geek
Registered Linux User No 379093
If life was for sale, what would be its price?
www.vlaamse-kern.com/sas/ for free php utilities
--


pgphaUbaWF5A3.pgp
Description: PGP signature


Re: [PHP] Designing a complicated multipage form with sessions

2005-10-21 Thread Raz
One definite thing to look out for is multiple submission of forms...

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



[PHP] Re: OOP Newbie - why does this not work?

2005-10-21 Thread John Taylor-Johnston

Here,s my guess:


  var $liveclass;
  $liveclass = new(Test);
  echo $liveclass-get() ;
  echo BR ;
 echo This is in the php code block ;


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



[suspicious - maybe spam] [PHP] [suspicious - maybe spam]

2005-10-21 Thread womodi4
$B(.(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(B
$B4|4V8BDj(BPC$B%=%U%HHNGd(B
$B(1(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(B

$B!!M_$7$+$C$?$$N%=%U%H$,$3$N2A3J!*(B
$B!!Cf$K$O(B100$BK|1_0Je$b$9$k%=%U%H$,!D6C$-$N$3$N2A3J!*(B
$B!!F0:n3NG'8e!G[EMAIL PROTECTED]'$$$G$9$N$G0B?4$7$F(B
$B!!$49XF~D:$1$^$9!#(B

$B(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(B
$B(B10,000$B1_0Je$4CmJ8D:$$$?$*5RMMAwNAL5NAv(B
$B(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(B
$B!!(BURL$B!!(Bhttp://saledisc.com/

$B!!:G?7%S%8%M%9!%G%6%$%s%=%U%H!(BCAD$B%=%U%H!D(B
$B!!$=$NB(B

$B(!(!(!(!([EMAIL PROTECTED]:$O$4Mw$/[EMAIL PROTECTED](!(!(!(B
$B!!(BURL$B!!(Bhttp://saledisc.com/
$B(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(B

$B(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(B
$B!!($4Mw$K$J$l$J$$l9g(B
$B!!$3$A$i$N%a!%k%[EMAIL PROTECTED](B
$B!!D@\!:G?7%j%9%H$r$*Aw$j$$$?$7$^$9!#(B
$B!!([EMAIL PROTECTED](Byahoo.co.jp
$B!!(B($B%%C%H%^!%/$r.J8;z$K$7$F$/[EMAIL PROTECTED](B)
$B(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(,(B
$B!!(:#8e%a!%k$NG[?.$r4uK$5$l$J$$J}$O(B
$B!!(Bstop$B!w(Bsaledisc.com

Re: [PHP] php 5.0.5 segfaults apache2 on ubuntu, 5.0.4 ok

2005-10-21 Thread Petr Smith

Hi,

thanks! that was it! when destruct method is removed, all problems are 
gone.


I really don't know why I added the __destruct method to this mysql 
wrapper. Maybe I saw it somewhere in discussion at php manual bottom


This code segfaults my apache:

?php

class test extends mysqli {
public function __construct() {
parent::__construct(localhost, root, , mysql);
}

public function __destruct() {
$this-close();
}
}

$obj = new test();

?

Accessing this page means immeadiate apacha segfault and actual 
connection close. Anybody please test this on 5.0.5 and verify if it's 
reproducible.


Petr


I think this could be related to your _destruct method
Can't you just rely on the parent class destruct method?
Sorry to be a bit vague, I'll look into it a little further.


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



Re: [PHP] OOP Newbie - why does this not work?

2005-10-21 Thread Stephen Leaf
would have to be.

http://smileaf.org/bob.php

as you can see it's working great.

did make  few more changes:
class Test {
public $saying = ;

function __construct() {
$this-saying = I'm in the Test 
Class. ;
}
function get() {
return $this-saying ;
}
}

when accessing a class variable _always_ in php use $this-

On Friday 21 October 2005 04:42 am, Bob Hartung wrote:
 Stephen,
I copied your code and ran it.  Same thing - a totally blank page.
 Therefore I have to surmise that there is a a) bug in the rpm I
 downloaded or more likely b) I have a conf setting wrong.  I will
 investigate further -- boy oh boy what a way to start!  Every line of
 code is a new chance to learn.

 Thanks again,

 Bob

 snip all before 

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



RE: [PHP] Re: OOP Newbie - why does this not work?

2005-10-21 Thread Nathan Tobik
You have to show us the definition for your class, also your syntax for
new is wrong.  It should be:

$liveclass = new Test();

Nate Tobik
(412)661-5700 x206
VigilantMinds

-Original Message-
From: John Taylor-Johnston
[mailto:[EMAIL PROTECTED] 
Sent: Friday, October 21, 2005 7:57 AM
To: php-general@lists.php.net
Subject: [PHP] Re: OOP Newbie - why does this not work?

Here,s my guess:

   var $liveclass;
   $liveclass = new(Test);
   echo $liveclass-get() ;
   echo BR ;
  echo This is in the php code block ;

-- 
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: OOP Newbie - why does this not work?

2005-10-21 Thread Jochem Maas

Nathan Tobik wrote:

You have to show us the definition for your class, also your syntax for
new is wrong.  It should be:

$liveclass = new Test();


it can also be (if you have nothing to pass to the constructor function):

$liveclass = new Test;




Nate Tobik
(412)661-5700 x206
VigilantMinds

-Original Message-
From: John Taylor-Johnston
[mailto:[EMAIL PROTECTED] 
Sent: Friday, October 21, 2005 7:57 AM

To: php-general@lists.php.net
Subject: [PHP] Re: OOP Newbie - why does this not work?

Here,s my guess:



 var $liveclass;
 $liveclass = new(Test);
 echo $liveclass-get() ;
 echo BR ;
echo This is in the php code block ;





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



Re: [PHP] Re: OOP Newbie - why does this not work?

2005-10-21 Thread Andy Pieters
While the use of () or not doesn't impede the function of his code, I consider 
it good programming habit to always add () to the class creator.  Since it is 
considered a function, you wouldn't call a function like x=function but 
rather x=function().  It is more consistent that way.

On Friday 21 October 2005 16:31, Jochem Maas wrote:
 Nathan Tobik wrote:
  You have to show us the definition for your class, also your syntax for
  new is wrong.  It should be:
 
  $liveclass = new Test();

 it can also be (if you have nothing to pass to the constructor function):

 $liveclass = new Test;

  Nate Tobik
  (412)661-5700 x206
  VigilantMinds
 
  -Original Message-
  From: John Taylor-Johnston
  [mailto:[EMAIL PROTECTED]
  Sent: Friday, October 21, 2005 7:57 AM
  To: php-general@lists.php.net
  Subject: [PHP] Re: OOP Newbie - why does this not work?
 
  Here,s my guess:
   var $liveclass;
   $liveclass = new(Test);
   echo $liveclass-get() ;
   echo BR ;
  echo This is in the php code block ;

-- 
Now listening to  on amaroK
Geek code: www.vlaamse-kern.com/geek
Registered Linux User No 379093
If life was for sale, what would be its price?
www.vlaamse-kern.com/sas/ for free php utilities
--


pgpd6AH5Ivt4b.pgp
Description: PGP signature


[PHP] compile issue.

2005-10-21 Thread Mark Nernberg
This is a repost, as I have received no response thus far.

Running FreeBSD 5.4/RELEASE on Sparc64 and Apache 2.0.55

When attempting to install 4.4.0 or 5.0.5, from ports or from source, I am
getting the following error: (This specific error is from 4.4.0 from ports
[/usr/ports/lang/php4]  The error also affects the 5.1RC.

/bin/sh /usr/ports/lang/php4/work/php-4.4.0/libtool --silent
--preserve-dup-deps --mode=compile cc  -Iext/standard/
-I/usr/ports/lang/php4/work/php-4.4.0/ext/standard/ -DPHP_ATOM_INC
-I/usr/ports/lang/php4/work/php-4.4.0/include
-I/usr/ports/lang/php4/work/php-4.4.0/main
-I/usr/ports/lang/php4/work/php-4.4.0
-I/usr/ports/lang/php4/work/php-4.4.0/TSRM
-I/usr/ports/lang/php4/work/php-4.4.0/Zend-O -pipe   -c
/usr/ports/lang/php4/work/php-4.4.0/ext/standard/crypt.c -o
ext/standard/crypt.lo
In file included from /usr/include/rpc/rpc.h:59,
 from /usr/include/crypt.h:9,
 from
/usr/ports/lang/php4/work/php-4.4.0/ext/standard/crypt.c:31:
/usr/include/rpc/rpc_msg.h:66: error: syntax error before numeric constant
*** Error code 1

Stop in /usr/ports/lang/php4/work/php-4.4.0.
*** Error code 1

Stop in /usr/ports/lang/php4.

Any ideas would  be helpful.  If anyone requires more information, just ask
 I will provide.

--
m

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



[PHP] install issue (affects 4.4.0 and 5.0.5) [/usr/include/rpc/rpc_msg.h, /usr/include/rpc/rpc.h, /usr/include/crypt.h, standard/crypt.c

2005-10-21 Thread Mark Nernberg
Running FreeBSD 5.4/RELEASE on Sparc64 and Apache 1.3.33

When attempting to install 4.4.0 and 5.0.5, from ports or from source, I am
getting the following error: (This specific error is from 4.4.0 from ports
[/usr/ports/lang/php4]

/bin/sh /usr/ports/lang/php4/work/php-4.4.0/libtool --silent
--preserve-dup-deps --mode=compile cc  -Iext/standard/
-I/usr/ports/lang/php4/work/php-4.4.0/ext/standard/ -DPHP_ATOM_INC
-I/usr/ports/lang/php4/work/php-4.4.0/include
-I/usr/ports/lang/php4/work/php-4.4.0/main
-I/usr/ports/lang/php4/work/php-4.4.0
-I/usr/ports/lang/php4/work/php-4.4.0/TSRM
-I/usr/ports/lang/php4/work/php-4.4.0/Zend-O -pipe   -c
/usr/ports/lang/php4/work/php-4.4.0/ext/standard/crypt.c -o
ext/standard/crypt.lo
In file included from /usr/include/rpc/rpc.h:59,
 from /usr/include/crypt.h:9,
 from
/usr/ports/lang/php4/work/php-4.4.0/ext/standard/crypt.c:31:
/usr/include/rpc/rpc_msg.h:66: error: syntax error before numeric constant
*** Error code 1

Stop in /usr/ports/lang/php4/work/php-4.4.0.
*** Error code 1

Stop in /usr/ports/lang/php4.

Any ideas would  be helpful.  If anyone requires more information, just ask
 I will provide.

--
m

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



Re: [PHP] php 5.0.5 segfaults apache2 on ubuntu, 5.0.4 ok

2005-10-21 Thread Jon Hill


 Accessing this page means immeadiate apacha segfault and actual 
connection close. Anybody please test this on 5.0.5 and verify if it's 
reproducible.


I am running PHP 5.0.5 on Apache 2 and get the following in my error log 
if I include the destruct method.


Jon

*** glibc detected *** /usr/local/apache/bin/httpd: free(): invalid 
pointer: 0x09bdca78 ***

=== Backtrace: =
/lib/libc.so.6[0x2a1424]
/lib/libc.so.6(__libc_free+0x77)[0x2a195f]
/usr/local/apache/modules/libphp5.so(my_no_flags_free+0x16)[0x1284da6]
/usr/local/apache/modules/libphp5.so(vio_delete+0x29)[0x12a20a9]
/usr/local/apache/modules/libphp5.so(end_server+0x3a)[0x129e74a]
/usr/local/apache/modules/libphp5.so(cli_advanced_command+0x129)[0x129e569]
/usr/local/apache/modules/libphp5.so(mysql_close+0x4d)[0x12a079d]
/usr/local/apache/modules/libphp5.so[0x11573b3]
/usr/local/apache/modules/libphp5.so(zend_objects_store_call_destructors+0x45)[0x125f091]
/usr/local/apache/modules/libphp5.so(shutdown_destructors+0x51)[0x1241f15]
/usr/local/apache/modules/libphp5.so(zend_call_destructors+0x49)[0x124c8d9]
/usr/local/apache/modules/libphp5.so(php_request_shutdown+0x3fa)[0x121acd6]
/usr/local/apache/modules/libphp5.so[0x127d87e]
/usr/local/apache/bin/httpd(ap_run_handler+0x3a)[0x80b6a1a]
/usr/local/apache/bin/httpd(ap_invoke_handler+0x56)[0x80b6d92]
/usr/local/apache/bin/httpd(ap_process_request+0x141)[0x809e929]
/usr/local/apache/bin/httpd[0x809a36d]
/usr/local/apache/bin/httpd(ap_run_process_connection+0x3a)[0x80c04c2]
/usr/local/apache/bin/httpd[0x80b51ba]
/usr/local/apache/bin/httpd[0x80b53a3]
/usr/local/apache/bin/httpd[0x80b5436]
/usr/local/apache/bin/httpd(ap_mpm_run+0x7b4)[0x80b5bf8]
/usr/local/apache/bin/httpd(main+0x57f)[0x80baec7]
/lib/libc.so.6(__libc_start_main+0xc6)[0x252de6]
/usr/local/apache/bin/httpd(apr_dbm_get_usednames_ex+0xbd)[0x807bad1]
=== Memory map: 
[Fri Oct 21 16:00:59 2005] [notice] child pid 3808 exit signal Aborted (6)

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



[PHP] Adding the php extension in windows XP with Iis Version 5.1

2005-10-21 Thread Hinojosa, Robert
Does anyone know why I cannot add the php or any extension in the
application mappings? When selecting Add and then trying to insert the new
extension the Ok button is always grayed out so it does not allow me to
insert a new ext.


Re: [PHP] Designing a complicated multipage form with sessions

2005-10-21 Thread Derek Williams

Andy Pieters wrote:

Hi List

I am quite experienced in PHP.  I have been asked to design a complicated form 
in php that spans multiple pages and has many subitems.  For instance if they 
select one checkbox, more details are required in the form of a dropdown list 
or radio buttons.


It would allow browsing the different pages randomly, and final validation is 
only to be performed on the last page.  In case of errors, it would load the 
page where the first error is found and display a message and highlight the 
faults.


I currently made a list of all vars in an xml file, and associated a page 
number for each.  Now when the page loads it looks up the vars used on that 
page and loads them from post (if present and stores them in session right 
away) or loads them from session if no post is present.


Any ideas for improvements, common pitfalls, etc are highly appreciated.


With kind regards


Andy

  
You may want to consider a mixed AJAX and clientside javascript 
validation.  Requiring the user to go through a complex form and delay 
validation until the end may fustrate users.  I would avoid putting 
business rules into the clientside javascript, but it would be 
reasonable to check for things like valid dates, required fields 
completed etc.  You can also use simple clientside javascript to create 
or expose appropriate dropdowns as needed.  In this case of items where 
more complex business rules need to be validated you can hit the backend 
via AJAX (XML over http) to load further clientside rules or perform 
autocompletion (e.g. zipcode to city state lookup).  See googles suggest 
site for example of autocompletion approach.  Since you are already in 
the XML world, you may want to consider creating your page via an XSLT 
transform of an XML representation of the data. 


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



[PHP] Submit/Validate triggering problem.

2005-10-21 Thread Uros Dukanac
Dear anyone... :)

First, I hope I'm sending this message to correct address.
If this is not the case I'm apologizing for wasting your time, and I'm asking 
you to give me the right e-mail address.

=== GENERAL 
LAMP Environment
PEAR - HTML_QuickForm 3.2.4pl1 stable
Platform: SuSE 9.3
=

=== PROBLEM 
I have a following problem (don't know is this a bug or not):
I have one HTML page, two FORMS, two TEXT fields and two SUBMIT buttons - A 
and B.
When I click either A or B button to submit a form program enters in both
validate() parts - In A and in B so the result on screen from code below is:

In A Validate In B Validate
==

=== WHAT I WANT ===
I would like to enter in A part when I click on A submit button, and to enter 
in B part when I click on B submit button.
==

=== QUESTION AND FEW MORE INFO ===
I can make workaround by checking the value of $Filter (is it A or B) to 
determine which button sent a request (see Workaround code after Original 
code), but it looks dirty to me, and I'm wondering why to do that if I 
already have two different instances of HTML_QuickForm assigned to two 
different variables $AForm and $BForm.
Why element from $BForm triggers $AForm-validate() and vice versa?
==

Thank you in advance.


Below is the code:
=== Original code ==
?php
require_once(HTML/QuickForm.php);

// Create new instance - Form A
$AForm = new HTML_QuickForm(Form1, POST);
$AForm-addElement(Text, Name1, Text1, array(size = 30));
$AForm-addElement(Submit, AButton, A);
if ($AForm-validate())
{
echo  In A Validate ;
}

// Create new instance - Form B
$BForm = new HTML_QuickForm(Form2, POST);
$BForm-addElement(Text, Name2, Text2, array(size = 30));
$BForm-addElement(Submit, BButton, B);
if ($BForm-validate())
{
echo  In B Validate ;
}

// Display Forms
$AForm-display();
$BForm-display();
?


=== Workaround code ==
?php
require_once(HTML/QuickForm.php);

$Filter  = $_POST[SButton];

// Create new instance - Form A
$AForm = new HTML_QuickForm(Form1, POST);
$AForm-addElement(Text, Name1, Text1, array(size = 30));
$AForm-addElement(Submit, SButton, A);
if ($AForm-validate()  Filter == A)
{
echo  In A Validate ;
}

// Create new instance - Form B
$BForm = new HTML_QuickForm(Form2, POST);
$BForm-addElement(Text, Name2, Text2, array(size = 30));
$BForm-addElement(Submit, SButton, B);
if ($BForm-validate()  Filter == B)
{
echo  In B Validate ;
}

// Display Forms
$AForm-display();
$BForm-display();
?

-- 
Uros Dukanac
---
LucidTech | Svetogorska 2 | 11000 Beograd
tel: +381 11 3033386 | fax: +381 11 3033391
http: www.lucidtech.org

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



Re: [PHP] Modular Authoring System

2005-10-21 Thread Derek Williams

Sascha,

We're starting work on a similar (to be open sourced) project, XML/XSLT 
based.  We're also putting together a process creation and tracking 
mechanism.  I would be glad to take a look at the design and code.  We 
have a great XSLT programmer.


Sascha Braun wrote:

Hi,

I am now working on a concept for a webportal software in about 2 and a
halv year. As far as I am in the development of the project I was able
to write an authoring system with support of unlimited language transla-
tions and xml based frontend/screen engine.

All html forms and screens are generated via parsed xml frontend tem-
plates. The navigation elements are consisting of xml elements too.

Alot of things can be done, without the developer has to write html or
php code very much.

The media asset management system is able to convert images, videos and
in near future audio files to any format the player needs to play the
video or audio file without use of mplayer-plugin or windows media pla-
yer.

I wrote a question catalog management system, with which it is very easy
to add question catalogs to the content management system, so individual
services can be offered to customers, by evaluation of the user given
answers to the system.

The user management has a very detailed rights management, and the user
profiles are consisting of xml profile element templates which are
editable, thru the form engine, which is reading the xml profile tem-
plates and is displaying them as forms.

The screentext management is a nice frontend to the screentext database,
in which all frontend screentexts are stored, while the documents of the
content management system are entered by a special xml editor i wrote,
with wich the webauthor dont has to be able to know any html tags or
such things, so write content for the website.

In future i want to add the possebility to the editor, that authors are
going to be able to add tables, generated by the GD lib, so informations
cant just be grabbed by other companys too easy, so informations cant
really be stolen. And i want to add a frontend to the JPGraph lib, so
the authors will be able to enter values into the documents they are
working on, to add diagrams to the document.

I nice working template engine has to be written, so the design of the
hole page can change by daytime or the time of the year.

I added a cronjob management tool, so alot of tasks can be executed
timed as needed. If a customer of an couple finder service want to get
out of his contract, it can be done automatically to the end of the
month, without the site administrators have to do anything about it.

The Online shopping module should consist of a kind of neural network to
find out, what kind of products is fitting best to a customer with
specific account values based on the question catalog management tool.

Later I want to add an tracking system, a product managment system, and
marketing management tool, a statistics tool and many other things.

The hole system is build up modular and is based on php5.

No other programmer did ever take a look at this system, so I dont
really now, if my design is well, or if my php code is just wellformed.

I'm went to work alone, because i did so in the last 8 years.

My question is now, as this concept and the authoring system itself is
not opensource at the moment. If somepeople would like to take a look at
it, and maybe discuss with me, wheather to make it opensource, or
letting it stay as a commercial project.

My only goal is, to set up the webportals I have written concepts for in
the last couple of years. But the project is now comming into a size
where its nearly impossible to start anything new, because there still
are alot of holes in the modules.

And my pressure is growing abit.

All i can say, that is is possible to set up a content management based
website including webdesign and all other things can be done with the
authoring system in about 4 - 6 days, instead of one or two month, it
would take to write something like that on your own if you dont use all
of the modules the authoring system is consisting of at the moment.

I'm not the best programmer, but I'm good in software design and concep-
tion. So it would be really nice, to have some people around, who can
take care abit about the quality of the project. And maybe make use of
it, like i want too.

So best regards,

and lets make it happen :)))

Sascha Braun

  


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



[PHP] Declaring vars as INT ?

2005-10-21 Thread Chris Knipe
Hi,

Uhm... Let's take the below quickly:

Function DoSomething($Blah) {
  $Blah = (int) $Blah;
  return $Blah
} 

$Blah, cannot be larger than 2147483647, and sometimes, I get negative
integers back from the above function.

This is with PHP 4.4.0 on FreeBSD 5.4-STABLE.  Can anyone else perhaps
confirm this, and if it is indeed true, is this a bug, or a limitation
somewhere on PHP?  Any other ways to confirm that *large* numbers, are
indeed integers?  I'm working with numbers in the form of mmddsss
(20051025001 for today for example)

Thanks,
Chris.

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



Re: [PHP] Declaring vars as INT ?

2005-10-21 Thread Jasper Bryant-Greene
On Fri, 2005-10-21 at 21:39 +0200, Chris Knipe wrote:
 Function DoSomething($Blah) {
   $Blah = (int) $Blah;
   return $Blah
 } 
 
 $Blah, cannot be larger than 2147483647, and sometimes, I get negative
 integers back from the above function.
 
 This is with PHP 4.4.0 on FreeBSD 5.4-STABLE.  Can anyone else perhaps
 confirm this, and if it is indeed true, is this a bug, or a limitation
 somewhere on PHP?  Any other ways to confirm that *large* numbers, are
 indeed integers?  I'm working with numbers in the form of mmddsss
 (20051025001 for today for example)

It's not a PHP bug. I'm guessing you're on a 32-bit platform. 2147483647
is the maximum length of a signed integer on a 32-bit platform, and PHP
doesn't do unsigned integers.

A date in the form of mmddsss etc. isn't really a number, so if it
was me I'd probably treat it as a string. If you really *have* to treat
it as a number, then use float and get all the precision errors that
come with floating-point, or use binary coded decimal or another
arbitrary precision system.

-- 
Jasper Bryant-Greene
General Manager
Album Limited

e: [EMAIL PROTECTED]
w: http://www.album.co.nz/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand

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



RE: [PHP] Declaring vars as INT ?

2005-10-21 Thread Chris Knipe
Aha :)

Thanks.
 

 -Original Message-
 From: Jasper Bryant-Greene [mailto:[EMAIL PROTECTED] 
 Sent: 21 October 2005 22:04
 To: [EMAIL PROTECTED]
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] Declaring vars as INT ?
 
 On Fri, 2005-10-21 at 21:39 +0200, Chris Knipe wrote:
  Function DoSomething($Blah) {
$Blah = (int) $Blah;
return $Blah
  }
  
  $Blah, cannot be larger than 2147483647, and sometimes, I 
 get negative 
  integers back from the above function.
  
  This is with PHP 4.4.0 on FreeBSD 5.4-STABLE.  Can anyone 
 else perhaps 
  confirm this, and if it is indeed true, is this a bug, or a 
 limitation 
  somewhere on PHP?  Any other ways to confirm that *large* 
 numbers, are 
  indeed integers?  I'm working with numbers in the form of 
 mmddsss
  (20051025001 for today for example)
 
 It's not a PHP bug. I'm guessing you're on a 32-bit platform. 
 2147483647 is the maximum length of a signed integer on a 
 32-bit platform, and PHP doesn't do unsigned integers.
 
 A date in the form of mmddsss etc. isn't really a number, 
 so if it was me I'd probably treat it as a string. If you 
 really *have* to treat it as a number, then use float and get 
 all the precision errors that come with floating-point, or 
 use binary coded decimal or another arbitrary precision system.
 
 --
 Jasper Bryant-Greene
 General Manager
 Album Limited
 
 e: [EMAIL PROTECTED]
 w: http://www.album.co.nz/
 p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
 a: PO Box 579, Christchurch 8015, New Zealand
 
 

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



Re: [PHP] Declaring vars as INT ?

2005-10-21 Thread Jordan Miller

Hello,

you could treat your variable as a string, and use the is_numeric()  
function (but this will include floats, too). To answer your question  
precisely and accurately, you may have to do regex matching since you  
are out of the bounds of int.


However, why, *exactly*, are you trying to confirm that your string  
is an integer? It seems to me kind of cumbersome and unnecessary. If  
you provide more explicit information on what you are trying to do,  
your overarching goal for the script, including what are your inputs  
and intended outputs, along with some real code, we can probably find  
a solution that will do what you want without mucking about like  
this. Just my two cents.


Jordan




On Oct 21, 2005, at 2:39 PM, Chris Knipe wrote:


Hi,

Uhm... Let's take the below quickly:

Function DoSomething($Blah) {
  $Blah = (int) $Blah;
  return $Blah
}

$Blah, cannot be larger than 2147483647, and sometimes, I get negative
integers back from the above function.

This is with PHP 4.4.0 on FreeBSD 5.4-STABLE.  Can anyone else perhaps
confirm this, and if it is indeed true, is this a bug, or a limitation
somewhere on PHP?  Any other ways to confirm that *large* numbers, are
indeed integers?  I'm working with numbers in the form of mmddsss
(20051025001 for today for example)

Thanks,
Chris.

--
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] Declaring vars as INT ?

2005-10-21 Thread Jordan Miller

Also, look at this function:
http://www.php.net/ctype_digit

Jordan


On Oct 21, 2005, at 2:39 PM, Chris Knipe wrote:


Hi,

Uhm... Let's take the below quickly:

Function DoSomething($Blah) {
  $Blah = (int) $Blah;
  return $Blah
}

$Blah, cannot be larger than 2147483647, and sometimes, I get negative
integers back from the above function.

This is with PHP 4.4.0 on FreeBSD 5.4-STABLE.  Can anyone else perhaps
confirm this, and if it is indeed true, is this a bug, or a limitation
somewhere on PHP?  Any other ways to confirm that *large* numbers, are
indeed integers?  I'm working with numbers in the form of mmddsss
(20051025001 for today for example)

Thanks,
Chris.

--
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] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread Jay Blanchard
IIS5 on W2K
PHP 4.4.n
php_curl.dll is not commented.
libeay32.dll  AND ssleay32.dll are in the system folder (system32 too, just
in case)
path to the extensions is correct

Fatal error: Call to undefined function: curl_init() in
E:\sitegrp1\TEST20051010\curltest.php on line 3

ack!

Can anyone explain why this isn't working? I know I can't

Thanks!

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



Re: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread Jasper Bryant-Greene
On Fri, 2005-10-21 at 15:11 -0500, Jay Blanchard wrote:
 IIS5 on W2K
 PHP 4.4.n
 php_curl.dll is not commented.
 libeay32.dll  AND ssleay32.dll are in the system folder (system32 too, just
 in case)
 path to the extensions is correct
 
 Fatal error: Call to undefined function: curl_init() in
 E:\sitegrp1\TEST20051010\curltest.php on line 3

Done a phpinfo() to see if the CURL extension is really getting loaded?

Is your extension_dir (or whatever it's called) correct in php.ini?

The other thing that's caught me out when I've been forced to use that
degenerate platform, is that sometimes PHP is using a different php.ini
from the one you thought it was using, f.x. if there has been an earler
PHP install and someone's put php.ini in c:\windows\system32 or
something.

-- 
Jasper Bryant-Greene
General Manager
Album Limited

e: [EMAIL PROTECTED]
w: http://www.album.co.nz/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand

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



RE: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread Jay Blanchard
[snip]
Done a phpinfo() to see if the CURL extension is really getting loaded?

Is your extension_dir (or whatever it's called) correct in php.ini?

The other thing that's caught me out when I've been forced to use that
degenerate platform, is that sometimes PHP is using a different php.ini
from the one you thought it was using, f.x. if there has been an earler
PHP install and someone's put php.ini in c:\windows\system32 or
something.
[/snip]

The curl extension is not getting loaded according to phpinfo. The extension
directory is set in the php.ini to c:\php\extension

I just noticed that extension_dir in phpinfo is c:\php4 THAT AIN'T RIGHT!
Why is PHP not loading the proper ini file? This is probably the source of
my problems all along! ACK!

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



Re: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread John Nichel

Jay Blanchard wrote:

[snip]
Done a phpinfo() to see if the CURL extension is really getting loaded?

Is your extension_dir (or whatever it's called) correct in php.ini?

The other thing that's caught me out when I've been forced to use that
degenerate platform, is that sometimes PHP is using a different php.ini
from the one you thought it was using, f.x. if there has been an earler
PHP install and someone's put php.ini in c:\windows\system32 or
something.
[/snip]

The curl extension is not getting loaded according to phpinfo. The extension
directory is set in the php.ini to c:\php\extension

I just noticed that extension_dir in phpinfo is c:\php4 THAT AIN'T RIGHT!
Why is PHP not loading the proper ini file? This is probably the source of
my problems all along! ACK!



This is what happens when you go over to the dark side.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread Jay Blanchard
[snip]
 I just noticed that extension_dir in phpinfo is c:\php4 THAT AIN'T RIGHT!
 Why is PHP not loading the proper ini file? This is probably the source of
 my problems all along! ACK!
 

This is what happens when you go over to the dark side.
[/snip]

It's not my fault! How do I fix this?

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



Re: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread Derek Williams

Probably a really dumb question:

Is php_curl.dll available?

Jay Blanchard wrote:

IIS5 on W2K
PHP 4.4.n
php_curl.dll is not commented.
libeay32.dll  AND ssleay32.dll are in the system folder (system32 too, just
in case)
path to the extensions is correct

Fatal error: Call to undefined function:  in
E:\sitegrp1\TEST20051010\curltest.php on line 3

ack!

Can anyone explain why this isn't working? I know I can't

Thanks!

  


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



Re: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread Jordan Miller
I agree with John. It looks like you either need a hammer or the  
rooftop of a 5-story building...


Jordan


On Oct 21, 2005, at 3:26 PM, Jay Blanchard wrote:


[snip]

I just noticed that extension_dir in phpinfo is c:\php4 THAT AIN'T  
RIGHT!
Why is PHP not loading the proper ini file? This is probably the  
source of

my problems all along! ACK!




This is what happens when you go over to the dark side.
[/snip]

It's not my fault! How do I fix this?

--
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] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread John Nichel

Jay Blanchard wrote:

[snip]


I just noticed that extension_dir in phpinfo is c:\php4 THAT AIN'T RIGHT!
Why is PHP not loading the proper ini file? This is probably the source of
my problems all along! ACK!




This is what happens when you go over to the dark side.
[/snip]

It's not my fault! How do I fix this?



Hell if I know, I haven't touched a Windows machine in years.  Move the 
ini file you want it to read to the location it's looking in?


You could symbolic link itoops...wait...no, you can't. ;)

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread Jasper Bryant-Greene
On Fri, 2005-10-21 at 15:26 -0500, Jay Blanchard wrote:
 [snip]
  I just noticed that extension_dir in phpinfo is c:\php4 THAT AIN'T RIGHT!
  Why is PHP not loading the proper ini file? This is probably the source of
  my problems all along! ACK!
  
 
 This is what happens when you go over to the dark side.
 [/snip]
 
 It's not my fault! How do I fix this?
 

I haven't used Windows for a while, but Start-Search-Files  folders
(or something like that) and enter php.ini. Delete all results except
the one that you've been editing, and then move the one you've been
editing around the following folder until you find the one in which it
works:

c:\php
c:\windows
c:\windows\system32
c:\

Horrible, isn't it?

-- 
Jasper Bryant-Greene
General Manager
Album Limited

e: [EMAIL PROTECTED]
w: http://www.album.co.nz/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand

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



RE: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread Jay Blanchard
[/snip]
Hell if I know, I haven't touched a Windows machine in years.  Move the 
ini file you want it to read to the location it's looking in?

You could symbolic link itoops...wait...no, you can't. ;)
[/snip]

The ini file IS in the location where phpinfo says that it is reading
from

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



[PHP] private properties problem

2005-10-21 Thread Pablo Godel
Today I discovered a possible serious problem with the way the latest 
PHP versions handle private properties.


Given the following code:

?php

class Base
{
   private $var1 = 0;
}

class FinalClass extends Base
{
  
   function Test()

   {
   $this-var1 = 10;
   }
}

$c = new FinalClass();

$c-Test();

print_r( $c );

?


I get the following result:

FinalClass Object
(
   [var1:private] = 0
   [var1] = 10
)


Now... PHP should have displayed an error when I was trying to set a 
value to this private member from the parent class. No error message was 
displayed. It created a local member which holded the value 10. But when 
trying to access this value from the parent class, it is not there.


I think PHP should notify of the problem but it is not doing so. I have 
my error reporting level on E_ALL.


Any ideas?

Pablo Godel

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



RE: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread Jay Blanchard
[snip]
I haven't used Windows for a while, but Start-Search-Files  folders
(or something like that) and enter php.ini. Delete all results except
the one that you've been editing, and then move the one you've been
editing around the following folder until you find the one in which it
works:

c:\php
c:\windows
c:\windows\system32
c:\

Horrible, isn't it?
[/snip]

Horrible indeed. I got no joy from this. It didn't work.

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



RE: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread tg-php
Search the machine for php.ini, I'm guessing that you'll find one in your 
main PHP directory as well as in your main Windows directory.  I believe the 
Windows directory copy is read first.  I'm not sure why.

At any rate, if it looks like it's reading the wrong copy of PHP.ini, searching 
your system for alternate copies and either removing them (should work) or 
moving your good copy should work.

Just looked it up.. yeah, it appears that there's probably a php.ini in your 
main Windows directory.

Also, lots of other good info on this topic at:
http://www.php.net/manual/en/install.windows.php

Also2, looks like restarting the web service may help in some cases.

Also3, since you've come over to the dark side as it where :), I'd recommend 
getting on the PHP Windows mailing list as well since some of your problems are 
going to be Windows specific and there may be people there with more experience.

Good luck Jay!

-TG


= = = Original message = = =

[snip]
Done a phpinfo() to see if the CURL extension is really getting loaded?

Is your extension_dir (or whatever it's called) correct in php.ini?

The other thing that's caught me out when I've been forced to use that
degenerate platform, is that sometimes PHP is using a different php.ini
from the one you thought it was using, f.x. if there has been an earler
PHP install and someone's put php.ini in c:\windows\system32 or
something.
[/snip]

The curl extension is not getting loaded according to phpinfo. The extension
directory is set in the php.ini to c:\php\extension

I just noticed that extension_dir in phpinfo is c:\php4 THAT AIN'T RIGHT!
Why is PHP not loading the proper ini file? This is probably the source of
my problems all along! ACK!


___
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] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread Jay Blanchard
[snip]
Also3, since you've come over to the dark side as it where :), I'd
recommend getting on the PHP Windows mailing list as well since some of your
problems are going to be Windows specific and there may be people there with
more experience.

Good luck Jay!
[/snip]

There's a PHP Windows mailing list?

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



RE: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread Jasper Bryant-Greene
On Fri, 2005-10-21 at 15:43 -0500, Jay Blanchard wrote:
 [snip]
 I haven't used Windows for a while, but Start-Search-Files  folders
 (or something like that) and enter php.ini. Delete all results except
 the one that you've been editing, and then move the one you've been
 editing around the following folder until you find the one in which it
 works:
 
 c:\php
 c:\windows
 c:\windows\system32
 c:\
 
 Horrible, isn't it?
 [/snip]
 
 Horrible indeed. I got no joy from this. It didn't work.

When you say didn't work... do you mean you didn't find any other
php.ini files?

There's one other thing I can think of. It's possible to set things like
the location of the php.ini file and also php configuration directives
through Apache's configuration.

Now I know you're using IIS, but is there a similar thing available
through IIS's configuration? (I wouldn't know, I don't practise the dark
arts...)

-- 
Jasper Bryant-Greene
General Manager
Album Limited

e: [EMAIL PROTECTED]
w: http://www.album.co.nz/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand

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



RE: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread Chris W. Parker
Jordan Miller mailto:[EMAIL PROTECTED]
on Friday, October 21, 2005 1:32 PM said:

 I agree with John. It looks like you either need a hammer or the
 rooftop of a 5-story building...

zooom!How is he supposed to smash a computer with the rooftop of a
5-story building? It's too big!!/zooom!

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



Re: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread John Nichel

Jay Blanchard wrote:

[snip]
Also3, since you've come over to the dark side as it where :), I'd
recommend getting on the PHP Windows mailing list as well since some of your
problems are going to be Windows specific and there may be people there with
more experience.

Good luck Jay!
[/snip]

There's a PHP Windows mailing list?



Windows has specific problems?

*ducks*

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread Jay Blanchard
[snip]
 I agree with John. It looks like you either need a hammer or the
 rooftop of a 5-story building...

zooom!How is he supposed to smash a computer with the rooftop of a
5-story building? It's too big!!/zooom!
[/snip]

By dropping the five story building upside down on to the serverduh!

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



Re: [PHP] private properties problem

2005-10-21 Thread Colin Shreffler
I'm not sure this is a problem.  I ran the same test and as you say, it
dynamically created a new variable with local scope to the derived (child)
class.  I would expect this to happen as it can not access private members
of its base (parent) class.

In your statement:

But when trying to access this value from the parent class, it is not
there.

Well it shouldn't be.  A base class does not know anything about its
derived class's members or methods.  Inheritence doesn't work in that
direction.  Only derived classes know about their base class members or
methods.

-c


 Today I discovered a possible serious problem with the way the latest
 PHP versions handle private properties.

 Given the following code:

 ?php

 class Base
 {
 private $var1 = 0;
 }

 class FinalClass extends Base
 {

 function Test()
 {
 $this-var1 = 10;
 }
 }

 $c = new FinalClass();

 $c-Test();

 print_r( $c );

 ?


 I get the following result:

 FinalClass Object
 (
 [var1:private] = 0
 [var1] = 10
 )


 Now... PHP should have displayed an error when I was trying to set a
 value to this private member from the parent class. No error message was
 displayed. It created a local member which holded the value 10. But when
 trying to access this value from the parent class, it is not there.

 I think PHP should notify of the problem but it is not doing so. I have
 my error reporting level on E_ALL.

 Any ideas?

 Pablo Godel

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





Thank you,
Colin Shreffler
Principal
303.349.9010 - cell
928.396.1099 - fax
[EMAIL PROTECTED]

Warp 9 Software, LLC.
6791 Halifax Avenue
Castle Rock, CO 80104

Confidentiality Notice: The information in this e-mail may be confidential
and/or privileged. This e-mail is intended to be reviewed by only the
individual or organization named in the e-mail address. If you are not the
intended recipient, you are hereby notified that any review, dissemination
or copying of this e-mail and attachments, if any, or the information
contained herein, is strictly prohibited.

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



Re: [PHP] compile issue.

2005-10-21 Thread Greg Maruszeczka
Mark Nernberg wrote:
 This is a repost, as I have received no response thus far.
 
 Running FreeBSD 5.4/RELEASE on Sparc64 and Apache 2.0.55
 
 When attempting to install 4.4.0 or 5.0.5, from ports or from source, I am
 getting the following error: (This specific error is from 4.4.0 from ports
 [/usr/ports/lang/php4]  The error also affects the 5.1RC.
 
 /bin/sh /usr/ports/lang/php4/work/php-4.4.0/libtool --silent
 --preserve-dup-deps --mode=compile cc  -Iext/standard/
 -I/usr/ports/lang/php4/work/php-4.4.0/ext/standard/ -DPHP_ATOM_INC
 -I/usr/ports/lang/php4/work/php-4.4.0/include
 -I/usr/ports/lang/php4/work/php-4.4.0/main
 -I/usr/ports/lang/php4/work/php-4.4.0
 -I/usr/ports/lang/php4/work/php-4.4.0/TSRM
 -I/usr/ports/lang/php4/work/php-4.4.0/Zend-O -pipe   -c
 /usr/ports/lang/php4/work/php-4.4.0/ext/standard/crypt.c -o
 ext/standard/crypt.lo
 In file included from /usr/include/rpc/rpc.h:59,
  from /usr/include/crypt.h:9,
  from
 /usr/ports/lang/php4/work/php-4.4.0/ext/standard/crypt.c:31:
 /usr/include/rpc/rpc_msg.h:66: error: syntax error before numeric constant
 *** Error code 1
 
 Stop in /usr/ports/lang/php4/work/php-4.4.0.
 *** Error code 1
 
 Stop in /usr/ports/lang/php4.
 
 Any ideas would  be helpful.  If anyone requires more information, just ask
  I will provide.
 
 --
 m
 


I can't help you directly but I'm guessing you might get a better answer
by checking the FreeBSD specific lists instead of here since it doesn't
look like your problem is so much with PHP as it is with
/usr/ports/lang/php4.

Try these first, then post on the lists if you can't find an answer in
the archives:

http://lists.freebsd.org/pipermail/freebsd-questions/
http://lists.freebsd.org/pipermail/freebsd-sparc64/


Hope that leads you to a satisfactory resolution.

G

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



Re: [PHP] SCRIPT_NAME

2005-10-21 Thread Minuk Choi

... what, the off by one error?

Hey, I was just providing suggestion off the top of my head. :-P

-Minuk

Robert Cummings wrote:


On Thu, 2005-10-20 at 23:27, Minuk Choi wrote:
 


Off the top of my head...

$filename = $_SERVER['PHP_SELF'];

$strippedFilename = substr($filename, strrpos($filename, '/'));
   



Won't work, I'll leave the reason as an exercise :B

Cheers,
Rob.
 



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



Re: [PHP] SCRIPT_NAME

2005-10-21 Thread Robert Cummings
On Fri, 2005-10-21 at 19:58, Minuk Choi wrote:
 ... what, the off by one error?
 
 Hey, I was just providing suggestion off the top of my head. :-P

Oh I know, I was just pointing out that it won't work :) Doesn't work
because it only strips off the first path segment (assuming no off by
one error also ;). For instance:

/a/b/c/d/foo.php

becomes:

a/b/c/d/foo.php

but the OP wanted:

foo.php

:)

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

2005-10-21 Thread Jasper Bryant-Greene
On Fri, 2005-10-21 at 21:01 -0400, Robert Cummings wrote:
 Oh I know, I was just pointing out that it won't work :) Doesn't work
 because it only strips off the first path segment (assuming no off by
 one error also ;). For instance:
 
 /a/b/c/d/foo.php
 
 becomes:
 
 a/b/c/d/foo.php
 
 but the OP wanted:
 
 foo.php

It will actually work... Did you not notice that he was using
strrpos() ? Note the extra 'r' in there :) http://php.net/strrpos

-- 
Jasper Bryant-Greene
General Manager
Album Limited

e: [EMAIL PROTECTED]
w: http://www.album.co.nz/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand

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



[PHP] rtrim Null characters

2005-10-21 Thread Richard Lynch
So, for fun, (well, *MY* idea of fun) I implemented a dirt-simple
CAPTCHA.

The image is totally OCR-able, but anybody wants to work that hard at
it can have at it.  That's modular enough to (really) fix later
anyway/

After lots of encryption/decryption with urlencoding, htmlentities,
and base64_encoding, to keep all the data kosher over HTTP et al...

I end up with a string with a bunch of NUL characters (ord($char) ==
0) tacked on the end, but otherwise correctly decoded.

I'm not really sure if it's base64 or the encryption itself that pads
the string, and don't really care, to tell you the truth...

Anyway, my question is, what is the morally correct function to use to
remove these null characters from the end of my string?

I'm guessing 'rtrim' would work, but is a NUL char really whitespace?

I suppose I could do str_replace(), but if things go bad some day, I
don't want to confuse myself by removing NUL characters in the middle
of the messed up string.


A second related question:

Given that the string to be encrypted is a single word and thus very
short, the PHP manual makes it quite clear that encrypt_mode of ECB is
the right choice. YAY!

What is not readily apparent, and what I can't figure out from my
research is if any of the algorithms available is better suited to
this usage.

To be clear: I'm mcrypt_encrypt()ing the secret word into the URL and
a hidden form element, along with the IV, ditto, and so both are
available to the potentical malicious user.  So if exposure of IV is
an issue in any suggested answer, keep that in mind.

The following options are available in my webhost's install:
cast-128
gost
rijndael-128
twofish
arcfour
cast-256
loki97
rijndael-192
saferplus
wake
blowfish-compat
des
rijndael-256
serpent
xtea
blowfish
enigma
rc2
tripledes

We can safely eliminate any hypothetical best which is not in that
list.

-- 
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] rtrim Null characters

2005-10-21 Thread Jasper Bryant-Greene
On Fri, 2005-10-21 at 20:45 -0500, Richard Lynch wrote: 
 Anyway, my question is, what is the morally correct function to use to
 remove these null characters from the end of my string?
 
 I'm guessing 'rtrim' would work, but is a NUL char really whitespace?

I think rtrim() is probably your best bet. Haven't tried, though.

 To be clear: I'm mcrypt_encrypt()ing the secret word into the URL and
 a hidden form element, along with the IV, ditto, and so both are
 available to the potentical malicious user.  So if exposure of IV is
 an issue in any suggested answer, keep that in mind.

To be honest, I think you're going about it the wrong way. Put the
secret word into $_SESSION. Point the img tag at a PHP script which
pulls it out of $_SESSION and renders it as an image. Then you don't
need to send it to the client in any form.

-- 
Jasper Bryant-Greene
General Manager
Album Limited

e: [EMAIL PROTECTED]
w: http://www.album.co.nz/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand

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



Re: [PHP] SCRIPT_NAME

2005-10-21 Thread Robert Cummings
On Sat, 2005-10-22 at 10:02, Jasper Bryant-Greene wrote:
 On Fri, 2005-10-21 at 21:01 -0400, Robert Cummings wrote:
  Oh I know, I was just pointing out that it won't work :) Doesn't work
  because it only strips off the first path segment (assuming no off by
  one error also ;). For instance:
  
  /a/b/c/d/foo.php
  
  becomes:
  
  a/b/c/d/foo.php
  
  but the OP wanted:
  
  foo.php
 
 It will actually work... Did you not notice that he was using
 strrpos() ? Note the extra 'r' in there :) http://php.net/strrpos

Yep I stand corrected :) Didn't notice the extra 'r' at all *heheh*.

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] Email Validation built-in? RFC

2005-10-21 Thread Richard Lynch
Given:

It is unacceptable to reject perfectly valid email addresses, no
matter how arcane. [Like mine. :-)]

The CORRECT RegEx for validating an email is 3 pages long, and
performance in PHP would probably not be so good...

In today's Security-conscious world, data validation is a requirement.

The (relatively) recent changes in domain names that allow UTF
(Unicode?) characters.

Checking MX records is not reliable at all.

Forcing users to respond to email is A) burdensome to real users in
many cases, and B) no real barrier to halfway intelligent fake users.

... would it not make sense for there to be a BUILT-IN PHP function of
a TRUE email syntactic validation?

So at least one KNOWS that the email is a valid construct, before you
even try (if you try at all) to make sure that a person actually
checks it at least once in their life.

Currently, email syntax validation is being done in very limited
fashion, if not outright wrong by rejecting what actually ARE valid
email addresses in about 10,000,000 PHP scripts by users who don't
have any realistic options to truly do it right because who can
really live with that 3-page Regex in their PHP code?

Yes, in the past, I may have come down squarely on the opposite side
of this topic, but I've changed my mind.

I believe PHP needs a built-in syntactically CORRECT email validation
function, vetted and tested by professionals, instead of the mess we
now have.

PLEASE do not point me to any existing email validation code unless
you believe it is not only 100% correct and complete with RFC
definitions of syntactically valid email.  Not interested.  I've
already seen them, and been burned by them.

-- 
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[2]: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread Tom Rogers
Hi,

Saturday, October 22, 2005, 6:26:57 AM, you wrote:
JB [snip]
 I just noticed that extension_dir in phpinfo is c:\php4 THAT AIN'T RIGHT!
 Why is PHP not loading the proper ini file? This is probably the source of
 my problems all along! ACK!
 

JB This is what happens when you go over to the dark side.
JB [/snip]

JB It's not my fault! How do I fix this?


I always put the php.ini file where the .exe file is, so for apache put it
where apache.exe is if loading as a module or where php.exe is if
using cgi

-- 
regards,
Tom

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



[PHP] Pear File_Archive examples or _good_ documentation?

2005-10-21 Thread Tim Rupp
The authors site is unreachable so I cant check it for examples, but 
last I remember he didnt have very good examples to begin with. Does 
anyone, who's used this package have decent examples that showcase how 
to use it and use it well? In particular I'm looking for info on how to 
extract archives that meet the criteria below.


- one folder with multiple items (including other folders) in it
- multiple items(files or folders) at first level of the archive

Reading the inline docs for the Pear class is less than useful for me 
because there's no concrete examples I can work off of...unless I'm 
blind and am completely missing something.


Help anyone?

Thanks,
Tim

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