Re: [PHP] Apache 1.3x/PHP 5.0.3 404 error handler & posted data...

2005-07-11 Thread Burhan Khalid

Rasmus Lerdorf wrote:
[ snip ]

A better option may be to just use mod_rewrite.  Something along the
lines of:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)\.html$  $1.php [T=application/x-httpd-php,L]

You should verify this with the mod_rewrite docs, but this should only
rewrite a request for whatever.html to whatever.php if whatever.html
doesn't exist.  I suppose you could also add a condition to only do the
rewrite if $1.php exists.


I tried something similar to the above. I had a directory that has 
sample php scripts that I use for explaining a concept.  I was hoping 
that the following mod_rewrite would take all requests for .phps and 
parse them as x-httpd-php-source, but it doesn't work, as phps files are 
parsed as php.


RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+\.php)s$ $1 [T=application/x-httpd-php-source,L]

Does anyone know of a way to make this work? Is it even possible?

Rasmus:

  A few months back you posted some Apache settings that allow one to 
run both php5 and php on the same Apache instance using mod_proxy 
(iirc).  Can you please post that again? I can't seem to google for it 
in the archives.


Thanks,
Burhan

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



Re: [PHP] SESSION

2005-07-11 Thread Richard Lynch
On Sun, July 10, 2005 7:50 pm, Thomas Bonham said:
> I have been trying to update & fix the errors.
> With the new code (That I will post at the end), I'm only getting one
> error and that is that it can't start the session because that it has
> been started.

Whoops!

If you've set php.ini to ALWAYS start a session, then you don't need
session_start() after all. Sorry!

You may still be experiencing the bug where session data comes back as
"string references"

var_dump($_SESSION);

in several places.

If you see & in front of your strings, then that's your problem.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Problem serializing a mysqli_result object.

2005-07-11 Thread Richard Lynch
On Thu, July 7, 2005 10:31 pm, Bjarke Freund-Hansen said:
> Richard Lynch wrote:
>
>>On Thu, July 7, 2005 12:53 pm, Bjarke Freund-Hansen said:
>>
>>
You can't serialize resource objects. Try:

serialize($res->fetch_assoc());


>>>I know I can serialize the array fetch_assoc returns, but I really need
>>> to
>>>serialize a mysqli_result, so I can feed it to any function expecting a
>>>mysqli_result.
>>>
>>>
>>
>>The connection simply WILL NOT survive the ending of a PHP script.
>>
>>Period.
>>
>>
> But I'm not trying to keep the connection, I don't care about the
> connection. What I want to serialize is the object returned from
> mysqli->query().

That object is tightly tied to the connection.

It ain't gonna survive  either.

>>If you want to hack the PHP source to try to change that, go for it...
>>
>>
> I've gone so far as to rewrite the mysqli_result class (in PHP), and
> parse the object returned from mysqli->query() to my own class, and
> serialize that one. Which I guess will work. But is that really the
> easiest way?

I guess...

If it's working for you, and you are aware that the object you create when
you un-serialize has lost some of its inherent properties, I think, then I
guess it's okay.

Does it actually work?  I mean, can you iterate through the rows it returned?

I guess my first question should have been:

Why?

What do you gain by serializing and unserializing a result object?

NOTE:
It's possible the mysqli API is *so* different from mysql API that the
properties I'm thinking of aren't there any more.
Or maybe it's only in PostgreSQL that some connection-specific properties
are tied to a result resource?

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] url reload

2005-07-11 Thread Richard Lynch
On Thu, July 7, 2005 6:40 pm, timothy johnson said:
> This should be pretty simple but I cant find any info on it at the
> site. I am writing a function that will create a anchor, but I want it
> to call the same page it is on. Is there a way to get the current php
> page I am on so that when I output my anchor for that correct page.
>
> so if I call it from index.php the link will say:
> index.php?var=data
>
> but if I can the same function from say photos.php then the link would be:
> photos.php?var=data..

It's pretty rare that you REALLY want to blindly copy ALL $_GET arguments,
but you can:

$get = '';
reset($_GET);
while (list($k, $v) = each($_GET)){
  $get .= "&k=" . urlencode($v);
}
$get[0] = '?';


But you should *PROBABLY* be checking for specific values in $_GET, making
sure they are "clean" and passing on only those values.

$kosher = '[^A-Za-z0-9\'"\\. ,-]';
$name = $_GET['name'];
$zip = $_GET['zip'];
$zip = (int) $zip; //Assuming only 5-digit zip code will ever be used in
this application
$zip = sprintf("%05s", $zip);
$name = preg_replace($kosher, '', $name);
$url = "?name=" . urlencode($name) . "&zip=$zip";

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] from tree/hirarki format to table format

2005-07-11 Thread Richard Lynch
On Thu, July 7, 2005 5:36 pm, Feriyanto said:
> affid   upline  sponsor
> 1 0   0
> 2 1   1
> 3 1   1
> 4 2   1
> 5 2   2
> 6 3   1
> 7 3   1
> 8 4   1
> 9 4   1
> 105   1
>
>
> i have table with field and data like above in my database mysql,
> and i only can preview that data in tree format
>
> Level 1 : affid 2
>
> Level 2 : affid 4
>
> Level 2 : affid 5
>
> Level 1 : affid 3
>
> Level 2 : affid 6
>
> Level 2 : affid 7
>
> now i want to preview that data in table, like this
> level1 (in table)
> level2
> level3
>
> can someone help me ???
>
> it affiliate view downline but in table format not in hirarki/tree format
> where affid is have upline and sponsor.

You can probably do this in SQL faster than in PHP.

So Google for "MySQL hierarchy" and "MySQL tree"

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] zlib.output_compression

2005-07-11 Thread LacaK

Can anyone help me with this question :

when I write script like this :


page displays, that zlib.output_compression is On, but realy is not 
compresed (is send only like text/html)


Is possible to turn on compression (enable) in user script (using 
ini_set), or only disable ini_set('zlib.output_compression', false); ?


Thanks

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



[PHP] getting the email addresses in a sendable format.

2005-07-11 Thread Ross
Hi,

I have a database of 300 email addresses retrieved with a select statement.

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

  $email_addresses[] = $row['email'];

  }

But I have having trouble assiging them to the variable $recipients. Really 
what i want is to convert

$email_addresses[0] = [EMAIL PROTECTED]
$email_addresses[1] = [EMAIL PROTECTED]
$email_addresses[2] = [EMAIL PROTECTED]

into

$recipients= "[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]";

Two points here...

(i) I believe php uses comas (,) instead of semi-colons(;) between the email 
addresses
(ii) does the space between addresses matter? I would rather have it as my 
user could see the recipeints more clearly.


R. 

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



Re: [PHP] getting the email addresses in a sendable format.

2005-07-11 Thread Paul Waring
On Mon, Jul 11, 2005 at 11:20:05AM +0100, Ross wrote:
> But I have having trouble assiging them to the variable $recipients. Really 
> what i want is to convert
> 
> $email_addresses[0] = [EMAIL PROTECTED]
> $email_addresses[1] = [EMAIL PROTECTED]
> $email_addresses[2] = [EMAIL PROTECTED]
> 
> into
> 
> $recipients= "[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]";

You want the implode() function using a line like this:

$recipients = implode(', ', $email_addresses);

This will create a string of all the values in each element of the
$email_addresses array, separated by a comma and a space (of course you
can change this to anything you want). You can find more information
about the function here:

http://www.php.net/implode

> (ii) does the space between addresses matter? I would rather have it as my 
> user could see the recipeints more clearly.

As far as I'm aware, any standards compliant mail server will just
ignore the extra whitespace so you are free to insert spaces if you so
desire.

Paul

-- 
Rogue Tory
http://www.roguetory.org.uk

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



Re[2]: [PHP] Re: Security, Late Nights and Overall Paranoia

2005-07-11 Thread Richard Davey
Hello Chris,

Sunday, July 10, 2005, 2:31:57 AM, you wrote:

CS> I completely agree. I think you'll find that, when pressed, no one
CS> can really provide a good reason to use BBCode. I often see
CS> security cited as a reason, but it makes no sense.

I gave several valid good usability reasons, that I've yet to see
anyone provide a coherent reason not to use.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



RE: [PHP] Two websites need to share part of one database, suggestions please

2005-07-11 Thread Nathan Tobik
This seems to be the best option of the one you presented.  If you start
duplicating data you will have a situation where your data will get out
of sync eventually.  You can have a lookup table with the keys to the
items that belong to website two, just look in the lookup table to get
your key, then get the row.  This eliminates the need to have an extra
column on every table.  Best of luck

Nate Tobik
(412)661-5700 x206
VigilantMinds

4. Add a field to each table that will differentiate which website the
record belongs to. e.g. 'SELECT * FROM orders WHERE website = 2'.

Now that I'm thinking about it, this option seems to ultimately be the
same as #1. I can't think of any inherent benefits to this option.


Which option should I go for? Is there another option I'm not
considering?


Thanks!
Chris.

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

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



[PHP] CASE Tool For PHP OO Programming

2005-07-11 Thread Pascual De Ruvo
Hi,

Can someone suggest a free CASE Tool for UML modelling that generates PHP 5 
code?

Thanks in advance,

Pascual De Ruvo


[PHP] error when trying to delete a record

2005-07-11 Thread Ross
I dunno if my text book is out of date or I have made a syntax error but I 
am trying to delete a record with


 $query= "DELETE FROM sheet1 WHERE id=$id";


 $result= mysql_query($query);
  if($result){
  echo "it was deleted";
 }
 else
 echo mysql_error();
 }


and I get the followign sql error


You have an error in your SQL syntax; check the manual that corresponds to 
your MySQL server version for the right syntax to use near '' at line 1 

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



RE: [PHP] error when trying to delete a record

2005-07-11 Thread Jay Blanchard
[snip]
$query= "DELETE FROM sheet1 WHERE id=$id";

You have an error in your SQL syntax; check the manual that corresponds
to 
your MySQL server version for the right syntax to use near '' at line 1 
[/snip]

try...

$query= "DELETE FROM sheet1 WHERE id = '".$id."' ";

Note the single quotes around conditional data. Imagine if $id = 1 and
you did your original query, it would read...

$query= "DELETE FROM sheet1 WHERE id=1"; 

Which is where id = TRUE. You could end up deleting all of the records
in the database.

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



Re: [PHP] error when trying to delete a record

2005-07-11 Thread John Nichel

Ross wrote:
I dunno if my text book is out of date or I have made a syntax error but I 
am trying to delete a record with



 $query= "DELETE FROM sheet1 WHERE id=$id";


 $result= mysql_query($query);
  if($result){
  echo "it was deleted";
 }
 else
 echo mysql_error();
 }


and I get the followign sql error


You have an error in your SQL syntax; check the manual that corresponds to 
your MySQL server version for the right syntax to use near '' at line 1 



echo out $id and/or your query to ensure it is what you think it is.

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

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



Re: [PHP] error when trying to delete a record

2005-07-11 Thread Mark Rees
""Jay Blanchard"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
$query= "DELETE FROM sheet1 WHERE id=$id";

You have an error in your SQL syntax; check the manual that corresponds
to
your MySQL server version for the right syntax to use near '' at line 1
[/snip]

try...

$query= "DELETE FROM sheet1 WHERE id = '".$id."' ";

Note the single quotes around conditional data. Imagine if $id = 1 and
you did your original query, it would read...

$query= "DELETE FROM sheet1 WHERE id=1";

Which is where id = TRUE. You could end up deleting all of the records
in the database.

---

Is the above statement true when the id field is numeric (which it surely is
in this case)? I get the expected results (in mySQL) when using statements
like

SELECT name FROM table WHERE id=1

with no single quotes round it. Putting quotes round integer values is
counter-intuitive - is it necessary in some cases?

---

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



Re: [PHP] error when trying to delete a record

2005-07-11 Thread Paul Waring
On Mon, Jul 11, 2005 at 03:25:33PM +0100, Mark Rees wrote:
> with no single quotes round it. Putting quotes round integer values is
> counter-intuitive - is it necessary in some cases?

If the field is a numeric type (e.g. INT) as opposed to numeric data
being stored in a character field (e.g. a telephone number) then it is
not only unnecessary to quote the value, it's also incorrect useage of
SQL, although you'd probably get away with it in most database systems.

Paul

-- 
Rogue Tory
http://www.roguetory.org.uk

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



[PHP] searching for files in a directory.

2005-07-11 Thread babu
Hi,
 
I have a directory which has thousands of files based on date. 
for example
mmdd-number(auto increment).txt
20050101-0001.txt,20050101-0002.txt20050101-0210.txt
20050102-0001.txt,20050102-0002.txt..20050102-0141.txt
 
and many other files, but i want to extract data from the files with the above 
format.
 
I have seen in the php documentation for reading a directory,but not files with 
a specific structure.
can some one give an idea.
 
thanks
babu.
 
 
 


-
Yahoo! Messenger NEW - crystal clear PC to PCcalling worldwide with voicemail

Re: Re[2]: [PHP] Re: Security, Late Nights and Overall Paranoia

2005-07-11 Thread Greg Donald
On 7/11/05, Richard Davey <[EMAIL PROTECTED]> wrote:
> I gave several valid good usability reasons, that I've yet to see
> anyone provide a coherent reason not to use.

Misuse of CPU cycles.


-- 
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

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



RE: [PHP] error when trying to delete a record

2005-07-11 Thread Mike Johnson
From: Paul Waring [mailto:[EMAIL PROTECTED] 

> On Mon, Jul 11, 2005 at 03:25:33PM +0100, Mark Rees wrote:
> > with no single quotes round it. Putting quotes round 
> > integer values is counter-intuitive - is it necessary 
> > in some cases?
> 
> If the field is a numeric type (e.g. INT) as opposed to 
> numeric data being stored in a character field (e.g. a 
> telephone number) then it is not only unnecessary to quote 
> the value, it's also incorrect useage of SQL, although 
> you'd probably get away with it in most database systems.

I agree. What's best is to ensure the val is of the proper type before
sending it to the db. Try casting it first; if the value is blank, it'll
cast as 0 (though that may not be optimal, either, if your record could
be 0):

$query = "DELETE FROM sheet1 WHERE id = " . (int)$id;

Also probably best to check if it's empty, something such as:

if (!empty($id)) {
$query = 'DELETE FROM sheet1 WHERE id = ' . (int)$id;
} else {
echo 'Argument $id was empty';
}

HTH!

-- 
Mike Johnson Smarter Living, Inc.
Web Developerwww.smartertravel.com
[EMAIL PROTECTED]   (617) 886-5539

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



RE: [PHP] error when trying to delete a record

2005-07-11 Thread Jay Blanchard
[snip]
Is the above statement true when the id field is numeric (which it
surely is
in this case)? I get the expected results (in mySQL) when using
statements
like

SELECT name FROM table WHERE id=1

with no single quotes round it. Putting quotes round integer values is
counter-intuitive - is it necessary in some cases?
[/snip]

If the id field is numeric and the $id is not set the query will return
a syntax error due to the query being seen as this...

SELECT foo FROM bar WHERE id = ;

The problems multiply when the id field is of the auto-increment type.
Some RDBMS have settings that will allow conditionals, such as WHERE
id=1, to be evaluated as TRUE or FALSE, which accounts for my previous
statement. id, in this case, may be a bad example because most
developers would like a more qualified conditional match before a
deletion occurs. I would never let my development team use the id (or
whatever it was called, especially an auto-increment field) for record
retrieval or deletion. In general you would not have to use quotes
around fields that are INTs, FLOATs, etc.

P.S. Paul, click reply-all when sending messages back to this list. I
know it is counter-intuitive, but it is how this one works.

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



[PHP] constructors in PHP

2005-07-11 Thread Alessandro Rosa
Is there the possibility to have in PHP multiple class constructors
as in C++ or just one ?
I would be sure about it in order to prevent useless mad investigations
in the code I'm writing.

Thanks in advance ...

Alessandro Rosa


Re: [PHP] zlib.output_compression

2005-07-11 Thread Greg Donald
On 7/11/05, LacaK <[EMAIL PROTECTED]> wrote:
> Can anyone help me with this question :
> 
> when I write script like this :
>ini_set('zlib.output_compression', true);
>   phpinfo();
> ?>
> 
> page displays, that zlib.output_compression is On, but realy is not
> compresed (is send only like text/html)

It's likely the browser is uncomressing it before you ever see it.  I
would telnet to port 80 and make an HTTP request to see for sure.


-- 
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

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



Re: [PHP] constructors in PHP

2005-07-11 Thread Greg Donald
On 7/11/05, Alessandro Rosa <[EMAIL PROTECTED]> wrote:
> Is there the possibility to have in PHP multiple class constructors
> as in C++ or just one ?

Doesn't seem as though you can:

> cat class.php 
#!/usr/bin/php



> ./class.php 
PHP Fatal error:  Cannot redeclare __construct() in
/home/greg/class.php on line 13

Fatal error: Cannot redeclare __construct() in /home/greg/class.php on line 13


-- 
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

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



Re: [PHP] constructors in PHP

2005-07-11 Thread André Medeiros
On Mon, 2005-07-11 at 16:44 +0200, Alessandro Rosa wrote:
> Is there the possibility to have in PHP multiple class constructors
> as in C++ or just one ?
> I would be sure about it in order to prevent useless mad investigations
> in the code I'm writing.
> 
> Thanks in advance ...
> 
> Alessandro Rosa

You can't make several definitions of constructors. What you _CAN_ do is
to use func_get_args ( www.php.net/func_get_args ) to determine how many
args were passed :)

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



[PHP] PHP 4.4.0 Released!

2005-07-11 Thread Derick Rethans
Hello!

The PHP Development Team would like to announce the immediate release of 
PHP 4.4.0. This is a maintenance release that addresses a serious memory 
corruption problem within PHP concerning references. If references were 
used in a wrong way, PHP would often create memory corruptions which 
would not always surface and be visible. The increased middle digit was 
required because the fix that corrected the problem with references 
changed PHP's internal API. PHP 4.4.0 does not have any new features, 
and is solely a bugfix release.

A separate release announcement is also available. For changes in PHP 
4.4.0 since PHP 4.3.11, please consult the PHP 4 ChangeLog. 

Release Announcement: http://www.php.net/release_4_4_0.php
Downloads:http://www.php.net/downloads.php#v4
Changelog:http://www.php.net/ChangeLog-4.php#4.4.0

regards,
Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

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



Re: [PHP] constructors in PHP

2005-07-11 Thread Alessandro Rosa
Thanks to all for clear responses!

So just a question now, why have not multiple constructors been implemented?
Are there some security issues related to them ?

Alessandro

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



[PHP] searching for files in a directory with a specific structure.

2005-07-11 Thread babu
Hi,

I have a directory which has thousands of files based on date. 
for example
mmdd-number(auto increment).txt
20050101-0001.txt,20050101-0002.txt20050101-0210.txt
20050102-0001.txt,20050102-0002.txt..20050102-0141.txt

and many other files, but i want to extract data from the files with the above 
format.

I have seen in the php documentation for reading a directory,but not files with 
a specific structure.i could not able to write the correct regular expression 
for the filename match.
can some one give an idea.

thanks
babu.



-
Yahoo! Messenger NEW - crystal clear PC to PCcalling worldwide with voicemail

Re: [PHP] searching for files in a directory with a specific structure.

2005-07-11 Thread Stut

babu wrote:
I have a directory which has thousands of files based on date. 
for example

mmdd-number(auto increment).txt
20050101-0001.txt,20050101-0002.txt20050101-0210.txt
20050102-0001.txt,20050102-0002.txt..20050102-0141.txt

and many other files, but i want to extract data from the files with the above 
format.

I have seen in the php documentation for reading a directory,but not files with 
a specific structure.i could not able to write the correct regular expression 
for the filename match.
can some one give an idea.


Check out http://php.net/glob. This might not be the best way to do it 
if you have *lots* of files since it returns all matches in an array.


A regex to match might look something like \d\d\d\d\d\d\-\d\d\d\d\.txt 
but I'm no regex expert.


-Stut

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



Re[4]: [PHP] Re: Security, Late Nights and Overall Paranoia

2005-07-11 Thread Richard Davey
Hello Greg,

Monday, July 11, 2005, 3:46:24 PM, you wrote:

GD> On 7/11/05, Richard Davey <[EMAIL PROTECTED]> wrote:
>> I gave several valid good usability reasons, that I've yet to see
>> anyone provide a coherent reason not to use.

GD> Misuse of CPU cycles.

So if you wanted to allow a user to say colour a piece of text red,
they'd have to enter x to make it
happen? Poor bastards (never mind the fact I'd love to see you use
less CPU cycles to perfectly validate that tag than say [red][/red]).

Interesting.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



[PHP] libssl.so.0.9.7

2005-07-11 Thread gmourani
Hello,

I've upgraded to OpenSSL 0.9.8 and PHP 4.4.0 and get the following error
durring compilation.

chmod 755 /var/tmp/php-4.4.0-root/usr/lib/httpd/modules/libphp4.so
Installing PHP CLI binary:/var/tmp/php-4.4.0-root/usr/bin/
Installing PHP CLI man page:  /var/tmp/php-4.4.0-root/usr/share/man/man1/
Installing shared extensions: /var/tmp/php-4.4.0-root/usr/lib/php4/
Installing PEAR environment:  /var/tmp/php-4.4.0-root/usr/share/pear/
/usr/src/openna/BUILD/php-4.4.0/sapi/cli/php: error while loading shared
libraries: libssl.so.0.9.7: cannot open shared object file: No such file
or directory
make[1]: *** [install-pear-installer] Error 127
make: *** [install-pear] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.70944 (%install)

Look like PHP still check for version 0.9.7 even if 0.9.8 is now
installed. Does someone on this list have a patch or information to fix
this problem? Thanks.

Gerhard,

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



Re: [PHP] constructors in PHP

2005-07-11 Thread Burhan Khalid

Alessandro Rosa wrote:

Thanks to all for clear responses!

So just a question now, why have not multiple constructors been implemented?
Are there some security issues related to them ?


As far as I know, its not a security issue, but a structure/design issue.

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



Re: Re[4]: [PHP] Re: Security, Late Nights and Overall Paranoia

2005-07-11 Thread Greg Donald
On 7/11/05, Richard Davey <[EMAIL PROTECTED]> wrote:
> u wanted to allow a user to say colour a piece of text red,
> they'd have to enter x to make it

I wouldn't know,  isn't one of the tags I allow.

> happen? Poor bastards (never mind the fact I'd love to see you use
> less CPU cycles to perfectly validate that tag than say [red][/red]).

I don't bother with perfect tag validation, and I doubt the phpbb
bbcode people do either since they average about 2-3 exploits a month
on Bugtraq.

I allow a specific set of safe html tags and I provide a preview
function.  Even after that, if the user goofs up I allow a specific
time span in which to edit the post to correct the goof.


-- 
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

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



Re[6]: [PHP] Re: Security, Late Nights and Overall Paranoia

2005-07-11 Thread Richard Davey
Hello Greg,

Monday, July 11, 2005, 5:06:51 PM, you wrote:

GD> I wouldn't know,  isn't one of the tags I allow.

If you stick to the plain vanilla HTML tags such as i, b, u, etc then
BBCode is pointless - I agreed on this with you several posts ago. I
don't however use it just for that, I use it to let thousands of kids
add a little sparkle to their messages/profiles with colours, images,
etc -- without them having to have good CSS/HTML knowledge (most of them
could handle a font tag, but that'd break my XHTML Trans). This is the
point I argued all along to which I get "it's not really a security
benefit" (no, it's a user benefit) and it's a "misuse of cpu cycles".

For people I hold in such high regard, I'm ashamed at the lot of you :)

GD> I don't bother with perfect tag validation, and I doubt the phpbb
GD> bbcode people do either since they average about 2-3 exploits a
GD> month on Bugtraq.

Not that I'd let an install of phpBB anywhere near a site I run, they
didn't invent BBCode, and in all fairness to those guys the majority
of their exploits are elsewhere.

GD> I allow a specific set of safe html tags and I provide a preview
GD> function. Even after that, if the user goofs up I allow a specific
GD> time span in which to edit the post to correct the goof.

Ditto. I just don't force them to use HTML.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



RE: [PHP] iCalendar creation not working with Outlook [SOLVED]

2005-07-11 Thread Chris W. Parker
Daevid Vincent 
on Saturday, July 09, 2005 7:24 PM said:

> I'm sure there's a better way to get the GMT time, as my way is a
> total hack. I'm in PST btw, 7 hours from GMT, and I set the party
> events to be 6 hours long arbitrarily. Adjust as desired.

PST is normally -8:00GMT. Currently it is -7:00GMT because of Daylight
Savings Time. You might want to make reservations for that in your code
instead of hardcoding the 7.


Chris.

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



[PHP] how to get time cost for MySQL query

2005-07-11 Thread x
Hi, Is there any MySQL lib function which can provide time cost for last
query?

Since we can see the time cost each time we query MySQL through MySQL
console (such as 75 rows in set (0.01 sec)), so I am wondering there is
already an existing function which will return the value...

Thanks

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



[PHP] Problem installing in Win2003 Server SP1

2005-07-11 Thread Grosz, Steve (IPG IT)
I have been trying for several days to get PHP 4.x installed on my
Win2003 SP1 server.  I am doing the manual (isapi) install.  I modified
my php.ini file, I think correctly. And added the extension into
IIS6, pointing to the \php directory and the php4isapi.dll file.

When I try to view a php file, even one that returns the basics showing
if PHP is running or not, I get a 'page can't be found'

Can anyone tell me what I might be doing wrong?

Thanks,
Steve

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



Re: [PHP] constructors in PHP

2005-07-11 Thread Psystorm

Burhan Khalid wrote:


Alessandro Rosa wrote:


Thanks to all for clear responses!

So just a question now, why have not multiple constructors been 
implemented?

Are there some security issues related to them ?



As far as I know, its not a security issue, but a structure/design issue.


The issue is that in php you can't definitely say what type a variable 
is , whereas in c++ you can say this variable is a string, this one a 
int, ….


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



[PHP] still trying to cURL.

2005-07-11 Thread Jon
I have minimal experience with cURL but have had some success with it.

I am trying to download some invoices that are posted every month.  I am
able to get a login to the https: and get the first few pages but when I try
to get the invoices I get an error page with this content.

HTTP Status 500 -


type Exception report
message
description The server encountered an internal error () that prevented it
from fulfilling this request.
exception
java.lang.NullPointerException
 ..
39 lines of error messages

Everything seems to work fine up to the point that I am given a jsessionID
on the third page that is curled.  It seems to be writing the info to the
cookie file but I don't know if I am handling it incorrectly or if that has
anything to do with it.

I have downloaded LiveHTTPHeaders version 0.10 available here
http://livehttpheaders.mozdev.org/index.html to see if I was missing any of
the information that has been passed and having compared the log file I can
say that I am passing the same information as the mozilla browser.  does
anyone have any suggestions.

and an RTFM is fine but I have been over several of the links posted
http://curl.haxx.se/docs/ so if you tell me RTFM please send my idiot self
to the correct page.

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



Re: [PHP] how to get time cost for MySQL query

2005-07-11 Thread Philip Hallstrom

Hi, Is there any MySQL lib function which can provide time cost for last
query?



Maybe...

http://us2.php.net/manual/en/function.mysql-info.php
http://us2.php.net/manual/en/function.mysql-stat.php

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



Re: [PHP] constructors in PHP

2005-07-11 Thread Alessandro Rosa
> > As far as I know, its not a security issue, but a structure/design
issue.
>
> The issue is that in php you can't definitely say what type a variable
> is , whereas in c++ you can say this variable is a string, this one a
> int, ….

But, right because PHP is weakly typed, multiple constructors could be
handled easier, I suppose ... isn't true?

Alessandro Rosa

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



[PHP] libssl.so.0.9.7

2005-07-11 Thread gmourani
Hello,

I've upgraded to OpenSSL 0.9.8 and PHP 4.4.0 and get the following error
durring compilation.

chmod 755 /var/tmp/php-4.4.0-root/usr/lib/httpd/modules/libphp4.so
Installing PHP CLI binary:/var/tmp/php-4.4.0-root/usr/bin/
Installing PHP CLI man page:  /var/tmp/php-4.4.0-root/usr/share/man/man1/
Installing shared extensions: /var/tmp/php-4.4.0-root/usr/lib/php4/
Installing PEAR environment:  /var/tmp/php-4.4.0-root/usr/share/pear/
/usr/src/openna/BUILD/php-4.4.0/sapi/cli/php: error while loading shared
libraries: libssl.so.0.9.7: cannot open shared object file: No such file
or directory
make[1]: *** [install-pear-installer] Error 127
make: *** [install-pear] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.70944 (%install)

Look like PHP still check for version 0.9.7 even if 0.9.8 is now
installed. Does someone on this list have a patch or information to fix
this problem? Thanks.

Gerhard,

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



Re: [PHP] searching for files in a directory with a specific structure.

2005-07-11 Thread babu
thanks the format works,
i have written some code for deleting some lines from the above obtained 
files,i have used like keyword match for deleting lines from the above 
files.the keywords are in the array.
can u pls look at the code and check where goes wrong.




Stut <[EMAIL PROTECTED]> wrote: babu wrote:
> I have a directory which has thousands of files based on date. 
> for example
> mmdd-number(auto increment).txt
> 20050101-0001.txt,20050101-0002.txt20050101-0210.txt
> 20050102-0001.txt,20050102-0002.txt..20050102-0141.txt
> 
> and many other files, but i want to extract data from the files with the 
> above format.
> 
> I have seen in the php documentation for reading a directory,but not files 
> with a specific structure.i could not able to write the correct regular 
> expression for the filename match.
> can some one give an idea.

Check out http://php.net/glob. This might not be the best way to do it 
if you have *lots* of files since it returns all matches in an array.

A regex to match might look something like \d\d\d\d\d\d\-\d\d\d\d\.txt 
but I'm no regex expert.

-Stut




-
How much free photo storage do you get? Store your holiday snaps for FREE with 
Yahoo! Photos. Get Yahoo! Photos

Re: [PHP] constructors in PHP

2005-07-11 Thread Greg Donald
On 7/11/05, Alessandro Rosa <[EMAIL PROTECTED]> wrote:
> But, right because PHP is weakly typed, multiple constructors could be
> handled easier, I suppose ... isn't true?

The sky is the limit with the function handling functions:

http://php.net/manual/en/ref.funchand.php


-- 
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

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



Re: [PHP] how to get time cost for MySQL query

2005-07-11 Thread x
I did checked both of them and it seems they do not provide such info... 
thanks
"Philip Hallstrom" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>> Hi, Is there any MySQL lib function which can provide time cost for last
>> query?
>>
>
> Maybe...
>
> http://us2.php.net/manual/en/function.mysql-info.php
> http://us2.php.net/manual/en/function.mysql-stat.php 

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



Re: [PHP] how to get time cost for MySQL query

2005-07-11 Thread x
I did checked both of them and it seems they do not provide such info...
thanks
"Philip Hallstrom" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>> Hi, Is there any MySQL lib function which can provide time cost for last
>> query?
>>
>
> Maybe...
>
> http://us2.php.net/manual/en/function.mysql-info.php
> http://us2.php.net/manual/en/function.mysql-stat.php

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



Re: [PHP] file function

2005-07-11 Thread Joseph Lee
I see. Now I know how it works. Thank you, all, for
your great help.

Joe

--- Burhan Khalid <[EMAIL PROTECTED]> wrote:

> Joseph Lee wrote:
> > Hi,
> > 
> > I tried file() in the following lines:
> > 
> >  >$authFile = file("/tmp/authenticate.txt");
> >print "authFile = $authFile";
> > ?>
> > 
> > However, it only gave me
> > authFile = Array
> > 
> > What's wrong with this file function? I tried
> single
> > quotes, but got the same answer, too.
> 
> Nothing.  You need to read the documentation.  What
> you probably wanted was:
> 
> print "authFile = ".implode("",$authFile);
> 
> or file_get_contents().
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 




__ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html 

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



[PHP] creating of multi dimensional arrays with unknown depth

2005-07-11 Thread Ben-Nes Yonatan

Hi all!

I got a string which include information for categories that I need to 
build, the string is built like this:

$string = "val1~~val2~~val3~~val4~~val5"

Now, I want to create from this string a multi dimensional array and not 
one dimension array as explode('~~', $string) will give me.


The desired result from this string is:

$array['val1']  = 'whatever';
$array['val1']['val2']  = 'whatever';
$array['val1']['val2']['val3']  = 'whatever';
$array['val1']['val2']['val3']['val4']  = 'whatever';
$array['val1']['val2']['val3']['val4']['val'5]  = 'whatever';

My problem is that the number of the dimensions is really unknown and 
can be changed from 1 to 20 as far as I know.


Is there a way to create such a dynamic depth in an automatic way and 
not by using lots of if's?


Thanks in advance,
Ben-Nes Yonatan
Canaan Surfing Ltd.

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



Re: Re[6]: [PHP] Re: Security, Late Nights and Overall Paranoia

2005-07-11 Thread Jonathan Kart
I've been loosely following this thread, and have a question now. 
Isn't one advantage of a bbcode type solution that you can more easily
avoid session hijacking vis cross site scripting?  If you allow html,
then you open the door for people to add eventhandlers.  I guess you
could always strip them, but it seems like for simple stuff bbcode
isn't a bad solution.

On 7/11/05, Richard Davey <[EMAIL PROTECTED]> wrote:
> Hello Greg,
> 
> Monday, July 11, 2005, 5:06:51 PM, you wrote:
> 
> GD> I wouldn't know,  isn't one of the tags I allow.
> 
> If you stick to the plain vanilla HTML tags such as i, b, u, etc then
> BBCode is pointless - I agreed on this with you several posts ago. I
> don't however use it just for that, I use it to let thousands of kids
> add a little sparkle to their messages/profiles with colours, images,
> etc -- without them having to have good CSS/HTML knowledge (most of them
> could handle a font tag, but that'd break my XHTML Trans). This is the
> point I argued all along to which I get "it's not really a security
> benefit" (no, it's a user benefit) and it's a "misuse of cpu cycles".
> 
> For people I hold in such high regard, I'm ashamed at the lot of you :)
> 
> GD> I don't bother with perfect tag validation, and I doubt the phpbb
> GD> bbcode people do either since they average about 2-3 exploits a
> GD> month on Bugtraq.
> 
> Not that I'd let an install of phpBB anywhere near a site I run, they
> didn't invent BBCode, and in all fairness to those guys the majority
> of their exploits are elsewhere.
> 
> GD> I allow a specific set of safe html tags and I provide a preview
> GD> function. Even after that, if the user goofs up I allow a specific
> GD> time span in which to edit the post to correct the goof.
> 
> Ditto. I just don't force them to use HTML.
> 
> Best regards,
> 
> Richard Davey
> --
>  http://www.launchcode.co.uk - PHP Development Services
>  "I do not fear computers. I fear the lack of them." - Isaac Asimov
> 
> --
> 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] Help installing on Win2003 server?

2005-07-11 Thread Grosz, Steve (IPG IT)
Can someone tell me where I can find some detailed instructions on how
to install PHP on a Win2003 Server?  I've tried to install it using the
PHP instructions, but it doesn't seem to be working, think I'm missing
something.
 
Thanks.


Re: [PHP] Re: Security, Late Nights and Overall Paranoia

2005-07-11 Thread Evert | Rooftop

The point is..

If you for example only allow  and  doing this with bbcode 
would require extra cpu-cycles to convert [i] to 


I don't really agree with this, because I think escaping the html + 
replacing bbcode would require less cpu cycles then scanning the string 
for invalid html and escaping them.


Maybe someone has the time to benchmark this?

Whatever the outcome will be, I would still prefer  over [i] because 
I'm a standards guy =)


regards,
Evert


Jonathan Kart wrote:

I've been loosely following this thread, and have a question now. 
Isn't one advantage of a bbcode type solution that you can more easily

avoid session hijacking vis cross site scripting?  If you allow html,
then you open the door for people to add eventhandlers.  I guess you
could always strip them, but it seems like for simple stuff bbcode
isn't a bad solution.

On 7/11/05, Richard Davey <[EMAIL PROTECTED]> wrote:
 


Hello Greg,

Monday, July 11, 2005, 5:06:51 PM, you wrote:

GD> I wouldn't know,  isn't one of the tags I allow.

If you stick to the plain vanilla HTML tags such as i, b, u, etc then
BBCode is pointless - I agreed on this with you several posts ago. I
don't however use it just for that, I use it to let thousands of kids
add a little sparkle to their messages/profiles with colours, images,
etc -- without them having to have good CSS/HTML knowledge (most of them
could handle a font tag, but that'd break my XHTML Trans). This is the
point I argued all along to which I get "it's not really a security
benefit" (no, it's a user benefit) and it's a "misuse of cpu cycles".

For people I hold in such high regard, I'm ashamed at the lot of you :)

GD> I don't bother with perfect tag validation, and I doubt the phpbb
GD> bbcode people do either since they average about 2-3 exploits a
GD> month on Bugtraq.

Not that I'd let an install of phpBB anywhere near a site I run, they
didn't invent BBCode, and in all fairness to those guys the majority
of their exploits are elsewhere.

GD> I allow a specific set of safe html tags and I provide a preview
GD> function. Even after that, if the user goofs up I allow a specific
GD> time span in which to edit the post to correct the goof.

Ditto. I just don't force them to use HTML.

Best regards,

Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I do not fear computers. I fear the lack of them." - Isaac Asimov

--
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] Help installing on Win2003 server?

2005-07-11 Thread Jay Blanchard
[snip]
Can someone tell me where I can find some detailed instructions on how
to install PHP on a Win2003 Server?  I've tried to install it using the
PHP instructions, but it doesn't seem to be working, think I'm missing
something.
[/snip]

Did you install Apache?

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



RE: [PHP] Two websites need to share part of onedatabase,suggestions please

2005-07-11 Thread Chris W. Parker
Robert Cummings 
on Friday, July 08, 2005 5:25 PM said:


> Thus siteMask should have one of the following values:
> 
> (1 << 1) == 2   // only site1 can use the product.
> (1 << 2) == 4   // only site2 can use the product.
> ((1 << 1) | (1 << 2)) == 6  // both sites can use the product.

Thanks for the example.

But I'm still at a loss as to what strategy I should take regarding
tables.

Should I create two databases where one database has the product
information and the other does not? Or should I create one giant
database with duplicate tables? That is, one database with 'customers'
and 'customers_two'?



Thanks,
Chris.

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



[PHP] Changing directory permissions???

2005-07-11 Thread Al

Is there a way to change directory permissions with pre php5.0? Linux/Apache

I'm designing a CM application and would like my code to enable non-techies to be able to create a 
simple text file. [e.g., directory temporarilly from 755 to 757 and then back again.]


PHP5.0 has a chmod; but not, 4.3.x

Thanks

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



Re: [PHP] Changing directory permissions???

2005-07-11 Thread Philip Hallstrom

Is there a way to change directory permissions with pre php5.0? Linux/Apache

I'm designing a CM application and would like my code to enable non-techies 
to be able to create a simple text file. [e.g., directory temporarilly from 
755 to 757 and then back again.]


PHP5.0 has a chmod; but not, 4.3.x


Huh?  chmod has been around since V3...

http://us2.php.net/chmod

chmod
(PHP 3, PHP 4, PHP 5)
chmod -- Changes file mode

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



RE: [PHP] Changing directory permissions???

2005-07-11 Thread Jay Blanchard
[snip]
Is there a way to change directory permissions with pre php5.0?
Linux/Apache

I'm designing a CM application and would like my code to enable
non-techies to be able to create a 
simple text file. [e.g., directory temporarilly from 755 to 757 and then
back again.]

PHP5.0 has a chmod; but not, 4.3.x
[/snip]

According to http://www.php.net/chmod it has included since 3.x along
with chgrp and chown

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



[PHP] Re: Help installing on Win2003 server?

2005-07-11 Thread Grosz, Steve (IPG IT)
No, this is on a IIS6 install, not Apache 

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 11, 2005 12:27 PM
To: Grosz, Steve (IPG IT); php-general@lists.php.net
Subject: RE: [PHP] Help installing on Win2003 server?

[snip]
Can someone tell me where I can find some detailed instructions on how
to install PHP on a Win2003 Server?  I've tried to install it using the
PHP instructions, but it doesn't seem to be working, think I'm missing
something.
[/snip]

Did you install Apache?

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



RE: [PHP] Help installing on Win2003 server?

2005-07-11 Thread Jay Blanchard
[snip]
No, this is on a IIS6 install 
[/snip]

Have you read this...
http://us2.php.net/manual/en/install.windows.iis.php ?

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



[PHP] Ugh. Need some advice...

2005-07-11 Thread aaronjw
Sorry for the OT guys but I really need some advice.

I've just started a new company with a friend/associate of mine where we
will be selling about 5 products for now.

Obviously, I don't require a major front-end but I do require excellent
functionality for the back-end. Order Management, export to Quickbooks,
Affiliate/Referral Management, etc.

Due to a time issue I kind of need to get this in place rather quickly and
given the Quickbooks export featurer that's required... development of
this on my own makes it more unlikely.

Can anyone recommend a software package (free or paid... don't care) that
does what I am looking for? Like I said, simplistic in the front-end, but
full featured in the back-end.

Oh, and it must be VERY easy for us to integrate our current
design...quickly.

Thanks and once again sorry for the OT.

Aaron

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



Re: [PHP] Ugh. Need some advice...

2005-07-11 Thread John Nichel

[EMAIL PROTECTED] wrote:

Sorry for the OT guys but I really need some advice.

I've just started a new company with a friend/associate of mine where we
will be selling about 5 products for now.

Obviously, I don't require a major front-end but I do require excellent
functionality for the back-end. Order Management, export to Quickbooks,
Affiliate/Referral Management, etc.

Due to a time issue I kind of need to get this in place rather quickly and
given the Quickbooks export featurer that's required... development of
this on my own makes it more unlikely.

Can anyone recommend a software package (free or paid... don't care) that
does what I am looking for? Like I said, simplistic in the front-end, but
full featured in the back-end.

Oh, and it must be VERY easy for us to integrate our current
design...quickly.


http://www.x-cart.com/

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

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



Re: [PHP] Two websites need to share part of one database, suggestions please

2005-07-11 Thread Brad Pauly
On 7/8/05, Chris W. Parker <[EMAIL PROTECTED]> wrote:
 
> Which option should I go for? Is there another option I'm not
> considering?

Another possibility would be adding a new table that relates products
to sites. This allows a one (product) to many (sites) relationship
without changing the products table. The same could be applied to the
other tables.

- Brad

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



Re: [PHP] Changing directory permissions???

2005-07-11 Thread Al

The key word is "directory"

chmod only works for files

PHP5 has a ftp_chmod; but not 4.3.x


Philip Hallstrom wrote:
Is there a way to change directory permissions with pre php5.0? 
Linux/Apache


I'm designing a CM application and would like my code to enable 
non-techies to be able to create a simple text file. [e.g., directory 
temporarilly from 755 to 757 and then back again.]


PHP5.0 has a chmod; but not, 4.3.x



Huh?  chmod has been around since V3...

http://us2.php.net/chmod

chmod
(PHP 3, PHP 4, PHP 5)
chmod -- Changes file mode


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



Re: [PHP] Changing directory permissions???

2005-07-11 Thread Philip Hallstrom



The key word is "directory"

chmod only works for files

PHP5 has a ftp_chmod; but not 4.3.x


It works on directories for me...

% php -v
PHP 4.3.4 (cli) (built: Jul 19 2004 14:52:27)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
% mkdir d
% ll -d d
drwxr-xr-x  2 philip  philip  512 Jul 11 12:21 d/
% php

% ll -d d
drwxrwxrwx  2 philip  philip  512 Jul 11 12:21 d/

-philip




Philip Hallstrom wrote:
Is there a way to change directory permissions with pre php5.0? 
Linux/Apache


I'm designing a CM application and would like my code to enable 
non-techies to be able to create a simple text file. [e.g., directory 
temporarilly from 755 to 757 and then back again.]


PHP5.0 has a chmod; but not, 4.3.x



Huh?  chmod has been around since V3...

http://us2.php.net/chmod

chmod
(PHP 3, PHP 4, PHP 5)
chmod -- Changes file mode


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



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



RE: [PHP] Ugh. Need some advice...

2005-07-11 Thread Jim Moseby
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 11, 2005 2:42 PM
> To: php-general@lists.php.net
> Subject: [PHP] Ugh. Need some advice...
> 
> 
> Sorry for the OT guys but I really need some advice.
> 
> I've just started a new company with a friend/associate of 
> mine where we
> will be selling about 5 products for now.
> 
> Obviously, I don't require a major front-end but I do require 
> excellent
> functionality for the back-end. Order Management, export to 
> Quickbooks,
> Affiliate/Referral Management, etc.
> 
> Due to a time issue I kind of need to get this in place 
> rather quickly and
> given the Quickbooks export featurer that's required... development of
> this on my own makes it more unlikely.
> 
> Can anyone recommend a software package (free or paid... 
> don't care) that
> does what I am looking for? Like I said, simplistic in the 
> front-end, but
> full featured in the back-end.
> 
> Oh, and it must be VERY easy for us to integrate our current
> design...quickly.
> 
> Thanks and once again sorry for the OT.
> 
> Aaron


www.oscommerce.org  <== web front end, free, relatively easy to get going

http://www.oscommerce.com/community/contributions,2847/category,all/search,q
uickbooks

^== article about a free plugin for oscommerce to interface directly with
quickbooks.

JM 

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



RE: [PHP] Help installing on Win2003 server?

2005-07-11 Thread Grosz, Steve (IPG IT)
 Yes, I have looked at that info, but am still having a problem.

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 11, 2005 12:39 PM
To: Grosz, Steve (IPG IT); php-general@lists.php.net
Subject: RE: [PHP] Help installing on Win2003 server?

[snip]
No, this is on a IIS6 install
[/snip]

Have you read this...
http://us2.php.net/manual/en/install.windows.iis.php ?

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



Re: [PHP] Changing directory permissions???

2005-07-11 Thread Al

Philip Hallstrom wrote:



The key word is "directory"

chmod only works for files

PHP5 has a ftp_chmod; but not 4.3.x



It works on directories for me...

% php -v
PHP 4.3.4 (cli) (built: Jul 19 2004 14:52:27)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
% mkdir d
% ll -d d
drwxr-xr-x  2 philip  philip  512 Jul 11 12:21 d/
% php

% ll -d d
drwxrwxrwx  2 philip  philip  512 Jul 11 12:21 d/

-philip




Philip Hallstrom wrote:

Is there a way to change directory permissions with pre php5.0? 
Linux/Apache


I'm designing a CM application and would like my code to enable 
non-techies to be able to create a simple text file. [e.g., 
directory temporarilly from 755 to 757 and then back again.]


PHP5.0 has a chmod; but not, 4.3.x




Huh?  chmod has been around since V3...

http://us2.php.net/chmod

chmod
(PHP 3, PHP 4, PHP 5)
chmod -- Changes file mode



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



That is because your php code made the directory and is therefore the owner.

My directory already exists and was made by ftp.

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



Re: [PHP] Help installing on Win2003 server?

2005-07-11 Thread John Nichel

Grosz, Steve (IPG IT) wrote:

 Yes, I have looked at that info, but am still having a problem.



And that problem is?  Error messages?  Logs?

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

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



Re: [PHP] Changing directory permissions???

2005-07-11 Thread Philip Hallstrom

That is because your php code made the directory and is therefore the owner.

My directory already exists and was made by ftp.


Well, in that case you are toast... nothing short of becoming the 'ftp' 
user or becoming the superuser or becoming a member of the group that 
directory belongs to is going to let you change permissions


good luck!

-philip

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



RE: [PHP] Help installing on Win2003 server?

2005-07-11 Thread Grosz, Steve (IPG IT)
I get a message in the browser saying it can't find the file, will find 
standard .htm or .cfm files, but when I try to browse to a .php file, nothing. 

-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 11, 2005 1:39 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Help installing on Win2003 server?

Grosz, Steve (IPG IT) wrote:
>  Yes, I have looked at that info, but am still having a problem.


And that problem is?  Error messages?  Logs?

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

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

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



Re: [PHP] Two websites need to share part of one database, suggestions please

2005-07-11 Thread André Medeiros
What about using web-services (something ala xml?). Could that be
considered an option?

On 7/11/05, Brad Pauly <[EMAIL PROTECTED]> wrote:
> On 7/8/05, Chris W. Parker <[EMAIL PROTECTED]> wrote:
> 
> > Which option should I go for? Is there another option I'm not
> > considering?
> 
> Another possibility would be adding a new table that relates products
> to sites. This allows a one (product) to many (sites) relationship
> without changing the products table. The same could be applied to the
> other tables.
> 
> - Brad
> 
> --
> 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] Register globals and ini_set

2005-07-11 Thread Philip Olson

>> If i use, at the beginning of my scripts,
>> ini_set('register_globals', 0), register globals will be
>> turned off?

> if you have php <= 4.2.3 yes, otherwise no.
> it has to be set in php.ini, .htaccess, or httpd.conf

You may NEVER set register_globals at runtime with
ini_set() regardless of PHP version.

Regards,
Philip

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



Re: [PHP] Ugh. Need some advice...

2005-07-11 Thread aaronjw
> "John Nichel" <[EMAIL PROTECTED]> wrote:

> http://www.x-cart.com/

Yeah, I downloaded this to play aorund with it.

My problem is I am not that great at working with template engines/system.

I don't know where the f#!@ to change anything and the documentation isn't
all that self explanatory.

>From the feature list, I'd like to use this software. It DOES do that I
need. It's just integrating it with our design... :(

Thanks John.

Aaron

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



Re: [PHP] Changing directory permissions???

2005-07-11 Thread Steve Buehler

At 02:13 PM 7/11/2005, you wrote:

Philip Hallstrom wrote:

Is there a way to change directory permissions with pre php5.0? Linux/Apache

I'm designing a CM application and would like my code to enable 
non-techies to be able to create a simple text file. [e.g., 
directory temporarilly from 755 to 757 and then back again.]


PHP5.0 has a chmod; but not, 4.3.x


Huh?  chmod has been around since V3...
http://us2.php.net/chmod
chmod
(PHP 3, PHP 4, PHP 5)
chmod -- Changes file mode

The key word is "directory"

chmod only works for files

PHP5 has a ftp_chmod; but not 4.3.x


Chmod does NOT "only" work for files.  Not sure about pre 4.1.2, but 
from 4.1.2 and up, it appears that on a linux/unix system, php's 
chmod treats directories like they where filesfor the most 
part.  My php code did not make the directory, but was run by the 
user that did make the directory.  Yes, I can see where there would 
be a problem if the directory was created by one user and the php 
script was executed by another userlike "apache".  But in the 
case where a user created a file with certain permissions and the 
script was run by another user, like apache, then it is 
understandable that php's chmod wouldn't work on it.  That doesn't 
mean that php's chmod will only work on files.  It only means that it 
has to have permission on the file to make the changes.


Steve

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



Re: [PHP] Ugh. Need some advice...

2005-07-11 Thread phpninja
 There is not going to be 1 easy solution that you can just magically tie in 
to your existing design. No matter what solution you chose, you are going to 
have to hack around to get it all working (any pre-written script). If it 
"DOES" everything you need, then you are not going to get any further with 
any other product. You are eventually going to have to succumb to 
integrating it with your existing design because the only other choice you 
have is writing your own cart/back end.
 [EMAIL PROTECTED]
  >> "John Nichel" <[EMAIL PROTECTED]> wrote:

>> *http://www.x-cart.com/* 

>Yeah, I downloaded this to play aorund with it.

>My problem is I am not that great at working with template engines/system.

>I don't know where the f#!@ to change anything and the documentation isn't 
all that self explanatory.

>From the feature list, I'd like to use this software. It DOES do that I 
need. It's just integrating it with our design... :(

>Thanks John.

>Aaron

>--

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


Re: [PHP] Ugh. Need some advice...

2005-07-11 Thread aaronjw
>  There is not going to be 1 easy solution that you can just magically tie
> in
> to your existing design. No matter what solution you chose, you are going
> to
> have to hack around to get it all working (any pre-written script). If it
> "DOES" everything you need, then you are not going to get any further with
> any other product. You are eventually going to have to succumb to
> integrating it with your existing design because the only other choice you
> have is writing your own cart/back end.
>  [EMAIL PROTECTED]

Thanks. Appreciate your words.

I agree with you. Just a question now of whether to hire them to do the
design integration or attempt to figure it out ourselves. With a new
start-up, money is one thing we don't have while time is something we do
have.

The sadder part is, I could probably write the cart/back-end in the same
time it took me to figure out the templating but obviously with less
features.

Thanks again for replying.

Aaron

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



RE: [PHP] Two websites need to share part of one database, suggestions please

2005-07-11 Thread Chris W. Parker
André Medeiros 
on Monday, July 11, 2005 12:44 PM said:

> What about using web-services (something ala xml?). Could that be
> considered an option?

No because I don't how to use that stuff. :)


Chris.

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



Re: [PHP] Changing directory permissions???

2005-07-11 Thread Al

Steve Buehler wrote:

At 02:13 PM 7/11/2005, you wrote:


Philip Hallstrom wrote:

Is there a way to change directory permissions with pre php5.0? 
Linux/Apache


I'm designing a CM application and would like my code to enable 
non-techies to be able to create a simple text file. [e.g., 
directory temporarilly from 755 to 757 and then back again.]


PHP5.0 has a chmod; but not, 4.3.x



Huh?  chmod has been around since V3...
http://us2.php.net/chmod
chmod
(PHP 3, PHP 4, PHP 5)
chmod -- Changes file mode


The key word is "directory"

chmod only works for files

PHP5 has a ftp_chmod; but not 4.3.x



Chmod does NOT "only" work for files.  Not sure about pre 4.1.2, but 
from 4.1.2 and up, it appears that on a linux/unix system, php's chmod 
treats directories like they where filesfor the most part.  My php 
code did not make the directory, but was run by the user that did make 
the directory.  Yes, I can see where there would be a problem if the 
directory was created by one user and the php script was executed by 
another userlike "apache".  But in the case where a user created a 
file with certain permissions and the script was run by another user, 
like apache, then it is understandable that php's chmod wouldn't work on 
it.  That doesn't mean that php's chmod will only work on files.  It 
only means that it has to have permission on the file to make the changes.


Steve

Thanks for the clarification Steve.

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



Re: [PHP] Two websites need to share part of one database, suggestions please

2005-07-11 Thread André Medeiros
XML is quite easy. Let's say you're making a search for books, and you
have site1.com searching site2.com for some stuff.

site2.com could have some sort of "back end" like

http://site2.com/_backend/search.php?keywords=a+book

That would search it's database for the keywords "a book".

It could generate XML like:



1
A Children's Book


2
A Book about Everything!



To do this request, PHP has the fopen command, that will allow you to
read from URLs too (see http://pt.php.net/fopen).

After reading the XML code into a string, just parse it. There are
hundreds of classes on phpclasses.org. Just take a pick :)

I hope this was helpful. If you need me to explain something more
thoroughly, let me know.

Good luck :)

On 7/11/05, Chris W. Parker <[EMAIL PROTECTED]> wrote:
> André Medeiros 
> on Monday, July 11, 2005 12:44 PM said:
> 
> > What about using web-services (something ala xml?). Could that be
> > considered an option?
> 
> No because I don't how to use that stuff. :)
> 
> 
> Chris.
>

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



Re: [PHP] using require

2005-07-11 Thread Tim Boring
Hello!

On Fri, 2005-10-14 at 11:33 -0700, Cima wrote:
> hi all,
> 
> 
> i have my web site working something like this: in every php script i have 
> require(auth.php). this auth.php has my connection to my postgresql server 
> and database along with some other stuff i need for the user to be 
> authenticated to my web site. when i log on, this auth.php connects to the 
> dbserver and checks if my username and password are stored and then i go to a 
> home page. my connection is stored in $dbh. 
> what happens when i start moving through all these web pages (php scripts), 
> each requires auth.php, with respect to the connection? is a new connection 
> established for every web page i go into that uses my $dbh for querying 
> purposes or is it the same connection i originally made when i first logged 
> into the web site?
> 

According to the manual
(http://www.php.net/manual/en/function.pg-connect.php), you should be
using the same connection.

If I might make some recommendations: unless you're doing something
unique as part of the login process, it might be worthwhile looking at
the LiveAdmin authentication system.  It's available via pear.  It
allows you to set up authentication containers, which can be an XML file
holding your usernames/passwords, or a database like Postgres.  It also
has containers for permissions.  I've tested in a couple of simple apps
and it works fairly well.

If LiveAdmin doesn't fit your needs, then you might look at Propel
(http://propel.phpdb.org/trac/), it's an object persistence layer which
provides a couple of benefits: 1) it abstracts your database so you
don't have hand-coded SQL scattered throughout your PHP code and you
don't have to mess around with the details of connecting to the db; 2)
it provides a pretty sweet build tool that takes an SQL schema
definition (marked up in XML) for a database and generates not only your
SQL to create the tables but also your PHP classes.  Then in your
application you only need to be concerned with using the generated
classes.  

I realize this isn't what you asked about, but I've used Propel in a
couple of small web apps and I've been really happy with it.  It cut the
number of lines of code in my main application by almost half.
Moreover, it helped simplify making changes to the db: if I need to
change a field in a table, add/delete a field, or add a whole new table,
I simply make the change in my schema file, re-generate my PHP classes,
and then use the new classes in my app.  I don't have to search through
a bunch of code to find all the instances of a particular SQL statement.

HTH,
Tim

 

> 
> any info will be highly appreciated!!
> 
> 
> thanx.
-- 
Tim Boring
IT Manager
Automotive Distributors Warehouse
2981 Morse Road
Columbus, OH 43231
Toll Free: 800-421-5556, x3007
Direct: 614-532-4240
E-mail: [EMAIL PROTECTED]

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



RE: [PHP] Two websites need to share part of one database, suggestions please

2005-07-11 Thread Chris W. Parker
André Medeiros 
on Monday, July 11, 2005 3:08 PM said:

> XML is quite easy. Let's say you're making a search for books, and you
> have site1.com searching site2.com for some stuff.
> 
> site2.com could have some sort of "back end" like

I see what you're saying. But that won't work in my situation because I don't 
simply want to read data from a specific site. I need to also 
modify/create/delete product records and coming up with something in XML will 
just add an extra level of complexity (that doesn't seem necessary).

Thanks for your input though.


Chris.

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



[PHP] Some CLASS file help, should be a quick answer...

2005-07-11 Thread Matt Babineau
Ok so I set a variable at the top of my class definition

var $tmp;
< bunch of functions>

Function $func1() {

$n = $this->result_from_another_function($var1, $var2, $var3); //
this function returns an ARRAY
//print_r($n);
$this->tmp = $n;
}


When I try to set $this->tmp = $n, it doesn't work!? But if I print_r($n)
the array that gets returned by $this->result_from_another_function($var1,
$var2, $var3) gets printed out and I can't understand this!! There is
plenty of data in $n, but not in $this->tmp!!!

I've read a couple tutorials but none explain this very wellanyone have
any thoughts?


Thanks,

Matt Babineau
Criticalcode
858.733.0160
[EMAIL PROTECTED]
http://www.criticalcode.com
 

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



[PHP] how to delete lines in a txt file using php.

2005-07-11 Thread babu
Hi i have a txt file like 
[SUBSTRAT]
TYP=25x25_10
SUBSTRATNAME=S112
PIXEL=5
OPERATOR=Zi
KOMMENTAR=dunkel
INTENSITAET=1000.00
[MESSUNG]
DATUM=03.01.2005
UHRZEIT=11:22
MESSUNG=SWEEP_UI
 
i want to delete lines which start with '[' and 'TYP'. i have multiple such 
files.i have used strstr method. i have written code for it, but it results in 
deletion of complete data from files. Can anyone check where the logic goes 
wrong.
here is my file.

 


-
Yahoo! Messenger NEW - crystal clear PC to PCcalling worldwide with voicemail

Re: [PHP] zlib.output_compression

2005-07-11 Thread LacaK
I see contents using Network Monitor, so I se response header and 
contents andthey are uncompressed, so somresion does not uccured.


It's likely the browser is uncomressing it before you ever see it.  I
would telnet to port 80 and make an HTTP request to see for sure.




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



Re: [PHP] how to delete lines in a txt file using php.

2005-07-11 Thread Richard Lynch
On Mon, July 11, 2005 4:13 pm, babu said:
>  $f=fopen($file,"w");

http://php.net/fopen

"w" will open the file for WRITING, a fresh, new, EMPTY file.

You want "r+" or "a+" or "w+" or something similar.

-- 
Like Music?
http://l-i-e.com/artists.htm



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



Re: [PHP] Some CLASS file help, should be a quick answer...

2005-07-11 Thread Richard Lynch
On Mon, July 11, 2005 4:05 pm, Matt Babineau said:
> Ok so I set a variable at the top of my class definition
>
> var $tmp;
> < bunch of functions>
>
> Function $func1() {

You don't really have a $ before the function name, right?...

>   
>   $n = $this->result_from_another_function($var1, $var2, $var3); //
> this function returns an ARRAY
>   //print_r($n);
>   $this->tmp = $n;

//check it here:
print_r($this->tmp);

> }
>
>
> When I try to set $this->tmp = $n, it doesn't work!? But if I print_r($n)
> the array that gets returned by $this->result_from_another_function($var1,
> $var2, $var3) gets printed out and I can't understand this!! There is
> plenty of data in $n, but not in $this->tmp!!!

All we know so far, from the code that you've posted is:
1. You've done something wrong
2. It's not actually *IN* the code you showed us; it's somewhere else.

Throw more code up in pastebin or something.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] Help installing on Win2003 server?

2005-07-11 Thread Richard Lynch
On Mon, July 11, 2005 12:43 pm, Grosz, Steve (IPG IT) said:
> I get a message in the browser saying it can't find the file, will find
> standard .htm or .cfm files, but when I try to browse to a .php file,
> nothing.

What is the EXACT error message?...

An error message isn't "nothing" -- It's an error message.

But of the 3,234,689 possible error messages you are seeing, it's hard to
tell which one you've got.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] creating of multi dimensional arrays with unknown depth

2005-07-11 Thread Richard Lynch
On Mon, July 11, 2005 10:56 am, Ben-Nes Yonatan said:
> Hi all!
>
> I got a string which include information for categories that I need to
> build, the string is built like this:
> $string   = "val1~~val2~~val3~~val4~~val5"
>
> Now, I want to create from this string a multi dimensional array and not
> one dimension array as explode('~~', $string) will give me.
>
> The desired result from this string is:
>
> $array['val1']= 'whatever';
> $array['val1']['val2']= 'whatever';
> $array['val1']['val2']['val3']= 'whatever';
> $array['val1']['val2']['val3']['val4']= 'whatever';
> $array['val1']['val2']['val3']['val4']['val'5]= 'whatever';

That's not a valid array construct...

You can't have $array['val1'] be a string ('whatever') and also an array
(['val2'])..

Or is that 5 different examples?

Untested Code:


-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] Quidelines for Site visitor counter

2005-07-11 Thread William Stokes
Hello,

I would like to add a visitor counter to my site. I know that there are 
plenty of free and nice applications/scripts for this avalable but I would 
like to write my own. I'm at the moment thinking either to make graphical or 
text based user interface for this statistics counter. So I'm asking your 
advice on how to draw those nice graphs with PHP? Any online manuals or 
books that can help since I've never done anything like this before. The 
server supports drawing graphical stats with PHP.

Here's a link that shows roughly what I'm looking for:

http://bbclone.de/demo/show_time.php?lng=en

Thanks
-Will 

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



Re: [PHP] how to get time cost for MySQL query

2005-07-11 Thread Richard Lynch
Try doing an "explain $query" query.

I *think* MySQL might cache the query/results enough that you'd get an
accurate estimate...

You could also turn MySQL Logging on.

Or, rather crudely, time it in PHP:

$query_start_time = microtime();
$result = mysql_query($query);
$query_end_time = microtime();

It's not going to be 100% accurate, of course, as the overhead from PHP to
MySQL is there, and if you get a *TON* of data in the query, then there's
maybe a LOT of overhead there...

But maybe you're better off including that anyway.

On Mon, July 11, 2005 10:23 am, x said:
> I did checked both of them and it seems they do not provide such info...
> thanks
> "Philip Hallstrom" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>>> Hi, Is there any MySQL lib function which can provide time cost for
>>> last
>>> query?
>>>
>>
>> Maybe...
>>
>> http://us2.php.net/manual/en/function.mysql-info.php
>> http://us2.php.net/manual/en/function.mysql-stat.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] libssl.so.0.9.7

2005-07-11 Thread Richard Lynch
Check if you've got "leftover" 0.9.7 library sitting around.

Perhaps you put 0.9.8 in /usr/local/lib, but 0.9.7 is still in /usr/lib

If you have "locate" you can just do:
locate libssl.so

and see what turns up

On Mon, July 11, 2005 10:09 am, [EMAIL PROTECTED] said:
> Hello,
>
> I've upgraded to OpenSSL 0.9.8 and PHP 4.4.0 and get the following error
> durring compilation.
>
> chmod 755 /var/tmp/php-4.4.0-root/usr/lib/httpd/modules/libphp4.so
> Installing PHP CLI binary:/var/tmp/php-4.4.0-root/usr/bin/
> Installing PHP CLI man page:
> /var/tmp/php-4.4.0-root/usr/share/man/man1/
> Installing shared extensions: /var/tmp/php-4.4.0-root/usr/lib/php4/
> Installing PEAR environment:  /var/tmp/php-4.4.0-root/usr/share/pear/
> /usr/src/openna/BUILD/php-4.4.0/sapi/cli/php: error while loading shared
> libraries: libssl.so.0.9.7: cannot open shared object file: No such file
> or directory
> make[1]: *** [install-pear-installer] Error 127
> make: *** [install-pear] Error 2
> error: Bad exit status from /var/tmp/rpm-tmp.70944 (%install)
>
> Look like PHP still check for version 0.9.7 even if 0.9.8 is now
> installed. Does someone on this list have a patch or information to fix
> this problem? Thanks.
>
> Gerhard,
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] constructors in PHP

2005-07-11 Thread Richard Lynch
On Mon, July 11, 2005 10:04 am, Alessandro Rosa said:
>> > As far as I know, its not a security issue, but a structure/design
> issue.
>>
>> The issue is that in php you can't definitely say what type a variable
>> is , whereas in c++ you can say this variable is a string, this one a
>> int, ….
>
> But, right because PHP is weakly typed, multiple constructors could be
> handled easier, I suppose ... isn't true?

It wouldn't be any easier/harder, really...

Your method/function definition would still have specific data types it
expected to receive.

Your function call would still know what data types it is dealing with,
and would call the right one.

Actually, it's a bit "harder" in weakly-typed languages, as the
interpreter has to do more work at the instant the function is called, to
determine what types are used.  In C++, you're the compiler *KNOWS* what
the types are at compile time.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] still trying to cURL.

2005-07-11 Thread Richard Lynch
Try closing your cURL handle and making a new one before you get the page
that's giving you trouble.

Sometimes cURL maintains "state" that it shouldn't.

You'll maybe need to get the Cookies "by hand" from the header and send
them back as headers -- Not sure a Cookie Jar can survive a new handle.

On Mon, July 11, 2005 9:59 am, Jon said:
> I have minimal experience with cURL but have had some success with it.
>
> I am trying to download some invoices that are posted every month.  I am
> able to get a login to the https: and get the first few pages but when I
> try
> to get the invoices I get an error page with this content.
>
> HTTP Status 500 -
> 
> 
> type Exception report
> message
> description The server encountered an internal error () that prevented it
> from fulfilling this request.
> exception
> java.lang.NullPointerException
>  ..
> 39 lines of error messages
>
> Everything seems to work fine up to the point that I am given a jsessionID
> on the third page that is curled.  It seems to be writing the info to the
> cookie file but I don't know if I am handling it incorrectly or if that
> has
> anything to do with it.
>
> I have downloaded LiveHTTPHeaders version 0.10 available here
> http://livehttpheaders.mozdev.org/index.html to see if I was missing any
> of
> the information that has been passed and having compared the log file I
> can
> say that I am passing the same information as the mozilla browser.  does
> anyone have any suggestions.
>
> and an RTFM is fine but I have been over several of the links posted
> http://curl.haxx.se/docs/ so if you tell me RTFM please send my idiot self
> to the correct page.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] constructors in PHP

2005-07-11 Thread Richard Lynch
On Mon, July 11, 2005 9:53 am, Psystorm said:
> Burhan Khalid wrote:
>
>> Alessandro Rosa wrote:
>>
>>> Thanks to all for clear responses!
>>>
>>> So just a question now, why have not multiple constructors been
>>> implemented?
>>> Are there some security issues related to them ?
>>
>>
>> As far as I know, its not a security issue, but a structure/design
>> issue.
>
> The issue is that in php you can't definitely say what type a variable
> is , whereas in c++ you can say this variable is a string, this one a
> int, ….

That's guaranteed not the issue -- unless the performance would suck too
badly...

Lisp has loosely-typed data, and had multiple constructors log
before C++ was a gleam in Strousap's (sp?) eye.

The real issue, most likely, is not making PHP so [bleep] complex nobody
normal wants to use it :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Quidelines for Site visitor counter

2005-07-11 Thread Richard Lynch
On Mon, July 11, 2005 10:58 pm, William Stokes said:
> I would like to add a visitor counter to my site. I know that there are
> plenty of free and nice applications/scripts for this avalable but I would
> like to write my own. I'm at the moment thinking either to make graphical
> or
> text based user interface for this statistics counter. So I'm asking your
> advice on how to draw those nice graphs with PHP? Any online manuals or
> books that can help since I've never done anything like this before. The
> server supports drawing graphical stats with PHP.
>
> Here's a link that shows roughly what I'm looking for:
>
> http://bbclone.de/demo/show_time.php?lng=en

If you want a fancy graph, use JPGraph (?) -- Google for "PHP Graph" it
will turn up.

If you just want to draw some numbers in an image:
http://php.net/gd

-- 
Like Music?
http://l-i-e.com/artists.htm

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