[PHP] How to determine a function's outer context?

2002-07-03 Thread Alberto Serra

Hi!

suppose we have this:

class utility {

   function general_purpose($parm) {
 some_process or
 die("classname::callerfunction error with parm $parm") ;
   }

}


class someclass {

   var $utility;

   function someclass() {
 $this->utility = new utility;
   }

   function do_something() {
 $this->utility->general_purpose("what-to-do");
   }

}

Now, is there anyway we can trace that utility::general_purpose() is 
being called from within someclass::do_something() without explicitely 
passing a string among utility::general_purpose() parameters?

Apart from leading to more compact code writing this would avoid typo 
errors and give a more accurate tracing system. I am sure it can be 
done, but I cannot figure out how to do it myself.

Thanks
Alberto
Kiev

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Security: PHP: how to "harden" PHP scripts?

2002-07-03 Thread Alberto Serra

Chris Shiflett wrote:
> Jean-Christian Imbeault wrote:
>> In general how does one go about hardening a PHP script. i.e. making 
>> it as "hacker-proof" as possible

There is no such thing as a 100% secure solution (this applies to 
everything running on a computer, PHP included). But basically you can 
make it pretty secure. Then again, quite a lot depends on what you are 
going to write. Govt/Banks need much more defense than a small/midsized 
commercial site (and are capable to pay for it). You can basically be 
happy with some care in you development, just make sure your customers 
do understand the amount of time this is going to take and are ready to 
pay for it. Then let them decide themselves, but if you see they choose 
a risky path in order to save budget money do write them a formal 
letter, in which you acknowledge the problem. Many customers do not 
think they need security until it's too late, then they get mad at you 
because they did not want to buy the extra time for secure coding. So 
make sure everyone knows what their responsibility are and make sure 
this is stated on paper.

> 1. Never, ever trust data from the client

That's it. If you leave Register_globals off you will be sure you get 
only what you need to get. Then, of course, you shall control data 
content. As I am sure you know yourself most of the trouble will come 
from uncorrect data input.
You might actually write client-side javascript controls to avoid 
uncorrect input and then think that your data are clean. This is where 
most of the problems come from (as Chris points out, it's not difficult 
to post a form to your script after writing it at home, or just do a 
plain command line call with altered parameters from a user browser, I 
see that stuff on our customers logs quite often).
So, no matter what you checked on the client, check it again on the 
server (even if you are not paranoid, some users may just have disabled 
their javascript, right?)

> Basically, if you code very carefully and deliberately, you will create 
> a very secure application. Many people focus only on securing the 
> environment, but writing secure code is often much more important.

Words of wisdom! and actually about 75% of the code you write is 
dedicated to this very job, if you really want to get a stable application.

Alberto
Kiev

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Authentication

2002-07-03 Thread Alberto Serra

Chris Shiflett wrote:

> How do sessions help against this? Well, they don't solve the problem 
> entirely, of course, but the unique ID you pass around won't be the same 
> unique ID *every* time that user visits the site. So, you at least have 
> a good chance of making the window of time that an imposter has to work 
> with very small.

If you want to avoid even this small window, just store on a db file the 
session numbers you give away, along with the IP address of the user who 
got it. Then when you get a new request for that session check the IP 
you are getting it from and you are 100% sure the guy is who he says to be.

There is one side-effect, though. Users on unstable dial-up lines do 
lose their sessions when they get disconnected and call again. It may 
have an impact on sales.

Alberto
Kiev

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Authentication

2002-07-03 Thread Alberto Serra

Chris Shiflett wrote:
 > Alberto Serra wrote:
 >> If you want to avoid even this small window, just store on a db file
 >> the session numbers you give away, along with the IP address of the
 >> user who got it. Then when you get a new request for that session
 >> check the IP you are getting it from and you are 100% sure the guy is
 >> who he says to be.

 > The 100% part is inaccurate. :)

Much too true LOLOL

 > As a caveat to Mr. Serra's suggestion, remember that there are *many*
 > users who will go through an IP masquerading gateway or proxy, so
 > their IP may fluctuate, even though they are actively browsing. For
 > this reason, it is often necessary to tolerate some fluctuation in
 > the IP address, perhaps only in the last octet though.

Thanks, I guess I'll just do that. I was actually wondering how to leave 
this barrier up without being nasty to normal users. That also solves 
the dial-up problem, at least much of it, as callers will fluctuate 
mostly on the last octet if they do reconnect through the same ISP, 
right? Besides, IP masquerading gateways ARE a problem with the 
suggestion I gave. And I guess this also explains why we are having so 
much trouble in counting users (that is, IPs) whenever ADSL connection 
come around. Any suggestion?

 > Another thing some people use to strengthen their security model is to
 > involve some sort of sequence number in the data that the client sends
 > back. For example, instead of just a session ID, perhaps you have a
 > cookie, URL variable, or whatever that is an encrypted (two-way so you
 > can decrypt it) session ID, sequence number, and anything else you
 > might think of to include.

So you mean I have a 32 byte MD5 session id to identify the current 
visit, plus another such thing to identify the step within it, right?
But why decrypting it? A presentation attack would give it back to 
server in the encrypted form anyway. What do we lose by just generating 
a random MD5 key and using it as it is with no encrypted meaning?

Now, just tell me if I got you right. Since we are comparing 3 IP octets 
plus the two MD5 keys we get an attack window like this:

hacker has three matching octets on his IP, plus he does attack while 
the real user is still using the visit-session/content-session key the 
hacker has stolen, right? This makes it dangerous for last pages (those 
seen right before exiting site), as they actually last for ages.

Anyway, it DOES seems more than enough security to me.
Thanks a lot!

Alberto
Kiev

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Multiple Forms and 1 SQL table

2002-07-03 Thread Alberto Serra

CM wrote:
> What do you do if you have a huge form that you want broken up into several
> different forms but each time the submit button is pressed the info is saved
> to the sql table.
> 
> Do you just create the table on the first form submit and then on each
> subsequent form you just update the table?

If you just do that chances are your table will be mostly made of 
uncomplete (and useless) records. It looks like a long sequence and many 
a user will leave it uncomplete.

If you want to save DB performance (by not fragmenting the table too 
much) you'll better do that on a temporary table that has the same 
format of the real table plus two more fields:
1) a session identifier (use something like a session id to recognize 
current user input).
2) a timestamp.
This temporary table usually will have no referential checks (as they 
might need full data set to make sense). Still, referential integrity 
should be checked along the way by some code.

Once you finally have all the stuff you need you just:

1) select previous data from temporary table
2) add last form input
3) insert it in the real table
4) delete from the temporary table the record having the current identifyer.

Still, the temporary table will be crowded with all the uncomplete 
sequences. If you cannot set a cleaning job on the server's chron just 
have the first form of your input sequence delete all temporary records 
that are older than delta time (where delta depends on the input process 
you are managing).

This way your real table stays compact and DB performs much better.

Alberto
Kiev


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Authentication

2002-07-03 Thread Alberto Serra

Chris Shiflett wrote:

> 
> These are just some ideas, mind you. Many people (you sound like such a 
> person) can develop their applications quite securely once they can step 
> back and see the big picture and follow a few general guidelines, such 
> as not trusting data from the client. In this case, the data from the 
> client is like a driver's license, and rather than just use the license 
> number, we're also checking their photograph and other personal 
> information, so that an imposter has a more difficult time. :)
> 

Thanks a lot! We have actually decided to use the fact that 
Register_globals
off will end up paralyzing our legacy stuff to write a core object 
system that
will be shared among all of our customers and have security built in at 
very low level. So you actually did help in projecting a number of sites 
security by answering to my annoying questions :)) I made sure you got 
credited for this on the source docs.

Thanks again :)
Alberto
Kiev


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Authentication

2002-07-03 Thread Alberto Serra

Jason Wong wrote:
> On Thursday 04 July 2002 09:09, Chris Shiflett wrote:
> 
> 
>>As a caveat to Mr. Serra's suggestion, remember that there are *many*
>>users who will go through an IP masquerading gateway or proxy, so their
>>IP may fluctuate, even though they are actively browsing. For this
>>reason, it is often necessary to tolerate some fluctuation in the IP
>>address, perhaps only in the last octet though.
> 
> 
> This can be self-defeating in that an attacker in the same network segment of 
> the user is probably in the best position to sniff and hijack the session 
> that you're trying to protect. Allowing this leeway makes the attacker's job 
> much easier!
> 

That's true. And since I am making a core structure that has to be 
shared by users having different security needs I guess I better leave 
this configurable just as the time-out interval. So local admins may 
decide on their own which level of security they want to apply to their 
sites.

Thanks for helping :))
Alberto
Kiev

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Authentication

2002-07-03 Thread Alberto Serra

Miguel Cruz wrote:
> 
> I'd suggest ignoring IP altogether and focusing on other tactics. There 
> are just too many pitfalls in trusting IPs and too much user annoyance 
> possible from not trusting them.

Well, the way I made it admins get emailed each every time a user gets 
refused
because of a bad IP, and they can decide to apply a control policy from 
0 to 4
octets check. It seems fair to me: admins will be annoyed by emails just as
much as users will be annoyed by their security policy. This should lead to
some balance, in the long run :)

Chances are most commercial sites will set the check IP rule to 0 but in 
case someone wants a strict check he can configure the system to do so. 
I guess this will fit everybody. And of course we do have all the other 
stuff, so even without IP checks the systems remain pretty secure.

Thanks for helping
Alberto
Kiev


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] how to get calling method identity?

2002-07-03 Thread Alberto Serra

Hi!

I already made this question, but probably I kinda made it in obscure 
terms. Trying to get clearer.

let's look at this:

function utility() {
}

Class a {
function some_method() {
  utility();
}
}

now, how can utility know that it's being called by a::some_method()? 
What I need is to build something that will output an error message like
"error in a::some_method"

get_class() will work only if I pass a reference every time I call 
utility, like

utility(&$this)

which is already not really what I want. And anyway this would not solve 
the problem of knowing which method was executed when the event occurred.

Any idea?

Alberto
Kiev

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Strange MySQL Query Problem

2002-07-03 Thread Alberto Serra

eat pasta type fasta wrote:

> $result = mysql_query("SELECT some_id, some_description, some_feature 
> FROM '$pop-up1' WHERE some_description LIKE '%$texfield%' AND 
> some_feature LIKE '%$pop-up2'");

have this query echoed to video and then cut it and paste it to mysql 
terminal. Most probably you'll find out that it's an uppercase/lowcase 
problem. Unlike Oracle Mysql IS case sensitive on tablenames and 
columnnames.

Alberto
Kiev

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Help!

2002-07-04 Thread Alberto Serra

John Lazos wrote:

> and i put the file in my htdocs directory i restarted apache and when 
> i'm trying to access the page http://localhost/hello.php as a result i'm 
> getting the contents of the file hello.,php


> What is wrong is my apache able to display php pages?

Looks like Apache does not know about PHP :) in your 
/usr/local/apache/conf/httpd.conf file (or another path, if you have set 
another prefix while compiling the tarball) you seem to miss this:

 AddType application/x-httpd-php .php
 AddType application/x-httpd-php .phtml
 AddType application/x-httpd-php .php3
 AddType application/x-httpd-php-source .phps

have fun :))
Alberto
Kiev



-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Help!

2002-07-04 Thread Alberto Serra

> John Lazos wrote:
> 
>> and i put the file in my htdocs directory i restarted apache and when 
>> i'm trying to access the page http://localhost/hello.php as a result 
>> i'm getting the contents of the file hello.,php
> 
> 
> 
>> What is wrong is my apache able to display php pages?
> 
> 
> Looks like Apache does not know about PHP :) in your 
> /usr/local/apache/conf/httpd.conf file (or another path, if you have set 
> another prefix while compiling the tarball) you seem to miss this:
> 
> AddType application/x-httpd-php .php
> AddType application/x-httpd-php .phtml
> AddType application/x-httpd-php .php3
> AddType application/x-httpd-php-source .phps
> 

I almost forgot. Also check the module list. It should be
something like this (but you might have much less modules
installed then I do, anyway, just make sure that after
deleting those you don't have the LoadModule and AddModule
order do match with the example. Apache gets quite nervous
if you give it some other module order)

LoadModule agent_log_module   libexec/mod_log_agent.so
LoadModule referer_log_module libexec/mod_log_referer.so
LoadModule mime_magic_module  libexec/mod_mime_magic.so
LoadModule status_module  libexec/mod_status.so
LoadModule info_modulelibexec/mod_info.so
LoadModule speling_module libexec/mod_speling.so
LoadModule rewrite_module libexec/mod_rewrite.so
LoadModule proxy_module   libexec/libproxy.so
LoadModule expires_module libexec/mod_expires.so
LoadModule usertrack_module   libexec/mod_usertrack.so
LoadModule unique_id_module   libexec/mod_unique_id.so
LoadModule php4_modulelibexec/libphp4.so

LoadModule ssl_module libexec/libssl.so



#  Reconstruction of the complete module list from all available modules
#  (static and shared ones) to achieve correct module execution order.
#  [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
ClearModuleList
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_log_agent.c
AddModule mod_log_referer.c
AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
AddModule mod_speling.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_proxy.c
AddModule mod_expires.c
AddModule mod_usertrack.c
AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c

AddModule mod_ssl.c

AddModule mod_php4.c


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] How to pass unknown number of variables to a function?

2002-07-04 Thread Alberto Serra

Uwe Birkenhain wrote:
> Hi everybody on this rainy morning!

Rainy!? It's damn hot in Kiev :)

> My problem:
> I give the user a form with a list of options with checkboxes.
> The list is long and not predictable - the values change always.
> I want to put the checked values (or all, that doesn't matter) in an array,
> to pass it to my function.
> 
> How can I write those keys and values in an array?
> 

Suppose you have a number of checkboxes. First, you name them 
sequentially (like "active_0,active_1 and so on) and you assign it your 
value. Then you process posted data like this. BEWARE! you need at least 
an array of hidden variables to know exactly how many checkboxes you 
must process. Then you just rebuild it the structure and pass it thru.

   # put the received input into an ordered structure
   ##
   $count = 0;
   while ( isset($id[$count]) ) {

 # Build variable names;
 ###
 $w_active   = "active_".$count;

 # get actual form values
 
 $active[$count]   = $$w_active;

 $count++;
   }

Hope it solves the problem. I've been using this for ages and it never 
gave me problems.

Alberto
Kiev

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] mysql/php how to retrieve the right column with 2 columnsof the same name

2002-07-04 Thread Alberto Serra

Wilbert Enserink wrote:

> Later on in my script I'm calling the value of this column with php.
> $query="select * from tblA LEFT JOIN ";

it's been said over and over :) NEVER EVER write a select * query...

use syntax

Select
a.column1,
a.column2,
b.column1
from
tbl1 as a,
tbl2 as b
where
.

and you'll never get in trouble :))

Alberto
Kiev


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] $_COOKIE

2002-07-05 Thread Alberto Serra

Scott Fletcher wrote:
> I have a question!  Since the $_COOKIE is on the server side, not on the
> client side.  So, will the use of hte $_COOKIE be affected when the user's
> browser disabled the cookie?  I do not know how the $_COOKIE on the server
> side work or get the information from.
> 
> Thanks,
>  FletchSOD
> 
> 
> 

ðÒÉ×ÅÔ!

Yes, that's the problem with cookies :( In case they get disabled, or 
just manually canceled) $_COOKIE will not contain anything at all. Which 
is why I don't like cookies.

áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] $_COOKIE

2002-07-05 Thread Alberto Serra

Scott Fletcher wrote:
> That is what I thought so!  Thanks!
> 
> To me, the $_COOKIE seem to get data from the browser in some way.  Correct
> me if I'm wrong.  Something like a communication between cookie.
> 
> Thanks,
>  FletchSOD

ðÒÉ×ÅÔ!

Yes, that's the way it works. Once you do a setcookie() on the server 
you actually issue a sort of "delayed command" for the client, if you 
pardon me the expression :) In short, when you print out your HTML you 
also tell the client to save some data in its disk (or RAM when you use 
session cookies).

This data will be presented back later to you with the next URL request. 
It is NOT saved on the server, it is just a sort of automatic add-on 
that you will have on all links pointing to you until the cookie 
expires. It will be presented to those URLs you specify when building 
the cookie (usually you will want to limit their action to some 
subdirectory to avoid having back data out of context).

Sounds very nice, but... But the trouble is that in doing so you issue a 
command to a machine of which you know almost nothing. Most of all, you 
don't know whether it's capable of executing your order. Or willing to, 
since users may disable cookies.

Sort of blind date, but the girl may actually not show up later... 99% 
she will, but you should not count on it.

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


> 
> "Alberto Serra" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 
>>Scott Fletcher wrote:
>>
>>>I have a question!  Since the $_COOKIE is on the server side, not on the
>>>client side.  So, will the use of hte $_COOKIE be affected when the
>>
> user's
> 
>>>browser disabled the cookie?  I do not know how the $_COOKIE on the
>>
> server
> 
>>>side work or get the information from.
>>>
>>>Thanks,
>>> FletchSOD
>>>
>>>
>>>
>>
>>ðÒÉ×ÅÔ!
>>
>>Yes, that's the problem with cookies :( In case they get disabled, or
>>just manually canceled) $_COOKIE will not contain anything at all. Which
>>is why I don't like cookies.
>>
>>áÌØÂÅÒÔÏ
>>ëÉÅ×
>>
>>--
>>
>>
>>@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@
>>
>>LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
>>lOrD i'M sHiNiNg...
>>YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
>>tHe TeSt, YeS iT iS
>>ThE tEsT, yEs It Is
>>tHe TeSt, YeS iT iS
>>ThE tEsT, yEs It Is...
>>
> 
> 
> 
> 



-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Is there an easy way to divid up HTTP_USER_AGENT?

2002-07-05 Thread Alberto Serra

ðÒÉ×ÅÔ!

> Because!

LOLOL okay. You can use this javascript stuff, it's more accurate and 
does not get fooled by the rubbish people write in their user_agents



// This function attempts to determine visitor's spoken language
// 
function browser_language() {
   if (navigator.appName == 'Netscape')
 var language = navigator.language;
   else
 var language = navigator.browserLanguage;

   return language;
}


// This function states whether browser is java_enabled
// 
function java_enabled() {
   // Find whether java is here
   if (navigator.javaEnabled() == 1) return "Y"; else return "N";
}


// This function states whether browser is font smoothing capable
// 
function fontSmoothing_enabled() {
   // Find whether fonts smoothing available
   if (window.screen.fontSmoothingEnabled == true) return "Y"; else 
return "N";
}


// This function is used to generate  the SRC parameter for the iframe
// in order to pass it all estracted parameters on clients workstation
// without using cookies
// 
function launch() {
   window.onerror=null;


   document.location = "somescript.php?"+
   "language="+ browser_language() +"&"+
   "screen="+ 
window.screen.width+"x"+window.screen.height +"&"+
   "screenavailable="+ 
window.screen.availWidth+"x"+window.screen.availHeight +"&"+
   "colours="+ window.screen.colorDepth +"&"+
   "fonts_smoothing="+ fontSmoothing_enabled() +"&"+
   "java="+ java_enabled() +"&"+
   "browser="+ navigator.appName +"&"+
   "version="+ navigator.appVersion +"&"+
   "mozilla="+ navigator.appCodeName +"&"+
   "os="+ navigator.platform +"&"+
   "ref="+ document.referrer;


ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×





-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] total (slightly OT)

2002-07-05 Thread Alberto Serra

ðÒÉ×ÅÔ!

watch out mysql (or whatever db you have) for SUM() and AVG functions, 
make sure you understand what a GROUP BY clause is.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

[EMAIL PROTECTED] wrote:
> Hey everyone,
> Am working late as usual before the weekend and so I fear i'm a bit braindead!
> Anyway,heres my problem
> I have fields named "total" and "avg" and no idea how many records
> how do I get the total and average?
> Do I use a function?
> 
> I know this is pretty simple but.
> 
> 
> Any help appreciated,
> -Kim.
> 



-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Survey: MySQL vs PostgreSQL for PHP

2002-07-05 Thread Alberto Serra

ðÒÉ×ÅÔ!

That's interesting. I actually never used Postgres on production 
environments, so... How often does it melt? And is there a known reason 
or it's just a matter of *luck*?

My opinion is that Mysql is after all nothing more than an ISAM file 
system, which can be queried by SQL. And it's more than enough for most 
small sized projects.

I dunno about InnoDB and BDB, but once referential integrity is the 
issue I'd move straight to Oracle and avoid the hassle of debugging some 
new engine features myself. At least, in a production environment. 
Oracle will also perform much better than anything else, if properly 
configured and maintained. But moving to such an environment requires a 
full time administrator if you do not want your performance to downgrade 
dramatically after some time.

In a web environment usually people do not want to spend that much 
money, so actually most of the stable stuff will probably remain on the 
ISAM file systems for a while more. After all it works, right?

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

Joa~o Paulo Vasconcellos wrote:
> I don't feel that. I run a web site with a big deal of traffic, and in speed 
> and scalability, MySQL is better than PGSQL or Sybase. I know because I tryed 
> each one of these before getting to MySQL in definitive. Sybase is WAY 
> too slow, and Postgres has a habit of melting down from time to time. In the 
> features field, if you need referential integrity you can use InnoDB or BDB 
> tables in MySQL, wich supports ON DELETE CASCADE and many things more, like 
> row-level locking, blah, blah, blah. To keep your data secure, Sybase is a 
> better option than PGSQL, because when PGSQL melts down, you lose some 
> records as a gift. I had not seen this behavior mainly because I did not ran 
> PGSQL long enough to see this, and the memory requirements of Sybase are just 
> too much to stand. I prefer MySQL above every other, even lacking SP's. Of 
> course, my business do not require anything more than standard MyISAM offers, 
> so PGSQL may be a better option in some cases.
> 
> 
> 
> On Friday 05 July 2002 17:59, Lazor, Ed wrote:
> 
>>How many here feel PostgreSQL has surpassed MySQL as the better backend for
>>PHP?  This would be based on performance (speed, scalability, etc.) and
>>features.
>>
>>-Ed




-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Re: PHP for AIX.5.1

2002-07-05 Thread Alberto Serra

Scott Fletcher wrote:
> Yea, it use the Linux Kernel.  I had to download RPM stuffs from IBM.  It
> can not be from Red Hat or any other.  IBM take the source code and put it
> into RPM.  IBM kept making error message about some RPMs, so that is why I
> went back to non-linux kernal AIX.
> 

ðÒÉ×ÅÔ!

Try installing the RPMs with the --force parameter. It usually solves 
the problem on Linux and since the kernel is the same...

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] HTTPS vs. HTTP ?

2002-07-05 Thread Alberto Serra

Lazor, Ed wrote:
> I saw that Microsoft has a Certificate Authority server package that allows
> you to create your own key.  Is there a way to do this in linux?  In this
> particular instance, it's me accessing my own web site.  I'd like to encrypt
> the session and I'm don't need someone to confirm anything.
> 
> -Original Message-
> Around these parts the client and server use a self-contained process to 
> handle the key exchange. The server's key has been signed by a certificate 
> authority (Verisign, etc.) 
>  


ðÒÉ×ÅÔ!

just install the OpenSSL server. It's part of the installation 
procedures. watch here:

http://www.delouw.ch/linux/Apache-Compile-HOWTO/html/index.html


ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] localhost - passing variables

2002-07-05 Thread Alberto Serra

Tony Tzankoff wrote:
> Is it possible to pass variables in PHP on the localhost server? Is there
> some kind of setting or something that I need? I am new to this and am not
> sure how to go about this. When I upload to a server, the script I have
> works just fine; but when I work on it locally, it does not work. Please
> help while I am still technically sane. Thanks. :oP
> 
> Tony Tzankoff
> http://www.tzankoff.com
> 

ðÒÉ×ÅÔ!

Watch your php.ini on localhost. I would bet you got register_globals 
off. Then look in the online manual and try to have your stuff working 
on localhost with that parameter off. Sooner or later your provider will 
upgrade, too. If you don't solve it now you'll end up having your 
production site blocked later.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] HTTPS vs. HTTP ?

2002-07-05 Thread Alberto Serra

Miguel Cruz wrote:

> Yup. You'd think that the browser developers would come up with a way to 
> indicate this (mouse pointer turning to a lock when hovering over a submit 
> button, etc.).
> 

ðÒÉ×ÅÔ!

Yes, it's a GREAT idea! would make our HTTPS processing traffic much 
better (that is, quicker). Besides, using an HTTPS server implies 
(correct me if I am wrong) consuming an IP number, which is why site 
owner pays extra money for the service, while having the address masked 
withinh a form would make it possible to use addresses such as 
HTTPS:www.providersite/com/namevirtualsite without loosing commercial 
image. And saving quite a lot of IP numbers from being spent just for a 
matter of commercial image.

We might just start putting on our sites some sort of "lock" button 
defined by CSS. If many of do it, maybe the idea will pass thru.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Stored Procedures

2002-07-05 Thread Alberto Serra

David Busby wrote:
> List,
> I'm using a postgres datbase for my PHP project, how do I make 
> stored procedures?  Or if no SPs then what would be recomendation for 
> building simple/reuseable "Put" and "Get" procedures for my data?
> 
> /B
> 
> 

ðÒÉ×ÅÔ!

Stored procedures ARE much better, (I have a long Oracle background so I 
am a biased source :)) BUT... If you want to make sure your code is 
fully portable you should take some cautions. That is:

1) don't use direct dbfunctions calls: (like mysql_something or 
pgsql_sothing). Make an insulation layer by calling DB_something, which 
is a function defined in a library of your own. If you have to move to 
another db engine you'll just change the redirection here and your SQL 
code will hold.
2) don't execute SPs directly, for the very same reason. In your 
insulation layer declare a procedure like DB_SP, which switches on the 
name of the SP you are calling and then calls the db. If you'll have to 
move to an engine that has no stored procedures you'll be able to write 
PHP functions (or whatever) that will substitute your SPs without 
killing your legacy stuff.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] ./configure with register_globals turned on?

2002-07-05 Thread Alberto Serra

Scott Fletcher wrote:
> I tried following all of your suggestion and so far, still the same.  I
> tried changing other feature in the php.ini and check the phpinfo and found
> that they haven't changed either.  So, the problem lie with the file path in
> finding the php.ini file.  I only have one php.ini file.  The other are in
> the php source code.  Oh well, I'm going to let it go and move on!  Need to
> finish upgrading the website and if there time, start experiementing on
> moving the website to Linux.  I'm going to try mySQL instead of IBM DB2.

ðÒÉ×ÅÔ!

The problem is the same on old AIX (as far as I can remember). 
Distributions install Apache as httpd and NOT as /usr/local/apache. So 
you end up having multiple configuration files for everything.

Instead of upgrading, try eliminating the old installations first, then 
install as fresh from the tarball. Works for me. Remember checking 
httpd.conf and php.ini. Just a plain find / will make sure that you have 
no "ghosts" left around.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×
-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] I am probably dumb but why isn't this inserting stuff intomy DB?

2002-07-05 Thread Alberto Serra

JJ Harrison wrote:
> Attached is the file.
> 

ðÒÉ×ÅÔ!

No attachment came :(

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] HTTPS vs. HTTP ?

2002-07-05 Thread Alberto Serra

ðÒÉ×ÅÔ!

yes, but in that case your Apache is running just ONE web site. Most 
people buy VirtualDomains which are namebased and not IP based. And they 
cannot share an IP number with other sites with SSL, AFAIK. Or am I 
misunderstanding the docs?

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

Jonathan Rosenberg wrote:
>  -Original Message-
> 
>>From: Alberto Serra [mailto:[EMAIL PROTECTED]]
>>Sent: Friday, July 05, 2002 8:54 PM
>>Cc: [EMAIL PROTECTED]
>>Subject: Re: [PHP] HTTPS vs. HTTP ?
> 
> 
>>Besides, using an HTTPS server implies
>>(correct me if I am wrong) consuming an IP number,
>>. . .
> 
> 
> Ok ... you're wrong.  HTTPS just uses a different port, same IP
> address.
> 
> 
>>ÐÏËÁ
>>áÌØÂÅÒÔÏ
>>ëÉÅ×
> 
> 
> --
> JR
> 
> 
> 



-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] I would like to ask about Photo Upload in mysql and reteiveproblem .

2002-07-05 Thread Alberto Serra

Jimmy Lam wrote:
> Dear all , 
> 
> I am a new bie here and I would like to know more about coding in upload photo 
>file 
> 
> Jimmy 
> 

ðÒÉ×ÅÔ!

just read the online manual. Everything is quite clear there about all 
sorts of uploads. Examples included.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Cannot enable extensions. Why?

2002-07-05 Thread Alberto Serra

ðÒÉ×ÅÔ!

 > gh> ; Whether or not to enable the dl() function.  The dl() function 
does NOT
 > gh> work
 > gh> ; properly in multithreaded servers, such as IIS or Zeus, and is
 > gh> automatically
 > gh> ; disabled on them.
 > gh> enable_dl = On

Solution is self-evident: format your hard-disk and install something 
like an operative system and a web-server on it :)) LOLOLOLOL You cannot 
expect to use Microsoft and have no problems, right? (not that I'd call 
Unix a paradise, but at least basic functions do work )

Don't fire back, today is Ivan Kupala Day and I am sitting here working 
while everyone else in town is having a drink, so I'm in the mood for 
cracking jokes a bit :))

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Cannot enable extensions. Why?

2002-07-05 Thread Alberto Serra

ðÒÉ×ÅÔ!

Miguel Cruz wrote:
> I can't believe it! I totally forgot it was Ivan Kupala Day!

Now that's too bad :)) You missed a great chance to party :))) Well, 
just as much as I did... :(

BTW, I better not say anything about Unix anymore... as soon as I sent 
that mail Mysql died :(( Looks like Old Ivan's soul is quite unhappy 
about me doing my work here while his party goes on... Or maybe he is on 
the Microsoft paylist... The devil knows it, as they say here :)))

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Re: Sort with PHP or SQL?

2002-07-05 Thread Alberto Serra

ðÒÉ×ÅÔ!

> Any suggestions on how to do this?  

Yes,

1)
*DO* look around and find yourself some text about normalization. I 
mean, paper. Something you can hold in your hands without rushing to 
try-and-code it. Then get yourself a sigarette (if you are a smoker) and 
spend two hours of your life making sure you perfectly understand what 
data modeling is like. If you miss this step there is almost nothing 
that people can do to help you.

2)
Look for a list that specializes in data-modeling. That's definitely OT 
here. Not that I don't want to talk about it, but reading this list will 
not give you much in that direction.

> Any ideas on optimizing this?  DB stuff doesn't come near the top of things
> I'm good at :)  

> The other problem is that any pages that end up having no
> Header "disappear", which is a good thing on the menu, but a bad thing on
> the admin pages when you're trying to connect all of them.

See point 1).

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] Charset/language request headers

2002-07-06 Thread Alberto Serra

ðÒÉ×ÅÔ!

I am not too familiar with the way language and charset requests are 
coupled by browsers. After processing the headers I get this two arrays 
(based on my personal Mozilla settings).

charset  -> Array ( [0] => KOI8-R [1] => utf-8 [2] => * )
language -> Array ( [0] => ru [1] => en [2] => fr [3] => it [4] => es )

All of charset requests appear to be related to russian only, while no 
indication at all is given on how to print out alternate languages.

Which seems to imply that we have no data about which charset should be 
used to present english or french/italian/spanish text and therefore we 
must maintain some proprietary associative table on our own.

Is that right or the alternate charachter sets are actually buried 
somewhere and it's just me being too ignorant to find them? I suspect I 
am right, because multilinguistic sites tend to show special chars as 
out of context cyrillic charachters on my browser... Which *is* pretty 
stupid. :(

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] Charset/language request headers. Yes, it's true :(

2002-07-06 Thread Alberto Serra

ðÒÉ×ÅÔ!

Doing multiligual sites presumes you can somehow understand what the 
client expects from you. Browsers all are full of language settings, 
but... The HTTP specification is very little language negotiation 
oriented in itself (this is probably a consequence of its having started 
out in a 100% english speaking environment).

I have been checking the docs here and there, but that's the way it is. 
  If russian was my second choice there would be no way to decide 
whether I should be sent a KOI-8 doc or its cp-1251 equivalent. And 
although I am not a chinese speaker I do suspect the same problem to 
arise there. Now I finally understood what was the need for a russian 
edition of Apache.

You can check some docs here: http://www.cs.tut.fi/~jkorpela/http.html 
it's a pretty handy site.

All language negotiation specification ignores the charset issue. It 
appears as if the two things had been projected separetely, by people 
that simply did not know about each other. And since people speaking 
more than one language are a minority I would expect this issue to 
remain "as is" for a century or so...

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] mail help, and php.ini help.

2002-07-06 Thread Alberto Serra

ðÒÉ×ÅÔ!

Greg Scotts wrote:
> $to #
> $from #
> $subject #
> $message #
> mail($to, $from, $subject, $message)

It always worked for me... you obviously checked variable content, did 
you? And I am not sure I got you right. Mail gets sent, it's just the 
sender address being wrong?

> Also, i was wondering how i could use my own PHP.INI config file on a =
> remote webserver which hosts my site.

You need a shell with root access. I doubt you will be given one.

> And can i set .php to something else, like .he for example?

Yes, if you are root :) You need to do it in your httpd.conf (that's 
actually something Apache must now. For PHP file extension is totally 
equivalent, you could have no extension at all and they would work. It's 
Apache that needs some rule for it to know how it's going to process the 
request).

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] help help help!!!!!!pls........

2002-07-06 Thread Alberto Serra

Balaji Ankem wrote:

> I have multiple check boxes ...and I gave the single name to all check
> boxes.
> 
> If I post to my php script I am not getting all the values as an
> array.I am getting only one value(last value).

Correct. Since they are all named in the same way, the last one kills 
them all.

> If I give name as OptionList[] I am getting an error for selectAll
> option. 

I never came to think about it, but the [] thing may actually disturb 
jscript.

I usually do it like this:

HTML side


   
 
 
   Option 2
 

Hi


   
 
 
   Option 2
 

Hi



PHP side
-
   # put the received input into an ordered structure
   ##
   $count = 0;
   while ( isset($control[$count]) ) {

 # Build variable names;
 ###
 $w_OptionList = "OptionList_".$count;

 # get actual form values
 
 $OptionList[$count] = $$OptionList;

 $count++;
   }

Javascript
--
I never use selectAll. But you can easily walk the array down in the 
very same way.


ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Re: Sort with PHP or SQL?

2002-07-06 Thread Alberto Serra

ðÒÉ×ÅÔ!

Pekka Saarinen wrote:
> Also, many virtual hosts share MySQL server(s), so offering a choice to 
> use PHP for pagination and sorting on "own server RAM/CPU" may by 
> beneficial. I also believe that anything that produces less load to 
> MySQL is good.

Absolutely true. First time a customer of mine wanted to host in the 
States he got offered Oracle on dedicated machine. Looked quite good, as 
usually having DB server on a dedicated machine performs *much* better.

Eventually, we found out that the yanks had *one* db server for 
something like 50 overloaded webservers. The poor dbbox was actually 
serving an incredible amount of MySql dbs, too.

So poor configuration must be taken into account. Especially when you 
are hired into a project and cannot really choose who the provider is 
going to be. In that case an oracle instance was *much* slower than a 
PHP sort out of a plain text file. And we are talking about a ridicolous 
amount of rows...

Everything may happen...

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] issue with script after php upgrade

2002-07-06 Thread Alberto Serra

ðÒÉ×ÅÔ!

Jamie Novak wrote:
> http://myserver/index.php?dir2=somedirectory
> 
> In 4.1.2, if I echo $dir2 at the beginning of the script just for
> testing, it will echo the value of the variable without issue.  In
> 4.2.1, the variable never appears to get set at all, although it does
> show up just the same in $QUERY_STRING under both versions of PHP, so I
> know something is at least being passed back to the server.
> 
> Does this make sense how I explained it?  Can anybody tell me what's
> changed between versions that would make the script (or, really, PHP)
> ignore the value I'm passing back?  (I looked at the changelog, but
> didn't really see anything that I understood to be related to the
> problem I'm experiencing.)
> 
> TIA,
> Jamie
> 

You did look for a leaf and missed the tree :)) Look for 
Register_globals in your php.ini file. It's *off* in the new versions 
and it should be so for security reasons. Just check the docs in the 
online manual and everything will be clear :))

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] HTTPS vs. HTTP ?

2002-07-06 Thread Alberto Serra

ðÒÉ×ÅÔ!

Chris Shiflett wrote:
> Richard,
>> Do you really believe that for $200 (or $119, or $500) that they "proven"
>> themselves trustworthy?

LOL no, I don't. As a matter of fact crooks usually have more money in 
their pockets than honest people do, so it's highly possible that a 
crook will pay the money while the innocent will save his last cent :))

> Now you've changed from "secure" to "secure from snooping." Notice the 
> difference? It is significant. Like I said before, encrypting the 
> transmission is useless by itself. To put it plainly:
> 
> encryption != security
> 
> What if you trust your friend who owns safeplace.org, and you want to do 
> business with him? Maybe you visit his site and enter a credit card 
> number somewhere. Thankfully, you notice that the lock icon is showing, 
> and that he is using SSL. With this warped idea of SSL where encryption 
> is all that counts, what if you find out that you're not really on 
> safeplace.org? You're really at evilcriminal.org, and he has a virtual 
> domain setup for safeplace.org. Also, he generated his own certificate 
> for safeplace.org using his own CA (good thing there was not C&A process 
> to undergo). So you have now sent the evil criminal your credit card 
> number because you trusted his domain name. Good thing it's secure, right?

So, let's see if I got you right:

   1) SSL just says we our packets are difficult to open, that is,
  they are encrypted. Nothing more

   2) Our packets are difficult to open but they are totally open
  to Uncle Sam's control software, as the RSA thingy cannot
  shield them from "governmental inspection", which makes sense
  if you are writing software for an american citizen but
  it's pretty annoying if your customer is from somewhere else.

   3) A key is nothing more than a negotiation token, a mere building
  brick that is used to fire the process.

   4) the "trust" you buy is something like a fixed IP number, that is
  the guys in the major do certify that you *are* who you pretend
  to be.

   5) If the one I am pretending to be is a criminal, being trusted by
  Verisign (or whoever in their place) won't make any difference.
  Their "license" just means that you are really dealing with those
  you think you are dealing with and that they do bear legal
  responsibility for whatever will happen in the transaction.
  Again, legal action will eventually have different
  results depending on where the trusted company is based, since
  not all countries have the same normative set. But that has
  nothing to do with the SSL protocol in itself.

Now, there's a question regarding point 4). What if someone from 
www.goodguys.com
gets the certified key pair and hands it over to some crook outside the 
company? I hope this is not just as easy as it sounds (the key pairs 
will probably check something in the environment before starting to 
shout "YEAAAH!! IT'S MEEE!!!") but still...

As for point 2), please get me right. I have my own political opinions 
as anybody
else, but my concern here is a professional one, since my customers are 99%
not americans. Small-mid sized companies (including mine) usually do not 
give a
damn about having their messages read by american eyes (we are simply 
not worth the trouble of looking in our archives) but large companies 
and Govt. organizations are *much* less indifferent to the subject, and 
I guess it's understandable, they want their privacy to be for real.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Thanks

2002-07-06 Thread Alberto Serra

ðÒÉ×ÅÔ!

Probably a stupid question. Is there anyway to force POSTing a form from
the refresh META?



IMHO that is NOT possible, but maybe I am wrong.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] Posting with refresh META

2002-07-06 Thread Alberto Serra

ðÒÉ×ÅÔ!

Sorry, I forgot writing a intelligible subject on previous posting :( So 
I repeat.

Probably a stupid question. Is there anyway to force POSTing a form from
the refresh META?



IMHO that is NOT possible, but maybe I am wrong.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] Привет!

2002-07-06 Thread Alberto Serra

ðÒÉ×ÅÔ!

I detach this from current thread as it has nothing to do with it :)

now:
   ðÒÉ×ÅÔ! means "hello" (pronounce "preevjet", accent goes on je)
   ÐÏËÁmeans "bye"   (pronounce "paka" accent on last a)

The rest is just my name (Alberto, I am italian as of original 
nationality) and the name of the place I am, that is, Kiev, the capital 
of Ukraine :)

I got SOOO annoyed by charset trouble in the last week that I decided to 
do something to enhance people's consciousness on the matter, by mixing 
alphabeths and languages in all of my mails.

Yes, it IS a pointless effort made by a powerless dwarf. :)

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Thanks

2002-07-06 Thread Alberto Serra

B.C. Lance wrote:
> not from meta refresh. but javascript could do that. set a timeout that 
> will fire the submit event after 2 seconds. that will work.
> 
> b.c. lance
> 

ðÒÉ×ÅÔ!

I already have that and it works fine. The problem is when jscript is 
not working (or missing). I was trying to build up some panic tree in 
case jscript fails.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×




-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Thanks

2002-07-06 Thread Alberto Serra

B.C. Lance wrote:
> you might wanna fire that javascript using onload from the body tag. 
> that kinda assure the page is loaded successfully before the event takes 
> off.

ðÒÉ×ÅÔ!

It is there already. My problem is to do it something that will save my 
*ss in case jscript is *NOT* there. So it must be a no thrills HTML 
solution that will run anyway, no matter how poor in resources the 
browser is.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Thanks -> Actually POSTING without javascript

2002-07-06 Thread Alberto Serra

ðÒÉ×ÅÔ!

B.C. Lance wrote:
> hm... how about sticking couple of iframes that will load the piece of 
> javascript and have each of the javascript in the iframe firing at 
> different time? i suppose at least 1 copy of javascript will be there to 
> do the intended work.

I realize I was being obscure :) BTW, the solution was obvious, I'll 
better explain what I am doing.

This is a "loader" utility that is put instead of the index.php script 
to configure a session by understanding what kind of client is calling, 
so it's very generical software that is shared among many a project.

In short, what index.php does is:
1) accept command line parameters (and the docs referrer) that are 
received and stock them somewhere for later use
2) sets a test cookie
3) generate a page that shows "loading..."

javascript in this page verifies user configuration (screen, java 
enabled, platform etc) and stuffs this data into a hidden form then 
sends it back to index.html where data will be used to understand 
whether we can rely on jscript and cookies within this session.

*The problem was here*. What if this second step fails? easy, I just 
leave the META as is and stock previous data on a session during the 
first execution of index.php

At this point index.php knows all it needs to fill in cionfiguration 
data and it just includes the real home page. From now on we will be 
able to tailor channelling (that is, cookies or not, jscript or not) 
without reasonable doubts. Yes, the user *may* change it's configuration 
during the session, but this is very low percentage of cases and we can 
live with it.

Well, that's the most general part of it. But at least it's clearer.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×



-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Having more problems

2002-07-06 Thread Alberto Serra

ðÒÉ×ÅÔ!

Shiloh Madsen wrote:
> 

> $LoginDB=@mysql_connect($dbhost, $dbuser, $dbpass);
> if (! $LoginDB) {
>   print "Unable to connect to the database server at this time.";
>   exit();
> } else {

This can be just:

$LoginDB=@mysql_connect($dbhost, $dbuser, $dbpass) or die('Unable to 
connect to the database server at this time.')


>  }
> ?>

Sorry, what exactly are you trying to do here?

As for a general advice:
   1) use libraries. Make yourself a public dibconnect funcion. Chances
  are your user/password will differ depending on where the code gets
  executed (production or development) You don't want to go thru
  hundreds of scripts the recode that, right?
   2) Look for a very old PD class called FastTemplate. I know people
  will object that it adds to general execution and lowers
  performance, but that will allow you to keep your HTML code
  well separated by your scripting. And it does help, especially
  when you are not sure about what you are doing.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Linked drop down selection lists and dynamically generatedlinks

2002-07-06 Thread Alberto Serra

ðÒÉ×ÅÔ!

Peter Goggin wrote:
> Can this be done using only PHP or do I need to use Javascripts?

managing this in PHP should be considered *only* when jscript is not 
available. It's a matter of load distribution.

When doing client server applications (like the web is) you shall always 
remember that any interaction about the two entities adds up time to the 
result. Which, incidentally, is the point in using Stored Procedures 
(when they are properly coded and the db engine is capable of supporting 
them) instead of making tons of single SQL calls from a single PHP script.

Now, if all of your data is already on the client (somehow stoked in 
jscript variables) your user interaction will be quick and easy. If you 
call PHP any time you will get a serious delay (because you do issue a 
request along the net, then the server processes it and sends it back to 
your browser, that again processes it and shows it). So this should be 
considered an emergency solution only.

A 100% robust solution should contain both, and call PHP only if jscript 
is not available on the client. But this is costly and requires the two 
procedures to be realigned everytime you have some change going on. Most 
applications can just use javascript and forget about it.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Thanks -> Actually POSTING without javascript

2002-07-06 Thread Alberto Serra

ðÒÉ×ÅÔ!


> an image of brintney spear and a text on it telling the user to click on 
>  sounds appealing to you? ;)

LOLOL yes, something like that :) when the second execution fails (that 
is, the refresh META sends back no data on the POST channel) we show the 
user a form with the local logo, where he just says what the dimensions 
of his screen are and we assume that javascript is not present within 
the sesion :)) The problem was just in not losing the referer and the 
passed link while doing all this snake-like contorsions :)

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×



-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Mailing all the elements of a form

2002-07-06 Thread Alberto Serra

Jeremy Bowen wrote:
> Hey,
> 
> I have looked in PHP manual but I cannot seem to find what I am looking for.
> 
> I have a very large form that I need to be able to mail. I just don't want
> to have to code all of the field into my mail() function.
> 
> Thanks,
> 
> Jeremy
> 
> 

ðÒÉ×ÅÔ!

*IF* the form is only to be mailed, and no other action shall be taken 
on the data it contains, you can use CGI processing instead of calling 
PHP. Can't remember the name of the call now, but there is something 
like that on every site.

*IF* you also want to process data *AND* mail it, you will have to to 
build the $body mail function or do some tricky things to have a second 
copy of your form built in a self-closing entity (DHTML can do that) 
which will perform the CGI action while your PHP script takes care of 
processing the original form.

Usually is much quicker to code the mail body. It depends on the context 
you are in.

ÐÏËÁ
áÌØÂÅÒÔÏ

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Linked drop down selection lists and dynamically generatedlinks

2002-07-06 Thread Alberto Serra

Naintara Jain wrote:
> this is of course, keeping in mind, that your backend (database data) is not
> changing every few seconds. If you are dealing with dynamic data, such that
> the list options might be changing at every moment then you would need the
> latest database data and PHP would need to be used after the selection in
> the 1st list.

ðÒÉ×ÅÔ!

True! If you have dynamic stuff you might consider having an invisible 
entity on your page that gets refreshed at constant intervals with a 
server call and contains a flag result. Any time the flag is set 
user-interaction will fire the PHP refresh, while you will still be 
using javascript when possible.

This will save you a lot of user complaints. People hate to wait for a 
second. It's maaad world :)

This road leaves a potential inconsistency problem that you shall solve 
on the final PHP call: user might send in the data before the flag is 
set. In that case you shall refresh the data and ask the user to repeat 
input. It's called an "optimistic strategy" :)

Actually, whether you can use it or not depends on the update frequency 
of your dynamic data. Plus some tailoring on the intervals (you don't 
want to kill your server by sending it millions of "check-the-content" 
requests). Decision is based on the number of users and the update 
frequency.

ÐÏËÁ
áÌØÂÅÒÔÏ


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Problem with SQL query

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

> I can't figure out what is wrong with this:
> 
> $query = "select count(*) as monthly_views from visitors group by
 > extract('year', time), extract('month', time) order by monthly_view desc
 > limit 1";

AFAIK this is no ANSI SQL, which is why is not portable. Your query 
should really be

SELECT
extract('year', time),
extract('month', time)
count(*) as monthly_views
FROM
visitors
group by
   extract('year', time),
   extract('month', time)
order by
   monthly_view desc
limit 1

*BUT* extract doesn't seem to be a MYSQL function, you most probably 
need to use DATE_FORMAT. Look in the Mysql docs for this.

As a general ANSI rule group by functions *need* the fields on which 
result is grouped to appear *first* in the query. Take half an hour to 
look at the GROUP BY docs in MySQL online manual, everything will become 
much clearer.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Problem with SQL query

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

I forgot to add:

SELECT
extract('year', time),
extract('month', time),
count(*) as monthly_views
FROM
visitors
group by
   extract('year', time),
   extract('month', time)
order by
   monthly_view desc
limit 1

I take it that you have a *monthly_view* column in your table that is 
not the *monthly_views* alias yoiu use in your query. if that's a typo 
and you mean to order by the numebr of visitors (that is, you want the 
most visited month on top of the result) your query should probably look 
like:

SELECT
extract('year', time),
extract('month', time),
count(*) as monthly_views
FROM
visitors
group by
   extract('year', time),
   extract('month', time)
order by
   3 desc
limit 1

That's because most databases (and I guess MySql is no exception) will 
not be able to use an alias in their GROUP BY, ORDER BY clauses. But you 
may want to try, maybe MySql *is* an exception, after all.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Splitting up a timestamp?

2002-07-07 Thread Alberto Serra

Tony Harrison wrote:
> Hi. I please need some help with converting a MySQL timestamp into something
> easily read. Any help at all is most appreciated, thanks.
> 


ðÒÉ×ÅÔ!

use DATE_FORMAT. (it's a MYSQL function, not a PHP one). Look for it in 
the online MySQL manual.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] inserting linebrakes in multisite forms

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

andy wrote:
> One Form has a textfield, I submit it to another html site where there is
> another form with a textfield. Inside this textfield I place a hidden field
> with the value of the field from page 1 then I submit to the actual php site
> inserting the values into a db.

So, let's see if I got you right:

Form 1: a textfield, you submit it to another page (no matter whether it 
is on the same host or not, this should not make any difference)

Form 2 contains:
   1) a hidden field with the value from form 1
   2) another text field for new user input
You submit form 2 and nl2br does not work on the values of the hidden 
field. Right?

If that is so it's simply because once the value gets put in 
form2/field1 it has already lost the new lines.
So you should run nl2br on it *before* it gets submitted the second 
time. Do it when you send the value to form2.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] About submitting multipart.forms

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

MG Lim wrote:
> has anyone met with this problem.. using IE to submit multipart forms. in
> text fields if there is "&" ... all text after it will disappear..quite a
> nuisance when submitting

yes, all dangerous chars should be substituted. Like " for the " 
symbol. It's not just IE, it's any browser.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] transporting variable via post to another site

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

andy wrote:
> Everything works fine exept of error handling. Which means if a user wants
> to go back from step 2 to one and has already filled in some data in site 2
> he will loose this data for sure. It is not possible to transport the data
> via get anymor because the text is way to long.

Okay, this means Form 1 can be entered from two directions:
   1) the usual sequence (that is, the way users usually get to it)
   2) getting back from Form 2

If you place a button on Form2 saying "go back to form 1" when your user 
presses it just post your current data back to the script of form1. 
*PLUS* you add a hidden field called *FLAGBACK* (or whatever you want to 
call it like.

when the script that prepares form1 is called it must check for 
*FLAGBACK* being present. If not, it will do the same old stuff, if yes 
you just write a new branch that will put the data back into form 1. Easy.

*BUT* all this will never protect your user in case he just presses 
*back* on his browser. Make sure this is well explained on the page.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] transporting variable via post to another site

2002-07-07 Thread Alberto Serra


ðÒÉ×ÅÔ!

andy wrote:
> sorry maybe I did explain it not good enough.
> 
> The problem is that if a user has entered data in form 2 goes back to form 1
> and forward to form 2 again, the data he entered once in form 2 is lost. And
> I do not find a way how the get the data out of form 2 because the back
> button is placed in form 3 (same site as form2 ) to allow a different action
> since we have to link to another site then in form 2.
> 
> sounds confusing? I know but I hope I explained it ok

Honestly yes, it does :( Cant't you draw a sort of diagram? Besides, I 
will probably also need to know how data is modelled (that is, what your 
tables look like) to give you meaningful advice.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Problem with SQL query

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

Mark Charette wrote:
> LIMIT was not included in the SQL92 SQL standards and very few vendors
> implement all of SQL99; the use of ANSI standards to promote "portable"
> programs has always been beset by this kind of problems.

Yes, and vendors just love to have proprietary standards to protect 
their market shares. The basic idea is that since you cannot just switch 
from an engine to another without seriously risking your application 
stability you will tolerate the "yes, it's a known bug" answer, whenever 
your 100 thousand dollars application cannot print a simple data report 
because trying to set fonts size will crash the current job. Or when 
real numbers are returned with a different values from the one you wrote 
in.

Not talking about MeAndMyFriendJoe'sXperimentalSQLMachineGun 0.0, That 
was Oracle 7.3 with Developer (fonts) and Oracle 8.something under WinNT 
("floating" real number values).

Eventually they solved both the problems (I have to say they even did it 
quick) but you can imagine the atmosphere when the final customer had to 
be told that they had invested an overall amount of 25k$ a day for 2 
years just not to be able to print a common report and that Oracle just 
answered "yes, it's a known bug - bug precedence level: low".

Which actually meant: "go ** yourselves, we ain't got no time for your 
stupid customers". If only they could switch engine... But they switched 
to their lawyers in instead and kept the engine running, because no ANSI 
was there (and because we all knew that no better stability was to be 
found on other vendors anyway).

Some things in escaping the ANSI standard are useful, though. Things like
Oracle's DECODE and the LIMIT clause do make query sets smaller and 
quicker.
And yet, IMHO most of the opposition to ANSI comes from a mere 
commercial point of view.

This way vendors can keep releasing poor alpha stuff and call it a 
"stable" release without having to worry about spending test money. Test 
is something you are going to do yourself, paying for it with your own 
money and your own professional credibility. No wonder vendors are happy 
with it.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] flip function

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

> I've tried with create function, for example:
> 
> function flip($f,$arg) {
>   return create_function('$y','return '.$f."($arg".',$y);');
> }
> 
> But if you use flip("foo",$o1) where o1 is an object then it won't work.

Never tried that on Haskell coding, but it did solve most of my trouble 
with objects:

function &flip(&$f,&$arg) {
return create_function('$y','return '.$f."(&$arg".',$y);');
}

then

flip("foo",&$o1)

I guess you will need same experimental work (and a lot of patience), 
but once you can fix the root problem usually everything else goes okay.

Just watch out for null returns. If you return an unassigned variable 
from an object member the most fantastic things begin to happen. And 
before reinstalling PHP from scratch (and exploring all of the 4 letters 
words you can think of) you should really check that you just simply did 
not end over an unassigned variable :)

ÐÏËÁ
áÌØÂÅÒÔÏ


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] HTTPS vs. HTTP ?

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

>> Chris Shiflett wrote:
> it is very misleading and would indicate that I 
> have very little knowledge about PKI systems, 

Come on, nobody here would ever think of that. Especially since most of 
us (put me as first one in the list) should know much more about PKI 
ourselves before judging anybody's knowledge :) Which is why we keep 
making questions that sometimes may be pretty absurd.

> I was trying to point out 
> how insecure this model would be if encryption were all that SSL 
> provided and the only trust involved was the trust of a domain name.

Yes, I've got it now.

> No government, as far as I know, can break the public key cryptography 
> currently being used by most SSL-enabled sites (using the strong 
> security - 128 bit certificates). This includes the United States.

I was saying this because I remember (maaany years ago, when the whole 
PGP thing started) reading some fire exchanges about RSA keys and the 
way the encrypting chips were going to be "friendly" to american eyes. 
Honestly, at that time I was not that interested to the issue and I just 
gave it a quick read, which left me with a wrong opinion.

> Now, SSL only encrypts your communication in transit, of course. I'm 
> sure your local government could find a way to make the entity you are 
> communicating with release the information in the communication to them. 
> This is, of course, outside the scope of SSL.

And outside the scope of my worries :) I am responsible for the software 
I deliver, whatever happens out of it is none of my bag :)

> However, it is adequate to know that one key is used to do the 
> encrypting, while the other is used for the decrypting. These are 
> generally referred to as public and private keys, because one is made 
> available to the public while the other is kept safely stored (in the 
> case of Web browsers, it is stored in the certificate repository of the 
> browser).

Yes, glad that I did use PGP sometimes :) this part is clear :) So 
Verisign is actually just "signing" the key as I did on PGP and that 
means anyone trusting me can trust you if they receive a message signed 
with your key, because when evaluating the message they will now it';s 
been signed by a key that I would trust myself. Right? Man, I don't even 
wanna imagine where and how Verisign password is kept LOLOL

> Digital certificates solve this problem. A digital certificate, as RSA 
> describes it, is a document that says:
> 
> "I guarantee that this particular public key is associated with this 
> particular user; Trust me!"

So actually, when you spend your $200 what happens is:
   1) Verisign (or whoever) starts a process to control they really wanna
  play with you (and this has nothing to do with IT or SSL, they will
  have their own policies)
   2) Verisign (or whoever) starts a process to control your public key
  and possibly something else in your system
   3) If the above has a positive answer they just sign your kay and hand
  it over to you. So there is no need for a central db. Trust is *in*
  the key and need not be searched for. The only thing to do is to
  verify that the trusting key has not been revoked.

That is, if it works like PGP. But this is probably too easy, as this 
way they would have no way to revoke my key without invalidating all 
keys on this planet. So this is a simplification. But just tell me if I 
got the basic message.

> So, assuming for the moment that we trust the certificate, we can assume 
> that a particular public key belongs to a particular user. For example, 
> you can be guaranteed that a public key belongs to me (Chris Shiflett) 
> and thus, only Chris Shiflett will be able to decrypt the communication. 
> If someone is trying to pose as me, you may send them encrypted 
> communication, but they won't be able to decrypt it.

Yes, because they have stolen the public key and could crypt the 
question but since they have not the private key they cannot open the 
answer.

> Well, I disagree that this has nothing to do with the SSL protocol 
> itself. Identification is a very important part of enabling secure 
> transactions to take place over the Web. Without this, there would be no 
> "ecommerce" as it has been dubbed.
...
> Of course, as users of Web browsers such as Netscape and Internet 
> Explorer, we have to trust AOL/Time Warner and Microsoft, respectively, 
> (yeah, scary thought) to only trust CAs that have high integrity, 
> security, etc. An extensive C&A (Certification and Accredidation) 
> process is used to make this guarantee.

Yes, but this is the part I doubt. When I buy a certificate from Kiev, 
how on earth those guys sitting in Washington are to know who I am and 
what I do for a living? They will have to handle the job to someone 
else. This layering of delegations will include banks and governmental 
stuff, and there is no such thing as a government that will not accept 
bribery.

Chris, what me and Richard doubt is *NOT*

[PHP] MING

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

has anyone been using MING extension in a production environment? Is it 
robust?

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] HTTPS vs. HTTP ?

2002-07-07 Thread Alberto Serra

ðÒÉ×ÅÔ!

This is for Chris and Miguel and all the people who threw in infos.

I just wanted to thank you all :) It's been really useful, and yes 
Chris, I guess you should post an explanation of the process somewhere. 
Most of us are prepared to use HTTPS but we can hardly explain our 
customers (and ourselves) what the hell we are doing.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] is their a jobs mailing list?

2002-07-08 Thread Alberto Serra

ðÒÉ×ÅÔ!

Peter wrote:
> I think a mailing list would be ...

I think the basic question is WHERE this thing will be. HOW it works 
becomes a secondary decision, once you know whether it makes sense to 
spend time on the project or not.

IF php.net wants to add up a job-oriented location this makes sense and 
can be discussed in depth. As for myself I can throw in a few ours a day 
of my scarce time (beginning in autumn). It's a nice way for offshore 
companies like ours to make themselves visible so it's totally worth the 
effort.

IF this is going to be the 1 billionth indipendent effort to capture 
audience share you must ask yourself first whether you can reasonably 
expect yourself to be able to position this site into a visible place. 
You hardly will have the money needed to support full-time marketing 
activity (we all already have quite a lot of things to do and tend to 
work on sundays anyway).

So I guess the first question is: do PHP.NET people need/want this thing?

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] $_REQUEST???

2002-07-08 Thread Alberto Serra

ðÒÉ×ÅÔ!

Scott Fletcher wrote:
> Can the $_REQUEST be trusted??  The documentation said it is the combination
> of $_GET, $_POST, $_COOKIE & $_FILE.  If the PHPSESSID is found in
> $_REQUEST, I can tell it is from $_COOKIE.  I wonder if the PHPSESSID can be
> stored into $_REQUEST if hte $_COOKIE is unavailable or turned off?
> 

Think of it as channels. You have 4 channels your data can come in:
1) GET (the link parameters or a form sent on the GET channel)
2) POST (a POSTed form)
3) COOKIE (data stored on the client machine IF the client machine
  will accept doing that for you)

Now, as the song goes, "you only get what you give". If you tried 
storing your data in a cookie $_REQUEST will have the data *only* if the 
cookie worked. For you to find it in there anyway you should send it 
back on multiple channels (but them why should you need a cookie when 
you are sure you are going to get anyway from another channel?)

The basic weak spot in using $_REQUEST is in that people may have your 
software believe that it received the input while they do send it from 
another channel:
   1) me disables the cookies on my browser
   2) me adds ?yourCookieName=myValue on the link (or
  &yourCookieName=myValue if you already have stuff on the GET line)
   3) you (your software) thinks you got the cookie and uses it. What
  happens next depends on the nature of data involved.

That's possible if you use the $_REQUEST. Again, it might mean nothing 
in your context (that is cookie value might be absolutely irrilevant 
from a security point-of-view). But it should be taken in consideration.

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] mbstring: Japanese conversion not working for me

2002-07-08 Thread Alberto Serra

ðÒÉ×ÅÔ!

Jean-Christian Imbeault wrote:
> Warning:  PostgreSQL query failed:  ERROR:  Invalid EUC_JP character
> sequence found (0x8140) in /www/htdocs/test.php on line 31
> 
> So I assumed that I should first convert user input into EUC-JP.

Now, let's make sure we have a clear background:
   1) japanese chars come in three flavours:
   a) ISO-2022-JP (the one you are using yourself)
   b) SHIFT-JIS
   c) EUC-JP
   2) your database setting requires you input in c) style while
  you present it values in a) style.

if all that describes your problem you have two ways out of it, which I 
cannot evaluate myself (no personal knowledge of the differences among 
the three charsets).

*Database configuration* if possible, turn your Postgres configuration 
into one that will all three charsets (this will leave you with mixed 
input, though, and it will kill your chances to do a search in your db 
later)
*charset forcing* have your input page always delivered in standard 
format, that is, just one charset. This will free you from charset 
trouble when doing the query, but might end up in having all of your 
forms showing out with a different charset, if your site uses mixed 
charset output.

I usually use the charset approach, because russian all flavours contain 
the same set of characters, it's just a different way of coding them. 
But this solution is not so painless when ported to charset that might 
be "simplified" (like chinese) or not. AFAIK Japanese should be a 
syllabic alphabeth, so probably you can do that just as I can.

If you need to have your pages using a given charset (that is, you have
legacy docs coming in one flavour but your forms need another) you can
simply SPAN your page sections into different charset areas.
that is  your text 

Mind you, this is handy *and* dangerous. In russian the two SPANned 
sections will look exactly the same, while actually being different. So 
people might end-up cut-and-pasting data from CP-1251 to KOI-8. Not sure 
whether browsers will convert that themselves on the fly. You better 
check it out.

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] mbstring: Japanese conversion not working for me

2002-07-08 Thread Alberto Serra

ðÒÉ×ÅÔ!

As for deciding what your user language/charset requests are (in terms 
of his/her browser settings) you might use this function

 // this function remains unchanged. It returns an array
 //  0 : negotiated charset
 //  1 : negotiated lancode
 function negotiated_langset() {
   // process charset request header and build charset request array
   $headchrreq = explode(',',$_SERVER['HTTP_ACCEPT_CHARSET']);
   $i = 0;
   while ($ihas_content($language[$i]) ) { $i++; }

# did we get anything?
if (isset($language[$i])) {
   $lancode = $language[$i];
   if ($i==0) { $charset=$charsets[0]; }
   else {
 // default charset when first choice unavailable
 $charset="ISO-8859-1";
   }
}
else {
  // default on nothing found
  $charset = "ISO-8859-1";
  $lancode  = "en";
}

$result[0] = $charset;
$result[1] = $lancode;

return $result;
 }

*NOTE* the !$this->has_content($language[$i]) call goes to a local 
function of yours that will return true/false, depending on whether you 
have available content for this language.

Charset request will default to ISO-8859-1 when your first languace 
choice is unavailable, because there is no data about further languages 
in the headers. You might want this to became a utf-8 value.

Function will not negotiate charset against content availability (as 
usually you will not have separate content editions for different 
charsets in your content repository). But you may easily add up the code 
snippet needed to do it, if that is your case.

If you do please share the result :)


ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Re: PHP and Object-Orientated Programming

2002-07-08 Thread Alberto Serra

ðÒÉ×ÅÔ!

Manuel Lemos wrote:
> Hello,
> 
> On 07/08/2002 06:56 PM, Cm wrote:
> 
>> I have a medium sized project that I'm started in PHP and mySQL.  I 
>> think an
>> object-orientated approach may be the best to reduce the amount of code.
>> My question is if I'm using PHP should I even try to do it an
>> object-orientated manner.  I've seen some posts that say that doing it 
>> this
>> way will really slow down PHP and that if you're doing OO you should 
>> really
>> do it in a language like Java.
> 
> 
> Non-sense. You can do OOP in PHP just fine, just differently than you 
> would do some things in Java. That did not stop thousands of people 
> using hundreds of PHP classes written in by many PHP developers and made 
> available here for free:
> 
> http://www.phpclasses.org/

We do OOP and never noticed a performance downgrade, right the opposite. 
Again, *any* tech solution will downgrade performance if unproperly 
coded. If you can do efficient OOP you can do it in whatever language 
you choose (well, maybe smalltalk and java qualify as an exception LOL)

I won't repeat the usual warnings about correct OOP in itself as it's OT 
here. Just watch out *PHP returns copies from the assignement operator = 
and not references*. That's it. Once you know that, you know everything. 
Learn to use the & sign when you need a reference (which *is* slower, so 
use it only when needed) and everything will be just fine. And *much* 
quicker than any java OOP will ever be.

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] mbstring: Japanese conversion not working for me

2002-07-08 Thread Alberto Serra

ðÒÉ×ÅÔ!

Jean-Christian Imbeault wrote:
> Impossible, though it would be nice. Postgres can only accept one 
> charset for it's input not multiple.

I hope you mean one charset per language. Otherwise I can just cancel 
POstgres from my list of usable engines. But yes, it can't be just one.

>> *charset forcing* have your input page always delivered in standard 
>> format,
> My page is always in the same charset, the problem is that the user 
> input might not be ...

You mean that browsers will accept charset mixing in japanese? You 
explicitely declare charset="mycharset" in the page headers and the 
damned thing returns input in charset="hischarset"??? Now that's a awful 
surprise to me. What browser does that?

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] mbstring: Japanese conversion not working for me

2002-07-08 Thread Alberto Serra

ðÒÉ×ÅÔ!
> Jean-Christian Imbeault wrote:
>> My page is always in the same charset, the problem is that the user 
>> input might not be ...

Okay, I went thru a bit of docs on the japanese multibyte problem and 
got some surface understanding of the problem. Yes, since char 
dimensions are going to be different I see why browser would end-up 
mixing up the input. If you find any interesting site explaining how to 
do this please share. I'll be extending an existing content-repository 
to add chinese text management in the winter so I'll better start to 
worry about it. Thanks in advance.

As for your problem, I am afraid you would better turn to a japanese 
programmers' mailing list. That's if you speak japanese yourself, but 
you seem to do, so...

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] Postgres and chinese, korean, japanese charsets

2002-07-08 Thread Alberto Serra

ðÒÉ×ÅÔ!

Jean-Christian Imbeault wrote:
> Alberto Serra wrote:
>> I hope you mean one charset per language. Otherwise I can just cancel 
>> POstgres from my list of usable engines. But yes, it can't be just one.
> 
> I'm no pgsql expert but I think that yes, it will only accept input in 
> one charset. But for charsets that use only 8-bits I think you can 
> insert data that is in more than one charset.
> 
> But for charsets that use more than 8-bits I think pgsql actually checks 
> that the input is in the charset the DB expects it to be in.

Can anyone say something about this? It would mean that a content 
repository ported to Postgres would not be able to hold chinese, korean 
and japanese content at the same time. Quite a big minus, I'd say.

Any chinese, korean or japanese programmers on this list? (I put the 
countries list in alphabetical order, no personal preferences implied).

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] mbstring: Japanese conversion not working for me

2002-07-08 Thread Alberto Serra

ðÒÉ×ÅÔ!

Jean-Christian Imbeault wrote:
> Worry and worry a lot ...

I already do :( The most terrorizing thing is that desolating "There are 
no user contributed notes for this page." that appears almost on every 
function in the online manual.

And the fact that there is no pointer for people in trouble to contact 
the developers of the library. The few user notes are from us europeans 
and tend to focus on how you can port utf-8 to old ISO standards.

IMHO such delicate matters would deserve a bit more of a detailed 
explanation, especially since most of us are going to use those 
functions to treat strings that they cannot read themselves to check the 
output result. Anyone knows how to get hold of the mblib developers mail 
address?

But okay, there *is* such a thing as a chinese/korean/japanese internet, 
so it means it can be done. Whether you and I can make it... well, it's 
another question :(

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Re: mbstring: Japanese conversion not working for me

2002-07-08 Thread Alberto Serra

ðÒÉ×ÅÔ!

Jean-Christian Imbeault wrote:
> Found my problem.There was no problem. I was trying to test my code by
> displaying the INPUT and OUTPUT in a web browser. I forgot to realize
> that my input and oupts were in different encodings.
> 

Now THAT'S NEWS! :) Okay, just put the SPAN thing around your different 
output sections and you'll be able to check both in and out on the same 
page :)

uuuf... I feel better now :)

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Re: Postgres and chinese, korean, japanese charsets

2002-07-08 Thread Alberto Serra

ðÒÉ×ÅÔ!

Jean-Christian Imbeault wrote:
> Don't know the answer to your question exactly but how about 
> transforming all user input into something like unicode/UTF-8 (or 
> UTF-16) and *then* putting it into the DB?
> 
> That way all the DB input has the same charset.

That was my first idea, yes. Normalizing to utf and get read of whatever 
trouble might lie on the way. Then I read on the MBlib docs that 
japanase chars may take up to 6 byte each, and that would hardly fit 
into a utf-16 format.

Again, all my worries are probably based on the sole fact that I never 
treated chinese/korean/japanese text in my life so I easily get deceived 
in my elaboration.

Thanks a lot for starting the subject. You saved me a lot of trouble in 
the coming winter :)

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Re: mbstring: Japanese conversion not working for me

2002-07-08 Thread Alberto Serra

ðÒÉ×ÅÔ!

> Can you explain that SPAN thing a bit more. You said to use:
> 
>  your text 
> 
> I can understand the charset param but what is the lang param used for?

Basically it might even be useless. But id does not harm to use it. Like 
this:



this text uses the header charset language setting


This is russian text in KOI-8 format
Á ×ÏÔ ÜÔÏ ÒÏÄÎÏÊ ÑÚÙË!


This again uses your header settings


This is english text in basic format
yes, it is


This again uses your header settings



Note that SPAN will not change anything in your formatting (like tables 
and so on).

Another (and safer) way to do it, is to define classes in a CSS sheet 
and apply the to SPAN areas. So you keep a centralized control on your 
char formatting.

But if you just need it to debug output you can be happy with a direct 
charset/lan specification.

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Re: mbstring: Japanese conversion not working for me

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

 > 
 > 2 : 111??1235
 > 

language codes are
zh = chinese
ko = korean
ja = japanese

the charset codes must be fully specified, such as
ISO-2022-JP (the one you are using yourself)
SHIFT-JIS
EUC-JP

otherwise it will make no sense to your browser. Usually looking at what 
you can find in your "preferences->navigator->languages" will do the 
trick (talking about Mozilla).

EUC-KR would mean korean, and so on, which is which just EUC will not 
mean anything.

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Re: mbstring: Japanese conversion not working for me

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

Jean-Christian Imbeault wrote:
> I tried EUC-JP and ISO-2022-JPand neither worked. Ah well ... so much 
> for a nice idea quick hack to displaying multiple charsets at once.

They should. I checked out w3c.org at that and it definitely should. No 
exception for japanese mentioned anywhere.

The two parameters actually open a local exception from the




headers. And SPAN sections can be nested. At least, so the standard goes.

Besides, while checking the docs I stepped onto something really funny 
(to say the very least). I quote from

http://www.htmlcompendium.org/attributes-list/attributes-notes/lang.htm

---
The argument to the "lang=" attribute is made up of two parts; a primary 
code and an optional subcode (separated by a "-" hyphen). The primary 
code is a two character language code.
i.e.

The subcode is "understood to be a (ISO 3166) country code". However, 
W3C also gives several examples:
  

They also propose a method of handling such "artificial languages" as 
Elfish and Klingon. For such languages they propose the primary code of "x"
-

Now I hope I shall never manage a porting to a Klingon repository LOLOL

Anyway, if you do not need it for your application but just for a 
debugging procedure you can just forget about it :)

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] Somehone having a problem to write to the list

2002-07-09 Thread Alberto Serra

To the *list* *maintainers*: this guy says he is registered but cannot 
write to the list. So he wrote me in instead.

úÄÒÁ×Ï! (it's like that, right?)

Djurovski Dejan wrote:
> $aDBLink=@mysql_connect("$host", "$user", "$password");
> mysql_select_db("$db", $aDBLink);

you might want to take the @ sign off the connection step to get the 
error message. Looks like you did not connect at all but got no warning 
because you told your function to keep shut.

At that point you cannot query anything, but you cannot know about it.

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Stupid install ???

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

Hopp3r wrote:
> I have installed PHP4.2.1 and when I open a browser to look at a test php
> page? all I see is the php code, not the output of phpinfo(). I know it is
> something small that I have overlooked. Can someone help? Please???
> 

Yes, you forgot reading the instructions :) You are missing these lines:

 AddType application/x-httpd-php .php
 AddType application/x-httpd-php .phtml
 AddType application/x-httpd-php .php3
 AddType application/x-httpd-php-source .phps

in your /usr/local/apache/conf/httpd.conf file

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] "Invalid content" using FastTemplates

2002-07-09 Thread Alberto Serra


ðÒÉ×ÅÔ!

PeterV wrote:
>> Warning:  Invalid content of \{\} in 
>> /home/httpd/includes/fasttemplate.class.php on line 199

You are on windows, aren't you? I remember seeing such a thing some two 
years ago. It vanished after php reinstallation. After that I did the 
right thing and had microsoft vanish from my life forever.

Anyway, it was something in the ereg that gets the symbols to substitute 
in the template. You should look there. But before you turn your HTML 
templates upside down do try and reinstall PHP. As far as I can remember 
everything worked by taking away the {} containers around the symbol 
(and in the ereg expression). Which is to say you should go thru 
thousands of HTML fragments. But really, it's been a long time.

As for version problems, I use FastTemplate since ages and never saw 
anything like that on a LinuxBox. Right now I am running the last 
version on the machine I am writing from. And FastTemplate runs with no 
problems.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Script File Permissions

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

Chris Earle wrote:
> So my question is this: how do I get my script to have permissions to write
> or append to any file?

Ask your sysadmin (I can almost bet the answer will be NO, I have to 
tell you).

Apache should be running on your system as user nobody, and most 
probably does NOT have the permission to write anything at all (apart 
from file uploads).

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] passing objects in url

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

Alexander Ross wrote:
> If $this is an object, can I have the following link?
> 
> Process
> 
> Will the URL become too long?  Will teh info get passed correctly? thanks
> 

99% you are right, it will definitely be too long for a GET. Besides, 
before writing the process_this.php?this=$this thing your *$this* should 
be serialized. Watch the docs for it.

Most probably you have access to some database, so you can just save 
your serialized version to a table (the type depends on the size of your 
serialized object) and just pass a pointer to the row for the process 
script to retrieve and unserialize the object back to normal life.

Just one more thing: if your object contains any reference they will 
definitely become invalid, methinks. And I would never do object 
serializing if I expected performance to be there. But this really 
depends on the nature of your object, so handle the suggestion with 
care, it's just way too generic.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] passing objects in url

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

Marek Kilimajer wrote:
> This won't work, you must register it within a session, just remember to 
> declare the class befor session_start()

This can be pretty risky if your object contains references to external 
objects. Works okay for insulated instances, though. Yet I would suggest 
not trusting sessions with objects.

You never know how your class is going to evolve on time and you never 
know how sessions are going to evolve on time either (just think of the 
register globals thingy).

I'd rather map object attributes to a good old table of mine and be sure 
I can build it back whenever I want to, no matter what surprises lie 
ahead on technology boulevard. Well, almost sure :)

ÐÏËÁ
áÌØÂÅÒÔÏ


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Cookies

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

Varsha Agarwal wrote:
> Hi,
> Can anyone tell me what a cookie is in simple language
> with an example??
> -Varsha

A web connection is made by two machines:
  1) the server, where the site is
  2) the client, that is, the machine at which sits the user

Once the client sends a request for a web page (an URL, in tech 
language) some sort of program gets executed on the server. At the very 
least a program called "Web Server" will receive the request, look for a 
file that has that name and send it back to the client.

But usually the file does not end in .html, so something more gets 
executed, like PHP.

Well, this new thing being executed may need to write data somewhere, 
and it usually does write it in a database (that is, a set of tables). 
When it does so, it writes data on the server, that is, the very same 
machine it is running on.

But for some reasons it is sometimes useful to write data on the remote 
machine, that is, the client. This process of writing data on the client 
machine is called "sending a cookie".

The client machine may actually accept or refuse doing so, the server 
cannot know that, so no important data should ever be written in a 
cookie, as it may not get written.

Now suppose I (the program coder) need to now that you like to receive 
pages with lots of flowers and hate to receive pages with lots of 
machine code diagrams. I put a menu on my page and let you choose, 
right? Only it would be nice, if the next time you come to visit the 
site you were immediately presented the pages you like.

But, unfortunately, I have no way to stock this information on the 
server, because I cannot associate it with you in anyway (thank god, 
otherwise bye bye privacy).

So what I do is writing on a cookie that you like flower pages and hate 
machine code diagrams.

Next time the client machine (your comp) will connect to my site it will 
first look in its cookies list. It will find that there is a cookie for 
this particular site and send it to the server along with the request. 
Bingo! now I know you hate machine code diagrams.

I oversimplified, of course, cookies have much more than just this. Thay 
have expiration dates, limits on directory tree validity and so on, but 
that's the root of it.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] PHP vs. Java

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

IMHO java is to be avoided. fullstop. Still, it might be unavoidable 
from a commercial point of view. In that case, you should avoid being 
involved in the project and let the marketing dept have their fun on 
their own.

There's a lot of pleasantly paid jobs that won't kill your nerves on 
this planet. Whatever you say now *you* will be responsible for it. So 
keep away from suicidal attempts.

Java *may* properly work (but it will never work half as fast as PHP 
will) but you are not going to find an adequate number of skilled 
resources to make that happen.

And when your unproper underpaid resources will turn your java soup into 
a slw boiling mess, guess who will pay for that? Got a mirror home? :)

I saw a project based on IBM San Francisco last ONE YEAR before being 
thrown out of the window (along with its manager). The best result of 
the project was in that it could query a table of 500 rows in only... 45 
seconds. New olympic record.

And no, I was not the manager. My spider sense told me to keep well away 
from it :)

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Script File Permissions

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

Chris Earle wrote:
> Thank you for the reply (I don't speak or read Russian if that's what that
> other stuff is).  
It is, but it's nothing more than "hello" and my signature, so you did 
not miss any basic content :)

> I forgot to mention that the server is a Win2k server with
> IIS 5 running.  Obviously I'm not the server admin (otherwise I would be
> using Apache).
Dunno. Never had that running myself. BUt as far as I can remember Ms 
security should be directory based. So the guy actually *might* allow 
you writing somewhere if you can convince him that it would show how 
clever he is ;)

> I hope that I can get permissions, but I bet you're right.  Probably just
> have to create a database, which I planned on doing (and know how to).  I
> really did want to use XML though, oh well.

Besides, sooner or later you might need to just log events out to a flat 
file, right?

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] $_REQUEST???

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

Patrick Teague wrote:
> Hello,
> 
> Considering all of this...  Would it be better simply to turn
> register_globals = On if the vast majority of the stuff you have on your
> site is simple search engine type stuff and/or GET variables?

Well, such stuff needs NOT security, nedless to say. But *any* site 
needs to work properly. Besides, having the register_globals off does 
not require gigantic mental efforts to get your values.

Personally I think that a register_globals off environment is educative, 
in that it forces you to think about the way data gets passed a bit more 
than usually. And an aware programmer is better then one who just 
"believes" in the fact that his next script is gonna get the stuff it 
needs.

But whether you have your register_globals on or off variable content 
validation is still up to your own code, and that's where 99% of 
security lies. Blocking the globals just bloks anyone from poisoning an 
*internal* variable of your scripts, legally passed values must be 
validated as they where before.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

Daniel Negron/KBE wrote:
> Is this retaliation ?

People are so stupid they cannot even understand that we will simply 
filter him out of our mail right to trash bin :) I'm just sorry Mozilla 
is missing an autoresponder. I would have him mailed back with some 
HUUGE .doc any time he writes (after automatically putting his stuff 
right on the trash bin, which I already do).

And nothing would be in the doc apart from infinite copies of the 
instruction for unsubscribing from the list :) Up to a meg or so :)

But okay, let the hengy-baby play :) He cannot do any harm LOLOL

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] (OT) Our Spam Friend

2002-07-10 Thread Alberto Serra

ðÒÉ×ÅÔ!

Brian McGarvie wrote:
> we should make a script that constantly emails him single characters and all of us 
>run it in a back ground process ;)

He is lucky we have all to much to do in our lives anyway :) But if 
anyone has got spare time... the guy's mailbox (unlike most russian 
public mail servers) *will* accept mail from a dial-up SMTP server 
having f**k.you (or whatever, just take the ** off and replace with 
proper coding) as an host name. I just happened to check ;)

Not that I was willing to. But we are having SMTP problems so I just 
send the mail from the SMTP rauuning on the box I sit at while the 
trouble gets solved.

Western addresses will get it (including our friend's address and this 
list) while my own address returns me the mail saying that "no, you 
cannot just login from a dial-up and pretend you were an internet 
server. Now your server is blacklisted" LOL

My 2 kopeki (cents). :)

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Generate a file

2002-07-10 Thread Alberto Serra

ðÒÉ×ÅÔ!

Phillip S. Baker wrote:
> Now if that is cool, how would I get the data into the downloaded.xls 
> file to have this work?

1) Save the data as a comma-separated list (pap.data.csv).
2) make an excel macro that will load it into a preexisting sheet and 
treat it
3) put the macro as the auto starter of the sheet.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] Operator missing?

2002-07-10 Thread Alberto Serra

ðÒÉ×ÅÔ!

in PHP we have a set of comparison operators going like

$a == $b (has same value)
$a === $b (has same value and type)

shouldn't we have also something like
$a =&= $b (is same instance)?

Maybe we already have it and I just don't know about it. Is that so?
Because of the copy/reference mechanism it would really be helpful in 
order to check one's work in referencing objects.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] strange php output

2002-07-10 Thread Alberto Serra

ðÒÉ×ÅÔ!

Calvin Spealman wrote:
>  if (!$page=="datetime") // Not using index.php
> {
> include("header.php");
> }
> ?>
> 
> this code works when datetime.php is included by index.php, but on its 
> own the script just outputs .  Even ignoring 
> the xhtml code outside the php code in the file.  its like the entire 
> file is ignored.  i really have no clue why.  anyone else have one?

Before using a variable (in a comparison or wherever) you should make 
sure it *does* exist.

try

if (isset($page) && !($page=="datetime")) // Not using index.php
{
  include("header.php");
}

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] cookie ?

2002-07-10 Thread Alberto Serra

ðÒÉ×ÅÔ!

[EMAIL PROTECTED] wrote:
> hi all,
> (yes it's me again)
> i've got an other problem.
> i've got an login system, and it has to put an cookie, but it seems he 
> doesn't do it.

1) users may block your cookie.
2) browsers (they often do) may not respond properly to a setcookie()
command when it specifies more than just name and value for the
cookie (that is, when you set an expiration date or limit your
cookie's visibility scope to a subdirectory)

If you have problem 1 there's nothing you can do. Change strategy. No 
user will be able to log to your system if they don't accept cookies.

If that happens to you when debugging and you know your browser *does* 
accept cookies, then try and send the cookie in the headers instead of 
using setcookie()

Like this:

// send/refresh cookie
$time = mktime()+ YourCookieLifeTimeInDays*86400;
$date = date("l, d-M-y H:i:s", ($time));
header("Set-Cookie: yourCookieName=Y; expires=$date GMT");

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×
@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] strange stuff in a class

2002-07-10 Thread Alberto Serra

ðÒÉ×ÅÔ!

>  
>   class test {
> function test() {
>   $globals['test2'] = &$this;
> }
>   }
> 
>   $test1 = new test();
> 
> ?>
> 
> The problem hier is that $globals['test2'] is a copy of $globals['test1'] not a 
> references.

It is, but you are looking in the wrong direction. the copy is in test1, 
test2 holds the reference.

This should work:


 >   class test {
 > function &test() {
 >   $globals['test2'] = &$this;
 > }
 >   }
 >
 >   $test1 = new test();
 >
 > ?>

To output a reference instead of a copy a function *must* be declared 
with an &. Not sure whether you might also need it here:

$test1 = new &test();

check it out

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




php-general@lists.php.net

2002-07-10 Thread Alberto Serra

ðÒÉ×ÅÔ!

when your instances contain references and you prepare ther references 
in the constructor, you should remember to call the *new* function with 
an &.

Otherwise all you get is a copy, and all the references you prepared are 
invalid.

use *new and all you trouble vanishes away :)

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Development Tools

2002-07-10 Thread Alberto Serra

ðÒÉ×ÅÔ!

gEdit rulez! :) well, I seldom make files any bigger than a couple of 
scrolls, so... much depends on your programming style. And habits.
But I am with Uwe. Nothing like a plain text editor.

Maybe I am just too old to understand novelty LOL

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×
@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] SQL field problem

2002-07-10 Thread Alberto Serra

ðÒÉ×ÅÔ!

[EMAIL PROTECTED] wrote:
> You see that all entries are not unique.So i want to list as output all entries but 
>only once.If the word "Dark" is in the table 6 times php should output dark only 1 
>time. 
> How should i solve this problem ?

select distinct

and RTFM

:)

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Dumb session / cookie / password questions

2002-07-10 Thread Alberto Serra

ðÒÉ×ÅÔ!

Martin Clifford wrote:
> Firstly, you should ALWAYS use an encryption algorithm for passwords. 
 > For my site, I used md5() and match with that.
 > That way, even if someone does get a hold of the encrypted password, 
it's not in their best interest
> (or maybe it is, if they're bored) to crack it.

NO need for decryption. I can just present it "as is" and your soft's 
gonna drink it (and may burp afterwards) :)

 > Putting that at the top of the page would check to see if any
 > information was sent to the page from the $_GET superglobal, and if it
 > was, reload the page without any URL extensions.

Using Register globals off would do the same without any code add-on. 
And it *does* work, as many a user lately found out, in anguish for 
his/her vanished parameters/sessions/cookies/umbrellas and girlfriends 
:) Yet it cannot block your MD5 stuff from being presented back to you 
on the right channel (not so difficult to guess, it's three channels in 
all).

If you don't hold CC numbers, military stuff, bank transactions or mafia 
secrets I can hardly see any need for paranoia (in case you do MD5ing is 
a *poor* solution). Having your CC processed by a secure third party 
will cost you much less than implementing a 90% secure system from 
scratch. When you have nothing to hide you also have nothing to fear :)

Think about it. Most users exchange their user/passwords in emails. 
"Hey! Wanna see what discount prices I got from that site, dude? Look, 
user Mickey pass MOuse (capital O, mind you, I love security, ya know). 
And don't tell anyone, okay?"

Users do it all the time. And sites, too. How many automated mails 
containing right the passwords you are trying to protect you'll be 
forced to send along the net for the sake of "customer satisfaction"?

Most of those "forgot your password? Tell us what email you gave us, 
we'll do the rest!" will be received on public email servers, because 
nobody in his mind would send a commercial site his real email (I 
canceled my first yahoo account when I was already receiving some 50 
commercials a day, mostly about penis enlargement and marijuana 
replacers). Those emails will remain on the account for ages, just in 
case the user forgot the pass again.

Would you rate yahoo as a "secure" site? Any time I walk into a computer 
club while I'm on vacation I end up into somebody else's yahoo/ICQ or 
whatever account... I am usually trying to log out from the session that 
was left open. Maybe because I am too stupid to understand yahoo's 
security policy LOL

That was just for the sake of throwing my 2 kopeki in before going to 
sleep (we are in no euro/dollar/sterling area either :)

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] mysql question

2002-07-11 Thread Alberto Serra

ðÒÉ×ÅÔ!

1LT John W. Holmes wrote:
> How about
> 
> SELECT * FROM table WHERE $current_shot BETWEEN start_shot AND end_shot

*if* that was on Oracle *and* the table was big you'd notice that your 
performance goes down. Don't ask me why. And I never checked it on 
MySql. But watch out for betweens. Check them.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Re: header()

2002-07-11 Thread Alberto Serra

ðÒÉ×ÅÔ!

> Richard Lynch wrote:
>>
>> You can't upgrade somebody's stupid IE browser to Mozilla just by sending
>> them a new User-Agent header, no matter how attractive a solution it 
>> might seem :-)

LOL sounds like having a supermodel pic sticked on the face of any girl 
you don't like :) Or boy, for what it matters :) Just make sure your 
glue holds properly :) Reality is not *that* virtual, yet...

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] mysql question

2002-07-11 Thread Alberto Serra

ðÒÉ×ÅÔ!

Alexander Ross wrote:
> I realize this isn't a php question, but I figured that someone here knows
> of a good mysql newsgroup and in the mean time someone here probaby knows
> the answer to my question.
> 
> Can I set up a query like this:
> 
> select * from table where start_shot <= $current_shot and end_shot >=
> $current_shot
> 
> note everything will be of type INT

Yes, you can, providing that those fields would exist and be of a 
comparable type.
Just one question, wasn't it quicker to just give it a try? :)

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] MAIL FROM NO ONE

2002-07-11 Thread Alberto Serra

Chris Knipe wrote:
> On Thu, Jul 11, 2002 at 02:29:11PM +0200, vins wrote:
> Allot of SMTP servers does quite a bit of sanity checking on the headers
> received from an email message.  

Not in the west. They are too busy allowing in the commercial spam they 
are sending themselves. Otherwise you'd never be reading mail from a 
server called Lena.tut, as you are right now. And thank god they are 
not, since our ISP as a *lousy* SMTP service and I have to resort to 
this to make sure I can keep on working.

What I do not understand is why you would need to build anything to bomb 
the guy. Just make sure you get an ISP that cannot track the phisical 
call (here many are still on protostoric pulse stations, you can find 
that somewhere at your place too, pretty sure).

Then invent yourself a server name and run straight from sendmail, over. 
  All you need is a temporary account from a dial-up. You are not 
robbing a bank, so nobody will look for you (your abuse.somewhere.co.za 
will say they never knew anybody, just like they said from norway and 
they will keep on drinking their beers).

Personally I would not be cruel to anyone that has been already that 
mistreated by Mother Nature. Let him live with himself, it's the worst 
you can do to him. We got rid of Erik, but he never will :) *that* makes 
me happy.

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




  1   2   >