Re: [PHP] Re: Good and free encoder for PHP5

2004-12-14 Thread Octavian Rasnita
Oh yeah but probably the problem is that it wasn't updated in order to work
with PHP 5.
Or does it does?

Teddy

- Original Message - 
From: Manuel Lemos [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 15, 2004 1:16 AM
Subject: [PHP] Re: Good and free encoder for PHP5


Hello,

Mário gamito said the following on 12/14/2004 08:51 AM:
 Does anyone around here knows a *good* and *free* encoder for PHP5 ?
 I used to run Turck, but it seems that somehow it has been discontinued.
 (At least, the last release occured about a year ago).

Did it stop working? My Turck copy still works. ;-)

-- 

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



Re: [PHP] Google search indexing

2004-12-14 Thread Octavian Rasnita
Yes Google index the entire url including the HTTP_QUERY_STRING (the part
after the question mark).
You will see many warnings in old tutorials telling that the search enginnes
don't index the entire url, but I don't think it is the case anymore.

However, if you want to avoid this, or to just create URLS more simple to
remember, use the Apache module mod_rewrite.

This way, you can let the server automaticly trranslate an url like
http://www.site.com/program/var1/var2/var3 in a URl like
http://www.site.com/program?v1=var1v2=var2v3=var3 ...or any other
translations.

The first link will be easier to remember and the search engines will see it
as a static web page.

The search engines won't submit any form, so they are not parsed at all. Use
common links if you want them to be indexed.

Teddy

- Original Message - 
From: Jason FB [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, December 14, 2004 8:04 PM
Subject: [PHP] Google search indexing


Follow up question:

At 4:39 PM + 12/14/04, Richard Davey wrote:
sp does anybody know how does google (and other search engines)
index websites
sp implemented in PHP + MySQL? For instance, sites which use PHP based CMS
sp (Content Management Systems)?

It doesn't. It indexes the HTML that they output. As far as Google is
concerned you could have a thousand trained monkies typing like mad
for your CMS, it still only cares about the output - the HTML.

sp Someone told us google spiders do call for the pages so they only see
the
sp resulting HTML code. Is that right?


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


[PHP] installing php 5.02 and Apache 2

2004-12-06 Thread Octavian Rasnita
Hi all,

I have installed Apache 2 under Fedora Core 2 and now I would like to
install PHP 5.02 as a server module.

I have downloaded and unpacked PHP 5.02, and I think that I need to run
./configure now but I don't know which parameters I need to add.

I have added --prefix=dir --with-mysql=dir --with-curl

But I want to add many other modules I might need. Do I need to specify the
entire list of modules in the command line? Or how can I create and choose a
config file?

And please tell me what option do I need to install the Apache 2 module.

I have seen some parameters in the ./configure --help instructions for
installing the module for Apache 2, but I saw that that module is only
experimental. Isn't there a working module for PHP 5.02 and Apache 2?

And do you know where the Apache 2 module is put after installing php? (in
order to specify it in httpd.conf).

Thank you.

Teddy

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



[PHP] Compiling a php program

2004-11-30 Thread Octavian Rasnita
Hi all,

Does anyone know a free php compiler that can create a single .exe program
with all the necessary libraries included in it?

I don't want that .exe file to require other .dll files.

I have tried a compiler named PriadoBlender or something like that, but it
has a bad interface which is not accessible for the blind, I was able to use
the program by editing the xml configuration file and inserting there the
input data, but it created a .exe file and in the destination dir it put
many other .dll files...

Thank you.

Teddy

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



[PHP] Messengers libraries?

2004-11-30 Thread Octavian Rasnita
Hi all,

Does anyone know if there are free php libraries for creating MSN or Yahoo
or Skype or AOL Messenger clients?

Thanks.

Teddy

Teddy

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



Re: [PHP] Compiling a php program

2004-11-30 Thread Octavian Rasnita
Thanks. I found encPHP very easy to use.

Now, I have another question. I would like to be able to encrypt the PHP
code for distributing to others. Is there a method of encrypting the code
before creating a binary executable from it?

I have seen that EncPHP just unpacks its content into a temp directory and
run the php program from that location, so the php code can be seen.

Thanks.


Teddy

- Original Message - 
From: Mike [EMAIL PROTECTED]
To: 'Octavian Rasnita' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, November 30, 2004 3:13 PM
Subject: RE: [PHP] Compiling a php program


I've used EncPHP (http://sourceforge.net/projects/encphp/) a long while ago
just to see how it'd work. It worked just fine - but the binaries get very
large, very fast. (as one would expect).

I also came across BinaryPHP (http://sourceforge.net/projects/binaryphp/)
while searching for EncPHP (I had forgotten the name) and it might be worth
checking out. Might get some smaller binaries if you're that serious about
it.

Either way - good luck. Though I find that if you want to write a binary
that other languages that compile directly to them are better solutions.

-M


 -Original Message-
 From: Octavian Rasnita [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, November 30, 2004 8:01 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Compiling a php program

 Hi all,

 Does anyone know a free php compiler that can create a single
 .exe program with all the necessary libraries included in it?

 I don't want that .exe file to require other .dll files.

 I have tried a compiler named PriadoBlender or something like
 that, but it has a bad interface which is not accessible for
 the blind, I was able to use the program by editing the xml
 configuration file and inserting there the input data, but it
 created a .exe file and in the destination dir it put many
 other .dll files...

 Thank you.

 Teddy

 --
 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] Is this a bug in PHP 4.3.4?

2004-11-29 Thread Octavian Rasnita
Hi all,

I use the  following program:

?php

print_form();
print_quotes ();

function print_form () {
ob_start();

output_add_rewrite_var(sort, sorting);

echo EOF
form
...
/form
EOF;

ob_flush();
}

function print_quotes () {
output_reset_rewrite_vars();

echo EOF
table
...
/table
EOF;
}

?


The result printed is:

Content-type: text/html
X-Powered-By: PHP/4.3.4

forminput type=hidden name=sort value=sorting /
...
/table
...
/table

Well, do you have any idea why PHP prints:

/table

...instead of:

/formtable

I have tried this program under Fedora Core 2 in command line mode and on an
Apache web server with the same results.

Do you have suggestions for making this program work and why does this
happen?

Thank you.

Teddy

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



Re: [PHP] Is this a bug in PHP 4.3.4?

2004-11-29 Thread Octavian Rasnita
Thank you. I will try that solution if it works, but the question still
remains...
Is PHP so buggy? The 'here document' should work without a problem in PHP
also.

My code works fine with PHP 5 (fortunately) under Windows, but it doesn't
work with PHP 4.3.4 under Linux.

I think I need to upgrade php under Linux also...

Teddy

- Original Message - 
From: Raditha Dissanayake [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, November 29, 2004 5:29 PM
Subject: Re: [PHP] Is this a bug in PHP 4.3.4?


Octavian Rasnita wrote:

Hi all,

I use the  following program:




function print_quotes () {
output_reset_rewrite_vars();

echo EOF
table
...
/table
EOF;
}


I have tried this program under Fedora Core 2 in command line mode and on
an
Apache web server with the same results.

Do you have suggestions for making this program work and why does this
happen?


I think the problem is with your 'here document' this is the traditional
way of doing things in perl but in php you could  'go back into HTML. by
using the '?' sequence. Thus your program might become

function print_quotes () {
output_reset_rewrite_vars();
 ?
 table
 ...
 /table
?

}


There are pros and cons of both approach but the bit of code i have
given will produce the expected result.

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



[PHP] Range: bytes=x-y

2004-11-28 Thread Octavian Rasnita
Hi all,

Does anyone know why some servers don't return a partial content when I use
the HTTP header:

Range: bytes=100-200

It should return the content of the page starting from byte 100 until the
byte 200, but it still returns the whole page.

Does this happen when the page is sent unbuffered?
Or what else could be?

And can I do something to force those servers to send just a part of the
page?

Thank you.

Teddy

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



Re: [PHP] automatic responder

2004-11-27 Thread Octavian Rasnita
You just need to get the HTTP_ACCEPT_LANGUAGE environment variable and see
the order of the prefered languages.

After that, you see if you have a translation for the first language, if the
site doesn't have it, try for the next language, and so on.

Teddy

- Original Message - 
From: Alessandro Rosa [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, November 27, 2004 3:14 PM
Subject: [PHP] automatic responder


Thank you for all responses about this topic.

I would also solve a more practical doubt finally: if I use
for example the PHP code 'POP3class', as suggested by
Manuel Lemos, it's implicitly meant that it should run periodically
on a web-server (for example, under a timer of a given number
of seconds), don't you?

Example: check pop3 mailbox every 5 secs by php code and
then perform all the required actions.

Alessandro Rosa

-- 
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] Bad PHP error

2004-11-27 Thread Octavian Rasnita
Hi all,

I have tried the following script:

$val = 100;
if (is_int($val)) {
echo $val;
}
else {
echo $val is not an integer\n;
}

The answer is:

100 is not an integer.

Why does this happen? I use PHP 5.

Isn't PHP able to work with values like 10 billion?

Do I need to use a certain special class for dealing with big numbers? How
can I use that class?

Thank you.

Teddy

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



Re: [PHP] Re: Bad PHP error

2004-11-27 Thread Octavian Rasnita
Ok, I understand. But what can I do if I want to print big numbers like 123
billion? (but real numbers, not those written with the E letter in them?

Is this possible with PHP or I need to do it with another language?

Thank you.

Teddy


From: M. Sokolewicz [EMAIL PROTECTED]


Octavian Rasnita wrote:

 Hi all,

 I have tried the following script:

 $val = 100;
 if (is_int($val)) {
 echo $val;
 }
 else {
 echo $val is not an integer\n;
 }

 The answer is:

 100 is not an integer.

 Why does this happen? I use PHP 5.

 Isn't PHP able to work with values like 10 billion?

 Do I need to use a certain special class for dealing with big numbers? How
 can I use that class?

 Thank you.

 Teddy
reply it's treated as a double since integers have a max value of (-2e32
+1 up to) 2e32-1, which is 4,294,967,296 (4 billion and some). However,
you shouldn't really see any difference in working, it's just treated as
  a double inside (a double float, that is). Which means it'll be
written like 1.0e10 internally

-- 
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: Bad PHP error

2004-11-27 Thread Octavian Rasnita
Well, that big number is not converted as a string and printed this way, or
I am missing something.

Here is an example:

?php
$var = 1;
//Here I have also tried inserting $var = (string) $var;
echo $var;
?

This prints:

1E+012

and... not 1 as it should.

I have first tried just echo $var, but I thought that maybe if I put it
between quotes, it will be printed right, but...

Thank you.

Teddy

- Original Message - 
From: M. Sokolewicz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Octavian Rasnita [EMAIL PROTECTED]
Sent: Saturday, November 27, 2004 11:08 PM
Subject: Re: [PHP] Re: Bad PHP error


Marek Kilimajer wrote:

  This would be for unsigned integers. PHP knows only signed integers,
  however. So the limit is 2147483648

Good point :)

When you're outputting it, PHP will convert it back to a string, using
the normal integer representation (which is stored aswell). So that
should be fine ;)

- Tul

Octavian Rasnita wrote:

 Ok, I understand. But what can I do if I want to print big numbers like
123
 billion? (but real numbers, not those written with the E letter in them?

 Is this possible with PHP or I need to do it with another language?

 Thank you.

 Teddy


 From: M. Sokolewicz [EMAIL PROTECTED]


 Octavian Rasnita wrote:


Hi all,

I have tried the following script:

$val = 100;
if (is_int($val)) {
echo $val;
}
else {
echo $val is not an integer\n;
}

The answer is:

100 is not an integer.

Why does this happen? I use PHP 5.

Isn't PHP able to work with values like 10 billion?

Do I need to use a certain special class for dealing with big numbers? How
can I use that class?

Thank you.

Teddy

 reply it's treated as a double since integers have a max value of (-2e32
 +1 up to) 2e32-1, which is 4,294,967,296 (4 billion and some). However,
 you shouldn't really see any difference in working, it's just treated as
   a double inside (a double float, that is). Which means it'll be
 written like 1.0e10 internally


-- 
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: Bad PHP error

2004-11-27 Thread Octavian Rasnita
Thank you. It seems that finally I will need to divide the numbers with
100, make the calculations that way, and specify that the numbers are in
millions, because I can't find any solution with PHP.

bcmath functions are not good, because they need a string to work for, and
not a number, and if I want to make some calculations, the numbers will be
converted to numbers and...

Thanks.

Teddy

- Original Message - 
From: Marek Kilimajer [EMAIL PROTECTED]
To: Octavian Rasnita [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, November 28, 2004 12:39 AM
Subject: Re: [PHP] Re: Bad PHP error


Octavian Rasnita wrote:
 Well, that big number is not converted as a string and printed this way,
or
 I am missing something.

 Here is an example:

 ?php
 $var = 1;
 //Here I have also tried inserting $var = (string) $var;
 echo $var;
 ?

 This prints:


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



Re: [PHP] Re: Bad PHP error

2004-11-27 Thread Octavian Rasnita
Hi,

I also use Win 2k with PHP 5 in command line mode.

It is pretty strange that in an older version of Jaws it works better.

Or... could I make some settings to make it work like in your case?

Teddy

- Original Message - 
From: BAO RuiXian [EMAIL PROTECTED]
To: Octavian Rasnita [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, November 28, 2004 1:58 AM
Subject: Re: [PHP] Re: Bad PHP error


Hello,

Octavian Rasnita wrote:

?php
$var = 1;
//Here I have also tried inserting $var = (string) $var;
echo $var;
?

This prints:

1E+012

and... not 1 as it should.

  

I tried the above example, and I got what you want, i.e. 1. 
My environment is Windows 2k, PHP 4.3.3 and Apache 2.0.47.

Best

Bao

I have first tried just echo $var, but I thought that maybe if I put it
between quotes, it will be printed right, but...

Thank you.

Teddy


  


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



Re: [PHP] Re: Bad PHP error

2004-11-27 Thread Octavian Rasnita
Oh thanks, I hope I will find a good combination that migh help me finally.

Teddy

- Original Message - 
From: BAO RuiXian [EMAIL PROTECTED]
To: M. Sokolewicz [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, November 28, 2004 2:23 AM
Subject: Re: [PHP] Re: Bad PHP error


Hello,

M. Sokolewicz wrote:

 you might want to try using number_format() to change the format back 
 to integer likeness


After I changed to echo number_format($var), I got 1,000,000,000,000:) 
Well, actually this is not my problem. I just tested this for fun.

Best

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



[PHP] Getting the contents of a file

2004-11-25 Thread Octavian Rasnita
Hi all,

I am trying to use the file() function, but without success.

Here is the code:
$url = http://www.rasd.ro/Quotes/11-24-2004.txt;
$file = file($url);

And this is the error:
PHP Parse error:  syntax error, unexpected T_VARIABLE in [FILE] on line 13

The line 13 contains:

$file = file($url);

I get the content of $url in a more complex way, so I cannot put the url to
that file directly in the function file().

Why it is not possible to use a var in file()?

Thanks.

Teddy

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



[PHP] Simple coding question

2004-11-19 Thread Octavian Rasnita
Hi all,

Please tell me which is the shortest method for writing the following code:

$var = $_GET['var'] || 'value';

I want the program to put the value value in the variable $var if the
array element 'var' is not defined or in case it is 0 and I would like to
avoid using that long style with if (..) {...} else {...}...

Thank you.

Teddy

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



[PHP] converting a number

2004-11-18 Thread Octavian Rasnita
Hi all,

I have a number like 1.0122E9 and I want to convert it into a real number in
a common notation and not in that scientific one (with E).

I have seen that very long numbers are always converted automaticly to that
notation and I need to insert that number in  a MySQL database and in that
case MySQL won't calculate well.

Please tell me how to do that in PHP or in MySQL..

Thank you.

Teddy

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



Re: [PHP] converting a number

2004-11-18 Thread Octavian Rasnita
Not exactly. And this query gives me an error.

Thank you.

Teddy

- Original Message - 
From: Warren Vail [EMAIL PROTECTED]
To: Octavian Rasnita [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, November 18, 2004 11:24 AM
Subject: RE: [PHP] converting a number


 
  I have a number like 1.0122E9 and I want to convert it into a
  real number in
  a common notation and not in that scientific one (with E).
 
  I have seen that very long numbers are always converted
  automaticly to that
  notation and I need to insert that number in  a MySQL database and in
that
  case MySQL won't calculate well.
 
  Please tell me how to do that in PHP or in MySQL..
 
 Is this what you were thinking of?

 $query = insert table(floatcol) values(.sprintf(%2.4f,$yourno).) ;


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



Re: [PHP] PHP Supremacy...

2004-11-17 Thread Octavian Rasnita
What do you mean by perl discontinued?

Perl 5 is continuu updated and this year I have seen perl 5.8.1, 5.8.3,
5.8.4, 5.8.5 is almost done.

Perl 6 is planned to run in a precompiled code (like Java programs) in an
environment that will also be able to run programs created in other
programming languages like Python...

For the programs that output web pages PHP is prefered even it is not so
complex like perl for the moment, because PHP is especially created for this
job.

I have seen a web page in which Yahoo explained why they have chosen PHP as
their programming language  for their dynamic web pages and not ASP, java or
C or perl.
(But they say that they also use perl programs for their backend tasks).
(and not ASP or Cold Fusion or other proprietary languages)

Teddy

- Original Message - 
From: Mike [EMAIL PROTECTED]
To: 'Lista de Php-General' [EMAIL PROTECTED]
Sent: Thursday, November 18, 2004 2:05 AM
Subject: RE: [PHP] PHP Supremacy...


I was really sad to see Perl discontinued so many years ago... damned open
source community not taking care of it's own.

-Original Message-
From: Pedro Irán Méndez Pérez [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 17, 2004 5:18 PM
To: Lista de Php-General
Subject: [PHP] PHP Supremacy...

Hello my friends, I need your help in convince to my boss in adopt php for

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



[PHP] Loading an extension

2004-11-16 Thread Octavian Rasnita
Hi all,

 I want to add an extension (CURL, mysql) to a php program without
specifying it in php.ini (because on some servers I might not have the right
to modify that configuration file).

I have tried using the dl() function, but here is an error I get on the
browser when doing this:

Warning: dl() [
function.dl]:
Not supported in multithreaded Web servers - use extension=ext/php_mysql.dll
in your php.ini in D:\broker\html\cotatii.php on line 6

Fatal error: Call to undefined function mysql_connect() in
D:\broker\html\cotatii.php on line 8

Thank you.

Teddy

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



[PHP] Converting to integer

2004-11-16 Thread Octavian Rasnita
Hi all,

I get some values from a MySQL table and some of them are in the format
1000.0, 234.0, etc.

I want those values converted as 1000, 234, and so on, but the other string
values need to remain the same.

I have tried using the function is_numeric to test which of the values
returned from MySQL are numbers, but none of them appear to be a number, so
I cannot convert them.

Thank you for any tips.

Teddy

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



[PHP] Simple XML

2004-11-11 Thread Octavian Rasnita
Hi all,

Does anyone know if PHP has a library for getting the content of an XML file
like XML::Simple in perl?

In that perl library I can get the whole content of an XML file in a
reference to an array of arrays of arrays... with only 3 lines of code.

Is there such a simple method in PHP?

Thank you much.

Teddy

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



[PHP] MySQL

2004-11-09 Thread Octavian Rasnita
Hi all,

Please tell me how to send a null string to be inserted in a MySQL database.

If I do something like:

$string = null;

mysql_query(insert ignore into table(field) values($string));

It gives me an error.

In fact, I have multiple fields to insert, and the error just tell me that
was an error at ... and prints the variables I want to imput and I don't
know what could be the problem.

Do I need to addslashes(), or what else?

Thank you.

Teddy

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



Re: [PHP] Passing regexp substrings to a function

2004-10-25 Thread Octavian Rasnita
Hi,

In perl, you can do something like:

$string =~ s/---piece of text that contains a certain (VALUE) in
it---/function($1)/gse;

This expression replaces its first part with the result of the function
function called with the parameter VALUE.
Is this what you want?

Maybe you can do something like that  using perl regular expressions in
PHP...

Teddy

- Original Message - 
From: Ville Mattila [EMAIL PROTECTED]
To: PHP General Mailing List [EMAIL PROTECTED]
Sent: Monday, October 25, 2004 2:33 PM
Subject: [PHP] Passing regexp substrings to a function


Hi there,

I have a few e-mail templates in a file that should be parsed. A
template can include also some module codes that should be replaced by
a return value of a certain function. For example, if the template
include a text {ProductInfo:1032}, the value 1032 would be passed as
an argument to a function mdlProductInfo() and the whole string would be
replaced by the return value of the function.

One possible way is to loop the string like this:

while(eregi({([a-z])(:[a-z0-9])+}, $template, $regs)) {
list($whole, $function, $valuestring) = $regs;
$values = explode(:, substr($valuestring, 1));

unset($retval);
eval($retval = mdl.$function.(.join(,, $values).););

$template = str_replace($whole, $retval, $template);
}

Any other ideas on this?

Ville

-- 
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] List Etiquette

2004-09-22 Thread Octavian Rasnita
Michael Sims wrote:
 Octavian Rasnita wrote:
 No, there is no way for customizing the headers Outlook Express use
 to put in the email messages.
 I wish there was, because I don't like them also...
 
 Although I haven't used it personally, OE-QuoteFix may help:
 
 http://home.in.tum.de/~jain/software/oe-quotefix/
 
 I do have experience with Outlook-QuoteFix by the same author and it
 works well. 

Oh cool! I have installed and now the format of the message looks great!
Thanks for telling me about that program.

Teddy

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



Re: [PHP] List Etiquette

2004-09-21 Thread Octavian Rasnita
No, there is no way for customizing the headers Outlook Express use to put
in the email messages.
I wish there was, because I don't like them also...

Teddy

- Original Message - 
From: - Edwin - [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 20, 2004 2:51 PM
Subject: Re: [PHP] List Etiquette


 Hi,

 On Mon, 20 Sep 2004 04:01:47 +0300
 Octavian Rasnita [EMAIL PROTECTED] wrote:
  My email client (Outlook Express) puts a lot of information
  at the top of the message automaticly, like:
 
  The signature,
  --- original message ---
  The From line
  - The to line
  - The date line
  - The subject line.

 There should be a way to customize that, no?


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



Re: [PHP] List Etiquette

2004-09-20 Thread Octavian Rasnita

- Original Message - 
From: John Nichel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 20, 2004 7:06 AM
Subject: Re: [PHP] List Etiquette


 Octavian Rasnita wrote:
 snip
  In other words it's easier for you to reach your Delete key when you top
  post than when you bottom post ???
  --
 
  Ok, I have bottom posted, and have trimmed the end of the message. But
this
  was a little text only, while the header of this message is still there,
and
  it is bigger.
  Well, I said that is harder to delete the head of the message and then
go to
  the end and delete the tail also.
  That's why is easier to trim the message when top posting.
 
  It would be easier for everyone if everyone would use Outlook Express
and
  not many other email clients that use a different style of headers they
put
  in the message, or that put the cursor in other positions by default.
 
  But most users use Outlook Express as the email client, and not other
  programs...
  And this not only because it is included by default in Windows, but
because
  for some features it is the best program, like the accessibilitty for
the
  blind for example.

 Most use Outlook or Outlook Express?  I think you'd be hard pressed to
 find _most_ users of a mailing list which deals with something in the
 Open Source Community (like php) using a Microsoft mailer.  Most of the
 newbies, probably; but the people who are on this list, day in and day
 out, are more than likely not...even if they are using a Microsoft OS.
 However, the, my mail client puts the cursor at the top is still a
 pretty weak reason to top post.



Why is it a pretty weak reason? I found it a very big one.
You don't know how easy is to use an email client when you can't read but
just listen to a robotic voice made by the computer. ...or you probably
don't care. Well, in that case, why should I care that you don't like top
posting?

See, I have bottom posted this time. So? The trimmed part at the end of the
message is much smaller than the one from the top of the message, so bottom
posting doesn't help trimming the message as you said.

Teddy

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



Re: [PHP] List Etiquette

2004-09-19 Thread Octavian Rasnita
Hi,

I have a very strong reason for top posting and a very strong one for not
agreeing too much bottom posting at all, and this is the fact that I am
blind and if I need to read a bottom post, I need to read again and again
the whole original message, even though most of the time I remember what was
it about, and I don't like to lose so much time to read it again so many
times.

I have read somewhere a Netiquette rule that advice top posting (I don't
remember where, but could be on W3C site...) and the reasons for that rule
were that:

1. Most of the times, the members of the list remember the subject of the
original message, and those who don't remember it, can make that effort for
scrolling down, because the most important part is not the original message,
but the answer.
2. People with dissabiliteies, that access the computer reading line by
line, will have to skip many rows sometimes in order to reach to the
important part of the message, and very often that important part have just
a single line, or two lines, and they might skip them if they read the text
faster.
3. Top posting is much easier to be done for most of the members of a list,
because they don't have to trim the original message very selective, but
they can just  hit reply, start writing, then they can press page down
once or a few times, or point with the mouse,  and delete from that point to
the end of the original message and that's all.
If bottom posting, the original message need to be trimmed for not including
signatures, advertising, and other unneeded things.

Well, I guess these are the reasons Microsoft made their mail clients in
such a way that the text cursor appears at the top of the reply window by
default, and not by mistake, and let's don't forget that most computer users
use MS Windows...

Even though I prefer top posting for the reasons I have told you about, I
also use sometimes bottom posting, and I also use answering point by point
in the original message where is the case.
I use bottom posting only in short threads, in which the members might not
remember about the subject of the original message, or in messages that are
hard to understand without reading the original message.

If I answer something like:

Your problem can be solved by using the following code: ...

Most of the users won't understand what problem was that answer for, because
on the lists we use to talk about problems all the time.

But if I answer something like:

If you want to create a program for downloading and parsing a file, use the
following code:...

Then I think that everyone will understand what is my answer for, and they
don't need to read again the original message, because they even might
remember that message.

So I think the top posting is preferred by users for a very good reason, but
I also think that we should try to admit that other members of the list have
other preferences, and try not fighting for that.

Cheers.

Teddy

- Original Message - 
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 19, 2004 5:02 AM
Subject: Re: [PHP] List Etiquette


On Sunday 19 September 2004 07:52, Robert Cummings wrote:

 But definitely there's not global consensus.

I really shouldn't be indulging you as it's pretty obvious you're only here
for a vigorous debate (that's my euphemism for an argument - the not so nice
meaning of argument).

The OP asked for the pros and cons of top posting vs bottom posting. I
responded with some reasons why top posting is bad.

What did you come up with?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz

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



Re: [PHP] Browser caching problem.

2004-09-19 Thread Octavian Rasnita
BTW, does anyone know if there is a program or script that can listen to
the stream and save it into a file?
I know this can be done using a program for recording the sound, but that is
not a very professional solution and it depends on the quality of the sound
card, the speed of internet connection, etc.

I am wondering if there is a program that can work with the mms:// protocol
for getting the data, or other protocols for streaming if there are more...
or if there are any specifications for making such a program.

Thanks.

Teddy

- Original Message - 
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 19, 2004 2:25 AM
Subject: Re: [PHP] Browser caching problem.


On Sunday 19 September 2004 07:12, Daniel Guerrier wrote:
 I'm using this code to dynamically retrieve windows
 media files and send it to the browser.  I thought the
 cache header would prevent the file from being cached.

 The only problems is the .wmv file still ends up in my
 IE temp files folder.  How can I prevent this from
 happening?

Don't give them the file in the first place?

If you're trying to prevent someone from saving the file and playing it back
at a later date then I think you'll need to stream the file. Have a look on
the MS site. Note that no matter what you do, if someone is determined
enough
they'll still be able to capture the contents.

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



Re: [PHP] List Etiquette

2004-09-19 Thread Octavian Rasnita
Hi,

From: John Nichel [EMAIL PROTECTED]

Do the words get smaller at the bottom?  Having to scroll thru line
after line of message doesn't deal with top vs. bottom posting...that
stems from people not trimming non-releative parts out of the message.
---

The rules should be made to make the reading process easier for the readers
and the top posting versus bottom posting has nothing to do with the
trimming of the messages.
It is much easier to trim a message when top posting, just as I explained
you.

I have *never* seen any site dealing with mailing lists/newsgroups that
suggested top posting over bottom posting.
--
Keep searching. :-)

Did you take a survey of list members to come to the conclusion of who
remembers what?  I usually remember what's going on in a thread only if
I've been posting to that thread from the begininning.  I, along with
many other members of this list post to numerous mailing lists, but
according to you, we remember the subject matter of one little thread?
And if we don't, it's up to us to scroll thru the mess of top and bottom
posted replies so that we can figure out what's going on, just to help
someone?
---

Yes, if you are not lazy. :-)
I have also told that in case of a little thread, I also use to bottom post,
because its subject might not be remembered by others.

Everyone on this list who falls into this category, raise your hand.
I'm sorry if you have a disability and all, but you're suggesting that
the good of the one outweighs the good of the many.
--

Do you think that I am the only one on this list that prefer top posting?
I think the way people like to post on a mailing list  depends on how they
were used to post and that way tend to be consider the best by them.
And that way depends on more things, like the email client used, and that
email client depend on the operating system used, and so on.
And I have seen that many people that use Unix use to like bottom posting
and I don't know why... who knows, maybe the Unix email clients automaticly
put the cursor at the bottom of the original message...

Teddy

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



Re: [PHP] List Etiquette

2004-09-19 Thread Octavian Rasnita

Teddy

- Original Message - 
From: -{ Rene Brehmer }- [EMAIL PROTECTED]
To: Octavian Rasnita [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, September 20, 2004 1:12 AM
Subject: Re: [PHP] List Etiquette


At 16:57 19-09-2004, Octavian Rasnita wrote:
Hi,

From: John Nichel [EMAIL PROTECTED]

Do the words get smaller at the bottom?  Having to scroll thru line
after line of message doesn't deal with top vs. bottom posting...that
stems from people not trimming non-releative parts out of the message.
---

The rules should be made to make the reading process easier for the readers
and the top posting versus bottom posting has nothing to do with the
trimming of the messages.
It is much easier to trim a message when top posting, just as I explained
you.

In other words it's easier for you to reach your Delete key when you top
post than when you bottom post ???
--

Ok, I have bottom posted, and have trimmed the end of the message. But this
was a little text only, while the header of this message is still there, and
it is bigger.
Well, I said that is harder to delete the head of the message and then go to
the end and delete the tail also.
That's why is easier to trim the message when top posting.

It would be easier for everyone if everyone would use Outlook Express and
not many other email clients that use a different style of headers they put
in the message, or that put the cursor in other positions by default.

But most users use Outlook Express as the email client, and not other
programs...
And this not only because it is included by default in Windows, but because
for some features it is the best program, like the accessibilitty for the
blind for example.

Teddy

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



Re: [PHP] List Etiquette

2004-09-19 Thread Octavian Rasnita
From: Chris Shiflett [EMAIL PROTECTED]

This is like arguing that people choose to use IE instead of Firefox.
Surely the flaws of this argument are obvious. For people who bother to
make a choice, Firefox is a clear winner. The same is true for formatted
email. People (who care) tend to agree on a few major points and only
disagree on minor details, such as line length and methods of attribution.
--

I choose to use IE and I don't like Firefox because I cannot use Firefox.
Fortunately I hope I will be able to use Mozilla's programs because I have
seen that they also want to make it accessible for the blind, but for the
moment their programs are not accessible.

So I choose IE, and not just use it because I like its security flaws so
much. :-)

Teddy

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



Re: [PHP] List Etiquette

2004-09-19 Thread Octavian Rasnita
From: John Nichel [EMAIL PROTECTED]

 Easier for reading?  Yes, you're right.  Do you read a book from the
 bottom of the page up?  Trimming a message is easier if you top post?
 That's pretty weak.  Follow a top posted thread, you'll see that most
 top posters just leave everything in there, whereas bottom posters tend
 to trim the message.
--

Yes, this is true, and I see that you fight more not for the bottom post,
but for trimming the messages.
I also don't like those who just send a message without trimming it at all,
but they do that because it is more simple for them. If you don't care
that's more simple for them, they might not care that you don't like that.
And it is not easier to trim if I want to bottom post.
My email client (Outlook Express) puts a lot of information at the top of
the message automaticly, like:

The signature,
--- original message ---
The From line
- The to line
- The date line
- The subject line.

And if I want to bottom post, I won't just need to hit control+End and start
writing at the end of the message, but I will need to trim the beginning of
the message and after that go and trim the end of the message also.

 Check the headers of this email.  I'm using a Windows box right now, and
 my cursor was automatically at the end when I clicked reply.  Again,
 it's laziness if one doesn't want to configure their client to put the
 cursor at the end, or to manually move the cursor.
--

I've told you that it's not just moving the cursor, but deleting the headers
the email clients put at the top also.
And Outlook Express doesn't allow the configurations you have ask for.
I don't like those headers it puts there at the top and I also don't like
that it doesn't allow too many configuration options, but unfortunately I
don't have another solution  a better email client, because most of them
are very hard accessible for screen readers.

Teddy

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



Re: [PHP] How does work shorten url services?

2004-09-18 Thread Octavian Rasnita
I don't think those sites use mod_rewrite because an URl can be anything,
including:

http://www.oijoij.com/eorier/eoroeir/oier/eorij.pl?terer=wer4334oijo=werooj=123#

(or much more complicated urls).

Those sites (because there are more) just put the urls in a database, and
assign an ID to each one.

Then, a program (that can be made in any language) queries the database for
the given ID, and get the long URL. Then it redirects to that URL and that's
all.

I have made such a program in perl but it is very very simple.

Teddy

- Original Message - 
From: Ramil Sagum [EMAIL PROTECTED]
To: Henri Marc [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, September 18, 2004 2:29 PM
Subject: Re: [PHP] How does work shorten url services?


On Sat, 18 Sep 2004 10:49:34 +0200 (CEST), Henri Marc
[EMAIL PROTECTED] wrote:
 Hello,

 The principle is that you enter your long url in their
 form and it gives you a shorten url like
 tinyurl.com/h4599

 I was wondering how it works. I think it must use PHP.


It would use a feature of an HTTP server such as Apache -- URL rewriting

Basically, you can make rules such that urls like

http://tinyurl.com/h4599


become


http://tinyurl.com/index.php?id=h4599


you would then handle it from there.

But this is off topic :)



ramil

http://ramil.sagum.net

-- 
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: A native Windows binding for PHP - released

2004-09-17 Thread Octavian Rasnita
I haven't downloaded it yet because I have seen that I need PHP 4 and that
it won't work with PHP 5, but I will install PHP4 just for testing it.
I am glad that it uses Win32 native classes because those classes are
accessible for the most screen readers used by the blind, so the interfaces
will be accessible for the blind also.

GTK for PHP, like the TK package for perl don't create accessible interfaces
but perl can use the Win32:: libraries or the XW:: and it is great that now
we can create programs with Windows GUI's also, using PHP.

Teddy

- Original Message - 
From: Gryffyn, Trevor [EMAIL PROTECTED]
To: Rubem Pechansky [EMAIL PROTECTED]
Cc: PHP List [EMAIL PROTECTED]
Sent: Friday, September 17, 2004 5:08 PM
Subject: RE: [PHP] Re: A native Windows binding for PHP - released


 On 09/16/2004 09:01 PM, Rubem Pechansky wrote:
  I have designed and successfully prototyped a native Windows binding
  for PHP. This binding is very lightweight and it is already
 capable of
  doing dialogs, controls, and a lot more with a few dozen lines of
  code. PHP can thus be used as a tool for quick development of native
  Windows applications.
 
  I have just released this project to the public as Open Source at
  http://winbinder.sourceforge.net/. Although it is still a work in
  progress, you can take a look at the source code, download a working
  demo and play with it a little bit.
 
  Your ideas, comments, criticisms and suggestions are very welcome.

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



[PHP] Downloading a part of a file

2004-09-07 Thread Octavian Rasnita
Hi all,

Please tell me how can I fetch an html document from a web page, let's say
starting from the character 1000, and get the text until the caracter 5000.

In fact, I want to use the GET or POST method, and to also send to the
server the HTTP header:

Range: bytes=1000-5000

Thanks.

Teddy

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



Re: [PHP] Re: htmlentities and foreign characters from MS Word

2004-09-06 Thread Octavian Rasnita
You could store those texts as binary in MySQL...

- Original Message - 
From: Monty [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 06, 2004 11:07 AM
Subject: [PHP] Re: htmlentities and foreign characters from MS Word


 That did it! It seems that my version of MySQL doesn't support Unicode
 encoding, only the various ISO encodings. So, I guess this translation is
 necessary before storing all text in the DB so foreign characters aren't
 broken when I retrieve them from the DB.
 
 Thanks! 
 
 
 I2eptilex wrote:

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



Re: [PHP] tool to increase your web site?s profitability

2004-09-05 Thread Octavian Rasnita
Does this list have a moderator?

Teddy

From: theeb basheer [EMAIL PROTECTED]

Dear Friend,

Would you be excited if I told that YOU COULD EARN $3,500 EVERY DAY from a
web site that gets only 100 visitors a day... and sells a product that costs
less than $150?

You could be earning over $100,000 every month!

This isn't hype. And this certainly is no joke! It's rare that I am this
impressed by a marketing technique... but this literally blew my mind! This
is information that we are sharing with our subscribers only -- so listen
up!

I watched in utter amazement as this guy (who we'll call Mr. H for the
moment) turned...

100 visitors a day into $1,277,500 a year in profits!

... and he's just starting out!

Get this -- he expects to be earning $10,000,000 a year when he's finished
implementing this SIMPLE, yet totally INGENIOUS MARKETING STRATEGY!

This isn't about banner advertising... search engines... or newsgroups. And
it's certainly not about some rare, high priced product... or huge volumes
of traffic. It's about none of that.

This guy has developed AN ENTIRELY NEW WAY TO MARKET YOUR BUSINESS on the
Internet! And he's blown the gimmicky theories of those so-called
marketing experts right out of the water!

He's proven that -- using this one totally brilliant marketing strategy -- 
the small business owner can EARN HUGE PROFITS CONSISTENTLY! Day after day,
month after month... the sales just keep rolling in!

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



Re: [PHP] Correct headers for I.E. to open PDF?

2004-09-03 Thread Octavian Rasnita
This has nothing to do with PHP or the server, but with the way the client
computer is configured.
If the user doesn't want to open a .pdf file in the browser but to be
prompted for saving the file, that's the way he will have it.
...fortunately.

Teddy

Teddy

- Original Message - 
From: Paul Danko [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 03, 2004 10:05 PM
Subject: [PHP] Correct headers for I.E. to open PDF?


I have searched the net, and found tons of developers with different
solutions to this problem, none of which I have found to work.

What should the headers be for a client to download a PDF document and
have it open using adobe i.e. pluggin??

Here is code I am using, it works on some versions of I.E., but not all:


$pdfdoc = $__BASE_PDF_BUILD_DIRECTORY.$_GET['FID'];

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



Re: [PHP] Regex for Validating URL

2004-09-02 Thread Octavian Rasnita
I have taken a look and I have seen a {3} and I think this was for
specifying the number of letters of the top domain name.
Well, I think it should be {4} for making it work for .info domains also...

T

Teddy

- Original Message - 
From: John Holmes [EMAIL PROTECTED]
To: Jason Wong [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, September 02, 2004 4:56 PM
Subject: Re: [PHP] Regex for Validating URL


From: Jason Wong [EMAIL PROTECTED]

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



[PHP] Reading the documentation

2004-08-22 Thread Octavian Rasnita
Hi all,

I have 2 questions:

1. Do PHP libraries have a documentation included inside of them like in
case of Perl's modules?

2. If yes, how can I read that documentation?

Thank you.

Teddy

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



Re: [PHP] Re: Reading the documentation

2004-08-22 Thread Octavian Rasnita
Ok, thank you.

Well, it seems that PHP libraries don't have the documentation included...
This is too bad, because it is much harder to search in the PHP manual, and
some libraries that might be downloaded from different sites and made by
different programmers won't have the documentation included in the PHP
manual.

I thought PHP also have a kind of program like perldoc for perl which can
display the documentation for a built in function, for a library that was
installed, plus different tutorials...

I guess it would be a good idea to implement such a thing in PHP also,
including a documentation in comments, with some special marks...

Teddy

- Original Message -
From: M. Sokolewicz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, August 22, 2004 11:29 AM
Subject: [PHP] Re: Reading the documentation


 Octavian Rasnita wrote:
  Hi all,
 
  I have 2 questions:
 
  1. Do PHP libraries have a documentation included inside of them like in
  case of Perl's modules?
 
  2. If yes, how can I read that documentation?
 
  Thank you.
 
  Teddy
 that would depend on what you understand under the term PHP libraries,
 if you mean the actual C files, then no, if you mean the PHP extensions,
 eg. mysql, mcrypt, XML, etc. then yes, they do have documentation (most
 of them), which can be found in the PHP Manual available on php.net. If
 you're talking about the PECL extensions, then they usually don't have
 much, if any, documentation about it. It basically means you'd need to
 read the C code for it and find out yourself...

 hope that helped,
 - Tul

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



[PHP] Sending email

2004-08-22 Thread Octavian Rasnita
Hi all,

I want to send a test message with the following specifications:

1. The message is sent by [EMAIL PROTECTED]

2. The message is sent to the following recipients: [EMAIL PROTECTED],
[EMAIL PROTECTED]

3. The message has the subject: [EMAIL PROTECTED]

4. The message has the following header:
From: Me[EMAIL PROTECTED]
To: Multiple recipientsrecipients.info

5. The body of the message is:

Test

Can I use mail() function for this?

Thank you.

Teddy

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



Re: [PHP] Re: Sending email

2004-08-22 Thread Octavian Rasnita
Thank you all, but how can I send the message from the [EMAIL PROTECTED] email
adress, but in the header of the message to put [EMAIL PROTECTED]

Something like giving the following commands to an SMTP server:

telnet mail.server.com 25

helo mail.server.com

mail from:[EMAIL PROTECTED]
rcpt to: [EMAIL PROTECTED]

data
From: Two[EMAIL PROTECTED]
To: ZZZ[EMAIL PROTECTED]
Subject: subject

test body
.

So the message is sent from the [EMAIL PROTECTED] email address and goes to
[EMAIL PROTECTED]
But when the message is received, it appears with the data from the body of
the message (after the data command), meaning from [EMAIL PROTECTED] to
[EMAIL PROTECTED]


And another question is why it appears the following error message (under
Windows 2000):
PHP Warning:  mail(): sendmail_from not set in php.ini or custom From:
header missing in...

I don't want to set that in php.ini, but I have put From: [EMAIL PROTECTED]
as the fourth parameter of the mail() function, however, it still gives me
that error.

I am running a local smtp server.

Thank you much.

Teddy

- Original Message -
From: M. Sokolewicz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, August 22, 2004 1:31 PM
Subject: [PHP] Re: Sending email


 Octavian Rasnita wrote:

  Hi all,
 
  I want to send a test message with the following specifications:
 
  1. The message is sent by [EMAIL PROTECTED]
 
  2. The message is sent to the following recipients: [EMAIL PROTECTED],
  [EMAIL PROTECTED]
 
  3. The message has the subject: [EMAIL PROTECTED]
 
  4. The message has the following header:
  From: Me[EMAIL PROTECTED]
  To: Multiple recipientsrecipients.info
 
  5. The body of the message is:
 
  Test
 
  Can I use mail() function for this?
 
  Thank you.
 
  Teddy
 sure you can :)

 just do
 mail('[EMAIL PROTECTED], [EMAIL PROTECTED]', '[EMAIL PROTECTED]',
 'test', 'From: Me [EMAIL PROTECTED]');

 more info:
 (http://www.php.net/manual/en/function.mail.php)

 --

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



Re: [PHP] Storing, formatting and displaying data

2004-08-20 Thread Octavian Rasnita
Oh thank you. This is exactly what I need.

I can create regular expressions to do the job, but I wanted some ideas for
the mark points used.

Teddy

Teddy

- Original Message -
From: Justin French [EMAIL PROTECTED]
To: Octavian Rasnita [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, August 20, 2004 7:02 PM
Subject: Re: [PHP] Storing, formatting and displaying data


 Octavian,

 If you wish to avoid WYSIWYG editors and stick with some thing
 ASCI-based, I can highly recommend Textile [1], which is distributed as
 part of a new PHP-based CMS called Textpattern [2].

 Textile is a sort-of shorthand mark-up for converting ASCI to valid
 XHTML.

 This is a paragraph with a line
 break, *strong* and _emphasised_ text.

 * this is
 * an unordered

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



Re: [PHP] downloading files

2004-08-19 Thread Octavian Rasnita
You can put the files that need to be downloaded in a directory somewhere
outside of the web server root, but in that case your PHP program will need
to read the file and print it to the browser, and it will also need printing
the HTTP headers:

Content-type: application/octet-stream
Content-disposition: attachment; file=$filename
Content-length: xxx
[blank line]

Or you can put the files somewhere on the web server tree, protect the
directory with .htaccess (username + password), and just put a simple link
to those files.
When someone will click that link, it will be asked for a username and
password in a popup window that the browser will open.

If you don't want to appear that window, you can set your server to redirect
the user to a php script, for a certain Status code that is generated when
authorization is required, and that PHP script can ask nice for a username
and password that can be used then by the script to allow access to that
file (but this way might be more complicated without real benefits).

Teddy

Teddy

- Original Message -
From: Aaron Todd [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 19, 2004 8:30 PM
Subject: [PHP] downloading files


 I posted a simular question before and never really got an answer.  The
post
 drifted off into some other valuable information, but I still have the
same
 question.

 I am trying to create a site with file downloads.  The files on the server
 that are to be downloaded need to be protected somehow.  I have already
 created a login page for the site so users must log in.  The download
files
 are in a directory protected by htaccess which it is my understanding that
 PHP can go underneath htaccess to get access to the files.  My problem is
 where do I put this directory?  I was already told to put it outside the
web
 root directory, but I really dont know where the best place is.

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



[PHP] Storing, formatting and displaying data

2004-08-19 Thread Octavian Rasnita
Hi all,

I would like to create a program that allow users to insert text into a
database, than that text to appear in a web page formatted as HTML.
It is simple to replace the end of line with br /\n in order to format
that text as html, but I don't know how I could let the users to create
bulleted lists, tables, etc.

Lets say that the users are admins that I can trust, but they don't know
HTML at all, however, they want to insert a table, or a list, etc.

Are there any solutions for this?
I am thinking to something like inserting
table
COL1##COL2##COL3
CEL1##CEL2##CEL3
/table

...for the tables, or something like that, then to make the program
transform this in a true table.

But maybe there are better solutions.

Thanks for any ideas.

Teddy

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



Re: [PHP] Cache

2004-08-17 Thread Octavian Rasnita
From: pan [EMAIL PROTECTED]


 What provides the new data?
 Can you run a html update from whatever is supplying the new data?



Hmm, I don't think I can. The data is stored in MySQL by a separate program,
but that data can be used in more pages.
I think the only good solution would be to run a program that create a cache
for every page from that site.
This would not be very simple because the site could have more template
styles available for the users, and all the page could appear in more
languages, and some pages could be accessed from a form with many options,
etc.
It would not be very practicly to create such many cached pages.

I begin to think that it is not really possible to do what I want and I
guess that if the PHP program is well done, the speed difference would not
be too big.

Teddy

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



Re: [PHP] Compile

2004-08-16 Thread Octavian Rasnita
From: raditha dissanayake [EMAIL PROTECTED]


 i think you are looking for something like turck mmcache.
 

Do you know if Turck MMCache works with PHP 5.0?

Teddy

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



Re: [PHP] PHP templates

2004-08-16 Thread Octavian Rasnita
Hi,

I took a look to Smarty and Savant templating systems, and  I like a few
things from both of them.
However, none of them are satisfactory.

I don't like Smarty because it needs another language and I find Savant more
easy to use.

I would like to have a templating system that:
1. Separates:
- the programming part (the main programs and the modules)
- the structure and main design of the site (the templates)
- The content of the site, this meaning the body text, the title, keywords,
and all other variables.
- Other files that can be included, like Javascript, .css, images, files
that can be downloaded, etc.

2. The templates should handle more languages, and all the content parts
should be able to appear in every language supported.

3. The program should be able to create a cache but not one containing PHP,
but one that is just simple html that can be loaded from a cached file and
presenting to the client.
(I don't know how to decide yet when to re-create the cached file)

If someone uses this templating system, someone can modify the design by
modifying the templates and this change will be reflected in every language.
If a translator add a new language or modifies a certain translation, the
design won't be affected.
The programmer could add a new program for a new page that does something
new, or new modules, etc.

I couldn't find such a thing yet and I think I will have to create it.

Teddy

- Original Message - 
From: Justin French [EMAIL PROTECTED]
To: Octavian Rasnita [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, August 16, 2004 4:38 AM
Subject: Re: [PHP] PHP templates


 On 15/08/2004, at 7:02 AM, Octavian Rasnita wrote:

  Hi all,
 
  I have seen that there are many templating systems for PHP. Which is
  the
  most used and the best you have found?
  Can you recommend me a free and good templating system?

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



[PHP] Cache

2004-08-16 Thread Octavian Rasnita
Hi all,

I want to create an html cache of a page, like when that page is saved to
the disk and let the visitors download that static page and not a dynamic
one.
Of course, a dynamic PHP program will load that static page and display it,
but without need to connect to databases, to make calculations, etc.

The problem is that I don't know how to automaticly decide when it is the
right moment to update the cache and this is very important.
I get some data from a database and the PHP program doesn't know when the
database gets updated by another program, so it cannot create the cache for
that page immediately.
If I let the program check the database each time it is ran, this takes some
times, and it is like I would not use the cache at all.

Is it possible to use that kind of cache I want? (meaning... a kind of
static page saved).

Thank you.

Teddy

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



Re: [PHP] CSRF attack not possible in I.E. 6.01 SP1?

2004-08-16 Thread Octavian Rasnita
Why is so important if Internet Explorer allows URLS of images where the
file name is only .jpg, .png, or .gif?

A url can be something like:

http://www.site.com/script.php/image.jpg?logout=true

Internet Explorer might think that the file is a .jpg and that script.php is
a directory but only the target web server knows which is the program.
Or a PHP code might be contained in a image.jpg file.

Teddy

Teddy

- Original Message -
From: Chris Shiflett [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: Jay Blanchard [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, August 16, 2004 9:52 PM
Subject: RE: [PHP] CSRF attack not possible in I.E. 6.01 SP1?


 --- [EMAIL PROTECTED] wrote:
  And I m sure all PHP developers check their applications for
  CSRF vulnerability, in various browsers (including I.E. ).

 I speak about CSRF in many of the talks I give, and I think you'd be
 surprised by how many people haven't even heard of it.

  As a PHP/Java developer, I would be interested to know what
  I.E. is doing in their browsers to prevent CSRF attacks. I m
  not trying to start a browser war here.

 Well, to be fair, even if it is true that IE does not request a URL
 referenced in an img tag unless the file extension matches a known image
 type, this isn't a complete or even optimal solution to the problem. Also,

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



Re: [PHP] PHP Security Workbook

2004-08-15 Thread Octavian Rasnita
I have also read that pdf document and I have found another interesting
advice.

The author says that a good way of hiding the username/password is to put a
file that exports 2 environment variables in a directory that can be read
only by the root, then include a call to that file in httpd.conf in order to
let the web server to have access to those variables.

Well, I don't really understand why this is so secure.

I understand that the web server is run by root, which sees that file and
exports the variables, then another user without many priviledges runs the
child process of the web server, but if there are more than one user that
run PHP files or files made in other languages on that server, they will
also be able to see those environment variables.

Did I understand correctly?
Teddy

- Original Message -
From: Chris Shiflett [EMAIL PROTECTED]
To: Burhan Khalid [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, August 15, 2004 4:05 PM
Subject: Re: [PHP] PHP Security Workbook


 --- Burhan Khalid [EMAIL PROTECTED] wrote:
  Most of the stuff was common sense to me (and I was glad I
  was doing those things unconsciously).

 That's good to hear. :-)

 Most of the people that have heard me give this talk (which is a few
 hundred now) have realized several vulnerabilities in their current
 applications, bad development habits, etc. I actually get tired of giving
 the same (or very similar) talks, but I'll keep giving this one as long as
 it keeps surprising a lot of the audience. The fewer excuses we give
 people to equate PHP with poor security, the better off we'll all be.

   However, I do have issue with one paragraph:
 
  Page 29,
 

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



Re: [PHP] PHP Security Workbook

2004-08-15 Thread Octavian Rasnita
Oh thank you for this information. This is very important for me to know.

 Yes, this is another thing that I mention in the talk but failed to
 include in the workbook. When this approach is being applied to a shared
 hosting environment, you want to put the Include directive within a
 VirtualHost block of httpd.conf, so that it only applies to a single
 virtual host.
 

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



Re: [PHP] Re: Help with Regular Expressions

2004-08-15 Thread Octavian Rasnita
From: [EMAIL PROTECTED]

 Hi all,

 I am working on a small php script which should do the
 following. I want all the links in the page to be
 preceded by first character and first two characters
 of the link.Please look into the example below for
 more
 clarification.

 eg.
 a href=/code.htmllink here/a to be
 replaced as
 a href=/c/co/code.htmllink here/a

 I guess, this is possible by using regular expressions
 but I am not able to crack the right expression.


Hi,

This is not very simple.
The URI which in your example is /code.html can be anything, including
something like m.html.
In that case which would be the first 2 letters?
Or, the URI can be something like m-like.html. In this case the first 2
letters will be m- or ml?

A good regular expression should work in all situations so it is important
to know what is the desired result, and not to asume that there won't be any
links like /.html or something worse.

Teddy

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



[PHP] PHP templates

2004-08-14 Thread Octavian Rasnita
Hi all,

I have seen that there are many templating systems for PHP. Which is the
most used and the best you have found?
Can you recommend me a free and good templating system?

Thank you.

Teddy

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