Re: [PHP] PHP4 and PHP5 at one machine

2003-07-08 Thread Milan Reznicek
Yes all these things I know, because already I'm running these two servers,
but both with PHP4.
But now I came accros the problem of "php4ts.dll". Because in both versiones
it has the same name. And if I have the old one my \WINNT\SYSTEM32 the
server which is running PHP5 won't start, and if i put there the newer one
the one with PHP4 won't start. That's my problem. Do you know how to solve
this?


Milan

--
--
Milan Reznicek
Software Developer

e-mail:   [EMAIL PROTECTED]
"Burhan Khalid" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tuesday, July 8, 2003, 8:42:16 PM, Milan wrote:
>
> MR> is there any posibility to run PHP4 and PHP5 at one machine, with
two
> MR> Apache servers running at the same time.
>
> MR> Windows 2000 SP3
> MR> Apache 1.3.27/PHP 4.3.0
> MR> Apache 2.0.46/PHP 5.0.0b1
>
> Yes it is possible. If you want both of the servers to be running at
> one time, then you'll have to change the Listen directive on one of
> them, since both will default to port 80. So, change one to something
> else, like 8080. Then access it with the port number
> http://address:port
>
> As far as the PHP install goes, you can have two PHP installs (one for
> each server), you just have to make sure where the .ini files are
> stored, and that the configuration directives for PHP (such as
> LoadModule, etc.) point to the right direction for each server.
>
> I also believe that the Apache Service Monitor can handle more than
> one Apache install, so you'll have a convienient place to control your
> servers.
>
> --
> Regards,
> Burhan Khalid
> phplist[at]meidomus[dot]com
> http://www.meidomus.com
>



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



[PHP] accesing php script in a different port

2003-07-08 Thread Michael P. Carel
hi to all,

I want to develop a system that can be access in a different port of the web
(such as in Port 11000). But i dont know  how to do this without affecting
existing apache or other webserver installation. My idea is based on some
utilities that exists such as the  Webmin Utilities that are commonly used
to administer Unix/Linux.

Can anyone give a hint or good tutorial links for this problem?

Thanks in advance.



Mike




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



[PHP] Re: Having problems with an IF statement, just doesn't make sense

2003-07-08 Thread Nadim Attari
Paying attention to this line:
> Also if I use !isset it returns true with a null value for $theme

Well this is clear in the manual:
isset() will return FALSE if testing a variable that has been set to NULL
So !isset($a_Null) = !FALSE = TRUE

>From PHP Manual
=
$var = 0;

if (empty($var)) {  // evaluates true
echo '$var is either 0 or not set at all';
}

if (!isset($var)) { // evaluates false
echo '$var is not set at all';
}

Read manual: empty() and isset()



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



[PHP] Re: movement on a page

2003-07-08 Thread Yasha Nisanov
are you talking about this ??












"Micah Montoy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there any way to jump out of PHP script but continue loading the HTML
on
> the rest of page?
>
> For instance I have this conditional and if its true, I want to stop
running
> the rest of the script and I want the rest of the page to continue loading
> that doesn't have any script.
>
> thanks
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/2003



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



RE: [PHP] How configure PHP parser 4.3.x in IIS version 6.0?

2003-07-08 Thread Roberto Ramírez
In order to use PHP on IIS6.0 you must allow IIS to use Unknown ISAPI
Extensions or Unknown CGI extensions in the Web Services section in the
IIS administration.

If you don’t allow it, IIS don’t parse any php file because it's not
allowed.


I hope this helps you...

Roberto




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Viernes, 05 de Diciembre de 2003 10:08 p.m.
To: PHP General
Subject: [PHP] How configure PHP parser 4.3.x in IIS version 6.0?

I use the dll  "php4isapi.dll" and it doesn't work, Could someone give
me a
hand?

Thanks in advanced.


-- 
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: simple ereg() question

2003-07-08 Thread Eddy-Das
ereg(".+")

--

- Eddy Wong
__
inframatrix internet solutions
http://www.inframatrix.com/


   ¥¿¤KEddy
Regular Octa-Eddy
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@¡½¢ª¢©
[EMAIL PROTECTED]@[EMAIL PROTECTED]@¡½ É\¿ß¡G [EMAIL PROTECTED]
[EMAIL PROTECTED]@¡½ É\¨¦¡G news://news.fixip.net/chat.ed
[EMAIL PROTECTED]@[EMAIL PROTECTED]@¡½ É\®Þ¤Æ¡G news://news.fixip.net/
[EMAIL PROTECTED]@¡½¢¨¢«
[EMAIL PROTECTED]@

"Gamin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
>How do i check with ereg() is a string is non-empty (!== '')
>
> Thx
>
> G
>
>



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



Re: [PHP] Text boxes posted to MySQL record that contain quotes

2003-07-08 Thread gamin
"Vernon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> OK when I use the mysql_escape_string() it adds the slashes so that the
> message will have \"the message\" so I've tried using the stripslashes()
as
> such:
>
> $message =
> stripslashes(mysql_escape_string($HTTP_POST_VARS['message']));
>
> which then causes the orginal problem, so it seems that I keep trying to
> reverse each other.
>
> I don't want the slashes and I need the quotes.

Hi,

   this is from obscure memory, have a look at the function
get_magic_quotes_gpc. I think that the input you are getting is already
escaped.

HTH

G



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



[PHP] movement on a page

2003-07-08 Thread Micah Montoy
Is there any way to jump out of PHP script but continue loading the HTML on
the rest of page?

For instance I have this conditional and if its true, I want to stop running
the rest of the script and I want the rest of the page to continue loading
that doesn't have any script.

thanks



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



[PHP] simple ereg() question

2003-07-08 Thread gamin
Hi,

   How do i check with ereg() is a string is non-empty (!== '')

Thx

G



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



[PHP] Re: getting part of a string

2003-07-08 Thread Micah Montoy
That worked like a charm.

thanks a lot


"Ulf Sundin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> try basename(). then just cut the extention with substr($string, 0, -4)
(-4
> if the extention is 4 characters i.e. .gif)
>
> Regards
> Ulf
>
>
> "Micah Montoy" <[EMAIL PROTECTED]> skrev i meddelandet
> news:[EMAIL PROTECTED]
> > Anyone have a sure way of grabbing just the file name from a string that
> > looks like this:
> >
> > C:/Documents and Settings/Bobo the Bugbear/My Documents/My
Pictures/1.gif
> >
> > I would like to pull off, just the name "1.gif" or even better just "1"
> > without the extension.
> >
> > I've been working on:
> >
> > $filevalue = str_replace("", "/", $filevalue);
> >
> > $parts = explode("/",$filevalue);
> > $file_name = $parts[count($parts)];
> >
> > but with no luck.
> >
> > thanks
> >
> >
>
>



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



[PHP] Re: getting part of a string

2003-07-08 Thread ulf sundin
try basename(). then just cut the extention with substr($string, 0, -4) (-4
if the extention is 4 characters i.e. .gif)

Regards
Ulf


"Micah Montoy" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Anyone have a sure way of grabbing just the file name from a string that
> looks like this:
>
> C:/Documents and Settings/Bobo the Bugbear/My Documents/My Pictures/1.gif
>
> I would like to pull off, just the name "1.gif" or even better just "1"
> without the extension.
>
> I've been working on:
>
> $filevalue = str_replace("", "/", $filevalue);
>
> $parts = explode("/",$filevalue);
> $file_name = $parts[count($parts)];
>
> but with no luck.
>
> thanks
>
>



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



[PHP] Anchor lost in header redirect

2003-07-08 Thread Yasha Nisanov
I'm not sure if this is the same bug that is talked about in Bug #6178:
URI Re-writing failure but there is comments of this being fixed in php
v4.0.2 and I am using php v4.3.1

I have a page that contains a form with enctype="multipart/form-data" -
used to upload an image

The form data is sent to a 2nd page that writes the image data into a
database.

In the 2nd page I also have a header function that contains an anchor
reference (#MyAnchor);

When the headers source page loads, the anchor disappears from the url.

This only happens when I post from a form that has
enctype=multipart/form-data.  I cannot be certain this is the cause but
I have some suspicions that it is.

Any ideas?



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/2003



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



RE: [PHP] PHP forum

2003-07-08 Thread PHP4 Emailer
HOLY COW,

I never laughed so hard in my life, This is DEAD ON, for what happens in
this exact forum.

Damn that [EMAIL PROTECTED] is funny!!

And I've only been here for about 3 months now. I've see about every one of
those in that short time. Boy that cracks me up.

Good find Richard!!
ha...  :}

-Original Message-
From: Richard Baskett [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 10:42 PM
To: PHP General
Subject: [PHP] PHP forum


Ok some of you might not like this, others of you will know exactly what I
mean, but it just reminded me so much of this forum that I am sure some of
you will catch the humor in it:

http://www.mac-forums.com/forums/showpost.php?postid=5736&postcount=85

Please keep your flames directed at me instead of the mailing list so we can
keep this thread to one post.

Cheers!

"What's in a name? That which we call a rose by any other name would smell
as sweet." - Shakespeare


--
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] getting part of a string

2003-07-08 Thread Micah Montoy
Anyone have a sure way of grabbing just the file name from a string that
looks like this:

C:/Documents and Settings/Bobo the Bugbear/My Documents/My Pictures/1.gif

I would like to pull off, just the name "1.gif" or even better just "1"
without the extension.

I've been working on:

$filevalue = str_replace("", "/", $filevalue);

$parts = explode("/",$filevalue);
$file_name = $parts[count($parts)];

but with no luck.

thanks



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



[PHP] How configure PHP parser 4.3.x in IIS version 6.0?

2003-07-08 Thread o_j_p_p
I use the dll  "php4isapi.dll" and it doesn't work, Could someone give me a
hand?

Thanks in advanced.


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



[PHP] PHP forum

2003-07-08 Thread Richard Baskett
Ok some of you might not like this, others of you will know exactly what I
mean, but it just reminded me so much of this forum that I am sure some of
you will catch the humor in it:

http://www.mac-forums.com/forums/showpost.php?postid=5736&postcount=85

Please keep your flames directed at me instead of the mailing list so we can
keep this thread to one post.

Cheers!

"What's in a name? That which we call a rose by any other name would smell
as sweet." - Shakespeare


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



Re: [PHP] Text boxes posted to MySQL record that contain quotes

2003-07-08 Thread Vernon
OK when I use the mysql_escape_string() it adds the slashes so that the
message will have \"the message\" so I've tried using the stripslashes() as
such:

$message =
stripslashes(mysql_escape_string($HTTP_POST_VARS['message']));

which then causes the orginal problem, so it seems that I keep trying to
reverse each other.

I don't want the slashes and I need the quotes.



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



Re: [PHP] PHP4 and PHP5 at one machine

2003-07-08 Thread Burhan Khalid
On Tuesday, July 8, 2003, 8:42:16 PM, Milan wrote:

MR> is there any posibility to run PHP4 and PHP5 at one machine, with two
MR> Apache servers running at the same time.

MR> Windows 2000 SP3
MR> Apache 1.3.27/PHP 4.3.0
MR> Apache 2.0.46/PHP 5.0.0b1

Yes it is possible. If you want both of the servers to be running at
one time, then you'll have to change the Listen directive on one of
them, since both will default to port 80. So, change one to something
else, like 8080. Then access it with the port number
http://address:port

As far as the PHP install goes, you can have two PHP installs (one for
each server), you just have to make sure where the .ini files are
stored, and that the configuration directives for PHP (such as
LoadModule, etc.) point to the right direction for each server.

I also believe that the Apache Service Monitor can handle more than
one Apache install, so you'll have a convienient place to control your
servers.

-- 
Regards,
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com


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



RE: [PHP] Text boxes posted to MySQL record that contain quotes

2003-07-08 Thread electroteque
adding slashes doesnt work like i said all that will show up in the box is a
slash \

Try mysql_escape_string()



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



Re: [PHP] [ML] Are there any announcement rules for this list?(was Re: [PHP] Re: NEW SPAMMER ...)

2003-07-08 Thread Richard Baskett
Ill second that.. err third that.. I like to hear announcements also.. as
long as they are PHP based of course :)

+1 for me also.

Rick

You will never be happy if you continue to search for what happiness
consists of. You will never live if you are looking for the meaning of life.
- Albert Camus

> From: Joel Rees <[EMAIL PROTECTED]>
> Date: Wed, 09 Jul 2003 09:59:31 +0900
> To: "Alexandru COSTIN" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> Subject: [PHP] [ML] Are there any announcement rules for this list? (was Re:
> [PHP] Re: NEW SPAMMER ...)
> 
>> I've just read the other thread about spammers and such.
>> Indeed, my announcement - even for a free platform - was not complying
>> to the posting guidelines as it not a response to any questions asked.
>> 
>> I apologize.
> 
> Where? The only guidelines that I can find for posting to this list are
> at 
> 
>   http://www.php.net/mailing-lists.php
> 
> I see nothing there at all concerning announcements.
> 
> I personally appreciate brief announcements of related products,
> regardless of licensing. A tag, [ANNOUNCEMENT] or [ANN], in the subject
> line would be helpful, but that's the only comment I have on the subject.
> 
> If the list maintainers do have rules or guidelines about announcements,
> maybe one of them would speak up now?
> 
> -- 
> Joel Rees, programmer, Kansai Systems Group
> Altech Corporation (Alpsgiken), Osaka, Japan
> http://www.alpsgiken.co.jp
> 
> 
> -- 
> 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] Text boxes posted to MySQL record that contain quotes

2003-07-08 Thread Burhan Khalid
On Wednesday, July 9, 2003, 5:50:05 AM, Vernon wrote:

V> I know that using stripslashes will remove \ using php but I'm having
V> trouble with posting quotation marks in a text record field. Anyone know how
V> I can get them to post to the database? It's basically like an email and I'd
V> like anything written to be able to post.

Try mysql_escape_string()



-- 
Regards,
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com


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



RE: [PHP] Text boxes posted to MySQL record that contain quotes

2003-07-08 Thread electroteque
apologies i hope it didnt look like i just hijacked the thread i was just
adding to it, this is a pretty serious issue though i dont think i've ever
come across it before funny enough as most the quoted text is in the
textarea instead , the quik fix i've done is to remove the quotes altogether
but that just defeats the purpose.


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



RE: [PHP] Text boxes posted to MySQL record that contain quotes

2003-07-08 Thread electroteque
wow i've had this issue aswell only yesterday , like in my search page of
the project i've just done i stored the search values of each option so that
they can return bak to the search page and edit their search entry , anyway
the fulltext search text input can contain quotes denoting exact phrase ,
this breaks in the textbox in fact even with addslashes like so \"some
text\" it will show up in the text input box like so \ , how do we get
around this ?

-Original Message-
From: Vernon [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 09, 2003 12:50 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Text boxes posted to MySQL record that contain quotes


I know that using stripslashes will remove \ using php but I'm having
trouble with posting quotation marks in a text record field. Anyone know how
I can get them to post to the database? It's basically like an email and I'd
like anything written to be able to post.

Thanks



--
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] New to PHP

2003-07-08 Thread Ow Mun Heng
Wow.. There's a guy named Rasmus here. Is here(or u) the same person who
wrote that book? this is way cool..

Oh.. BTW, "PHP & Mysql Web Development" is GOOD.

Also, since a lot of codes are open sourced, Read through them as well. I'm
learning through that too. (& this list)

Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-Original Message-
From: Ralph [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 9:01 AM
To: 'Hiren Mehta'; 'PHP'
Subject: RE: [PHP] New to PHP


Here are some sites for you to get started:

http://www.zend.com/developers.php
http://www.phpcomplete.com/tutorials.php
http://www.evilwalrus.com/articles.php

And for books, here are some excellent books I've come across:

Programming PHP
By Rasmus Lerdorf

Web Application Development with PHP 4.0
by Tobias Ratschiller

Professional PHP4 Programming
By Deepak Thomas





-Original Message-
From: Hiren Mehta [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 07, 2003 2:28 PM
To: PHP
Subject: [PHP] New to PHP

Hi I am new to PHP and would like to learn more about it. Which would be
the best place to start with besides the manual and what would you
suggest is a pre-requiste for learning PHP.

Thanks

Regards,

Hiren



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



[PHP] Text boxes posted to MySQL record that contain quotes

2003-07-08 Thread Vernon
I know that using stripslashes will remove \ using php but I'm having
trouble with posting quotation marks in a text record field. Anyone know how
I can get them to post to the database? It's basically like an email and I'd
like anything written to be able to post.

Thanks



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



RE: [PHP] include/require inside of function

2003-07-08 Thread Ow Mun Heng
Hi Mike,

I finally got it. Thanks. All I needed to do was just define global
$page_title inside the function to denote that I wanted to use that
variable.

One other quick question, in my original code (per below) the function
create_global() was used to create_globals on demand. But this involved a
lot of jumping, from one function to another just to create the globals on
demand. Is this efficient (more?? less??) compared to just stating global
$page_title inside the function?


Please enlighten me.


---config---
$page_title = "Main Page Title";
--

---functions-
function display_title()
{
global $page_title;  << This was what I missed
echo $page_title;
}

function org_display_title_code()  <<--- That was what I used originally
{
$l_main_title = create_globals( 'page_title' );

echo 'This is (create global) title1 -> ' . $l_main_title  ;
}

function create_globals( $passed_option )
{
if ( isset( $GLOBALS[$passed_option] ) )
{
return  $GLOBALS[$passed_option];
}
}

---

--index.php--




Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-Original Message-
From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 11:34 PM
To: Ow Mun Heng
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] include/require inside of function


> -Original Message-
> From: Ow Mun Heng [mailto:[EMAIL PROTECTED]
> Sent: 08 July 2003 15:53
> 
>   Here's the thing.. I declared $page_title = "My Page Title" in a
> file called config.php which is included in the index.php 
> page. when I tried
> to -> echo $page_title <- Nothing comes out. 
> 
>   If I declared it as global $page_title , then "My Page 
> Title" would
> be echoed out.

And is the assignment in the included file inside a function?  If so, the
usual rules about variables within functions apply.  If not, please post the
relevant code from both files so we can try to figure out your problem.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



RE: [PHP] Incrementing counter from an HTML page.

2003-07-08 Thread Student4
i think you can use image counter a tag img connect to our script, 
something like this



where the file phpcounter.php is generate counter in image form



Glory!
 
The problem I am facing is that my Index page can be an HTML page only..
not PHP. I cant use framesets, redirects etcetera. 
I want to build my own Counter using PHP & mySQL Database.. with the
"Users Online" and "Total Hits" feature. 
How can I increment the counter or affect a PHP code using HTML.. is
there someway I can achieve this? To be able to show the php counter on
my HTML page.. ?
 
Thanks,
PHPSpooky

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



[PHP] Re: __get, __set, __clone

2003-07-08 Thread Greg Beaver
Hi Yann,

What you are trying to do is possible in PHP 4, actually:

var_name1 = "value1";
$this->var_name2 = "value2";
}
}
$test = new MyTester;
var_dump($test); // shows two variables, $var_name1 and $var_name2
?>
Here is sample code that uses __set to allow you to transparently 
declare an object that allows you to set database values just by setting 
properties.


class UsesSetForMysql {
private $_db;
private $_table;
private $_row;
private $_keyname;
function __construct($server, $user, $password, $database, $table, 
$keyname, $keyvalue)
{
 $this->_db = mysql_connect($server, $user, $password);
 $this->_keyname = $keyname;
 $this->_table = $table;
 if ($this->_db) {
 $test = mysql_select_db($this->_db, $database);
 if ($test) {
  $a = mysql_query('SELECT * FROM ' . $this->_table . ' 
WHERE ' . $this->_keyname . ' = "' . $keyvalue . '"');
  if ($a) {
   $this->_row = mysql_fetch_array($a, MYSQL_ASSOC);
  }
 } else {
  mysql_close($this->_db);
  $this->_db = false;
 }
 }
}

function __destruct()
{
 if ($this->_db) {
  mysql_close($this->_db);
  $this->_db = false;
 }
}
function __set($name, $value)
{
 if (isset($this->_row) && $this->_row) {
 $this->_row[$name] = $value;
 $a = mysql_query('UPDATE ' . $this->_table . " SET $name = 
\"$value\" WHERE " . $this->_keyname . ' = "' . 
$this->_row[$this->_keyname] . '"');
 if ($a) {
  $keyvalue = $this->_row[$name];
  if ($name == $this->_keyname) {
   $keyvalue = $value;
  }
  $a = mysql_query('SELECT * FROM ' . $this->_table . ' 
WHERE ' . $this->_keyname . ' = "' . $keyvalue . '"');
  $this->_row = mysql_fetch_array($a, MYSQL_ASSOC);
 }
 }
}

function __get($name, &$value)
{
if (isset($this->_row) && is_array($this->_row)) {
if (isset($this->_row[$name])) {
$value = $this->_row[$name];
return true;
} else {
return false;
}
}
}
}
$table = new UsesSetForMysql('localhost', 'dummy', 'madeup', 'mytable', 
'mykey', 6);
$table->FirstName = 'Greg';
$table->LastName = 'Beaver';
// etc.
?>

:)
Greg
Yann Larrivee wrote:
Hi, in the past 2 days i have been looking into php5 and it's new
features.
I am not a psecialiste of OOP (only been OOPing for 2 month)

For a moment i tought that __set would allow me not to have to define a
methode __set that would set a value to a member variable.
It seems like we have to define the class __set and __get.

for example i tought i would be able to do.

class a{
function __construct(){
$this->__set("var_name1","value1");
$this->__set("var_name2","value2");
}
}
I read these 2 tutorial
http://www.phpbuilder.com/columns/argerich20030411.php3?page=5 (the
explanation seems really bad to me and does not show any usefull way to
use these functions)
http://talks.php.net/show/php5intro/25
This one well i comes back to the same thing as if i code it my self.
So my big question is why , when , how do we use these features
(__get,__set) 
For a moment i tought i would save me time, but if i have to redefine
them what is the point ?

I guess i am somewhat confuse on this issue, any explanation would be
appreciated. 

Thanks




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


[PHP] Annoucement Idea

2003-07-08 Thread Joe Harman
I am wondering if the creators of this list could impose a rule... all
things must be PHP related... if you have an announcement and it is
related to PHP... it must be proceed in the subject line of the email
with the word "ADV" or "Annoucement" - that way if you don't want to
read it, you can delete it... or set up a rule in Outlook to delete
it??? 
 
so... just an idea
 
see ya,
joe


Re: [PHP] [ML] Are there any announcement rules for this list? (wasRe: [PHP] Re: NEW SPAMMER ...)

2003-07-08 Thread Robert Cummings
Personally I like to hear about new releases of PHP related products
here too. For how often it occurs, I can't see how 1 in 80 emails a day
is really going to impact the list. Especially since 10 to 20 emails are
generated in support or indignation for such announcements :)

+1

Cheers,
Rob.

On Tue, 2003-07-08 at 20:59, Joel Rees wrote:
> > I've just read the other thread about spammers and such.
> > Indeed, my announcement - even for a free platform - was not complying
> > to the posting guidelines as it not a response to any questions asked.
> > 
> > I apologize.
> 
> Where? The only guidelines that I can find for posting to this list are
> at 
> 
> http://www.php.net/mailing-lists.php
> 
> I see nothing there at all concerning announcements.
> 
> I personally appreciate brief announcements of related products,
> regardless of licensing. A tag, [ANNOUNCEMENT] or [ANN], in the subject
> line would be helpful, but that's the only comment I have on the subject.
> 
> If the list maintainers do have rules or guidelines about announcements,
> maybe one of them would speak up now?

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] how to force variables declaration??

2003-07-08 Thread David Nicholson
Hello,


This is a reply to an e-mail that you wrote on Wed, 9 Jul 2003 at 02:10,
lines prefixed by '>' were originally written by you.
> hi to all.
> i would like to know how to force to php to declare everything
> variable,
> example
> var $var;
> $var = bla,bla..
> var $var2 = array();
> $var2 = bla,bla..
> and issue error when a variable is instanced without declare, some
> idea???:

Check out:
http://uk2.php.net/error_reporting

You want to use E_ALL to do what you described.

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

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



[PHP] session data missing

2003-07-08 Thread ulf sundin
After creating a new session with session_start() and inserting a few values
e.g $HTTP_SESSION_VARS['foo'] = 'bar'; a file /tmp/sess_{session_id} is
created.
The problem is that this file is empty! 0 bytes. no data is stored.
I'm using php 4.0.6 on linux with apache 1.3 something.

Regards
Ulf



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



Re: [PHP] Object assignment

2003-07-08 Thread Tom Rogers
Hi,

Wednesday, July 9, 2003, 10:38:22 AM, you wrote:
MG> I'm having trouble creating objects with DOMXML.  As I loop through a level
MG> of nodes, I'm creating a new element based on the array's key name.  The XML
MG> might look like this:

MG> 
MG>   Value 1
MG>   Value 2
MG> 

MG> So I'd be doing this with DOMXML in a loop:

$thisChild = $doc->>create_element($key);
MG> $thisChild = $ancestor->append_child($thisChild);

MG> Where $key is 'record' in this example, and $ancestor is 'rootElement',
MG> which is carried along in the function.

MG> The problem that when I reach the second element by the same name, and in
MG> the same node level, I'm overwriting the $thisChild object that I just
MG> created.  How can I dynamically name these objects so that I can have an
MG> indeterminate number of elements by the same name, in the same level?

What I have done is to keep an array of elements so it would work like
this

$elements = array();

//loop
if(!isset($elements[$key])){
  $elements[$key] = $doc->create_element($key);
}
$thisChild = $ancestor->append_child($elements[$key]);
//end loop

-- 
regards,
Tom


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



RE: [PHP] how to force variables declaration??

2003-07-08 Thread Martin Towell
change your error reporting level to E_ALL
You'll then get a warning|notice (can't remember which)

-Original Message-
From: mack paul [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 9 July 2003 11:10 AM
To: [EMAIL PROTECTED]
Subject: [PHP] how to force variables declaration??


hi to all.

i would like to know how to force to php to declare everything variable,
example

var $var;
$var = bla,bla..
var $var2 = array();
$var2 = bla,bla..

and issue error when a variable is instanced without declare, some idea???:



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__ Information from NOD32 1.452 (20030703) __

This message was checked by NOD32 for Exchange e-mail monitor.
http://www.nod32.com




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



[PHP] how to force variables declaration??

2003-07-08 Thread mack paul
hi to all.

i would like to know how to force to php to declare everything variable,
example

var $var;
$var = bla,bla..
var $var2 = array();
$var2 = bla,bla..

and issue error when a variable is instanced without declare, some idea???:



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



RE: [PHP] Object assignment

2003-07-08 Thread Martin Towell
Since I can't see the source for append_child(), I'll assume you're using
the $key as the index??

If so, try changing it to just a numeric index, ie, 0, 1, 2, etc.

HTH
Martin

-Original Message-
From: Matt Grimm [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 9 July 2003 10:38 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Object assignment


I'm having trouble creating objects with DOMXML.  As I loop through a level
of nodes, I'm creating a new element based on the array's key name.  The XML
might look like this:


  Value 1
  Value 2


So I'd be doing this with DOMXML in a loop:

$thisChild = $doc->create_element($key);
$thisChild = $ancestor->append_child($thisChild);

Where $key is 'record' in this example, and $ancestor is 'rootElement',
which is carried along in the function.

The problem that when I reach the second element by the same name, and in
the same node level, I'm overwriting the $thisChild object that I just
created.  How can I dynamically name these objects so that I can have an
indeterminate number of elements by the same name, in the same level?

Source:
http://www.healthtvchannel.org/test/php2xml.phps

Thanks,
--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__ Information from NOD32 1.452 (20030703) __

This message was checked by NOD32 for Exchange e-mail monitor.
http://www.nod32.com




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



[PHP] [ML] Are there any announcement rules for this list? (was Re: [PHP] Re: NEW SPAMMER ...)

2003-07-08 Thread Joel Rees
> I've just read the other thread about spammers and such.
> Indeed, my announcement - even for a free platform - was not complying
> to the posting guidelines as it not a response to any questions asked.
> 
> I apologize.

Where? The only guidelines that I can find for posting to this list are
at 

http://www.php.net/mailing-lists.php

I see nothing there at all concerning announcements.

I personally appreciate brief announcements of related products,
regardless of licensing. A tag, [ANNOUNCEMENT] or [ANN], in the subject
line would be helpful, but that's the only comment I have on the subject.

If the list maintainers do have rules or guidelines about announcements,
maybe one of them would speak up now?

-- 
Joel Rees, programmer, Kansai Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp


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



[PHP] Re: seeing strange things?

2003-07-08 Thread Micah Montoy
OK.  I think Imp the strange thing seeing things are and I don't think they
are.  Anyway, disregard the last part about the Array.  I had an echo
statement that I was using for testing buried in the code.




"Micah Montoy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> A couple more things and I'll stop bugging everyone.  I'm trying to get
the
> file name of the string.  If it includes the extension that's fine as
well.
> I thought the code below would do this but its not.
>
>  $filevalue = str_replace("", "/", $filevalue);
>
>  //get specific file name
>  $parts = explode("/",$filevalue);
>  $file_name = $parts[count($parts)];  //line 42
>
> Its giving me error:
> Notice: Undefined offset: 6 in
> c:\inetpub\wwwroot\webpage10\example\u_images\act_load_imgs.php on line 42
>
> One other thing, after the results, I get on my output screen at the top
the
> word "Array", yet I don't have this anywhere in my output.  Even after I
> remove the above code to get rid of the error message, I get this.  Anyone
> have any ideas of how I can get rid of this?
>
> thanks
>
>



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



[PHP] seeing strange things?

2003-07-08 Thread Micah Montoy
A couple more things and I'll stop bugging everyone.  I'm trying to get the
file name of the string.  If it includes the extension that's fine as well.
I thought the code below would do this but its not.

 $filevalue = str_replace("", "/", $filevalue);

 //get specific file name
 $parts = explode("/",$filevalue);
 $file_name = $parts[count($parts)];  //line 42

Its giving me error:
Notice: Undefined offset: 6 in
c:\inetpub\wwwroot\webpage10\example\u_images\act_load_imgs.php on line 42

One other thing, after the results, I get on my output screen at the top the
word "Array", yet I don't have this anywhere in my output.  Even after I
remove the above code to get rid of the error message, I get this.  Anyone
have any ideas of how I can get rid of this?

thanks



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



[PHP] Object assignment

2003-07-08 Thread Matt Grimm
I'm having trouble creating objects with DOMXML.  As I loop through a level
of nodes, I'm creating a new element based on the array's key name.  The XML
might look like this:


  Value 1
  Value 2


So I'd be doing this with DOMXML in a loop:

$thisChild = $doc->create_element($key);
$thisChild = $ancestor->append_child($thisChild);

Where $key is 'record' in this example, and $ancestor is 'rootElement',
which is carried along in the function.

The problem that when I reach the second element by the same name, and in
the same node level, I'm overwriting the $thisChild object that I just
created.  How can I dynamically name these objects so that I can have an
indeterminate number of elements by the same name, in the same level?

Source:
http://www.healthtvchannel.org/test/php2xml.phps

Thanks,
--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org



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



Re: [PHP] preg_replace - understanding

2003-07-08 Thread Micah Montoya
Never mind.  Its working.

thanks

- Original Message - 
From: "Jennifer Goodie" <[EMAIL PROTECTED]>
To: "Micah Montoy" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, July 08, 2003 5:43 PM
Subject: RE: [PHP] preg_replace - understanding


> > $filevalue = str_replace("\\", "/", $filevalue);
> >
> > it is reversing the "\\" to "//" but not replacing them with just a
single
> > "/".
>
> I think you need to escape your \ so each \ is \\ so your string should be
> ""
>
>
>



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



Re: [PHP] preg_replace - understanding

2003-07-08 Thread Micah Montoya
You where right.  That's what it was doing but now its not reversing the
direction.  It at least is a single "\".  Have an idea for reversing it.  I
played with it a bit but still no go on this.

thanks


- Original Message - 
From: "Jennifer Goodie" <[EMAIL PROTECTED]>
To: "Micah Montoy" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, July 08, 2003 5:43 PM
Subject: RE: [PHP] preg_replace - understanding


> > $filevalue = str_replace("\\", "/", $filevalue);
> >
> > it is reversing the "\\" to "//" but not replacing them with just a
single
> > "/".
>
> I think you need to escape your \ so each \ is \\ so your string should be
> ""
>
>
>



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



RE: [PHP] preg_replace - understanding

2003-07-08 Thread Jennifer Goodie
> $filevalue = str_replace("\\", "/", $filevalue);
>
> it is reversing the "\\" to "//" but not replacing them with just a single
> "/".

I think you need to escape your \ so each \ is \\ so your string should be
""



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



Re: [PHP] preg_replace - understanding

2003-07-08 Thread Micah Montoy
I took a look at the str_replace function and it will work but I am getting
a weird thing happening now.  When I do:

$filevalue = str_replace("\\", "/", $filevalue);

it is reversing the "\\" to "//" but not replacing them with just a single
"/".

What may be causing this?

thanks


"Kevin Stone" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> - Original Message -
> From: "Micah Montoy" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 08, 2003 4:01 PM
> Subject: [PHP] preg_replace - understanding
>
>
> > I'm trying to understand how the code works within the preg_replace
> function
> > but the manual is just obscure as the examples are.  Anyway, I am
looking
> to
> > use it to replace "\\" in a string with "/" and I can not figure how
how.
> > At first, I thought I could just do:
> >
> > $filevalue = preg_replace("'\\', /", $filevalue);
> >
> > but it doesn't do anything.  If someone could relate what it is and what
> the
> > parts mean between the (), I would appreciate it.
> >
> > thanks
>
> You're not using the function correctly.  You've got the search string and
> replace string tied up into one input there.  They need to be separate.
>
> $filevalue = preg_replace('\\', '/', $filevalue);
> http://www.php.net/manual/en/function.preg-replace.php
>
> However you should consider using the str_replace() function in your case
> since you aren't doing any pattern matching and it's a lot faster than
> preg_replace().
>
> $filevalue = str_replace('\\'. '/', $filevalue);
> http://www.php.net/manual/en/function.str-replace.php
>
> --
> Kevin
>
>



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



Fw: [PHP] preg_replace - understanding

2003-07-08 Thread Kevin Stone

- Original Message -
From: "Micah Montoy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 08, 2003 4:01 PM
Subject: [PHP] preg_replace - understanding


> I'm trying to understand how the code works within the preg_replace
function
> but the manual is just obscure as the examples are.  Anyway, I am looking
to
> use it to replace "\\" in a string with "/" and I can not figure how how.
> At first, I thought I could just do:
>
> $filevalue = preg_replace("'\\', /", $filevalue);
>
> but it doesn't do anything.  If someone could relate what it is and what
the
> parts mean between the (), I would appreciate it.
>
> thanks

You're not using the function correctly.  You've got the search string and
replace string tied up into one input there.  They need to be separate.

$filevalue = preg_replace('\\', '/', $filevalue);
http://www.php.net/manual/en/function.preg-replace.php

However you should consider using the str_replace() function in your case
since you aren't doing any pattern matching and it's a lot faster than
preg_replace().

$filevalue = str_replace('\\'. '/', $filevalue);
http://www.php.net/manual/en/function.str-replace.php

--
Kevin



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



RE: [PHP] XML

2003-07-08 Thread Ray Hunter
I see that not many sites require the use of xml/xsl(t). Many sites can
just use html and database to accomplish 99.9% of the work.

I always suggest that when you have tons of data that you need to send
to the user that it is a good idea. Especially now that xslt is growing
up :)

I like to use xml and xsl for various reasons, mainly i can really
separate the logic and presentation. All data is keep in the xml file
and presentation in the xsl file. So when i need to make changes in the
presentation then i only change the xsl file and never really have to
touch the logic (php) code. This is really, really great for some sights
that are extremely complex.

Also in php i can create standards that my xml files will follow (dtds,
schema) and allowing me to create modules (functionality) very
efficiently and timely.

Also as mentioned xml provides a format for transfering data. However, i
would not use it with databases unless it is large amounts of data.
However, i have used xml for creating sql queries and setting up
configureation files which are extremely reliabe.

--
BigDog



On Tue, 2003-07-08 at 15:51, Jeff Harris wrote:
> |-Original Message-
> |From: Petre Agenbag [mailto:[EMAIL PROTECTED]
> |Sent: Tuesday, July 08, 2003 6:27 AM
> |To: [EMAIL PROTECTED]
> |Subject: [PHP] XML
> |
> |
> |Hi List
> |
> |Firstly, this question is arguable more about XML than PHP, but they are
> |interlinked, so I hope it is "topical" for this list.
> |
> |Firstly, Where I come from:
> |
> |I am VERY comfortable with PHP/MySQL on Linux and understand all those
> |concepts.
> |
> |Now I'm trying to see the benefits of XML, and quite frankly, I just
> |cannot see why one would want to use it...
> |
> [snip]
> 
> On Jul 8, 2003, "Joe Harman" claimed that:
> 
> |Okay Petre... You have asked the question that I always wanted to ask!!!
> |I can't wait to see peoples answer... I simply can't find a use for it
> |either
> |
> |Joe
> 
> This probably should be on another list, but it might give someone an idea
> on how to create something in PHP. I've been trying to figure out if some
> of what I'm doing would be good for XML. The answer for that is "no, use a
> database."
> 
> It seems to me, that XML is a way of encoding data for the transmission
> between two processors. For example, the database uses XML to transfer
> data to the PHP engine. The weather magnet uses XML to transmit
> information to your PHP script, which parses it and produces the HTML
> output. My page asks your script for some information, and it's returned
> as well-formed XML.
> 
> As far as using an XML file to act as a database and your parser to create
> the HTML, it's probably better to use a database.
> 
> Jeff
> (my $.015 [after taxes] )
> -- 
> Registered Linux user #304026.
> "lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
> Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
> Responses to this message should conform to RFC 1855.
> 
> 


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



RE: [PHP] Alex,Joe - >Re: [PHP] New Krysalis version released

2003-07-08 Thread Joe Harman
Yeah Ryan... I actually agree with the passive spamming issue...
Actually spamming in general... And don't take any offense to my
comments... LOL... Cause they totally weren't ment that way... Have a
great one!

Respectfully,
Joe

-Original Message-
From: Ryan A [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2003 6:19 PM
To: Alexandru COSTIN
Cc: Joe Harman; [EMAIL PROTECTED]
Subject: [PHP] Alex,Joe - >Re: [PHP] New Krysalis version released


Hi,
I never said that it isnt a good product, heck it sounds like its a
great product... I myself am a newbie here (a few months) pretty new to
php compared to a lot of guys here but have created some commercial
scripts...imagine the old fossils :-) here who have created loads of
good scripts? I just think that if someone asks for something _then_
recomend your product in your reply. In this case if someone said "hey,
am new to xml/xsl in php can anybody help" then someone could have said
"read blah and blah and heres a great product from Alenandru at
 check it out..." or something to that effect It just seems to
be a pain in the  when everytime someone has written something we
get an announcement, everyone has ideas and there is a hell of a lot of
good stuff out there...but...

When i start looking into XML/XSL I will give that a look see and
probably ask this list for advise but till then I think this is kind of
"passive spamming" or atleast an overload of (as of now) unwanted info,
I am sure it will be useful and of great value if its free or not but
till someone asks for the info

-Ryan


- Original Message -
From: "Alexandru COSTIN" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, July 08, 2003 9:22 PM
Subject: [PHP] New Krysalis version released


> Hello,
> For the ones interested in XML/XSL publishing with PHP, we've just

> released the Krysalis 2.4.1 version.
>
> Includes a lot of features, fixes and performance improvements.
> Check http://www.interakt.ro/index_news_162.html for more details.
>
> Our XML-schema support is being worked right now for inclusion in
PEAR -
> contact us if you want to contribute - we still need some 
> PEARyfication help.
>
> Alexandru
>
> --
> Alexandru COSTIN
> Chief Operating Officer
> http://www.interakt.ro/
> +4021 312 5312
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




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



[PHP] Alex,Joe - >Re: [PHP] New Krysalis version released

2003-07-08 Thread Ryan A
Hi,
I never said that it isnt a good product, heck it sounds like its a great
product...
I myself am a newbie here (a few months) pretty new to php compared to a lot
of guys here but have created some commercial scripts...imagine the old
fossils :-) here who have created loads of good scripts?
I just think that if someone asks for something _then_ recomend your product
in your reply.
In this case if someone said "hey, am new to xml/xsl in php can anybody
help" then someone could have said "read blah and blah and heres a great
product from Alenandru at  check it out..." or something to that
effect
It just seems to be a pain in the  when everytime someone has written
something we get an announcement, everyone has ideas and there is a hell of
a lot of good stuff out there...but...

When i start looking into XML/XSL I will give that a look see and probably
ask this list for advise but till then I think this is kind of "passive
spamming" or atleast an overload of (as of now) unwanted info, I am sure it
will be useful and of great value if its free or not but till someone asks
for the info

-Ryan


- Original Message -
From: "Alexandru COSTIN" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, July 08, 2003 9:22 PM
Subject: [PHP] New Krysalis version released


> Hello,
> For the ones interested in XML/XSL publishing with PHP, we've just
> released the Krysalis 2.4.1 version.
>
> Includes a lot of features, fixes and performance improvements.
> Check http://www.interakt.ro/index_news_162.html for more details.
>
> Our XML-schema support is being worked right now for inclusion in
PEAR -
> contact us if you want to contribute - we still need some PEARyfication
> help.
>
> Alexandru
>
> --
> Alexandru COSTIN
> Chief Operating Officer
> http://www.interakt.ro/
> +4021 312 5312
>
>
>
> --
> 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] Stumper: Get Variable Name

2003-07-08 Thread Mike Migurski
>I want to be able to e-mail myself the name of the variable that bombed
>out and the line that it was on (as well as the filename) if possible.
>Don't really know where to start... looks like this:

You can use PHP's predefined constants in an assertion, and
debug_backtrace().

http://www.php.net/manual/en/language.constants.predefined.php
http://www.php.net/debug_backtrace

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html


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



[PHP] preg_replace - understanding

2003-07-08 Thread Micah Montoy
I'm trying to understand how the code works within the preg_replace function
but the manual is just obscure as the examples are.  Anyway, I am looking to
use it to replace "\\" in a string with "/" and I can not figure how how.
At first, I thought I could just do:

$filevalue = preg_replace("'\\', /", $filevalue);

but it doesn't do anything.  If someone could relate what it is and what the
parts mean between the (), I would appreciate it.

thanks



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



[PHP] exec for EXE with arguments

2003-07-08 Thread Juerg Zgraggen
hi

i'd like to call an exe with several parameters like this:
the parameter -name= must have quotes from beginning til end because of the
Spaces between.
   C:/Programme/Apache
Group/Apache2/htdocs/myexe.exe -action=add -name="My Own Task"

so i tried this in PHP... but it dows not work! It only works when i take
out the \"... however i can't do this because my exe neeads the parameter
like this:

//  CODE --
$execString = "\"C:/Programme/Apache Group/Apache2/htdocs/myexe.exe\""
// i have to use \" because of the spaces
." -action=add"
." -name=\"My Own Task\""; // i have to use \"
because of the spaces
exec(escapeshellarg($execString), $arrRes, $iret);
print_r($arrRes);
//  CODE --
$arrRes is empty although the exe ALWAYS gives a return value

on www.php.net i found the functions escapeshellarg and escapeshellcmd.
could these functions be the solution i'm looking for? i really don't know
how to use them for my case.

can anybody give me a hint please...
Regards,
Juerg







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



[PHP] Stumper: Get Variable Name

2003-07-08 Thread Michael Smith
Alright, I've got an error reporting class with a report() method.

I want to be able to e-mail myself the name of the variable that bombed 
out and the line that it was on (as well as the filename) if possible. 
Don't really know where to start... looks like this:

function report ($error_var) {

   include ("variables/global.var.php");
   require ("admin/classes/class.phpmailer.php");
   require ("admin/classes/class.smtp.php");
  
   $mail = new PHPMailer();
   //set the variables we need
   $mail->From = $smtp['from'];
   $mail->Subject = "Reporting A PrattCMS Error";
   $mail->FromName = $smtp['fromname'];
   $mail->Host = $smtp['host'];
   $mail->Mailer = "smtp";
   $mail->SMTPAuth = $smtp['auth'];
   $mail->Username = $smtp['user'];
   $mail->Password = $smtp['pass'];
   $mail->Helo = $smtp['helo'];
   $body = "We regret to inform you that ";
}

and I want to be able to tell myself what the variable's name was, the 
line it errored out on, etc.

Thanks!

-Michael

--
Michael Smith
IT Intern
[EMAIL PROTECTED]
If computers get too powerful, we can organize 
them into a committee -- that will do them in. 
  -Bradley's Bromide



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


RE: [PHP] XML

2003-07-08 Thread Jeff Harris
|-Original Message-
|From: Petre Agenbag [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, July 08, 2003 6:27 AM
|To: [EMAIL PROTECTED]
|Subject: [PHP] XML
|
|
|Hi List
|
|Firstly, this question is arguable more about XML than PHP, but they are
|interlinked, so I hope it is "topical" for this list.
|
|Firstly, Where I come from:
|
|I am VERY comfortable with PHP/MySQL on Linux and understand all those
|concepts.
|
|Now I'm trying to see the benefits of XML, and quite frankly, I just
|cannot see why one would want to use it...
|
[snip]

On Jul 8, 2003, "Joe Harman" claimed that:

|Okay Petre... You have asked the question that I always wanted to ask!!!
|I can't wait to see peoples answer... I simply can't find a use for it
|either
|
|Joe

This probably should be on another list, but it might give someone an idea
on how to create something in PHP. I've been trying to figure out if some
of what I'm doing would be good for XML. The answer for that is "no, use a
database."

It seems to me, that XML is a way of encoding data for the transmission
between two processors. For example, the database uses XML to transfer
data to the PHP engine. The weather magnet uses XML to transmit
information to your PHP script, which parses it and produces the HTML
output. My page asks your script for some information, and it's returned
as well-formed XML.

As far as using an XML file to act as a database and your parser to create
the HTML, it's probably better to use a database.

Jeff
(my $.015 [after taxes] )
-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



RE: [PHP] Compiling PHP

2003-07-08 Thread Ralph Guzman
The error you are providing here is because you do not have the required
libraries installed. Some of these modules require that the programs or
libraries be installed, php does not install them for you.

This is an extensive config. Are you sure you need all these. I see that
you are trying to enable pgsql, mySQL, interbase. Will you be running
all these databases on you server? 

I've looked through your config, and below are some notes I made.

Hope this helps.


..


>> --prefix=/usr 
is there a reason why you must install php to /usr. The default
directory is /usr/local/lib?

>> --with-apxs=/usr/sbin/apxs 
is your apache compiled with mod_so for apxs support?
http://httpd.apache.org/docs/programs/apxs.html

>> --enable-safe-mode 
this may restrict some php functions

>> --with-exec-dir=/usr/bin 
this will allow executables in your /usr/bin directory. This might be a
security risk. Why not let it default to /usr/local/php/bin? 

>> --with-zlib 
I think this should be --with-zlib-dir=
http://www.php.net/zlib

>> --with-regex=system 
PHP supports regular expressions by default. Why don't you use
--with-regex=php 
http://www.php.net/regex

>> --with-ttf 
do you have the FreeType libraries installed?
http://www.php.net/image

>> --with-db 
does your server support this type of database?
http://www.php.net/manual/en/ref.dbm.php

>> --with-gdbm 
does your server support this type of database?

>> --with-mbstring 
do you need multi-byte character support?
http://www.php.net/mbstring

>> --with-mbstr-enc-trans
not sure what this does.

>> --with-libdir  
not sure what this does.

>> --with-interbase=shared 
are you running Interbase on your server?
http://www.php.net/manual/en/ref.ibase.php

>> --with-pgsql=shared 
are you running PostgreSQL on your server?
http://www.php.net/manual/en/ref.pgsql.php

>> --with-ldap 
do you have LDAP libraries installed?
http://www.php.net/manual/en/ref.ldap.php

>> --with-imap-ssl
I think this should be --with-imap-ssl=[DIR]
 http://www.php.net/imap

>> --with-mysql 
are you running MySQL on your server?
http://www.php.net/manual/en/ref.mysql.php

--with-gd
Do you have the GD library installed?
http://www.php.net/manual/en/ref.image.php

--with-png 
Do you have PNG library installed?
http://www.php.net/manual/en/ref.image.php



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




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



Re: [PHP] Re: NEW SPAMMER -> [PHP] New Krysalis version released

2003-07-08 Thread Jeff Harris
On Jul 8, 2003, "Alexandru COSTIN" claimed that:

|Hi,
|I've just read the other thread about spammers and such.
|Indeed, my announcement - even for a free platform - was not complying
|to the posting guidelines as it not a response to any questions asked.
|
|I apologize.
|
|Alexandru
|

I've just started poking around with XML. Does anyone know anything that I
might use to learn more about it? Optimally, it would be available in the
pear repository, and have plenty of documentation.

Jeff

-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



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



Re: [PHP] Removing Arrays With Certain Keys From Larger Array

2003-07-08 Thread Steve Keller
At 7/8/2003 02:18 PM, jwulff wrote:

> I have an array exampled below.  I want to remove and use certain nested
> arrays from the larger array where the key == title, size, day, etc...  How
> does an idiot like myself accomplish this?
You can reference it the same as you reference any other array. For 
example, you used "print_r" to display the sample array, to print a sub 
array you do the same thing:

print_r($myArray[0]);

That'll print the array under the "0" key.

If you wanted element 1 of the array under key 0, then you'd do something like

$myValue = $myArray[0][1];

Hope this helps.

--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Defending -> [PHP] New Krysalis version released

2003-07-08 Thread Alexandru COSTIN
Hey - thanks,
I will have a better sleep now knowing that we have made some of our
clients happy :) - and that they appreciate this.

Alexandru

"Joe Harman" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey, I have used this companies free software... And actually bought
> some... They were extremely helpful when Macromedia lacked PHP support
> in UltraDev... They probably have more free stuff that costly things...
> Personally, by using their free stuff, I ended up learning a lot... And
> the should be valuable to this community... Especially the newbees
> here
>
> On the other side... I can understand why you are against the spam...
>
> You probalby will be surprised if you take a look at the quality of
> their products...
>
> joe
>
> -Original Message-
> From: Alexandru COSTIN [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 08, 2003 4:47 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: NEW SPAMMER -> [PHP] New Krysalis version released
>
>
> Krysalis is a free platform licesed as LGPL.
> It has some (periferic) commercial modules but 95% of the platform
> is free and open.
>
> What should I do to announce a new release of a free platform on a
> php newsgroup without offending anyone?
>
> Alexandru
>
> --
> Alexandru COSTIN
> Chief Operating Officer
> http://www.interakt.ro/
> +4021 312 5312
> "Ryan A" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Didnt we just have a thread about spamming like this on the list?
> >
> >
> >
> > - Original Message -
> > From: "Alexandru COSTIN" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
> > <[EMAIL PROTECTED]>
> > Sent: Tuesday, July 08, 2003 9:22 PM
> > Subject: [PHP] New Krysalis version released
> >
> >
> > > Hello,
> > > For the ones interested in XML/XSL publishing with PHP, we've
> > > just released the Krysalis 2.4.1 version.
> > >
> > > Includes a lot of features, fixes and performance improvements.
> > > Check http://www.interakt.ro/index_news_162.html for more
> > > details.
> > >
> > > Our XML-schema support is being worked right now for inclusion
> > > in
> > PEAR -
> > > contact us if you want to contribute - we still need some
> > > PEARyfication help.
> > >
> > > Alexandru
> > >
> > > --
> > > Alexandru COSTIN
> > > Chief Operating Officer
> > > http://www.interakt.ro/
> > > +4021 312 5312
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



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



RE: [PHP] Re: Defending -> [PHP] New Krysalis version released

2003-07-08 Thread Joe Harman
Hey, I have used this companies free software... And actually bought
some... They were extremely helpful when Macromedia lacked PHP support
in UltraDev... They probably have more free stuff that costly things...
Personally, by using their free stuff, I ended up learning a lot... And
the should be valuable to this community... Especially the newbees
here

On the other side... I can understand why you are against the spam... 

You probalby will be surprised if you take a look at the quality of
their products... 

joe

-Original Message-
From: Alexandru COSTIN [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2003 4:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: NEW SPAMMER -> [PHP] New Krysalis version released


Krysalis is a free platform licesed as LGPL.
It has some (periferic) commercial modules but 95% of the platform
is free and open.

What should I do to announce a new release of a free platform on a
php newsgroup without offending anyone?

Alexandru

-- 
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 312 5312
"Ryan A" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Didnt we just have a thread about spamming like this on the list?
>
>
>
> - Original Message -
> From: "Alexandru COSTIN" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; 
> <[EMAIL PROTECTED]>
> Sent: Tuesday, July 08, 2003 9:22 PM
> Subject: [PHP] New Krysalis version released
>
>
> > Hello,
> > For the ones interested in XML/XSL publishing with PHP, we've 
> > just released the Krysalis 2.4.1 version.
> >
> > Includes a lot of features, fixes and performance improvements.
> > Check http://www.interakt.ro/index_news_162.html for more 
> > details.
> >
> > Our XML-schema support is being worked right now for inclusion 
> > in
> PEAR -
> > contact us if you want to contribute - we still need some 
> > PEARyfication help.
> >
> > Alexandru
> >
> > --
> > Alexandru COSTIN
> > Chief Operating Officer
> > http://www.interakt.ro/
> > +4021 312 5312
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>



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




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



[PHP] Removing Arrays With Certain Keys From Larger Array

2003-07-08 Thread jwulff
I have an array exampled below.  I want to remove and use certain nested
arrays from the larger array where the key == title, size, day, etc...  How
does an idiot like myself accomplish this?

Array
(
[0] => Array
(
[0] => title
[1] => by Month for Melvin
)

[1] => Array
(
[0] => Jan-99
[1] => 5286.69
[2] => 4687.89
[3] => 88.71
[4] => 98.05
[5] => 9.04
)
)



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



RE: [PHP] date frustrations

2003-07-08 Thread Joe Harman
There is probably a better way than this... But I always use EPOCH when
I need to put something in order... You can then just write a function
to interperate the date when it need to be readable Hope that makes
sense

joe

-Original Message-
From: Shena Delian O'Brien [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2003 1:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] date frustrations


Ok so on a web application I needed to list the files in a directory, 
ordered by last modified date.

I was pulling them out in an array, fetching the filemtime() for each 
file, and trying to order them by that date. I was using asort() to sort

the files in an array so they'd list chronologically.

Well that wasn't working as planned. Files were getting out of order. I 
figured asort() could have been having trouble ordering dates 
numerically, so I tried strtotime() on the dates first, and ordered the 
files by unix timestamp.

That didn't work either. I did a date() on the unix timestamp fetched by

strtotime() and found that the dates were coming out inaccurately. 2003 
was being changed to 2013, etc.

Well I gradually figured out that the date format output by filemtime() 
was not an acceptable natural language date format. filemtime() was 
fetching dates with a dash - ex. 07-08-2003. strtotime() was making 
incorrect timestamps because it doesn't read dates with dashes formatted

that way. Apparently asort() reads dates the same way strtotime does.

I think this is kind of perverse... in order to fix it I had to do an 
ereg_replace("-","/",$date) in order to change the filemtime() date 
format to one properly readable by strtotime and asort.

*sigh*

Am I the only one who has noticed this? Is this something that can be 
corrected in PHP? (Perhaps the dates fetched by filemtime() etc can be 
changes to be formatted in a way that is acceptable to other date() 
functions??)


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

2003-07-08 Thread Joe Harman
Okay Petre... You have asked the question that I always wanted to ask!!!
I can't wait to see peoples answer... I simply can't find a use for it
either

Joe

-Original Message-
From: Petre Agenbag [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2003 6:27 AM
To: [EMAIL PROTECTED]
Subject: [PHP] XML


Hi List

Firstly, this question is arguable more about XML than PHP, but they are
interlinked, so I hope it is "topical" for this list.

Firstly, Where I come from:

I am VERY comfortable with PHP/MySQL on Linux and understand all those
concepts.

Now I'm trying to see the benefits of XML, and quite frankly, I just
cannot see why one would want to use it...

Anyway, I don't want to start a discussion on that from.

I have done extensive reading on XML/XSL(XSLT : XHTML), DTD and XML
parsing on browser and server side.

I arguable still don't have a 100% understanding of exactly how things
fit together, but the little bit I think I got so far is:

I would use an XML doc to package my data in a structure.
This XML file is "useless" on it's own, and good for transporting data
to another app or client. Should I need to do something with the data, I
would look at XSL and in particular XSLT in order to convert the XML
into XHTML so a browser can display the data ( so we can safely assume
that I am only interested in the web applications of XML)

This is where I'm starting to get a headache, because now it seems that
there are browser issues wrt XSL, and one also have the added choice of
parsing the XML with the browser or on server level.

For me, parsing it on browser level must be a no-no, as I would assume
that it's would take alot of effort to find out what type of browser the
client has, then load the appropriate XSL file for that browser.

So, I'm here, with the server side XML parsing in mind.

Now on M$ systems, it seems that IIS has built in ActiveX XMLDOM parsing
built in, and you can "easily" parse the XML document by using ASP etc.

So can I assume that this is also true with PHP/Apache, ie, Apache has a
built in XML parser and I can use PHP fnuctions to parse my XML file on
the server side and thus "pump" out XHTML that is compatible with all
past and future browsers?

Also, what is the procedure that most of you (members of the PHP lists)
follow when dealing with XML. ie, do you go for the client side parsing
or do you do server side parsing. And how do you decide when to use XML
and when to stick to trusty old PHP/MySQL? ( Sorry,  know this is
probably the dumbest question I can ask, but I really battle to see when
to use it, or rather WHY I should use it seeing that the data is
arguably "static" in nature ( I would either get the XML file from
somewhere else, or I would generate it from some source and pass it on,
effectively creating a little data island/snapshot of the actual data at
a point in time?)

Thanks for any input.





-- 
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] __get, __set, __clone

2003-07-08 Thread Yann Larrivee
Hi, in the past 2 days i have been looking into php5 and it's new
features.

I am not a psecialiste of OOP (only been OOPing for 2 month)

For a moment i tought that __set would allow me not to have to define a
methode __set that would set a value to a member variable.

It seems like we have to define the class __set and __get.

for example i tought i would be able to do.

class a{
function __construct(){
$this->__set("var_name1","value1");
$this->__set("var_name2","value2");
}
}

I read these 2 tutorial
http://www.phpbuilder.com/columns/argerich20030411.php3?page=5 (the
explanation seems really bad to me and does not show any usefull way to
use these functions)

http://talks.php.net/show/php5intro/25
This one well i comes back to the same thing as if i code it my self.

So my big question is why , when , how do we use these features
(__get,__set) 
For a moment i tought i would save me time, but if i have to redefine
them what is the point ?

I guess i am somewhat confuse on this issue, any explanation would be
appreciated. 

Thanks


-- 
Yann Larrivee <[EMAIL PROTECTED]>


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



Re: [PHP] Refresh PHP

2003-07-08 Thread Mauricio
Doing this, it works. The variable 'url_variable' is changed when it pass
over the if. But I don't want to use a get variable, it could be easily
changed by the users... its my problem...

Maurício Valente

- Original Message -
From: "Ralph Guzman" <[EMAIL PROTECTED]>
To: "'Mauricio'" <[EMAIL PROTECTED]>; "'PHP'" <[EMAIL PROTECTED]>
Sent: Tuesday, July 08, 2003 4:05 PM
Subject: RE: [PHP] Refresh PHP


> How about:
>
> if($_GET['url_variable'] != $url_variable){
>$url_variable = $_GET['url_variable'];
>session_register('url_variable')
> }
>
>
> -Original Message-
> From: Mauricio [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 08, 2003 11:14 AM
> To: PHP
> Subject: Re: [PHP] Refresh PHP
>
> Hello Ralph,
>
> Actually, after calling session_destroy() I reset those variables
> assigning
> an empty value like you said. But it still doesn't work. I did a test
> after
> destroying session variables, printing them. They are empty.
>
> Another weird thing is that when a login as "joao" them logoff,  exclude
> IE
> cache, going in Tools >> Internet Option..., and login again with
> another
> user, this way the variable are printed correctly.
>
> It happens in any windows version (95,98,ME,2K,XP) using IE 6.0 and
> Netscape
> 7.
>
>
>
> - Original Message -
> From: "Ralph Guzman" <[EMAIL PROTECTED]>
> To: "'Mauricio'" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 08, 2003 2:11 PM
> Subject: RE: [PHP] Refresh PHP
>
>
> > Rather than using session_destroy() reset the session variable by
> > assigning it an empty value. For example, lets say your url looks
> > something like this:
> >
> > http://www.mydomain.com/?url_variable=Mauricio
> >
> > then do the following:
> >
> > if($_GET['url_variable'] != $url_variable){
> >$url_variable = "";
> >session_register('url_variable')
> > }
> >
> >
> > -Original Message-
> > From: Mauricio [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, July 08, 2003 7:02 AM
> > To: PHP
> > Subject: [PHP] Refresh PHP
> >
> > Hi people!
> >
> > Did anyone get this situation?
> >
> > I'm creating a Site that uses 3 session variables. One of them I
> always
> > print at the top of the page, it's the name of the user. There is a
> link
> > that calls the function session_destroy(). Everytime that I follow
> this
> > link
> > and log in with another user, that session variable printed doesn't
> > change,
> > but if I press F5 in IE or Netscape them it brings the right user. I
> > can't
> > make the page return the current user login, it always came with the
> > last
> > user logged. I tried to add some headers to set no cache in all php
> > pages,
> > but it doesn't work.
> >
> > Anyone can help me???
> >
> > Thanks
> >
> > PS: Sorry about my poor english...
> >
> >
> > Maurício Valente
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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



Re: [PHP] Retaining formatting problem[Scanned]

2003-07-08 Thread Mike Migurski
> cannot have multiple lines, use this
>
>little amount of
>
>text

This is true.

Also, watch the line endings coming aout of that textarea - you may want
to normalize them. I prefer unix linebreaks, so I use this to convert mac
and DOS endings:

str_replace(array("\r\n", "\r"), "\n", $textarea_value)

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html


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



[PHP] Re: NEW SPAMMER -> [PHP] New Krysalis version released

2003-07-08 Thread Alexandru COSTIN
Hi,
I've just read the other thread about spammers and such.
Indeed, my announcement - even for a free platform - was not complying
to the posting guidelines as it not a response to any questions asked.

I apologize.

Alexandru


-- 
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 312 5312
"Ryan A" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Didnt we just have a thread about spamming like this on the list?
>
>
>
> - Original Message -
> From: "Alexandru COSTIN" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Tuesday, July 08, 2003 9:22 PM
> Subject: [PHP] New Krysalis version released
>
>
> > Hello,
> > For the ones interested in XML/XSL publishing with PHP, we've just
> > released the Krysalis 2.4.1 version.
> >
> > Includes a lot of features, fixes and performance improvements.
> > Check http://www.interakt.ro/index_news_162.html for more details.
> >
> > Our XML-schema support is being worked right now for inclusion in
> PEAR -
> > contact us if you want to contribute - we still need some PEARyfication
> > help.
> >
> > Alexandru
> >
> > --
> > Alexandru COSTIN
> > Chief Operating Officer
> > http://www.interakt.ro/
> > +4021 312 5312
> >
> >
> >
> > --
> > 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] detaching

2003-07-08 Thread Uros Gruber
Hello!

first my code

#!/usr/local/bin/php -q



I read that posix_setsid return pid on succesfull detaching. But i get
-1. I read man for setsid and this -1 mean error.

What i want is that if i run this  script with automatic detaching.
But it does nothing than waiting this for to finish.

What am I doing wrong.
  

-- 
lp,
 Uros  mailto:[EMAIL PROTECTED]


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



[PHP] Re: NEW SPAMMER -> [PHP] New Krysalis version released

2003-07-08 Thread Alexandru COSTIN
Krysalis is a free platform licesed as LGPL.
It has some (periferic) commercial modules but 95% of the platform is
free and open.

What should I do to announce a new release of a free platform on a php
newsgroup without offending anyone?

Alexandru

-- 
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 312 5312
"Ryan A" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Didnt we just have a thread about spamming like this on the list?
>
>
>
> - Original Message -
> From: "Alexandru COSTIN" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Tuesday, July 08, 2003 9:22 PM
> Subject: [PHP] New Krysalis version released
>
>
> > Hello,
> > For the ones interested in XML/XSL publishing with PHP, we've just
> > released the Krysalis 2.4.1 version.
> >
> > Includes a lot of features, fixes and performance improvements.
> > Check http://www.interakt.ro/index_news_162.html for more details.
> >
> > Our XML-schema support is being worked right now for inclusion in
> PEAR -
> > contact us if you want to contribute - we still need some PEARyfication
> > help.
> >
> > Alexandru
> >
> > --
> > Alexandru COSTIN
> > Chief Operating Officer
> > http://www.interakt.ro/
> > +4021 312 5312
> >
> >
> >
> > --
> > 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] NEW SPAMMER -> [PHP] New Krysalis version released

2003-07-08 Thread Ryan A
Didnt we just have a thread about spamming like this on the list?



- Original Message -
From: "Alexandru COSTIN" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, July 08, 2003 9:22 PM
Subject: [PHP] New Krysalis version released


> Hello,
> For the ones interested in XML/XSL publishing with PHP, we've just
> released the Krysalis 2.4.1 version.
>
> Includes a lot of features, fixes and performance improvements.
> Check http://www.interakt.ro/index_news_162.html for more details.
>
> Our XML-schema support is being worked right now for inclusion in
PEAR -
> contact us if you want to contribute - we still need some PEARyfication
> help.
>
> Alexandru
>
> --
> Alexandru COSTIN
> Chief Operating Officer
> http://www.interakt.ro/
> +4021 312 5312
>
>
>
> --
> 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] odbc_result...

2003-07-08 Thread Scott Fletcher
Hi!

   Is there a way to verify that odbc_resut($result,1) is successfull or
not.  I'm not talking about

--snip--
$result = odbc_exec($connect,$ask);
if ($result) { echo "Successfull!"; } else { echo "Failed!!"; }
--snip--

--snip--
$result = odbc_exec($connect,$ask);
$db_result = odbc_exec($result,1);
if ($db_result) { echo "Successfull!"; } else { echo "Failed!!"; }
--snip--

because it check on database connection, not whether is the SQL
Statement had been successfully execuated or failed.  What I'm looking for
is whether is the SQL Statement, 'INSERT' is successful or fail.  Not the
database connection.

Thanks!



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



[PHP] New Krysalis version released

2003-07-08 Thread Alexandru COSTIN
Hello,
For the ones interested in XML/XSL publishing with PHP, we've just
released the Krysalis 2.4.1 version.

Includes a lot of features, fixes and performance improvements.
Check http://www.interakt.ro/index_news_162.html for more details.

Our XML-schema support is being worked right now for inclusion in PEAR -
contact us if you want to contribute - we still need some PEARyfication
help.

Alexandru

-- 
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 312 5312



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



RE: [PHP] Compiling PHP

2003-07-08 Thread Mike At Spy

Actually, I think I found the issue.  Now I am getting:

configure: error: build test failed.

And I changed my config to be:

./configure --prefix=/usr --with-apxs=/usr/sbin/apxs --with-gd --with-mysql 
--with-png --with-pear --with-gettext=/usr --enable-safe-mode --with-config-
file-path=/etc/httpd --with-exec-dir=/usr/bin --with-zlib --enable-magic-quo
tes --with-regex=system --with-ttf --with-db --with-gdbm --enable-mbstring -
-enable-mbstr-enc-trans --enable-track-vars --enable-wddx=shared --enable-mm
=shared --enable-xml --enable-ftp --disable-debug --with-libdir=/usr/local/l
ib --with-db3 --with-interbase=shared --with-pgsql=shared --with-ldap --with
-imap --with-pdflib=shared --with-kerberos


Anyone have any ideas?  I'm on linux redhat 7.3.

Thanks,

-Mike






> -Original Message-
> From: Mike At Spy [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 08, 2003 3:47 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Compiling PHP
>
>
>
> I am doing a new compile of PHP (4.3.3) - anyone know what this error is?
>
> configure: error: libgds or libib_util not found!
>
> Here is my configuration:
>
> ./configure --prefix=/usr --with-apxs=/usr/sbin/apxs
> --enable-safe-mode --wi
> th-config-file-path=/etc/httpd --with-exec-dir=/usr/bin
> --with-zlib --enable
> -magic-quotes --with-regex=system --with-ttf --with-db
> --with-gdbm --with-mb
> string --with-mbstr-enc-trans --enable-track-vars
> --enable-wddx=shared --ena
> ble-mm=shared --enable-xml --disable-debug --with-libdir
> --with-interbase=s
> hared --with-pgsql=shared --with-ldap --with-imap-ssl
> --with-mysql --disable
> -url-fopen-wrapper --with-gd --with-png --with-pear
>
> Thanks for any help!
>
> -Mike
>
>
>
> --
> 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] Compiling PHP

2003-07-08 Thread Mike At Spy

I am doing a new compile of PHP (4.3.3) - anyone know what this error is?

configure: error: libgds or libib_util not found!

Here is my configuration:

./configure --prefix=/usr --with-apxs=/usr/sbin/apxs --enable-safe-mode --wi
th-config-file-path=/etc/httpd --with-exec-dir=/usr/bin --with-zlib --enable
-magic-quotes --with-regex=system --with-ttf --with-db --with-gdbm --with-mb
string --with-mbstr-enc-trans --enable-track-vars --enable-wddx=shared --ena
ble-mm=shared --enable-xml --disable-debug --with-libdir  --with-interbase=s
hared --with-pgsql=shared --with-ldap --with-imap-ssl --with-mysql --disable
-url-fopen-wrapper --with-gd --with-png --with-pear

Thanks for any help!

-Mike



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



[PHP] Re: Invalid Block Size

2003-07-08 Thread Chris Binns-Smith
Hello:

  I am installing pear(for mssql support) and I am getting
an Invalid block size 283 error. Any Ideas?

Thanks
chris

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



RE: [PHP] another big, juicy, delicious bug

2003-07-08 Thread Kyle Babich
This function is what I used:

function getId ($ip) {
$ipData = file('idData/ips.txt');
$ipData = array_flip($ipData);

$id = $ipData[$ip] + 1;
return $id;
}

It is defined in idData.inc.php which is required in the file with the
problem (controlPanel.php).
I decided to ban a third IP just to see what would happen and when I
banned the third it worked fine, and it fixed the other banned IP.  So,
that just adds to the problem.  Why would it work with 1 and 3 banned IPs
but not 2...  Anyway here is the part of controlPanel.php where the
function is called...





  





Banned Users = 2) { ?> :: Unban All 







Unban IP
Address"; ?>


 

On Tue, 8 Jul 2003 08:00:35 -0500, "Jay Blanchard"
<[EMAIL PROTECTED]> said:
> [snip]
> But then it will go and do something like this:
> Array (
>   [0] => 172.170.69.74
>   [1] => 172.141.183.231 
>   [2] => 172.137.79.102 
>   [3] => 172.151.144.242 
>   [4] => 172.150.212.129 
>   [5] => 172.158.154.92 
> ) // correct array 
> 
> Array ( 
>   [172.170.69.74 ] => 0 
>   [172.141.183.231 ] => 1 
>   [172.137.79.102 ] => 2 
>   [172.151.144.242 ] => 3 
>   [172.150.212.129 ] => 4 
>   [172.158.154.92] => 5 
> ) // correct flipped
> 
> 172.151.144.242 // correct ip
> 
> // complete nothingness where $ipData[$ip] should equal 3
> 
> 1 // wrong $id, should be 4
> [/snip]
> 
> First of all this is probably not a bug.
> 
> Second, where is the code that tests for the condition? Do the other
> IP's in the array output their id properly in this same set? This info
> will help us to solve the problem.
> 
> Jay
> 

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



RE: [PHP] Refresh PHP

2003-07-08 Thread Ralph Guzman
How about:

if($_GET['url_variable'] != $url_variable){
   $url_variable = $_GET['url_variable'];
   session_register('url_variable')
}


-Original Message-
From: Mauricio [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2003 11:14 AM
To: PHP
Subject: Re: [PHP] Refresh PHP

Hello Ralph,

Actually, after calling session_destroy() I reset those variables
assigning
an empty value like you said. But it still doesn't work. I did a test
after
destroying session variables, printing them. They are empty.

Another weird thing is that when a login as "joao" them logoff,  exclude
IE
cache, going in Tools >> Internet Option..., and login again with
another
user, this way the variable are printed correctly.

It happens in any windows version (95,98,ME,2K,XP) using IE 6.0 and
Netscape
7.



- Original Message -
From: "Ralph Guzman" <[EMAIL PROTECTED]>
To: "'Mauricio'" <[EMAIL PROTECTED]>
Sent: Tuesday, July 08, 2003 2:11 PM
Subject: RE: [PHP] Refresh PHP


> Rather than using session_destroy() reset the session variable by
> assigning it an empty value. For example, lets say your url looks
> something like this:
>
> http://www.mydomain.com/?url_variable=Mauricio
>
> then do the following:
>
> if($_GET['url_variable'] != $url_variable){
>$url_variable = "";
>session_register('url_variable')
> }
>
>
> -Original Message-
> From: Mauricio [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 08, 2003 7:02 AM
> To: PHP
> Subject: [PHP] Refresh PHP
>
> Hi people!
>
> Did anyone get this situation?
>
> I'm creating a Site that uses 3 session variables. One of them I
always
> print at the top of the page, it's the name of the user. There is a
link
> that calls the function session_destroy(). Everytime that I follow
this
> link
> and log in with another user, that session variable printed doesn't
> change,
> but if I press F5 in IE or Netscape them it brings the right user. I
> can't
> make the page return the current user login, it always came with the
> last
> user logged. I tried to add some headers to set no cache in all php
> pages,
> but it doesn't work.
>
> Anyone can help me???
>
> Thanks
>
> PS: Sorry about my poor english...
>
>
> Maurício Valente
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



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




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



RE: [PHP] Mail Header/Return Receipt

2003-07-08 Thread Ralph Guzman
Disposition-Notification-To: is not a sure bet, since the majority of
people ignore the return receipt.

The only way you will know if the email address is invalid is when the
email bounces back and the server sends you the error message. At this
point you can have a script check the email server spool file for
bounced messages containing invalid email addresses. 

If are running an in-house web server, one way you can check if the user
received the email, rather than attaching the pdf file to the email,
generate and keep the pdf file on your web server. Then on the email
give them a link to your web server where they can download the file.
But instead of linking straight to the pdf file, use a download script
that will check what file is being downloaded and then report this back
to you. Something like:

http://www.mydomain.com/download.php?file=Quote.pdf

If you must attach the file to the email, then another method would be
to include an  tag in the email message, so when the recipient
opens up the email  will call out a script on your server which
will track the users email address and then report this back to you.
Something like:

http://www.mydomain.com/[EMAIL PROTECTED]"
WIDTH="1" HEIGHT="1" BORDER="0">

 
-Original Message-
From: Brian S. Drexler [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2003 11:19 AM
To: 'Ralph Guzman'
Subject: RE: [PHP] Mail Header/Return Receipt

That is a good idea.  I can tell them it has at least been sent from our
server, but what if the e-mail address they are sending it to is not
valid?
I'd like for them to know if it fails.  I'll figure it out.  When I do
I'll
let you know what I did.  Thanks for all the help and suggestions!

Brian

-Original Message-
From: Ralph Guzman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 2:12 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Mail Header/Return Receipt


once the email is sent out, can't you simply have your script send the
user a receipt?

If you must use Disposition-Notification-To: for the receipt then I
think you will have to figure how to do this on the email server level.
Afterall, the script is doing what it's supposed to.

-Original Message-
From: Brian S. Drexler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 10:47 AM
To: 'Ralph Guzman'
Subject: RE: [PHP] Mail Header/Return Receipt

I can't.  Server A has a printer driver installed that calls some PHP
functions.  It takes the title tag from a Postscript file sent to the
printer and gets some information from a different machine running MySQL
on our network.  Depending on this information it may fax the postscript
file using HylaFAX or e-mail it.  If it is going to e-mail then it then
takes that information (e-mail address, to and from, phone number, etc.)
and creates an HTML e-mail and a PDF file and e-mail's them.  It works
pretty well for us and it makes it simple for the people using the
application. All they do is print the report to a default printer and it
does all the work for them.  With the faxes it will e-mail them a
confirmation if it fails or not, and that's what I'm trying to get the
e-mail to do (quite unsuccessfully I might add).  Good thought though.
Any other ideas?

-Original Message-
From: Ralph Guzman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 1:41 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Mail Header/Return Receipt


What if you run the script from server b?

-Original Message-
From: Brian S. Drexler [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2003 10:33 AM
To: 'Ralph Guzman'
Subject: RE: [PHP] Mail Header/Return Receipt

Ok, I wasn't sure if it was a simple "header" tag that I was missing or
something like that.  Thanks though...




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



Re: [PHP] Pre-Compiled PHP Module: php_imap.so

2003-07-08 Thread R'twick Niceorgaw
On 8 Jul 2003 at 11:17, [-^-!-%- wrote:

> 
> Is there anyplace to download a pre-compiled PHP module?
> I'm looking for the php_imap.so module.
> 
> Environment: PHP 4.2.3/Apache on Redhat Linux i386.
> Please advise.
> 
get the php-imap rpm



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



Re: [PHP] Regular Expression

2003-07-08 Thread Paul Chvostek
On Tue, Jul 08, 2003 at 06:47:26AM -0500, Wendell Brown wrote:
> 
> I think this would do better...
> 
>   if( preg_match( "/P[\. ]*O\.* +BOX/i", $address ) )

Unless preg_match does something non-standard, you don't need to escape
a period that's inside square brackets.  In fact, the regexp you've
built will also match an $address of "p\o box".

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/


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



Re: [PHP] Refresh PHP

2003-07-08 Thread Mauricio
Hello Ralph,

Actually, after calling session_destroy() I reset those variables assigning
an empty value like you said. But it still doesn't work. I did a test after
destroying session variables, printing them. They are empty.

Another weird thing is that when a login as "joao" them logoff,  exclude IE
cache, going in Tools >> Internet Option..., and login again with another
user, this way the variable are printed correctly.

It happens in any windows version (95,98,ME,2K,XP) using IE 6.0 and Netscape
7.



- Original Message -
From: "Ralph Guzman" <[EMAIL PROTECTED]>
To: "'Mauricio'" <[EMAIL PROTECTED]>
Sent: Tuesday, July 08, 2003 2:11 PM
Subject: RE: [PHP] Refresh PHP


> Rather than using session_destroy() reset the session variable by
> assigning it an empty value. For example, lets say your url looks
> something like this:
>
> http://www.mydomain.com/?url_variable=Mauricio
>
> then do the following:
>
> if($_GET['url_variable'] != $url_variable){
>$url_variable = "";
>session_register('url_variable')
> }
>
>
> -Original Message-
> From: Mauricio [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 08, 2003 7:02 AM
> To: PHP
> Subject: [PHP] Refresh PHP
>
> Hi people!
>
> Did anyone get this situation?
>
> I'm creating a Site that uses 3 session variables. One of them I always
> print at the top of the page, it's the name of the user. There is a link
> that calls the function session_destroy(). Everytime that I follow this
> link
> and log in with another user, that session variable printed doesn't
> change,
> but if I press F5 in IE or Netscape them it brings the right user. I
> can't
> make the page return the current user login, it always came with the
> last
> user logged. I tried to add some headers to set no cache in all php
> pages,
> but it doesn't work.
>
> Anyone can help me???
>
> Thanks
>
> PS: Sorry about my poor english...
>
>
> Maurício Valente
>
>
>
> --
> 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] Pre-Compiled PHP Module: php_imap.so

2003-07-08 Thread [-^-!-%-

Is there anyplace to download a pre-compiled PHP module?
I'm looking for the php_imap.so module.

Environment: PHP 4.2.3/Apache on Redhat Linux i386.
Please advise.

-john

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




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



Re: [PHP] date frustrations

2003-07-08 Thread Shena Delian O'Brien
Ahh, you're right! I had a rogue:

$date = date("m-d-Y", filemtime($fn));

in there. :) Thought I got rid of all of those in testing... my 
organization has a standard date format and it must be dashes instead of 
slashes, and of course it has to be month, day, year!

Jason Wong wrote:
On Wednesday 09 July 2003 01:51, Shena Delian O'Brien wrote:

[snip]


Well I gradually figured out that the date format output by filemtime()
was not an acceptable natural language date format. filemtime() was
fetching dates with a dash - ex. 07-08-2003. strtotime() was making
incorrect timestamps because it doesn't read dates with dashes formatted
that way. 


What version of PHP are you using? And what exactly is the code that you're 
using?

filemtime() returns a _unix timestamp_ and will asort() as is.



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


Re: [PHP] about writing permissions

2003-07-08 Thread Jason Wong
On Tuesday 08 July 2003 22:53, George Papatheodorou wrote:
> The strange this is that user has writing access to the file, and so
> does his group. I even changed permissions to rw-rw-rw and the script
> could still not write in the file. The only solution came when I told
> the server manager to change the files owner to thttpd (not apache as
> mentioned above, it was only as an example) and then the script worked.
> I still wonder why this occurs and if there is any solution to it.

The user also needs to have execute permissions for the directory (and any 
parent directories) containing the target file.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Our OS who art in CPU, UNIX be thy name.
Thy programs run, thy syscalls done,
In kernel as it is in user!
*/


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



Re: [PHP] date frustrations

2003-07-08 Thread Jason Wong
On Wednesday 09 July 2003 01:51, Shena Delian O'Brien wrote:

[snip]

> Well I gradually figured out that the date format output by filemtime()
> was not an acceptable natural language date format. filemtime() was
> fetching dates with a dash - ex. 07-08-2003. strtotime() was making
> incorrect timestamps because it doesn't read dates with dashes formatted
> that way. 

What version of PHP are you using? And what exactly is the code that you're 
using?

filemtime() returns a _unix timestamp_ and will asort() as is.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
A woman without a man is like a fish without a bicycle.
-- Gloria Steinem
*/


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



RE: [PHP] Regular Expression

2003-07-08 Thread Ralph Guzman
Thanks Wendell. This is exactly what I was looking for.

-Original Message-
From: Wendell Brown [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2003 4:47 AM
To: PHP General Mailing List
Subject: Re: [PHP] Regular Expression

On Mon, 07 Jul 2003 21:59:23 -0700, Ralph Guzman wrote:

>I have a form where I have to check whether user is submitting a PO Box
>as an address. I wrote the following using eregi, but it returns true
>even when the field is not Po Box. How do I go about doing this
>properly?
>
>if(eregi("^Po Box$", $address)){
>  $error_message_custom = "You cannot use a PO BOX for Bill To
Address";
>}

I think this would do better...

  if( preg_match( "/P[\. ]*O\.* +BOX/i", $address ) )

This will look for a "P" followed by a space, period or an "O" followed
by a period and/or one or more spaces and the word BOX.  It will also
ignore case.


-- 
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] date frustrations

2003-07-08 Thread Shena Delian O'Brien
Ok so on a web application I needed to list the files in a directory, 
ordered by last modified date.

I was pulling them out in an array, fetching the filemtime() for each 
file, and trying to order them by that date. I was using asort() to sort 
the files in an array so they'd list chronologically.

Well that wasn't working as planned. Files were getting out of order. I 
figured asort() could have been having trouble ordering dates 
numerically, so I tried strtotime() on the dates first, and ordered the 
files by unix timestamp.

That didn't work either. I did a date() on the unix timestamp fetched by 
strtotime() and found that the dates were coming out inaccurately. 2003 
was being changed to 2013, etc.

Well I gradually figured out that the date format output by filemtime() 
was not an acceptable natural language date format. filemtime() was 
fetching dates with a dash - ex. 07-08-2003. strtotime() was making 
incorrect timestamps because it doesn't read dates with dashes formatted 
that way. Apparently asort() reads dates the same way strtotime does.

I think this is kind of perverse... in order to fix it I had to do an 
ereg_replace("-","/",$date) in order to change the filemtime() date 
format to one properly readable by strtotime and asort.

*sigh*

Am I the only one who has noticed this? Is this something that can be 
corrected in PHP? (Perhaps the dates fetched by filemtime() etc can be 
changes to be formatted in a way that is acceptable to other date() 
functions??)

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


RE: [PHP] Going Back in PHP

2003-07-08 Thread Ralph Guzman
If you still have the older version of PHP running, you can use
phpinfo(); and look under Configure Command to see how PHP was
originally configured.

Otherwise, just look at PHP configure options and figure out what
settings you need:

http://www.php.net/manual/en/install.configure.php


-Original Message-
From: Mike At Spy [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2003 10:27 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Going Back in PHP


I am trying to help one of our admins with a php config/setup issue on
one
of our servers; the admin re-compiled php, but did not include all of
the
correct settings.  Outside of having the previous make and config files,
is
there any other files on the server that may hold the old settings so
that
we can gather them and return to the previous way we had php set up?

Thanks,

-Mike



-- 
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] PHP4 and PHP5 at one machine

2003-07-08 Thread Milan Reznicek
Hi,
is there any posibility to run PHP4 and PHP5 at one machine, with two
Apache servers running at the same time.

Windows 2000 SP3
Apache 1.3.27/PHP 4.3.0
Apache 2.0.46/PHP 5.0.0b1


Thank You for Answers Milan

--
--
Milan Reznicek
Software Developer

e-mail:   [EMAIL PROTECTED]



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



[PHP] Going Back in PHP

2003-07-08 Thread Mike At Spy

I am trying to help one of our admins with a php config/setup issue on one
of our servers; the admin re-compiled php, but did not include all of the
correct settings.  Outside of having the previous make and config files, is
there any other files on the server that may hold the old settings so that
we can gather them and return to the previous way we had php set up?

Thanks,

-Mike



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



Re: [PHP] imap_header timing out

2003-07-08 Thread Amer Neely
> Is error_reporting in your php.ini set to "E_ALL & ~E_NOTICE" ?
> 

It's the default:
error_reporting  =  E_ALL
-- 
/* All outgoing email scanned by AVG Antivirus /*
Amer Neely, Softouch Information Services
W: www.softouch.on.ca
E: [EMAIL PROTECTED]
V: 519.438.5887
Perl | PHP | MySQL | CGI programming for all data entry forms.
"We make web sites work!"

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



Re: [PHP] imap_header timing out

2003-07-08 Thread Adam Voigt
Is error_reporting in your php.ini set to "E_ALL & ~E_NOTICE" ?


On Tue, 2003-07-08 at 13:09, Amer Neely wrote:
> > Put:
> > 
> > set_time_limit(0);
> > 
> > At the top of your script.
> 
> Excellent! That worked, thank you.
> 
> Now I'm getting ..
> [08-Jul-2003 12:32:46] PHP Notice:  (null)(): Unexpected characters at
> end of address: <> (errflg=3) in Unknown on line 0
> 
> And the output is a blank html page, but the source code shows no
> messages are being grabbed!
> 
> I haven't been able to find a reference to 'errflg=3' anywhere. I
> suspect there are some bad characters lying in wait in one of the
> headers. A perl script that reads the mailbox has no problems with any
> of the headers, but it uses external modules for some of the header
> parsing. I may have to do my own with PHP.
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



Re: [PHP] imap_header timing out

2003-07-08 Thread Amer Neely
> Put:
> 
> set_time_limit(0);
> 
> At the top of your script.

Excellent! That worked, thank you.

Now I'm getting ..
[08-Jul-2003 12:32:46] PHP Notice:  (null)(): Unexpected characters at
end of address: <> (errflg=3) in Unknown on line 0

And the output is a blank html page, but the source code shows no
messages are being grabbed!

I haven't been able to find a reference to 'errflg=3' anywhere. I
suspect there are some bad characters lying in wait in one of the
headers. A perl script that reads the mailbox has no problems with any
of the headers, but it uses external modules for some of the header
parsing. I may have to do my own with PHP.
-- 
/* All outgoing email scanned by AVG Antivirus /*
Amer Neely, Softouch Information Services
W: www.softouch.on.ca
E: [EMAIL PROTECTED]
V: 519.438.5887
Perl | PHP | MySQL | CGI programming for all data entry forms.
"We make web sites work!"

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



[PHP] Mail Header/Return Receipt

2003-07-08 Thread Brian S. Drexler
Ok, I have an interesting one here.  I'm trying to send an e-mail from
Server A, through Server B, and to a recipient using PHP on Server A.
Server B relays the e-mail because Server A does not have an internet
connection.  Now, I want to request a read/delivery receipt for the user
sending the mail but if I specify the Disposition-Notification-To: Header
the mail fails to deliver because the username/domain that Server A is
executing the script with comes through.  I don't know if this makes any
sense but here is some stuff from the logs

This is from the server the mail is being sent to(Recipient Server)

Jul  8 13:32:13 www sendmail[26808]: h68HWCY26808: ruleset=check_mail,
arg1=<[EMAIL PROTECTED]>, relay=ServerB.myDomain.com [64.113.42.5],
reject=501 5.1.8 <[EMAIL PROTECTED]>... Domain of sender address
[EMAIL PROTECTED] does not exist
Jul  8 13:32:13 www sendmail[26808]: h68HWCY26808:
from=<[EMAIL PROTECTED]>, size=256213, class=0, nrcpts=0,
proto=ESMTP, daemon=MTA, relay=ServerB.myDomain.com [64.113.42.5]

This is from Server A:

Jul  8 12:43:48 ServerA sendmail[31361]: MAA31361: from=uucp, size=256011,
class=0, pri=286011, nrcpts=1,
msgid=<[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Jul  8 12:43:49 ServerA sendmail[31363]: MAA31361:
[EMAIL PROTECTED], ctladdr=uucp (10/14), delay=00:00:01,
xdelay=00:00:01, mailer=smtp, relay=ServerB.myDomain.com. [206.162.111.100],
stat=Sent (2.0.0 h68GhoQ18448 Message acc
epted for delivery)

This is from Server B:
Jul  8 12:43:56 ServerB sendmail[18450]: h68GhoQ18448:
to=<[EMAIL PROTECTED]>, delay=00:00:06, xdelay=00:00:05,
mailer=esmtp, pri=286213, relay=mail.recipient.com. [64.113.39.156],
dsn=5.6.0, stat=Data format error
Jul  8 12:43:56 ServerB sendmail[18450]: h68GhoQ18448: h68GhuQ18450: DSN:
Data format error
Jul  8 12:43:57 ServerB sendmail[18450]: h68GhuQ18450:
to=<[EMAIL PROTECTED]>, delay=00:00:01, xdelay=00:00:01,
mailer=esmtp, pri=286313, relay=ServerA.myDomain.com. [206.162.111.97],
dsn=2.0.0, stat=Sent (MAA31368 Message accepted for delivery)

Any help would be greatly appreciated.Thanks in advance!

Brian

Here is my code also: (I'm using PEAR Mail and MIME)

$FullName=$r["FullName"];
$Email=$r["Email"];
$ConfirmVia=$r["ConfirmVia"];
$ConfirmTo=$r["ConfirmTo"];
if($ConfirmVia=="Email" || $ConfirmVia=="EMail") {
$file="/tmp/Quote".$Theresult.".pdf";
system("ps2pdf $filename $file");
//This is the part that actually sends the mail
include('Mail.php');
include('Mail/mime.php');
$text = 'The quote that you requested is attached.  Thank you for the
opportunity to quote your enclosure needs!\n\n'.$FullName.'\n'.$Email;
$html = 'The quote that you requested 
is
attached.  Thank you for the opportunity to quote your enclosure
needs!'.$FullName.''.$Email.'';
$crlf = "\r\n";
$hdrs = array(
'From'=> $Email,
'Subject' => 'Your Quote # '.$Theresult,
'Disposition-Notification-To' => $Email,
'Return-Path' => $Email
);
$mime = new Mail_mime($crlf);

$mime->setTXTBody($text);
$mime->setHTMLBody($html);
//$mime->addAttachment($file, 'text/plain');
$mime->addAttachment($file);

$body = $mime->get();
$hdrs = $mime->headers($hdrs);

$mail =& Mail::factory('mail');
$mail->send($ConfirmTo, $hdrs, $body);

//End mail part
system("rm -f $file");


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



[PHP] Re: imap_header timing out

2003-07-08 Thread Pete Morganic
see the set_time_limit(); function
http://uk2.php.net/manual/en/function.set-time-limit.php
increase to around a minute or make the mailbox read them back in pages 
with 10 at a time for example

Pete

Amer Neely wrote:
I've a script reading a mailbox using
$InBox = imap_open($Host,$User,$Pass);
$NumMsgs=imap_num_msg($InBox);
for ($i=1; $i <= $NumMsgs; $i++)
{
$Header=imap_header($InBox,$i); # this is line 154
.
.
.
and so on.
With 12 messages in the mailbox this works fine, but with 15 it comes
back as timed out...
[08-Jul-2003 12:32:46] PHP Fatal error:  Maximum execution time of 30
seconds exceeded in g:\httpd\public\readmail\readmail.php on line 154
I'm running this at home (W2K/Apache/PHP 4.3.2) on a dialup account. Can
someone shed some light on why it may be timing out, and where do I
increase the timeout if needed? Or optimize the code if possible?


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


RE: [PHP] Read a file

2003-07-08 Thread Ralph Guzman
You might want to look at patConfiguration:

http://www.php-tools.de/

It can read/write text and xml files.



-Original Message-
From: carlos castillo [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2003 8:53 AM
To: 'PHP List'
Subject: RE: [PHP] Read a file

But them how i can look for the tag i need if i have the file in an
array, i need to read an xml file and extract the info between tags
 and .

Thanks,

Carlos A. Castillo.
Ingeniero de desarrollo
[EMAIL PROTECTED]

 
Su Aliado Efectivo en Internet
www.imagine.com.co
(57 1)2182064 - (57 1)6163218
Bogotá - Colombia 

- Soluciones web para Internet e Intranet
- Soluciones para redes
- Licenciamiento de Software
- Asesoría y Soporte Técnico



-Mensaje original-
De: Burhan Khalid [mailto:[EMAIL PROTECTED] 
Enviado el: martes, 08 de julio de 2003 10:15
Para: Carlos Castillo
Asunto: Re: [PHP] Read a file

On Tuesday, July 8, 2003, 6:08:20 PM, Carlos wrote:
CC> I need to read a whole file and then look for an info on it, i want
to know
CC> with which function is better, fopen(),
fpasstrhu()...fseek()
 
The function that will be best will depend on what kind of file you
are wanting to read. For simple text files, this works well :

$contents = file("somefile.txt");

Which puts all the information in the file in an array.

http://www.php.net/file


-- 
Regards,
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com




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




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



Re: [PHP] imap_header timing out

2003-07-08 Thread Adam Voigt
Put:

set_time_limit(0);

At the top of your script.



On Tue, 2003-07-08 at 12:45, Amer Neely wrote:
> I've a script reading a mailbox using
> $InBox = imap_open($Host,$User,$Pass);
> $NumMsgs=imap_num_msg($InBox);
> for ($i=1; $i <= $NumMsgs; $i++)
> {
> $Header=imap_header($InBox,$i); # this is line 154
> .
> .
> .
> and so on.
> 
> With 12 messages in the mailbox this works fine, but with 15 it comes
> back as timed out...
> [08-Jul-2003 12:32:46] PHP Fatal error:  Maximum execution time of 30
> seconds exceeded in g:\httpd\public\readmail\readmail.php on line 154
> 
> I'm running this at home (W2K/Apache/PHP 4.3.2) on a dialup account. Can
> someone shed some light on why it may be timing out, and where do I
> increase the timeout if needed? Or optimize the code if possible?
> 
> -- 
> /* All outgoing email scanned by AVG Antivirus /*
> Amer Neely, Softouch Information Services
> W: www.softouch.on.ca
> E: [EMAIL PROTECTED]
> Perl | PHP | MySQL | CGI programming for all data entry forms.
> "We make web sites work!"
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



RE: Re[2]: [PHP] Read a file

2003-07-08 Thread Adam Voigt
Umm, sudo?



On Tue, 2003-07-08 at 12:49, carlos castillo wrote:
> Thanks, i already solve that problem, but now i have
> another...sorry...jejejeje.
> 
> Look I need to change the permissions for the files, I use
>   $cmd = "chmod 644 $archivo";
>   system($cmd);
> 
> but I can do it, only the root can do thatyou have an idea how I can
> do it?
> 
> Thanks,
> 
> Carlos A. Castillo.
> Ingeniero de desarrollo
> [EMAIL PROTECTED]
> 
>  
> Su Aliado Efectivo en Internet
> www.imagine.com.co
> (57 1)2182064 - (57 1)6163218
> Bogotá - Colombia 
> 
> - Soluciones web para Internet e Intranet
> - Soluciones para redes
> - Licenciamiento de Software
> - Asesoría y Soporte Técnico
> 
> 
> 
> -Mensaje original-
> De: Burhan Khalid [mailto:[EMAIL PROTECTED] 
> Enviado el: martes, 08 de julio de 2003 11:03
> Para: carlos castillo; [EMAIL PROTECTED]
> Asunto: Re[2]: [PHP] Read a file
> 
> On Tuesday, July 8, 2003, 6:52:56 PM, carlos wrote:
> 
> cc> But them how i can look for the tag i need if i have the file in an
> cc> array, i need to read an xml file and extract the info between tags
> cc>  and .
> 
> Well, I wish you would have said that earlier. Parsing XML files is
> different than parsing text (or other files).
> 
> PHP has XML parsing built-in thanks to expat. More information on XML
> support in PHP is at http://www.php.net/xml
> 
> I have written a tutorial at my website
> http://www.meidomus.com/archives/75.php that shows an
> example of parsing
> XML files in PHP. It does not use the XMLDOM extension. It might be of
> help to you.
> 
> -- 
> Regards,
> Burhan Khalid
> phplist[at]meidomus[dot]com
> http://www.meidomus.com
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



[PHP] imap_header timing out

2003-07-08 Thread Amer Neely
I've a script reading a mailbox using
$InBox = imap_open($Host,$User,$Pass);
$NumMsgs=imap_num_msg($InBox);
for ($i=1; $i <= $NumMsgs; $i++)
{
$Header=imap_header($InBox,$i); # this is line 154
.
.
.
and so on.

With 12 messages in the mailbox this works fine, but with 15 it comes
back as timed out...
[08-Jul-2003 12:32:46] PHP Fatal error:  Maximum execution time of 30
seconds exceeded in g:\httpd\public\readmail\readmail.php on line 154

I'm running this at home (W2K/Apache/PHP 4.3.2) on a dialup account. Can
someone shed some light on why it may be timing out, and where do I
increase the timeout if needed? Or optimize the code if possible?

-- 
/* All outgoing email scanned by AVG Antivirus /*
Amer Neely, Softouch Information Services
W: www.softouch.on.ca
E: [EMAIL PROTECTED]
Perl | PHP | MySQL | CGI programming for all data entry forms.
"We make web sites work!"

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



RE: Re[2]: [PHP] Read a file

2003-07-08 Thread carlos castillo
Thanks, i already solve that problem, but now i have
another...sorry...jejejeje.

Look I need to change the permissions for the files, I use
$cmd = "chmod 644 $archivo";
system($cmd);

but I can do it, only the root can do thatyou have an idea how I can
do it?

Thanks,

Carlos A. Castillo.
Ingeniero de desarrollo
[EMAIL PROTECTED]

 
Su Aliado Efectivo en Internet
www.imagine.com.co
(57 1)2182064 - (57 1)6163218
Bogotá - Colombia 

- Soluciones web para Internet e Intranet
- Soluciones para redes
- Licenciamiento de Software
- Asesoría y Soporte Técnico



-Mensaje original-
De: Burhan Khalid [mailto:[EMAIL PROTECTED] 
Enviado el: martes, 08 de julio de 2003 11:03
Para: carlos castillo; [EMAIL PROTECTED]
Asunto: Re[2]: [PHP] Read a file

On Tuesday, July 8, 2003, 6:52:56 PM, carlos wrote:

cc> But them how i can look for the tag i need if i have the file in an
cc> array, i need to read an xml file and extract the info between tags
cc>  and .

Well, I wish you would have said that earlier. Parsing XML files is
different than parsing text (or other files).

PHP has XML parsing built-in thanks to expat. More information on XML
support in PHP is at http://www.php.net/xml

I have written a tutorial at my website
http://www.meidomus.com/archives/75.php that shows an
example of parsing
XML files in PHP. It does not use the XMLDOM extension. It might be of
help to you.

-- 
Regards,
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com


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


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



RE: [PHP] Sessions

2003-07-08 Thread Johnson, Kirk
> This works fine on my development PC, (PHP v  4.3.1) and on 
> my primary test
> site (PHP v4.2.2).
> However when I try it on the target site (PHP v4.1.2) then I find that
> immediately after starting the session everything works fine, 
> however when I
> move to any other page the session information is lost and 
> I'm redirected to
> log in again.

Also check the "register_globals" setting in the various php.ini files. It
is probably set to "off" on your dev and test sites, but may be set to "on"
on the target site.

Kirk

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



RE: [PHP] Sessions

2003-07-08 Thread Aaron Axelsen
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Here is a good session tutorial, maybe it will help you see something
your missing.

http://www.sitepoint.com/article/319


- ---
Aaron Axelsen
AIM: AAAK2
Email: [EMAIL PROTECTED]

Want reliable web hosting at affordable prices?
www.modevia.com
 
Web Dev/Design Community/Zine
www.developercube.com



- -Original Message-
From: Jason k Larson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2003 11:15 AM
To: Dave Alger
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Sessions


You need to make sure that when you are being directed to the other
pages that the session 
name and session id are being passed.  Check session.use_trans_sid in
the sessions section 
of phpinfo().  The session name and id are available globally after a
session has been 
started as the constant SID.  If you are posting form data, make sure
there is an input 
for the session name with a value of the session id, etc.

Hope that helps.

- --
Jason k Larson


Dave Alger wrote:
> Hi All,
> 
> I'm struggling with a session problem and I'm not sure where I
> should  be looking for the answer.
> 
> Most of my pages begin like this:
>   
> 
> include_once('cfheader.php');
> $feedback = cfHeader("Main Page");
> //Start of page code
> 
> The cfheader.php file begins like this:
> 
> 
>  session_start();
> function cfHeader($Title,$Protect=false)
> {
>  $feedback="";
>  //IF we're loggin on then destory and get new session
>  if (IsSet($_POST['login']))
>  {
>   include_once('userreg.inc');
>   session_destroy(); //Destroy current session before continuing
>   $feedback =do_login();
>  }
>  if ($Protect==true && !IsSet($_SESSION['name']))
>  {
>   //No Session.
>   echo "";
> //Redirect 
>   exit;
>  }
> 
> 
> 
> This works fine on my development PC, (PHP v  4.3.1) and on my
> primary  test site (PHP v4.2.2). However when I try it on the
> target site (PHP  v4.1.2) then I find that immediately after
> starting the session 
> everything works fine, however when I move to any other page the 
> session information is lost and I'm redirected to log in again.
> 
> I was looking over the PHPInfo but to be honest I can't see what it
> is  that's different.
> 
> All help is gratefully appreciated.
> 
> regards,
> Dave
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.497 / Virus Database: 296 - Release Date: 04/07/2003
> 
> 
> 


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

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBPwru1rrnDjSLw9ADEQJ1BACdHrNZ0thj/W4eCgEhc800ufxhsTQAoLlm
TyX4yM46n8VgUMQNQtbwHKC8
=E8V5
-END PGP SIGNATURE-



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



  1   2   >