OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 29 Jul 2005 10:24:49 -0000 Issue 3594

php-general-digest-helplists.php.net
Date: Fri Jul 29 2005 - 05:24:49 CDT


php-general Digest 29 Jul 2005 10:24:49 -0000 Issue 3594

Topics (messages 219563 through 219584):

Re: Debugging mail()
        219563 by: Todd Cary
        219564 by: Philip Hallstrom
        219565 by: Todd Cary

Dropdown Building Function
        219566 by: Jack Jackson

Re: PHP form not working
        219567 by: Matt Zandstra

Re: New installation of PHP 5.0.4 on Windows 2003 server
        219568 by: Louis Solomon [SteelBytes]

problems with overloading in php 5.
        219569 by: Gordon Heydon

PHP code in a MySQL record
        219570 by: Nathaniel Hall

PHP noobie
        219571 by: Bob Stia
        219573 by: Dotan Cohen
        219574 by: Mary-Anne Nayler
        219575 by: Jochem Maas

Re: How Can I send mail in php in HTML format?
        219572 by: Manuel Lemos

Re: function with argument of type array
        219576 by: Jochem Maas
        219578 by: Marcus Bointon
        219581 by: Jochem Maas

time()
        219577 by: virtualsoftware.gmail.com
        219579 by: Marcus Bointon

Re: safe mode
        219580 by: Kim Madsen

Visit to Germany
        219582 by: DL Neil, Newsletter a/c

overwrite private class members in php5?
        219583 by: Norbert Wenzel
        219584 by: Norbert Wenzel

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Todd Cary wrote:
> I have the following code in my script and no errors are created, but I
> do not get any emails. It works on other servers.
>
> Are there some logs I can check to figure out why an email is not being
> sent/received?
>
> Todd
I think I figured out the problem: the needed port is assigned to
another server!

Todd

attached mail follows:


> I have the following code in my script and no errors are created, but I do
> not get any emails. It works on other servers.
>
> Are there some logs I can check to figure out why an email is not being
> sent/received?

Depends on your setup, but /var/log/maillog in the unix world would be a
good place to start...

attached mail follows:


Todd Cary wrote:
> I have the following code in my script and no errors are created, but I
> do not get any emails. It works on other servers.
>
> Are there some logs I can check to figure out why an email is not being
> sent/received?
>
> Todd

Whoops...forgot the code:

if (mail("toddaristesoftware.com", "Test email", $body,
"From:webmasteraristesoftware.com")) {
  $msg = "Email has been sent to " . $req_email;
  $req_email = "";
} else {
   $msg = "Cannot send email";
}

And I believe the problem is that the required is being used by another
server.

attached mail follows:


Hi,
because that last topic on multipage forms was so exciting, I decided to
database the questions as well. I wonder if anyone can help me with a
function to pull rows into dropdown boxes.

It's a 1:n relationship between questions and answers, and I have a
table of questions

q_id
q_name
q_text
q_style //dropdown, radio, checkboxes
q_cat //question category

and a table full of answers

a_id
q_id
a_answer

When I do

        $fields = 'SELECT *';
        $from = 'FROM questions,answers';
        $sort = "ORDER BY questions.q_cat";
        $where = "WHERE answers.q_id=questions.q_id";

// construct the sql query:
$sql = "$fields $from $where $sort";

// Run SQL query 1
if (!($result = mysql_query($sql))) {
echo "Could not connect to the database ($sql)" . mysql_error();
}

while ($row = mysql_fetch_assoc($result)) {
        

I need to loop through the results and make a dropdown list from them,
taking the question name as the select name, and then making each answer
id and answer text the makings of an option ros.

Based on a problem a while ago which was similar but different, someone
here actually made me a function *similar* to what I need to do now,
This one acts different and I just cannot adapt the old one, because I
still get confused at this level.

I think it wants to be something like (and note that part of the return
is the code to react to error checking results):

$dropdown[] = '<option <?php if (' . $q_name . ' == "' . $a_id . '")
echo "selected "; ?> value=\'' . $a_id . '\'>' . $a_answer . '</option>';

        etc for all $a_answer(s)...
        and then
        
return '<?php if (sizeof($message[\'' . $q_name . '\'])){ echo "<div
class='error'>"; } ?>
        <div class=\'row\'>
        <select class=\'answer\' name=\'' . $q_name . '\'>
        <option value=\'\'>Select from this list</option>'
                     join('',$dropdown)
                     . '</select></div>'
      . '<?php if (sizeof($message[\''. $q_name '\'])){ echo
"</div><!--/error-->"; } ?>';
        

Can anyone point me at the right direction?

Thanks!!

JJ

attached mail follows:


Pasting your page onto my server and commenting out your includes the
following lines stand out:

$email_err ="<span class="red">Please enter your email address!</span><br />";
$message_err = "<span class="red">Please enter a message!</span><br />";

You have quotes within quotes here. You should either escape the inner
quotes or use single quotes to define your string. So this will work:

$email_err ="<span class=\"red\">Please enter your email address!</span><br />";
$message_err = "<span class=\"red\">Please enter a message!</span><br />";

or this will work:

$email_err ='<span class="red">Please enter your email address!</span><br />';
$message_err = '<span class="red">Please enter a message!</span><br />';

The latter is slightly more efficient, but you won't notice the difference.

Incidentally, you should consider separating your presentation from your logic a little more, but that's a whole other issue.

HTH

Matt

On Thu, 28 Jul 2005, Bruce Gilbert wrote:

> Here is the entire code on the page. Now I am getting an error again...

SNIP

> $email_err ="<span class="red">Please enter your email address!</span><br />";
> $send= "no";
> }
> //check value of $_POST['message']
> if ($POST['message'] =="") {
> $message_err = "<span class="red">Please enter a message!</span><br />";

SNIP

> </html>
>
> http://inspired-evolution.com/Contact_Form_test.php
>
> error is on line 52

--
getInstance()
http://www.getinstance.com

attached mail follows:


maybe NTFS permissions on php.ini?

--
Louis Solomon
www.SteelBytes.com

""Harris, Walter"" <harriswncarts.edu> wrote in message
news:DEF9C5FC613BEC46BB08F973317F22A702D400C6email.ncarts.edu...
Hi to all:

I have manually installed PHP 5.0.4 on a Windows 2003 server with IIS 6
installed, using ISAPI.

Working with the systems administrator, we set up web site named
phptest. This points to the directory c:\php\www where the .php and
.html pages are stored.

I am wanting to use PHP to inquiry/update the Windows Active Directory
(i.e. our LDAP server), therefore, I have uncommented
"extension=php_ldap.dll" in the php.ini file.

Other changes to the php.ini of which I moved into c:\windows:

doc_root = c:\php\www
   and
extension_dir = "c:\php\ext"

The problems are:

1. LDAP library is not being loaded.

2. When index.php which contains:

<html>
<h1>Test PHP install and LDAP load </h1>

<?php
phpinfo();
?>

runs, the LDAP library is not being shown BUT when I execute "php -i" at
a DOS command prompt, the OpenLDAP library is being loaded.

3. Another thing I found different between the index.php and php -i
executions is:
         in the php -i the doc_root displays c:\php\www and
extension_dir displays c:\php\ext BUT
         in the index.php doc_root displays No value and extension_dir
does not display the c:\php\ext value.

Does anyone know what I may have missed in installing PHP on the windows
2003 server? Need to be able to use the LDAP calls.

Thanks for your assistance.

Walter Harris
NC School of the Arts
Office Phone 336 770-1454
Cell Phone 336 462-6668
-----Original Message-----
From: Taksam [mailto:taksam_tongyahoo.com]
Sent: Wednesday, July 27, 2005 1:00 PM
To: php-windowslists.php.net; php-generallists.php.net
Subject: [PHP-WIN] can I use Apache v 2 with PHP?

Hello everybody:

I finally installed Apache 1.3.3 and PHP 5.0.4 engine and made my first
PHP page and it works! thanks for your help! And didn't use an IDE, just
UltraEdit :) but, I WILL use and IDE someday anyway.

Now, my question is: can I use Apache version 2 with PHP? And, even if I
can use it in my development environment... is it safe to use Apache
2+PHP in a production environment?

Fist of all, thanks for your answers, I am new with PHP, but I've been
using Java for the last 5 years, so, it's very interesting to compare
both.

Tak (learning PHP in turbo-mode)

---------------------------------
 Start your day with Yahoo! - make it your home page
----------------------------------------------
This message has been scanned for viruses and
dangerous content and is believed to be clean.
----------------------------------------------

attached mail follows:


Hi,

I have an interesting problem that I cannot explain with using the
__set() and __get() when playing with arrays.

Basically with a normal object if you store an array as a property you
can manipulate it like an array. eg.

$obj->prop[5] = 'apple';

In this example if $obj->prop is an array then the position 5 will then
contain 'apple'. This is expected behaviour and works very well.

Now if you use the following code and use overloading you can do the
same thing.

--8<--
<?php

class ex {
  public function __get($prop) {
    echo "getting property $prop\n";
    return $this->fields[$prop];
  }

  public function __set($prop, $value) {
    echo "setting property $prop\n";
    $this->fields[$prop] = $value;
  }

  private $fields;
}

$obj = new ex;
$obj->prop = array(4 => 'pear');

$obj->prop[5] = 'apple';
?>
--8<--

as expected it will work exactly the same as the first example. but the
output "setting property prop" is not shown when the $obj->prop[5] which
I find a little strange.

but now if I do not store the values in the object as an array but store
them as something else like a serialized string it will not work. eg.

--8<--
<?php

class ex {
  public function __get($prop) {
    echo "getting property $prop\n";
    return unserialize($this->fields[$prop]);
  }

  public function __set($prop, $value) {
    echo "setting property $prop\n";
    $this->fields[$prop] = serialize($value);
  }

  private $fields;
}

$obj = new ex;
$obj->prop = array(4 => 'pear');

$obj->prop[5] = 'apple';
?>
--8<--

Now this example will not work. Could someone please help me understand
why. I have a funny feeling that the __set() is not being called, and
something in the php5 overload code is guessing what should happen and
doing it.

I am not on the php-general mail list so any replies can you please send
it directly to me.

Thanks to anyone that can solve this for me.
Gordon.

attached mail follows:


I am working on a project that uses an index.php page. Depending on the
variable in the URL, a different php page is included. I have a
config.php that contains variables that are accessible from any page.
That is the easy part.

I have some pages pulling HTML out of a database. I would like to be
able to reference some of the variables in the config.php in the
database blob field. Here is an example:

index.phphalln_\_otc_\._edu
------
<html><head>...etc
<?php
        include 'config.php';
        if (blabla) {
                include "thispage.php";
        } else {
                include "thatpage.php";
        }
?>

config.php
------
<?php
        $this_var=1;
        $that_var="Nothing";
?>

test.php
------
<?php
        $query="SELECT * from table";
        $result=mysql_query($query) or die ("Cannot process query");
        $row=mysql_fetch_row($result);
        echo $row[1];
?>

MySQL record:
------
id,year,month,day,entry

1,2005,01,01,This is a test<br><? echo $that_var; ?>

_____________________________
I have tried using <br>&gt;? echo $that_var; ?&lt; and I have tried
escaping everything, but that still didn't work. Any ideas?

Nathaniel Hall
halln_\_otc_\._edu

attached mail follows:


Hello PHP list

First allow me to apologize if this is the wrong place for this and
direct me to the proper place. (be nice now!)

I know nothing about PHP and have read at least 100 faqs and googled for
hours. I don't even know some of the basics.

Allow me to explain. I am the webmaster for a small web site for a
Florida car club. The members have been asking if they could post info
about events, communicate community wide, maybe post their own
Classified ads, etc,

I would like to comply with their wishes for an email/blog kind of thing
but don't have the foggiest notion where to begin. The googling/faq's
don't help me a bit and appears to be pretty complicated. I don't even
know the basics. I really have no desire to go into a steep learning
curve to accomplish what should be a pretty simple thing. I need simple
and easy.

I have composed in straight html (not that much,but enough) and with
several GUI's. (all open source Linux based) I compose on my system and
then simply upload to the site with FTP. I have found a few PHP
packages but are not sure what they do. They require PHP, MySQL or
Postgres, and Apache. Do I really need to install Apache? (The site is
hosted by a commercial remote ISP as a courtesy/good will thing and I
think they support PHP but do not wish to place any burden on them to
support the site) Do I really need a data base?

Please be patient and point the old guy in the right direction.

Thanks,
Bob S.

attached mail follows:


On 7/29/05, Bob Stia <rnrsanctum.com> wrote:
> Hello PHP list
>
> First allow me to apologize if this is the wrong place for this and
> direct me to the proper place. (be nice now!)
>
> I know nothing about PHP and have read at least 100 faqs and googled for
> hours. I don't even know some of the basics.
>
> Allow me to explain. I am the webmaster for a small web site for a
> Florida car club. The members have been asking if they could post info
> about events, communicate community wide, maybe post their own
> Classified ads, etc,
>
> I would like to comply with their wishes for an email/blog kind of thing
> but don't have the foggiest notion where to begin. The googling/faq's
> don't help me a bit and appears to be pretty complicated. I don't even
> know the basics. I really have no desire to go into a steep learning
> curve to accomplish what should be a pretty simple thing. I need simple
> and easy.
>
> I have composed in straight html (not that much,but enough) and with
> several GUI's. (all open source Linux based) I compose on my system and
> then simply upload to the site with FTP. I have found a few PHP
> packages but are not sure what they do. They require PHP, MySQL or
> Postgres, and Apache. Do I really need to install Apache? (The site is
> hosted by a commercial remote ISP as a courtesy/good will thing and I
> think they support PHP but do not wish to place any burden on them to
> support the site) Do I really need a data base?
>
> Please be patient and point the old guy in the right direction.
>
> Thanks,
> Bob S.
>

Try googleing for wiki software. The software that runs wikipedia is:
http://www.mediawiki.org/wiki/Main_Page

Dotan Cohen
http://lyricslist.com/lyrics/artist_albums/41/armstrong_louis.php
Armstrong, Louis Song Lyrics

attached mail follows:


I've used Cutenews before and found it to be ok: http://www.cutephp.com/

Bob Stia wrote, On 29/07/05 08:47 AM:

>Hello PHP list
>
>First allow me to apologize if this is the wrong place for this and
>direct me to the proper place. (be nice now!)
>
>I know nothing about PHP and have read at least 100 faqs and googled for
>hours. I don't even know some of the basics.
>
>Allow me to explain. I am the webmaster for a small web site for a
>Florida car club. The members have been asking if they could post info
>about events, communicate community wide, maybe post their own
>Classified ads, etc,
>
>I would like to comply with their wishes for an email/blog kind of thing
>but don't have the foggiest notion where to begin. The googling/faq's
>don't help me a bit and appears to be pretty complicated. I don't even
>know the basics. I really have no desire to go into a steep learning
>curve to accomplish what should be a pretty simple thing. I need simple
>and easy.
>
>I have composed in straight html (not that much,but enough) and with
>several GUI's. (all open source Linux based) I compose on my system and
>then simply upload to the site with FTP. I have found a few PHP
>packages but are not sure what they do. They require PHP, MySQL or
>Postgres, and Apache. Do I really need to install Apache? (The site is
>hosted by a commercial remote ISP as a courtesy/good will thing and I
>think they support PHP but do not wish to place any burden on them to
>support the site) Do I really need a data base?
>
>Please be patient and point the old guy in the right direction.
>
>Thanks,
>Bob S.
>
>
>

attached mail follows:


Bob Stia wrote:
> Hello PHP list
>
> First allow me to apologize if this is the wrong place for this and
> direct me to the proper place. (be nice now!)

this list is really for people who are programmning in php.
as you describe it your looking for a php solution as an end user,
so no this is not really the right place - although I couldn't
really say where you would be better off.

>
> I know nothing about PHP and have read at least 100 faqs and googled for
> hours. I don't even know some of the basics.

given that you seem to have STFW,etc , till your eye bled - and that
by your own admission you are still clueless I (maybe
others too!) will try to point you in the right direction.

>
> Allow me to explain. I am the webmaster for a small web site for a
> Florida car club. The members have been asking if they could post info
> about events, communicate community wide, maybe post their own
> Classified ads, etc,
>
> I would like to comply with their wishes for an email/blog kind of thing
> but don't have the foggiest notion where to begin. The googling/faq's
> don't help me a bit and appears to be pretty complicated. I don't even
> know the basics. I really have no desire to go into a steep learning
> curve to accomplish what should be a pretty simple thing. I need simple
> and easy.
>
> I have composed in straight html (not that much,but enough) and with
> several GUI's. (all open source Linux based) I compose on my system and

ah if your using Linux on the desktop then you are already have an advantage :-)

> then simply upload to the site with FTP. I have found a few PHP
> packages but are not sure what they do. They require PHP, MySQL or
> Postgres, and Apache. Do I really need to install Apache? (The site is

Apache is a webserver. you do need it - and its already installed
(assuming the ISP/hosting-company is linux/unix/etc running their servers,
as apposed to Windows - in which the webserver is probably not Apache
but instead IIS. in practice, *for the end user* (before I start a flamewar),
it does not really matter which webserver is being used (rather like it should
not matter which webbrowser you use or which email application you use.)

if the hosting company is running Apache then Im' willing to bet that
they also have PHP and MySQL available (PostGres is a database engine,
as is MySQL, MySQL is 'everywhere' whereas PostGres is a fringe player
  - not that many hosting companies support it - I would forget trying to run
any application/package that requires PostGres in your case)

you may have read the term LAMP?

L Linux
A Apache
M MySQL
P PHP (also Perl & Python)

a so called software stack - and it's installed blooming everywhere (almost) so
don't worry too much about these requirements - regardless you do not have to
install these yourself - your hosting company will have done all this (assuming
they support LAMP)

> hosted by a commercial remote ISP as a courtesy/good will thing and I
> think they support PHP but do not wish to place any burden on them to

you will either have to ask them or garner the information - if they
don't support PHP then PHP cannot be of service to you unless you are
willing to switch hosts.

> support the site) Do I really need a data base?

99% of all ready2go php packages/apps require a DB - I think you can
safely assume you'll need one.

>
> Please be patient and point the old guy in the right direction.

there are plenty of php apps out there.
my first recommendation would be to try WordPress (http://wordpress.org)
which is a very nice php blog app that has a very easy install process.

I doubt WordPress will satisfy all your members wishes - but lets learn to
walk before we run heh :-)

whatever package you decide on, if you get into trouble installing it,
head to the relevant forum where the developers and users of said package
will be best able to help troubleshoot.

good luck.

>
> Thanks,
> Bob S.
>

attached mail follows:


Hello,

on 07/28/2005 04:30 PM Tomás Rodriguez Orta said the following:
> Hello friends.
>
> How Can I send mail from php in HTML format?.
> I use the mail() function, but I dont know doing.somebody can I help me?

You may want to take a look at this class that can compose and send HTML
messages, if necessary embedding image that are sent with the message
and can show to recipient even when he is offline.

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

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

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

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

attached mail follows:


Marcus Bointon wrote:
> On 28 Jul 2005, at 12:07, André Medeiros wrote:
>
>> On Thu, 2005-07-28 at 11:08 +0200, marc serra wrote:
>>
>>> Hi, i want to know if it is possible to create a function and declare
>>> that one of its arguments is array type.
>>>
>>> In fact i want to do something like this
>>>
>>> function test(String $litteral, array $foo){

unless String is a class you defined that won't work at all. basic data types
cannot be hinted (e.g. bool, int, string, float)

>>
>>
>> There is no way to do that. What you _CAN_ do, to ensure you're getting
>> an array is:
>
>
> There IS a way to do exactly this. It's called type hinting and it's a
> PHP 5 feature:

for a split second I was about to say a word start with 'bull', but Marcus
is more or less correct - typehints for classes has existed since the beginning
of php5, the ability to typehint arrays is aparently being included in php5.1
(still in beta).

thanks Marcus for the heads up. :-)

=================

now don't get me started on the fact that 'they' pulled the plug on being able
to do they following - I feel the breath of some purist overlord breathing down
my neck:

class Test { /* ... */ }
function foo(Test $t = null) { /* ... */ }

(the above worked in the first few betas of php5.0)

if a php 'God' reads this (and at least one of you is kind enough to grace us with
his presence on this list) - please reconsider allowing typehints with defaults of
NULL (only NULL and nothing else is more than enough for me!).

>
> http://www.php.net/manual/en/language.oop5.typehinting.php
>
> Marcus

attached mail follows:


On 29 Jul 2005, at 08:19, Jochem Maas wrote:

> unless String is a class you defined that won't work at all. basic
> data types
> cannot be hinted (e.g. bool, int, string, float)

There's been quite a bit about this on php-internals. It seems to be
because PHP doesn't differentiate between these types internally;
they all seem to be classified as a generic scalar type whose actual
type is determined according to context. Java can go to the other
extreme, where every simple type is an object, and hence it's easy
(if not mandatory) to specify types like this. You would never be
able to say 'print "2" + 2' in Java and expect to get "4". This
looseness is very much part of what makes PHP so easy to get into -
if you really want these kind of features, you can just use Java
instead!

Another point is that exception handling (another PHP5 feature) is
next to useless without type hinting, so they HAD to implement it for
objects so that catch clauses could work properly.

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcussynchromedia.co.uk | http://www.synchromedia.co.uk

attached mail follows:


Marcus Bointon wrote:
> On 29 Jul 2005, at 08:19, Jochem Maas wrote:
>
>> unless String is a class you defined that won't work at all. basic
>> data types
>> cannot be hinted (e.g. bool, int, string, float)
>
>
> There's been quite a bit about this on php-internals. It seems to be
> because PHP doesn't differentiate between these types internally; they

so called zvals (zend value) and indeed typehinting these in php would
be silly.

> all seem to be classified as a generic scalar type whose actual type is
> determined according to context. Java can go to the other extreme,
> where every simple type is an object, and hence it's easy (if not
> mandatory) to specify types like this. You would never be able to say
> 'print "2" + 2' in Java and expect to get "4". This looseness is very
> much part of what makes PHP so easy to get into - if you really want
> these kind of features, you can just use Java instead!

not unless you put a gun to my head ;-)

>
> Another point is that exception handling (another PHP5 feature) is next
> to useless without type hinting, so they HAD to implement it for

that never crossed my mind!

> objects so that catch clauses could work properly.
>
> Marcus

attached mail follows:


Hi,
I have the date when users registered stored in the database using time() function format.

I have to search for users that are registered this week, this month and this year. How can i do that? I mean how can i found the beginning of this week? Or the beginning of this month?

Thanks in advance for your help!

attached mail follows:


On 29 Jul 2005, at 08:37, <virtualsoftwaregmail.com>
<virtualsoftwaregmail.com> wrote:

> I have the date when users registered stored in the database using
> time() function format.

Hm. I hope this means you're storing it as a TimeStamp format, or
better, DateTime, and not as a simple integer field.

> I have to search for users that are registered this week, this
> month and this year. How can i do that? I mean how can i found the
> beginning of this week? Or the beginning of this month?

If you are storing it as a DateTime field, MySQL has loads of date
related functions for doing this, and it's more efficient to do it
using MySQL's functions that the equivalent in PHP. Take a look here:
http://dev.mysql.com/doc/mysql/en/date-and-time-types.html and http://
dev.mysql.com/doc/mysql/en/date-and-time-functions.html

You can do the calculations in PHP. For example, to find the first
day of this month as a timestamp:

$first = strtotime(date('Y-m-01'));

strtotime has some wonderful functionality - you can ask for dates
like 'next week' 'last year' 'yesterday -1 week'.

To format a timestamp into a MySQL-compatible DateTime string, use:

$datetime = date('Y-m-d h:i:s', $timestamp);

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcussynchromedia.co.uk | http://www.synchromedia.co.uk

attached mail follows:


> -----Original Message-----
> From: Bostjan Skufca domenca.com [mailto:bostjan.skufcadomenca.com]
> Sent: Thursday, July 28, 2005 1:38 PM

> > > I would *never* host anything on a server with safe_mode on!
>
> What are your reasons for this decision?

I correted it in a mail 5 minutes after.

With safe_mode off this is possible

System("cat /home/Bostjan/include/db_setup.inc");

From any php script and any user.

One should be protected by safe_mode_gid and safe_mode_include_dir, but I´ve seen several examples of hosting setups that allows complete access to another users directory. With safe_mode on I´M more safe and so are my customers ;-)

--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/Systemdeveloper

attached mail follows:


Greetings,

I'm hoping to visit the Stuttgart area* for one week ~ ten days
commencing c.Friday 19 August, to visit my brother-in-law and take a
short vacation.

If there are any PHP-related gatherings or activities I would be
interested to meet up (last time I tried, I missed out by one week...)

NB My grasp of the German language is in the feeble~abysmal range, but I
promise to read at least page one of my language tutorial before I come!

Regards,
=dn
* Dettingen-unter-Teck, Kirchheim/Teck, Notzingen

attached mail follows:


Hi, I've done something like this:

class MyClass {

   private $var;

   function __construct($value) {
     $this->var = $value;
   }

   public function printVar() {
     echo($this->var);
   }

}

$object = new MyClass('1');
$object->printVar(); // prints 1
$object->var = 3; // Fatal Error as expected
$object->$var = 2; // no error msg
$object->printVar(); // prints 2

Hows that possible or what's the difference between
  $object->var and
  $object->$var ?

thanks in advance for your help!
Norbert

attached mail follows:


Norbert Wenzel wrote:
> public function printVar() {
> echo($this->var);
> }

I have to do a little correction, i wrote
        $this->$var
to see the variable, otherwise i don't see
anything.