php-general Digest 16 Oct 2003 11:16:24 -0000 Issue 2358

Topics (messages 166260 through 166282):

Re: Session lose value with httpS
        166260 by: Chris W. Parker
        166261 by: [-^-!-%-
        166267 by: Curt Zirzow

Re: Return to browser and keep running!
        166262 by: Manuel Vázquez Acosta
        166264 by: Chris W. Parker

HTTP_POST_RAW_DATA problem
        166263 by: Manuel Vázquez Acosta
        166265 by: Raditha Dissanayake

Re: Detecting devices i.e. PDA, Mobile
        166266 by: Raditha Dissanayake

Sending htaccess auth information through php
        166268 by: daniel.electroteque.org

Re: parsing ini files
        166269 by: John W. Holmes

preg help please :)
        166270 by: Justin French
        166274 by: Eugene Lee

What's a good regex to validate an email address? ;)
        166271 by: John W. Holmes

Time Calcuations
        166272 by: Jake McHenry
        166273 by: John W. Holmes

generating nested xml from mysql
        166275 by: daniel.electroteque.org

Help with file upload
        166276 by: Bunmi Akinmboni
        166277 by: Marek Kilimajer
        166278 by: Nitin

php
        166279 by: Amanda Lau
        166281 by: Mike Brum

Information
        166280 by: hatem gouda

"const" in PHP
        166282 by: BENARD  Jean-philippe

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
 <-^-!-%- [mailto:[EMAIL PROTECTED]>
    on Wednesday, October 15, 2003 3:58 PM said:

> What would cause a session value to be lost, under HTTPS?

Hmm... I'll be coming up against this soon and would like to know the
answer as well.

One question though: can you set values in the $_SESSION array within
HTTPS and retrieve those same values within HTTPS? Are you able to
retreive it in HTTP if it were created in HTTPS?



Chris.

--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

--- End Message ---
--- Begin Message ---


I am able to set and read the values on the same page.

I lose the value (and the session) was I move to another page.



=P e p i e  D e s i g n s
 www.pepiedesigns.com
 Providing Solutions That Increase Productivity

 Web Developement. Database. Hosting. Multimedia.

On Wed, 15 Oct 2003, Chris W. Parker wrote:

>  <-^-!-%- [mailto:[EMAIL PROTECTED]>
>     on Wednesday, October 15, 2003 3:58 PM said:
>
> > What would cause a session value to be lost, under HTTPS?
>
> Hmm... I'll be coming up against this soon and would like to know the
> answer as well.
>
> One question though: can you set values in the $_SESSION array within
> HTTPS and retrieve those same values within HTTPS? Are you able to
> retreive it in HTTP if it were created in HTTPS?
>
>
>
> Chris.
>
> --
> Don't like reformatting your Outlook replies? Now there's relief!
> http://home.in.tum.de/~jain/software/outlook-quotefix/
>

--- End Message ---
--- Begin Message ---
* Thus wrote [-^-!-%- ([EMAIL PROTECTED]):
> 
> Hello everyone!
> 
> What would cause a session value to be lost, under HTTPS?

what is the output of session_get_cookie_params() on the unsecure
site vs. the secure site.

> 
> NOTE: The regular server name is   'mydomain.net', but the secure server
> name is 'secure-servename.net'. Would this affect the session function,
> even though it's the same machine?

Yes, this is what is causing the problem. The secure-servername doesn't
have acces to the cookies (as you'll see from the above results).

You'll have to pass the SESSIONID and ensure that the SESSIONID is 
valid on the secure server side assuming the domain resides on the
same server:

unsecure.php:
$sharedkey = uniqid(mt_rand());
$_SESSION['goodsession'] = md5(SID . 'secretkey' . $sharedkey);
$_SESSION['sharedkey'] = $sharedkey;
?>
<a href="https://secureserver/<?php echo SID?>">secure server</a>
 

secure.php:
$sharedkey = $_SESSION['sharedkey'];
$goodsession = md5(SID . 'secretkey' . $sharedkey);
if ($goodsession != $_SESSION['goodsession']) {
  // bad session data.
}

Although not fool proof and certain conditions need to be met in
order for this to work properly, but its just an example to ensure
that the SESSION is the right one.


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
          http://zirzow.dyndns.org/html/mlists/

--- End Message ---
--- Begin Message ---
> Add before the exit:
> set_time_limit(0);
>
> http://php.net/set_time_limit
>
> Curt


You didn't get the idea. I want to be able to keep running a script
disconnected from the browser; once all the output has been sent to the
browser there's no need for the user to wait until the script finish its
execution.
set_time_limit(0); makes the scripts to run completely without the 30
seconds error; but it will keep the connection with the browser; so it does
not solve the problem though

Thanks anyway,
Manu.

--- End Message ---
--- Begin Message ---
Manuel Vázquez Acosta <mailto:[EMAIL PROTECTED]>
    on Wednesday, October 15, 2003 5:46 PM said:

> set_time_limit(0); makes the scripts to run completely without the 30
> seconds error; but it will keep the connection with the browser; so
> it does not solve the problem though

I think you want to "fork" your command. I think what you need to do is have the page 
execute another php page via the commandline. I think that's what you want to do.



Chris.

--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

--- End Message ---
--- Begin Message ---
Hello:

I'm running into a problem when trying to get $HTTP_POST_RAW_DATA; it always
returns NULL althought my php.ini always_populate_raw_post_data is set to
On.

My env: Windows XP-Pro; Apache 1.3.24/PHP module 4.3.3

Any ideas?
Manu.

--- End Message ---
--- Begin Message --- Hi,

RAW_POST_DATA does not get populated for known content types. That's why i got a little help from perl when building the megaupload progress bar.


Manuel Vázquez Acosta wrote:


Hello:

I'm running into a problem when trying to get $HTTP_POST_RAW_DATA; it always
returns NULL althought my php.ini always_populate_raw_post_data is set to
On.

My env: Windows XP-Pro; Apache 1.3.24/PHP module 4.3.3

Any ideas?
Manu.





--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/          |  http://www.raditha/megaupload/
Lean and mean Secure FTP applet with  |  Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB  |  with progress bar.

--- End Message ---
--- Begin Message --- As Tom has said you are going back to square one. If you can spend the effort to make XHTML you can just as easily create an XSL

Shaun wrote:

Justin,

Thank you for you replies, I have decided to convert the whole site to
XHTML, for compatability. However, I am unable to view the site through my
phones WAP browser, does this mean XHTML is only compatible with PC's and
PDA's? I have validadted the code at http://validator.w3.org ...

Thanks for your help


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


On Sunday, October 12, 2003, at 07:46 PM, Tom Rogers wrote:



From my experience css is even more unreliable than user agent being
set and all
browser producers seem to have their own idea of what a standard is
supposed to
look like as well. At least with table layouts most of the current
desktop
browsers will make a half decent try. With companies like Netscape and
Microsoft
providing browsers you should stay away from strict anything is my
advice :)


It depends what you're aiming for.  If you're aiming for pixel perfect
display on the usual browsers, great -- go for tables and the usual
hacks.  But in the meantime you're sacrificing forwards compatibility
for backwards compatibility, making your site hugely inaccessible,
causing huge ongoing development costs (update the hacks to support
newer browsers and devices), etc etc.

What's the point in developing three or more sites (WAP, PDA, Desktop)
when one can do the same, with a few SMALL sacrifices.

As a bonus, you're developing HTML for EVERYONE, not turning away
ANYONE, and you're saving your client some money.


Anyway, this is getting a little OT :) You're entitled to do things your way, and so am I... the $'s and accessibility are making my decisions for me.





The ideal way of detecting a wap browser is through the accepted mime
types from
the request header but I am not sure if that info is passed on by PHP.

You could try

<?
$headers = width: 300px;;
print_r($headers);
<?
and see what is supplied under accept with various devices

You need to look for something like this:

text/vnd.wap.wml for .wml files (WML source files)
application/vnd.wap.wmlc for .wmlc files (WML compiled files)
text/vnd.wap.wmlscript for .wmls files (WMLScript source files)
application/vnd.wap.wmlscriptc for .wmlsc files (WMLScript compiled
files)
image/vnd.wap.wbmp for .wbmp files (wireless bitmaps)



Nice idea!

Justin







--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/          |  http://www.raditha/megaupload/
Lean and mean Secure FTP applet with  |  Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB  |  with progress bar.

--- End Message ---
--- Begin Message ---
Hi there, i was wondering if there was a way to send htaccess auth
information through php. My application is loading a parent flash movie
which externally loads flash videos within a directory i want to password
protect with htaccess. I was wondering how could it be possible to send
headers to that the parent flash can load the external videos without a
password box popping up ?

Basically there is two solutions. Password protect the directory and work
out a way to get flash to load the flash videos without a password box
popping up.

Or doing a fopen and fread on flash files outside the web directory like so.

header("Content-type: application/x-shockwave-flash");
$fp = @fopen("/path/".$_GET['filename'],"r");
$swf = @fread($fp,filesize("/path/".$_GET['filename']));
@fclose ($fp);
echo $swf;

This will output the binary information, then the parent flash loads that
php file with the filename into a movie container. It works but is it
slower than the first solution ?

Let me know.

Dan
(whos punctuation is hopefully better than in the past)

--- End Message ---
--- Begin Message --- Andrei Popovici wrote:

I have a script which reads his configuration from an ini file. For reading
that file I use the parse_ini function. When the ini is written incorectly
the php displays a message that he has encountered a parse error in that
ini. How can I catch that error and display a message of my own?

Had to think about this one for a bit... :)


If you know the contents of the ini file, you could always count() the resulting array to determine if all of the values were read correctly. The "error" that's displayed is just a warning, so a proper error_reporting() level would take care of the message not being displayed.

Or, as an alternate solution, you can use output buffering to capture the error.

<?php
$old_error_level = error_reporting(E_ALL);

ob_start();
$array = parse_ini_file('file.ini');
$response = ob_get_contents();
ob_end_clean();

if(strlen($r)>0)
{ echo "error while parsing file"; }
else
{ echo "no error"; }

?>

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message --- Hi,

I have the following:

<?
$quote = "&#822[0|1]{1};";
$text = preg_replace(
        "/$quote(.*)$quote:$quote(.*)$quote/",
        "<a href='\\2'>\\1</a>",
        $text
        );
?>

It basically matches "link text":"url" with the added twist of having the quotes converted to &#8220; or &#8220; by a previous function.

It works fine if there is one link found inside a string, but falls over horribly if there's two links inside a string.

How can I improve the (.*) to exclude $quote ?


Thanks, Justin French

--- End Message ---
--- Begin Message ---
On Thu, Oct 16, 2003 at 02:23:45PM +1000, Justin French wrote:
: 
: I have the following:
: 
: <?
: $quote = "&#822[0|1]{1};";
: $text = preg_replace(
:       "/$quote(.*)$quote:$quote(.*)$quote/",
:       "<a href='\\2'>\\1</a>",
:       $text
:       );
: ?>
: 
: It basically matches "link text":"url" with the added twist of having 
: the quotes converted to &#8220; or &#8220; by a previous function.
: 
: It works fine if there is one link found inside a string, but falls 
: over horribly if there's two links inside a string.
: 
: How can I improve the (.*) to exclude $quote ?

Try inverting the greediness with a "U" pattern modifier:

        "/$quote(.*)$quote:$quote(.*)$quote/U"

For more details:

        http://www.php.net/manual/en/pcre.pattern.modifiers.php

--- End Message ---
--- Begin Message --- Heh... I was adding a note to the PHP Manual and I thought it was really funny they had to include this note in the "rules":

(And if you're posting an example of validating email addresses, please don't bother. Your example is almost certainly wrong for some small subset of cases. See this information from O'Reilly Mastering Regular Expressions book for the gory details.)

lol...

The link is http://examples.oreilly.com/regex/readme.html in case anyone is interested...

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Hello again....

Here's my problem: In my time calculations, I'm taking the time that
the user clocked out, minus the time they clocked in. I'm using the
time_to_sec function in mysql. I work very odd hours. If I clock in
say at 10pm, then clock out at 1am, the clock is majorly messed up. I
think it's because it's a new day. I thought that the time_to_sec
functon turned the time into seconds from 1980 or something like that,
so the date and time when returning to the function should be right...


Or maybe it's because it's returning the new time, and not the new
date?

I think I just answered my own question....

          $cisecs = mysql_query("SELECT TIME_TO_SEC('$citime')");
          $cisecs = mysql_fetch_array($cisecs);
          $cosecs = mysql_query("SELECT TIME_TO_SEC('$cotime')");
          $cosecs = mysql_fetch_array($cosecs);

          if (($cisecs[0] != 0) && ($cosecs[0] != 0) && ($getnopay ==
false))
          {
            $timeresult = $cosecs[0] - $cisecs[0];

            $totaltime = mysql_query("SELECT
SEC_TO_TIME($timeresult)");
            $totaltime = mysql_fetch_array($totaltime);
          }
          else
          {
            $timeresult = 0;

            $totaltime = mysql_query("SELECT
SEC_TO_TIME($timeresult)");
            $totaltime = mysql_fetch_array($totaltime);
          }

Jake McHenry
Nittany Travel MIS Coordinator
http://www.nittanytravel.com

--- End Message ---
--- Begin Message --- Jake McHenry wrote:

Here's my problem: In my time calculations, I'm taking the time that
the user clocked out, minus the time they clocked in. I'm using the
time_to_sec function in mysql. I work very odd hours. If I clock in
say at 10pm, then clock out at 1am, the clock is majorly messed up. I
think it's because it's a new day. I thought that the time_to_sec
functon turned the time into seconds from 1980 or something like that,
so the date and time when returning to the function should be right...

Use a complete timestamp for the two times. That'll include a complete date and time that the worker clocked in and out. You can then convert them to unix timestamps, subtract them, and use sec_to_time() to determine the hours when it's needed. SUM() that up with a WHERE condition to limit the dates to the current week and you'll know how many hours you worked.


Or just store it in unix timestamp format to begin with. :)

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Hi there i am having a problem generating nested xml from mysql

My class is ok with one loop. But there is a problem when i want to do a
query and within that loop result do another query. More specifically i
want my xml to look like this.

<menu>
    <top_menu>
        <title></title>
        <sub_menu>
           <title></title>
        </sub_menu>
    </top_menu>
</menu>

where top menu gets the first loop and sub menu is the second query within
the first query.

Let me know thanks

--- End Message ---
--- Begin Message ---
This is the new code:
<?php
if (is_uploaded_file($_FILES['ufile1']['tmp_name'])) {
    copy($_FILES['ufile1']['tmp_name'], ".");
        echo "$ufile1_name ";
        echo "DONE";
        echo " ";
        print_r($_FILES);
} else {
    echo "Possible file upload attack. Filename: " .
$_FILES['ufile1']['name'];
        echo " ";
        print_r($_FILES);
}
?>

Bunmi

Bunmi Akinmboni wrote:

Thanks John,
I had done it before and still tried it again now. This is what I get:

Warning: copy(.): failed to open stream: Is a directory in /home/ayserve/public_html/fu/fuprocess.php on line 6
ayservenet.jpg DONE Array ( [ufile1] => Array ( [name] => ayservenet.jpg [type] => image/pjpeg [tmp_name] => /tmp/php1tARiu [error] => 0 [size] => 3030 ) )


Bunmi

John W. Holmes wrote:

Bunmi Akinmboni wrote:

Pls Help.
I have done a lot of reading prior to this yet I just can't seem make it work. I wrote an upload program as seen below but the response I got was:


Possible file upload attack. Filename: ayservenet.jpg Array ( [ufile1] => Array ( [name] => ayservenet.jpg [type] => image/pjpeg [tmp_name] => /tmp/phpIMEhdh [error] => 0 [size] => 3030 ) )


[snip]

if (is_uploaded_file($_FILES['ufile1']['name'])) {
copy($_FILES['ufile1']['name'], ".");
echo "$ufile1_name ";
echo "DONE";
echo " ";
print_r($_FILES);
} else {
echo "Possible file upload attack. Filename: " . $_FILES['ufile1']['name'];
echo " ";
print_r($_FILES);
}
?>



You should pass $_FILES['ufile1']['tmp_name'] to is_uploaded_file().




--
'Bunmi Akinmboni
5, Aibu Street, Off Bode Thomas Street,
P.O. Box 6235, Surulere, Lagos, NIGERIA.
Tel: (234) 1-813-3335
Fax: (234) 1-583-2585 (Nigeria Only)
Fax: 1 (309) 285-2383 (International)
Email: [EMAIL PROTECTED]
Web site: http://www.budelak.com
          http://www.ayserve.net

Web Design, Web Hosting, Domain Registration, ICT Consultancy, Networking, Internet, eCommerce, System Integrator
===================================================

--- End Message ---
--- Begin Message --- Your webserver needs write permission to the directory where you want to copy.

Bunmi Akinmboni wrote:

This is the new code:
<?php
if (is_uploaded_file($_FILES['ufile1']['tmp_name'])) {
    copy($_FILES['ufile1']['tmp_name'], ".");
    echo "$ufile1_name ";
    echo "DONE";
    echo " ";
    print_r($_FILES);
} else {
    echo "Possible file upload attack. Filename: " .
$_FILES['ufile1']['name'];
    echo " ";
    print_r($_FILES);
}
?>

Bunmi

Bunmi Akinmboni wrote:

Thanks John,
I had done it before and still tried it again now. This is what I get:

Warning: copy(.): failed to open stream: Is a directory in /home/ayserve/public_html/fu/fuprocess.php on line 6
ayservenet.jpg DONE Array ( [ufile1] => Array ( [name] => ayservenet.jpg [type] => image/pjpeg [tmp_name] => /tmp/php1tARiu [error] => 0 [size] => 3030 ) )


Bunmi

John W. Holmes wrote:

Bunmi Akinmboni wrote:

Pls Help.
I have done a lot of reading prior to this yet I just can't seem make it work. I wrote an upload program as seen below but the response I got was:


Possible file upload attack. Filename: ayservenet.jpg Array ( [ufile1] => Array ( [name] => ayservenet.jpg [type] => image/pjpeg [tmp_name] => /tmp/phpIMEhdh [error] => 0 [size] => 3030 ) )



[snip]


if (is_uploaded_file($_FILES['ufile1']['name'])) {
copy($_FILES['ufile1']['name'], ".");
echo "$ufile1_name ";
echo "DONE";
echo " ";
print_r($_FILES);
} else {
echo "Possible file upload attack. Filename: " . $_FILES['ufile1']['name'];
echo " ";
print_r($_FILES);
}
?>




You should pass $_FILES['ufile1']['tmp_name'] to is_uploaded_file().




--- End Message ---
--- Begin Message ---
----- Original Message ----- 
From: "Bunmi Akinmboni" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 16, 2003 1:33 PM
Subject: [PHP] Help with file upload


> This is the new code:
> <?php
> if (is_uploaded_file($_FILES['ufile1']['tmp_name'])) {
>      copy($_FILES['ufile1']['tmp_name'], ".");

i guess, actual problem is something like::

>      copy($_FILES['ufile1']['tmp_name'], ".");

while it should be

>      copy($_FILES['ufile1']['tmp_name'], "./");

hope it helps


> echo "$ufile1_name ";
> echo "DONE";
> echo " ";
> print_r($_FILES);
> } else {
>      echo "Possible file upload attack. Filename: " .
> $_FILES['ufile1']['name'];
> echo " ";
> print_r($_FILES);
> }
> ?>
>
> Bunmi
>
> Bunmi Akinmboni wrote:
>
> > Thanks John,
> > I had done it before and still tried it again now. This is what I get:
> >
> > Warning: copy(.): failed to open stream: Is a directory in
> > /home/ayserve/public_html/fu/fuprocess.php on line 6
> > ayservenet.jpg DONE Array ( [ufile1] => Array ( [name] => ayservenet.jpg
> > [type] => image/pjpeg [tmp_name] => /tmp/php1tARiu [error] => 0 [size]
> > => 3030 ) )
> >
> > Bunmi
> >
> > John W. Holmes wrote:
> >
> >> Bunmi Akinmboni wrote:
> >>
> >>> Pls Help.
> >>> I have done a lot of reading prior to this yet I just can't seem make
> >>> it work. I wrote an upload program as seen below but the response I
> >>> got was:
> >>>
> >>> Possible file upload attack. Filename: ayservenet.jpg Array (
> >>> [ufile1] => Array ( [name] => ayservenet.jpg [type] => image/pjpeg
> >>> [tmp_name] => /tmp/phpIMEhdh [error] => 0 [size] => 3030 ) )
> >>
> >>
> >> [snip]
> >>
> >>> if (is_uploaded_file($_FILES['ufile1']['name'])) {
> >>>     copy($_FILES['ufile1']['name'], ".");
> >>>     echo "$ufile1_name ";
> >>>     echo "DONE";
> >>>     echo " ";
> >>>     print_r($_FILES);
> >>> } else {
> >>>     echo "Possible file upload attack. Filename: " .
> >>> $_FILES['ufile1']['name'];
> >>>     echo " ";
> >>>     print_r($_FILES);
> >>> }
> >>> ?>
> >>
> >>
> >>
> >> You should pass $_FILES['ufile1']['tmp_name'] to is_uploaded_file().
> >>
>
>
> -- 
> 'Bunmi Akinmboni
> 5, Aibu Street, Off Bode Thomas Street,
> P.O. Box 6235, Surulere, Lagos, NIGERIA.
> Tel: (234) 1-813-3335
> Fax: (234) 1-583-2585 (Nigeria Only)
> Fax: 1 (309) 285-2383 (International)
> Email: [EMAIL PROTECTED]
> Web site: http://www.budelak.com
>            http://www.ayserve.net
>
> Web Design, Web Hosting, Domain Registration, ICT Consultancy,
> Networking, Internet, eCommerce, System Integrator
> ===================================================
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Hi.
I have a question.
I receive this message three times every time I boot my computer:
Unknown(): Could not load dynamic library 'extensions\php_dbg.dll-
4.3.2' - The specified module could not be found.
Is there a way I can fix this problem?

Amanda

--- End Message ---
--- Begin Message ---
Either confirm that you have php_dbg.dll in your extensions directory or
comment out that line in your php.ini file.

-M

-----Original Message-----
From: Amanda Lau [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 16, 2003 4:20 AM
To: [EMAIL PROTECTED]
Subject: [PHP] php


Hi.
I have a question.
I receive this message three times every time I boot my computer:
Unknown(): Could not load dynamic library 'extensions\php_dbg.dll- 4.3.2' -
The specified module could not be found. Is there a way I can fix this
problem?

Amanda

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

--- End Message ---
--- Begin Message ---
Dear Miss/Mrs./Mr.
    I intend to move to Australia and work there as an auditor or an accountant.So I'd 
like to be familiar with Australian accounting environment before I move to there.
    So I'd like you to give me some information about "MYOB Accountants Office" and 
"MYOB Tax"like:
* Where can I have courses about them in Egypt ,or How I could have courses by distant 
 education if there is no courses available in Egypt?
* Where can I find self-study books or CDs about them and what is the title of these 
books or CDs(Can I get them free or there are a fee for having them how mush it could 
be).
           I'll be waiting for your reply,     
                            Wish you all the best,
 
                                                                                  
Yours faithfully,
                                                                               Hatem 
A. Gouda   

































---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

--- End Message ---
--- Begin Message ---
Hi,

        With the ArcaAttributes class definition (see below) I've an arror
when trying to use one of the constants of this class as this :

        echo ArcaAttributes::ATT_EMPLOYEENUMBER;

        Parse error: parse error, expecting `'('' in
/dtpdev01/dtp/racine-web/arca_test/test.php on line 117

        It seams waiting only functions when using "::".

Could someone help me ? How to define constant in a cless without the
"define()" function ? (I don't want to use the define function because it
makes the constant defined everywhere).

Many thanks in advance !

>>>
class ArcaAttributes {
        /**
         * Liste des attributs ŕ retourner
         * @var array
         */
        var $attributes = array();
        var $set = false;
        
        const ATT_EMPLOYEENUMBER = 'uid';
        const ATT_CN = 'cn';
        const ATT_MAIL = 'mail';
        const ATT_POSTALADDRESS = 'postofficebox';
        const ATT_TELEPHONENUMBER = 'telephonenumber';
        
        const ATT_DEFAULT_PERSON_ATTRIBUTES = array(
                ArcaAttributes::ATT_EMPLOYEENUMBER,
                ArcaAttributes::ATT_CN,
                ArcaAttributes::ATT_MAIL,
                ArcaAttributes::ATT_POSTALADDRESS,
                ArcaAttributes::ATT_TELEPHONENUMBER
        );
        
        function ArcaAttributes($clearList = false) {
                if ($clearList)
                        $this->attributes = array();
                else
                        $this->setDefaultAttributes();
        }
                
        function addAttribute($attrib) {
                array_push($this->attributes, $attrib);
        }
        
        function clearAttributes($clearList = false) {
                if ($clearList) {
                        $this->set = false;
                        $this->attributes = array();
                }
                else
                        $this->setDefaultAttributes();
        }
        
        function setDefaultAttributes() {
                $this->set = true;
                $this->attributes =
ArcaAttributes::ATT_DEFAULT_PERSON_ATTRIBUTES;
        }

        function is_set() {
                if ($this->set === true)
                        return true;
                else
                        return false;
        }
}
<<<

            (o_   BENARD Jean-Philippe - Consultant STERIA Infogérance
(o_   (o_   //\     RENAULT DTSI/ODPS/[EMAIL PROTECTED] * ALO * API : MLB 02C 1 14
(/)_  (\)_  V_/_   2 Av du vieil étang * 78181 MONTIGNY-LE-BRETONNEUX
                       Tél : +33 1-30-03-47-83 * Fax : +33 1-30-03-42-10

--- End Message ---

Reply via email to