[PHP] Looking for easier way to build email message

2008-01-24 Thread Rene Brehmer
Drew a blank off the archive, so here goes...

I'm working on some forms for our company website, all of which simply have
to be mailed to us by email.

After verifying that the content of all the fields is valid and the proper
type, it builds the email message as following. This all works great, but I
want a simpler/easier way to reuse the code (we have 3 forms, with
distinctively different content, but the mail process remains the same), so
something that will do the below, but can be reduced to something like
grabbing a text file and fill in the blanks would be nice, instead of this:

  // prepare message
  if(! $error) {
$message = "Information submitted with Tee Time booking form:\r\n";
$message .= "Name and address:\r\n\r\n";
$message .= "$name\r\n";
$message .= "$address\r\n";
$message .= "$city\r\n";
$message .= "$state $postcode\r\n\r\n";
$message .= "Email: $email\r\n";
$message .= "Phone: $phone\r\n";
$message .= "\r\n\r\nBooking info:\r\n\r\n";
$message .= "Arrival: $a_month $a_day\r\n";
$message .= "Departure: $d_month $d_day\r\n";
$message .= "Persons: $persons\r\n";
$message .= "Rooms: $rooms\r\n";
$message .= "\r\nGolf Courses\r\n\r\n";
for($i = 1; $i < 8; $i++) {
  if($_POST['course_'.$i] != 0) {
$message .= 'Course: '.$_POST['course_'.$i]."\r\n";
$message .= 'Date: '.$_POST['month_'.$i].'
'.$_POST['day_'.$i]."\r\n";
$message .= 'Time: '.$_POST['teetime_'.$i]."\r\n";
$message .= '# of golfers: '.$_POST['golfers_'.$i]."\r\n";
  }
}
if(! empty($comments)) {
  $message .= "\r\nComments:\r\n$comments\r\n";
}
$message .= "\r\nUser Client Info:\r\n";
$message .= 'User IP: '.$_SERVER['REMOTE_ADDR']."\r\nUser agent:
".$_SERVER['HTTP_USER_AGENT']."\r\n\r\n";


// NOTE: This code only builds the actual message, the headers are built
elsewhere in the code.
// This is our golf-package quote request (I work for a hotel) form, where
you can book up to 7 tee times. Thus the iteration in the middle, to run
through the 7 tee time fields.

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



[PHP] Re: How to deal with errors in forms

2006-08-26 Thread Rene Brehmer
Documented research indicate that on Fri, 25 Aug 2006 13:18:25 +0200, "Ivo
F.A.C. Fokkema" wrote:

> 
> You might also try to process the results from the form first, and then,
> if errors are found, display the form again and put the data in there
> yourself. No need to send the user back and forth. But you may need to
> restructure your code a little. I personally always use this method.
> 
> 1) Check if form is sent.
> 1a) True? Check form contents. Put errors in a variable. If there are no
> errors, do whatever you need to do.
> 1b) False? Set all form fields to the default values (probably empty strings).
> 
> 2) Check if error variable exists.
> 2a) True? Print error variable on the screen.
> 
> 3) Print form, and load values in them.

The above method is basically what I use with great success. I've simply
added my own alerthandler functions, meaning the form checking part sets a
variable called $alert_level to a value between 0 and 3, 0 = no errors, 1 =
notice, 2 = warning, and 3 = error, and then the handler itself checks what
kind of alert to put out and displays a box coloured to match the alert
level. The main reason for doing it like that is because I wanted something
simple that I could reuse across all my pages, so alert messages look
similar - people pay more attention to them if all your pages use the same
method of notifying them of problems and errors.
The alert_handler uses a second variable, $alert_message, that the form
checker uses to tell exactly where the problem is, to avoid one of the
"There was an error in your input" situations.

On top of that, I'd like to suggest (or actually recommend) using POST
instead of GET, especially when you use 2000 char fields. PHP doesn't care
either way, but if you use POST you won't have the problem of field
contents being cut off because they won't fit in the URL. And you can keep
all your variable names the same, or even make them longer and easier to
remember perhaps.


Rene

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



Re: [PHP] Calculation error - PHP not following math hierarchi ???

2005-08-03 Thread Rene Brehmer
Documented research indicate that on Wed, 3 Aug 2005 16:38:08 +0100, Robin
Vickery wrote:

> On 8/3/05, Rene Brehmer <[EMAIL PROTECTED]> wrote:
>> Using this function:
>> 
>> function calc_distance($curX,$curY,$newX,$newY) {
>>   // calculate distance to new location
>>   $distX = abs($curX - $newX);
>>   $distY = abs($curY - $newY);
>> 
>>   if ($distX <= 150 && $distY <= 150) {
>> $dist = sqrt($distX^2 + $distY^2);
> 
> I don't think you really want to do a bitwise xor there.
> 
> http://www.php.net/manual/en/language.operators.bitwise.php
> 
> Try pow() instead
> 
> http://www.php.net/manual/en/function.pow.php

Thanks. I didn't know it was a bitwise operator ... Was trying to find the
right way to go about it in the manual, but when you don't know what it's
called in English, it's a bit of a problem ... and since the Danish version
of the manual isn't up to date, I don't really use it...

But thanks, looks like what I want ... thank you...


Rene

-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



[PHP] Calculation error - PHP not following math hierarchi ???

2005-08-03 Thread Rene Brehmer
I've run into a situation where PHP is way off when doing a relatively
simple calculation of distance between two points in 2-dimensional space,
where coordinates go from 1 to 300 in both X and Y directions. When passing
300, it goes back to 1, and vise-versa (it's for a game and is supposed to
approximate the movement over a sphere).

Using this function:

function calc_distance($curX,$curY,$newX,$newY) {
  // calculate distance to new location
  $distX = abs($curX - $newX);
  $distY = abs($curY - $newY);
  
  if ($distX <= 150 && $distY <= 150) {
$dist = sqrt($distX^2 + $distY^2);
  } elseif ($distX > 150 && $distY <= 150) {
$dist = sqrt((abs(300 - $newX))^2 + $distY^2);
  } elseif ($distX <= 150 && $distY > 150) {
$dist = sqrt($distX^2 + (abs(300 - $newY))^2);
  } else {
$dist = sqrt((abs(300 - $newX))^2 + (abs(300 - $newY))^2);
  }
  
  return $dist;
}

And using 150,150 as $curX,$curY and 300,300 as $newX,$newY ... PHP
calculates $dist as 3.46410161514
which obviously is far off target ...referring to my calcultor, the correct
result for the same code is supposed to be 212.1320

What happens here ? And how the heck do I get to calculate right ?

Float errors usually isn't this severe, so I'm assuming it's a problem with
properly acknowledging the hierarchi of the mathematical operators ... 

It's PHP ver. 4.3.0, on Apache/2.0.53 (Win32), on WinXP SP1

I've been trying to manually calculate the formula out of order to figure
out how the strange result comes about, but haven't had any success yet ... 

Any suggestions ?

Rene
-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



Re: [PHP] who can do this without the recursion

2005-07-05 Thread Rene Brehmer
Documented research indicate that on Tue, 5 Jul 2005 14:07:21 -0700 (PDT),
"Richard Lynch" wrote:

> You'd think having done a zillion of these in my Grad School days would
> have made more of an impression...
> 
> Mostly it impressed me that recursion wasn't "cool" -- just another "tool"
> and one that you only should pull out 1% of the time.

When we learned about recursion it took our teacher 15 minutes to come up
with an example for what the heck it was good for ... and it wasn't even a
good one (can't remember what it was).

I only use recursion when I need to output data stored in a tree format
(you know, each child has a parent, each parent can have multiple
children), otherwise I don't really know what to use recursion for.

Mostly I have database queries where the results are built into 2-3 D
arrays, and then used as the data the recursions work from ... found it to
be the only way doing those trees fast when the data is variable and stored
in a database...
-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



Re: [PHP] Report

2005-07-05 Thread Rene Brehmer


Documented research indicate that on Mon, 4 Jul 2005 15:22:51 +0100, Gaby
vanhegan wrote:

> On 4 Jul 2005, at 15:09, Miles Thompson wrote:
> 
>> There is a lot of JUNK showing up on this list, and for me this one 
>> was the last straw. From "Post Office" at [EMAIL PROTECTED] it had 
>> an attachment named
> 
> Likewise on the php-install list as well.  Of the 20 emails I've had 
> over the last few days, 3 have been legitimate posts...
> 
> Gaby

PHP DB list is pretty flooded as well ... I set up my filters to simply
dump all messages that are remotely like those to the trash ... might loose
some valid in between, but the trash is starting to take over to the point
where it's getting too much work to dump it manually ...

But there's quite a few, atleast on the email version of the lists, that
have their vCard attached to their messages (they may not even know it), so
we'd loose all those (valid) messages as well if the list has a flat rule
about no attachments. I don't really care, I just have to regularly empty
my attachments folder because of all those vCards

-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



Re: [PHP] Re: Removing nonlatin characters

2005-07-05 Thread Rene Brehmer
Documented research indicate that on Mon, 4 Jul 2005 19:29:38 +0300, Dotan
Cohen wrote:

> On 7/4/05, Rene Brehmer <[EMAIL PROTECTED]> wrote:
> Documented research indicate that on Fri, 1 Jul 2005 13:58:23 +0300, Dotan
> Cohen wrote:
> 
> Totally forgot ... there is one advantage that you can control what the
> characters are replaced with ... but I dunno if recode_string does as good
> a job ...
>
>You should see how windows tries to alphabetize hebrew! Actually, XP
>is not so bad (unless the hebrew has vowels), but what is annoying is
>the inconsistency. Winamp (not a MS product) and Media Player 10 
>organize differently- and neither of them are correct!
>
>I suppose that I could add hebrew to your function. I would just
>replace every hebrew character with ? as hebrew is not mixed in with
>latin letters in normal usage (nor is it very compatable). Would you
>like me to send to you the function afterward?

Nah, that's fine, thanks :) ... it's not like I invented the function, I
just modified what was posted on this list so it'd work with Danish letters
for the purpose I had ... don't think I have any need for hebrew though.

But talking of WinAmp, it bothers me it isn't unicode. I have some songs
where the titles (or part of them) are in Cyrillic, and Windows Explorer
and Windows Media Player are sofar the only programs I've found that will
display those characters correctly. When playing them in Winamp it's cuz I
know the songs that I have some idea of which one it is...


Rene

-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



Re: [PHP] Re: Removing nonlatin characters

2005-07-03 Thread Rene Brehmer
Documented research indicate that on Fri, 1 Jul 2005 13:58:23 +0300, Dotan
Cohen wrote:

> On 6/29/05, Rene Brehmer <[EMAIL PROTECTED]> wrote:
> I think you mean something like this:
> 
> function stripAccents($string) {
>   $returnString = strtr($string,
>   'àáâãäçèéêëìíîïñòóôõöšùúûüýÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖŠÙÚÛÜÝ',
> 'acnosyACNOSY');
>   $returnString =
> str_replace('æ','ae',str_replace('Æ','AE',$returnString));
>   $returnString =
> str_replace('ø','oe',str_replace('Ø','OE',$returnString));
>   $returnString = str_replace('ß','ss',$returnString);
>   return $returnString;
> }
> 
> This function is part using code once posted on this list, part my own
> creation.
>
>Thank you Rene. Does this approach have any special advantages over
>recode_string?

Totally forgot ... there is one advantage that you can control what the
characters are replaced with ... but I dunno if recode_string does as good
a job ...

-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



Re: [PHP] Re: Removing nonlatin characters

2005-07-03 Thread Rene Brehmer
Documented research indicate that on Fri, 1 Jul 2005 13:58:23 +0300, Dotan
Cohen wrote:

> On 6/29/05, Rene Brehmer <[EMAIL PROTECTED]> wrote:
> I think you mean something like this:
> 
> function stripAccents($string) {
>   $returnString = strtr($string,
>   'àáâãäçèéêëìíîïñòóôõöšùúûüýÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖŠÙÚÛÜÝ',
> 'acnosyACNOSY');
>   $returnString =
> str_replace('æ','ae',str_replace('Æ','AE',$returnString));
>   $returnString =
> str_replace('ø','oe',str_replace('Ø','OE',$returnString));
>   $returnString = str_replace('ß','ss',$returnString);
>   return $returnString;
> }
> 
> This function is part using code once posted on this list, part my own
> creation.

Thank you Rene. Does this approach have any special advantages over
recode_string?

I have no idea ... I've never used recode_string, I didn't even know it
existed ... When I started doing PHP, it was with ver. 4.2.0. I believe
recode_string is something that came with 4.3.0 or thereabout.

I used that function for only one project, where I kept the original
strings in one field in the database, and then had a stripped version of
the same in different fields, for the sole purpose to being able to control
sorting when running on Windows (Windows stinks at sorting text correctly,
especially when you use Scandinavian regional settings ... it assumes
wildly and there's no proper understanding of how we alphabetize in
Scandinavia). On Linux, sorting is much better, and I've never had to make
special columns just for sorting... (FWIW: MySQL and probably several other
DB systems, adapt their sorting methods from the host OS).

-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



[PHP] Re: Removing nonlatin characters

2005-06-29 Thread Rene Brehmer
Documented research indicate that on Sat, 25 Jun 2005 01:27:13 +0300, Dotan
Cohen wrote:

> I thought that this was another old STFA but marc and google are quiet.
> 
> I as parsing a bunch of submitted works and some of them have
> non-latin characters. I know that I once saw in the user-submitted
> notes in the docs a function for replacing them with o,a,i,e,u but I
> can't find it. I think that it may have been purged. Can anyone help?

I think you mean something like this:

function stripAccents($string) {
  $returnString = strtr($string,
  'àáâãäçèéêëìíîïñòóôõöšùúûüýÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖŠÙÚÛÜÝ',
'acnosyACNOSY');
  $returnString =
str_replace('æ','ae',str_replace('Æ','AE',$returnString));
  $returnString =
str_replace('ø','oe',str_replace('Ø','OE',$returnString));
  $returnString = str_replace('ß','ss',$returnString);
  return $returnString;
}

This function is part using code once posted on this list, part my own
creation.

HTH

Rene

-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



Re: [PHP] Re: security question...??

2005-06-22 Thread Rene Brehmer
Bruce,

I think you missed my point here: Nomatter how secure the client's browser
is, or even if he uses a custom made Client Access Program (believe me, the
banks in Denmark used that approach at first because browsers weren't
secure enough), it still doesn't change the fact that there may be other
factors that cause the transmission to be insecure.

A packet sniffer doesn't have to in any way be connected to the browser or
other program used to access your server. And if the program used is made
correctly (as in, not IE), you won't be able to detect whatever's running
outside that program from the server side. And packet sniffers already
exist in the majority of computers: firewalls, anti-virus, and network
traffic monitors. They all do, or can, read the contents of the network
packets going in and out of the computer. I have numerous versions of
those, some of them will let me actually see the contents of each and every
network packet ... 

Packet sniffers exist that'll let you monitor the network traffic on a
remote computer, without even have access to that computer (one of my
friends did it to me just to show how easy it is). So even if your server
could see that the program your client uses is as secure as can be, there
isn't any way possible that you'll be able to see if the connection between
you and the client is tapped or not...

My bank in Denmark use custom encryption plugins for the browser because
the built-in encryption system isn't good enough. Their system is based
upon HTML websites only because it's more comfortable to use, but without
their custom plugin and the digital key I have to install to make it work,
the online banking website is completely inaccessible. Their system don't
even use normal cookies because it'd leave footprints on your computer. But
it still doesn't change the fact that it still communicates through normal
HTTP and TCP commands, and that the packets are still readable, although
encrypted...


Rene

Documented research indicate that on Wed, 22 Jun 2005 06:00:48 -0700,
"bruce" wrote:

> rene...
> 
> the scenario that i'm envisioning could very well cause people to get
> ticked. but i also can easily see financial institutions starting to tell
> their customers, that unless your system is of a certain level, or running a
> certain kind of browser, that you'll get charged more to do business with
> them...
> 
> security is an issue, and it's going to get larger. and that will require
> thinking about the user/client's setup..
> 
> if i as a bank, refuse to allow you to signin to my server, because i detect
> that your client is not valid/legitimate, meaning i think it's been hacked,
> how have i trampled the rights of anyone. i haven't. will some customers
> run, sure.. perhaps.. will i potentially feel better. yeah. will i
> potentially have something that i can promote as an extra level of security
> that others don't have, maybe..
> 
> let people continue to read/hear about massive losses of data and see what
> happens...
> 
> rene, you also have to understand, i'm not trying to determine if the user's
> entire system is 'clean/valid'. i'd settle for a way of knowing that the
> browser/client that i'm talking to is legitimate!!
> 
> -bruce
> 
-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



[PHP] Re: php - jscript - onclick event..

2005-06-22 Thread Rene Brehmer
This doesn't answer your question whatsoever (sorry), but is meant merely
as a friendly recommendation: DON'T use JScript !!

JScript only works with Internet Explorer 4-6 (as far as I've been able to
tell, it doesn't even work with IE 7 in Longhorn), just like the original
JavaScript only works in the old Netscape 4.x browsers. Instead use proper
JavaScript 1.0 - 1.2, and you'll have code that works in nearly all current
browsers.

I don't know if you actually MEAN JScript, or meant to say JavaScript, but
it's two different languages, however closely related. I didn't check your
code to see if it's JScript or JavaScript, but when you know PHP and Java,
JScript is a beast to work with, because it has so little in common with
Java and JavaScript that it's no wonder MS lost the lawsuit.

I do have the documentation for JScript, but it's 6000 km away, so I can't
really reach it atm ...

FWIW

Rene

Documented research indicate that on Wed, 22 Jun 2005 10:15:53 -0700,
"bruce" wrote:

> hi..
> 
> a somewhat php/jscript question...

-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



[PHP] Re: Amy's Site question

2005-06-22 Thread Rene Brehmer
Documented research indicate that on Wed, 22 Jun 2005 09:17:48 -0400, Jack
Jackson wrote:

> Hello,
> 
> On a site I'm listing measurements in both inches and cm; in the db 
> they're stored as inches. To convert them to cm I'm doing:
> 
>  x  ($cartoon['art_height'] * 2.54); ?> cm
> 
> How can I limit the result of that math to one decimal place, ie, 9.5 
> cm, not 9.523 cm?

number_format() ... it's under Math commands in the manual I believe

so you'd do:

 x
 cm

This also puts a , for every thousand by the way. It has an option to feed
it a specific format string, but I never use that part of it, so you'll
have to check the manual for that if you need it, sorry.


Rene
-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



Re: [PHP] Re: Apache Webserver User Survey

2005-06-22 Thread Rene Brehmer


Documented research indicate that on Wed, 22 Jun 2005 12:15:36 +1000, Ian
Holsman wrote:

> if you do know a IIS mailing list, please feel free to mail me..
> I really couldn't find any.

I was actually talking about Usenet groups, but ok. Microsoft's usenet
server has a whole bunch of IIS groups, but I dunno if they'd take too
kindly to your survey - they're a bit anal about developers posting in
their non-developer groups.

But otherwise I only found one group that specifically mentions IIS, and
that's in Japanese...

But if you want to find user groups for specific topics (whether it's IIS
or something else), search through Yahoo Groups (groups.yahoo.com), there's
bound to be a few popping up.


Rene

-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



Re: [PHP] Re: Apache Webserver User Survey

2005-06-21 Thread Rene Brehmer
Documented research indicate that on Wed, 22 Jun 2005 10:58:12 +1000, Ian
Holsman wrote:

> Greg Donald wrote:
>> On 6/21/05, Al <[EMAIL PROTECTED]> wrote:
>> 
>>>Why bother.
>>>
>>>http://news.netcraft.com/archives/web_server_survey.html
>> 
>> http://www.securityspace.com/s_survey/data/200504/index.html
>> 
>> http://www.securityspace.com/s_survey/data/man.200504/apachemods.html
>> 
> 
> These show that apache has 70% usage, but not why.

Because it's free and can do just about any HTTP need you might have on any
platform ever made ?

I tried using IIS, both the small one that comes with Windows 2000 Pro and
XP Pro, and the full version that comes with Windows 2000/2003 server, and
it is by far nowhere as lean or stable as Apache. ... And because IIS comes
with windows, and an awful lot of companies, for gawd knows what reason,
choose windows for their servers, it remains the only real alternative to
Apache.

But at any rate: Your survey might be better aimed at the Apache and IIS
user groups, rather than the PHP groups.

And personally, I don't like the demographical info in your survey. Unless
you're doing a localization project, I don't see the relevance in it. What
people use a webserver for in Timbuktu is generally the same as in Alaska,
the different local languages aside: Serving porn sites, news and reviews,
technical and not so technical references, and community sites (those four
things happen to be what about 70% of the web consists of).


-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



Re: [PHP] Re: security question...??

2005-06-21 Thread Rene Brehmer
Documented research indicate that on Tue, 21 Jun 2005 13:37:50 -0700,
"bruce" wrote:

> chris...
> 
> what you state is true at the extreme... but in the case of an client app, i
> could already extract information about the various apps that make up the
> client.. ie if, as in the case of IE, I was able to get information from the
> IE browser about various dlls that make up the browser. if these pieces of
> information correclt match what msoft would state should be there, then i
> could assume that the app was/is legitimate. 

BUT: That would mean that you can't take into account any plugins or
extensions the user might install. And the security leak you're afraid of
might not even be IN the browser program used. It might as well be a packet
sniffer on the outside of the user's firewall ...

> and here's why. while you may not give a damm, there will be a growing
> chorus of people who'll want to know that the developers/sites are doing
> everything they can to ensure the safety of the entire transaction. in fact,
> i'm willing to bet that somehting like what i've been discussing will be
> delivered, and promoted as a security/selling point...

I think it's more a matter of education and morale than anything else. You
can't take responsibility for all clients not screwing up their own system.
You just have to hope and trust, that when you tell your users to use this
and that browser, and take this and that precaution, that they actually do
it, and not install a whole bunch of crap that creates a security problem.

What you're asking for is basically a way to control what users do on their
own computers, and refuse them if you don't like what they've done. It's
not very short of invasion of privacy. Electronic Arts already do that with
their games (spy on your computer without your permission, and the refuse
you to play the game you legally paid for, because you have other legally
paid programs that they don't approve of).

What you can do however, is to develop an app that can run a security test
locally on the user's computer, and have that app sign off on the user
being safe enough for you to want to deal with him. And then force them to
regularly have to do that again. But I'm telling you, the more troublesome
you make it for your users to use your stuff, the more users you'll loose,
and fast. Mostly thanks to MS and Apple, computer users today know very
little about their computers, or how they work, or how they protect
themselves, and we teach them that they should all and anything that comes
their way. So it's continuingly limited what you can actually ask a
computer user to put up with, they'll just go somewhere else that's less
hazzlesome (that's the whole reason the majority use IE: It's there, it's
easy to use, it gets the job done, and it doesn't complain a whole lot).
The majority of end-users don't care, or know, or understand, simple
security precautions when it comes to network traffic.

Education and discipline is, in the end, the only means to achieve what you
want.

/rambling off
-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



Re: [PHP] Re: security question...??

2005-06-21 Thread Rene Brehmer
Documented research indicate that on Tue, 21 Jun 2005 16:25:36 +0100,
"Shaw, Chris - Accenture" wrote:

> You could always use a IE exploit to crash the browser, if they are still
> requesting, you know they are not IE. ;)
> 
> Out of interest, what information are you planning on getting from the
> browser?
> 
> Why can you not use certificates?

Certificates only serve to verify the user as being who they say they are
(and in the other direction, verify that the server is who it claims to
be), they don't in any way do anything to ensure that the client browser is
in fact secure.


Rene

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



Re: [PHP] Re: So many returned mail notices!

2005-06-21 Thread Rene Brehmer


Documented research indicate that on Tue, 21 Jun 2005 20:14:59 +0200,
Jochem Maas wrote:

> Chris W. Parker wrote:
>> JB05UK <mailto:[EMAIL PROTECTED]>
>> on Tuesday, June 21, 2005 10:31 AM said:
>> 
>>>My point is if you dont like spam do something about it, clearly your
>>>too ignorant to understand.
>> 
>> When did I complain about spam? Go back to my original post, reread it,
>> think about it, then realize that I never complained about the messages.
>> I merely was asking if other people were receiving the same messages or
>> if there was something out of wack with my email servers.
>> 
>> Get a clue.
> 
> but Chris, clues are very expensive in England - not everyone can afford 
> them. ;-)

"But I thought Clue was a board game?"

#endsarcasm


-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



Re: [PHP] Re: So many returned mail notices!

2005-06-21 Thread Rene Brehmer


Documented research indicate that on Tue, 21 Jun 2005 18:31:17 +0100,
JB05UK wrote:

> Chris W. Parker wrote:
>> Your point is?
> 
> My point is if you dont like spam do something about it, clearly your 
> too ignorant to understand.

Clearly that comment alone indicates who's the real ignorant here...

-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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



Re: [PHP] Re: security question...??

2005-06-21 Thread Rene Brehmer
However secure you try to make a web application, even with encryption, it
still does not hinder anyone from putting a packet sniffer on your client
and grab whatever sensitive information you send out.

And if a hacker really wanted to get hold of your sensitive information, he
wouldn't actually have to use a typical browser or anything similar to do
it, nor is it likely he would. There's nothing to hinder for talking to
your HTTP server using manually entered commands in a telnet client.

My information 'bout the US approach to encryption may be a little out of
date, but for the longest, using anything stronger than 40 bit encryption
was illegal, unless the CIA knew the extra bits above 40 (thus Philip
Zimmermann got arrested for violating the weapons law when he created PGP).
All that mess did change something, but there's still limitations to what
you can do in regards to encryption, that don't exist in any other country.
9/11 didn't exactly help that in any way.

But nevertheless, for every way you can come up with ensuring that your
client is using a secure application, there's atleast as many ways to make
a program that fools your tests, and then you're back to where you came
from. The thing I said about where your responsibility ends, is simply that
when you tell a client to use this and that software to access the data in
your remote application, then you can't really prevent them from using
software that they think is right, but isn't. There is no reliable way,
with current technologies, of determining whether or not a client's
software is what it says it is or not. I think it falls under implicit
trust ... 

It reminds me of those websites that checks for the version of your
browser, and refuses to work if you don't have one they like, that falls
completely short when you visit them with Firefox because it has Mozilla
and ver. 1 in its ID string, and the sites think it's a Netscape 1 ...
point being that you can't blindly trust what the client software tells you
... I don't honestly see any way of doing what you want, without also being
able to see how it can be fooled...


Rene

Documented research indicate that on Mon, 20 Jun 2005 17:50:25 -0700,
"bruce" wrote:

> rene..
> 
> from my perspective, i strongly disagree...
> 
> if you're going to be writing apps that deal with sensitive information, you
> better damm well give some thought as to how secure the client is, or even
> if the client is actually valid!
> 
> while i'm not precisely sure as to how you'd go about ensuring that the
> client is indeed real/valid, and not faked, there are some reasonable
> approaches that the vendor/manufacturer could take, or make available that
> could go a good way towards satisfying the issue somewhat...
> 
> and creating a secure client/server connection that only the two parties
> (server/client) can listen to is not illegal in the US.. i'm not sure where
> you get your information..
> 
> but my point was not regarding tha actual communicatino pipe/wire. there are
> already methods of securing the wire conversation betwen the server/client.
> i'm concerned with being reasonably sure that the client i'm talking to is
> indeed a valid/real client. IE, if it identifies itself as IE, then it
> actually is IE, and not some spoofed app, that acts like IE, that might be
> sending data to who knows where...
> 
> -bruce

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



Re: [PHP] Re: security question...??

2005-06-20 Thread -{ Rene Brehmer }-
I don't see any way of doing such a thing, without also seeing how easily
it would be to fake it.

I'm not really sure what it is you want to achieve. As a webmaster you
can't really take responsibility for the clients using insecure software to
access your website.

It is technically possible to use custom browsers, combined with personal
encryption chipcards, that allow only a specific person to establish an
encrypted connection to the server, and nothing else. And then refuse
connections made by other means. But that method is illegal in the US
because the CIA/NSA/FBI and so on can't "listen in" on the connection, and
as such it's a violation of the weapons/terror laws...

There is no way of ensuring a truly secure connection over an open network
without taking some drastic measures and have each site use their own
specific encryption algorithms with corrosponding clients...


Rene

Documented research indicate that on Mon, 20 Jun 2005 11:13:52 -0700,
"bruce" wrote:

> jason...
> 
> it's the 2nd point... the hacked app that i'm concerned/thinking about...
> 
> as i stated, a secure app/system incorporates not just the system, and the
> wire, it also deals with the client app that's being used.
> 
> and in fact, i'm of the belief that the manufacturers/developers of a given
> app could in fact provide some function on their servers that you could
> check against to verify that the browser/app in question is indeed
> legitimate...
> 
> as to the details, i'm not exactly sure how it could be accomplished, but
> i'm pretty sure it could be done...
> 
> i'm not trying to stop someone from copying an app... i just want to know
> that the version of IE that i'm talking to is indeed a good/not hacked
> copy...
> 
> -bruce

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



[PHP] Re: So many returned mail notices!

2005-06-20 Thread -{ Rene Brehmer }-
I'm subbed to both the newsgroup, and the emails, and I have them in both.
It's a virus using the PHP list address as sender, apparently going through
RoadRunner, and then posting itself to the newsserver. Since the messages
don't have the [PHP] marker, they're posted to the newsgroup, not the email
list ... all messages going through the email list server gets the [PHP]
marker in the subject.

It has nothing to do with the digest ... I didn't even know there was a
digest option for the PHP.net lists ...


Rene

Documented research indicate that on Mon, 20 Jun 2005 19:11:09 +0100,
JamesBenson wrote:

> Im suscribed to the newsgroup and dont receive emails, I simply browse 
> the threads in Thunderbird, you must of signed up for daily digests.
> 
> Chris W. Parker wrote:
>> Hey,
>> 
>> I know this kind of post can be annoying to some people but I must ask
>> anyway. Is everyone else getting a bunch of returned mail from
>> [EMAIL PROTECTED] It looks like it has something to do with
>> (possibly) an email address that is subscribed through Road Runner?
>> 
>> Anyway this kind of thing always makes me a bit nervous because I start
>> to think something is wrong with my end.
>> 
>> Chris.

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



Re: [PHP] OT - Blank subject lines!!!

2005-06-17 Thread -{ Rene Brehmer }-

That's why I have this at the top of my mail filters:

if subject matches regexp
([[:blank:]][[:blank:]][[:blank:]]+) | (^$) | (^[[:blank:]]+$)
transfer to trash

I'm using Eudora btw...

Was gonna do a filter to dump all subjects that have nothing else but 
"help" in them too, but haven't quite decided on that yet...



Rene

At 07:49 13/04/2005, Miles Thompson wrote:
I assume others are seeing these as well - infrequent postings with blank 
subject lines. Always throws me for a bit of a loop, forcing a "pause and 
adjust".


For those replying to them, or hijacking them, please stop.

Regards - Miles Thompson

PS Truly Canadian - note the "please"! /mt


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



[PHP] What's the going rate for making websites ?

2005-04-03 Thread -{ Rene Brehmer }-
Hi gang
Sorry for asking this question here, but I don't know where else to ask. 
And Goole'ing didn't help me much.

My father-in-law has a friend in Alaska (and I'm in Canada) that needs a 
website done. Not sure what kinda site he wants done yet, or how much he 
needs me to do for him (like webspace, domain hosting, domain registration, 
and such) but for now I've been asked what it'd cost to get it done.

I'm assuming it's something pretty simple, since it's just for a motorcycle 
club, but he wants a price first ...

What do y'all charge when you do sites for people ??? ... In the past I've 
only done pro-bono work (because they usually don't require much work, so 
it's not a problem getting it done while working on other projects), but 
I've never actually done paid work before... It's more that I just recently 
moved to Canada (from Denmark) so I have no feeling with what the prices 
and rates are overhere ...

TIA
Rene 

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


Re: [PHP] Silly OOP question

2004-11-14 Thread -{ Rene Brehmer }-
At 17:14 14-11-2004, Robert Cummings wrote:
On Sun, 2004-11-14 at 09:30, -{ Rene Brehmer }- wrote:
> Just remember that PHP isn't a true OOP language, so going OOP may not
Please define "true OOP" language and provide a few examples that meet
your criteria. Then show how other examples like PHP fail to meet your
true OOP criteria. Don't forget, if a language has OOP as a subset, it
still has true OOP capabilities. Also it might help to clarify if you
mean PHP in general or PHP4 and below.
"True" as in parts of the OOP not being optional, like it is in PHP. You 
can fudge around the OOP principle in PHP and still get it working.

> necessarily be the best solution always. OOP makes certain types of
> projects easier to code, and some projects would be almost impossible 
to do
> without OOP (like anything you wanna do where you need to use scope to
> avoid major headaches), but because PHP isn't compiled or a true OOP

PHP is runtime compiled to bytecode. It's just as compiled as any other
language. With a good compiler cache it's just as compiled as java.
Compiled to byte-code is only the same as pre-compiled in most other 
programming languages.

> language, OOP in PHP hampers performance, and that hampering is 
exponential
> with the complexity of the objects.

You're shitting us all right? Exponential? Really? could you show us
some benchmarks on how it's exponential?
Dynamic object creation will always hamper performance relative to the 
object complexity. It's true for all languages ... it's within seconds 
though on a non-dedicated server, but depending on what you do, it's not 
that hard to break 30 secs exec time on PHP that way.

Let's not be sowing seeds of FUD on the PHP general list.
Then it might be good to read instead of interpret.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Silly OOP question

2004-11-14 Thread -{ Rene Brehmer }-
At 12:34 14-11-2004, Brent Clements wrote:
I've always wondered this about OOP and maybe you guys can answer this 
question.

I'm writing a php application and I'm trying to figure out the correct way 
to right the oop part of this application.

for instance.
I have a "project.class" file that has functions for dealing with 
individual projects because you break down ideas into singular entities in 
OOP(as I understand it)

But what if I wanted to deal with multiple projects such as getting a list 
of the projects in my database, should I create a function in the 
"project.class" to handle the now plural request, or should I create a 
"projects.class" file that has a function called "getProjects".

Hopefully I'm explaining this question right. It makes sense in my own 
head. :-)
If I get what you're doing right, then you need to break it down more, if 
you wanna go truly OOP ... and create an array of objects.

Something like:
$arrProjects[] = new project($projectname);
and then have an object for each idea, that are handled by the projects, like:
class Project {
  var $project_name;
  var $arrIdeas[];
  function Project($projectname) {
$this->project_name = $projectname;
  }
  function add_idea() {
$this->arrIdeas[] = new idea();
  }
}
Just remember that PHP isn't a true OOP language, so going OOP may not 
necessarily be the best solution always. OOP makes certain types of 
projects easier to code, and some projects would be almost impossible to do 
without OOP (like anything you wanna do where you need to use scope to 
avoid major headaches), but because PHP isn't compiled or a true OOP 
language, OOP in PHP hampers performance, and that hampering is exponential 
with the complexity of the objects.

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


Re: [PHP] probably stupid, but...

2004-11-13 Thread -{ Rene Brehmer }-
At 16:28 13-11-2004, Curt Zirzow wrote:
* Thus wrote -{ Rene Brehmer }-:
> At 21:32 12-11-2004, Chris W. Parker wrote:
> >also you need to wrap your array values in { } when an array is
> >referenced within a string. i.e.
> >
> >// normal
> >$value = $_GET['something'];
> >
> >// with { }
> >$value = "Here is some data: {$_GET['something']}";
>
> Is that actually in the manual ??? If it is, where ?
Yeah, its defined in the array section where it defines the proper
way to access array's (Array do's and dont's)
  http://php.net/manual/en/language.types.array.php
Thanks alot :) ... Could've sworn I read everything in the syntax section 
... but must've overlooked that somehow :-/

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


RE: [PHP] probably stupid, but...

2004-11-12 Thread -{ Rene Brehmer }-
At 21:32 12-11-2004, Chris W. Parker wrote:
also you need to wrap your array values in { } when an array is
referenced within a string. i.e.
// normal
$value = $_GET['something'];
// with { }
$value = "Here is some data: {$_GET['something']}";
Is that actually in the manual ??? If it is, where ?
I've been learning PHP for a little over 2 years now, and I've kept jumping 
in and out of strings because I couldn't figure out how to make the darn 
thing replace array values within it.

The syntax section does not mention this that I've been able to find, nor 
does the variable section, and if it's in the array section then it's very 
well buried. I seriously think the basic syntax section needs to cover a 
bit more ground ... it would also solve our problem with recurring 
questions about very basic things.

I'm not saying that the manual should be a complete "teach-it-yourself" 
guide, but basic stuff that you need to use like all the time ought to be 
in there.

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


Re: [PHP] CONGRATULATION (YOU JUST WON LOTTERY)

2004-11-05 Thread -{ Rene Brehmer }-
Spam message reported, original sender added to permanent blacklist
Have a nice day
Rene
At 02:56 06-11-2004, floydjeffers wrote:
[skip spam]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Re: VOTE TODAY

2004-11-05 Thread -{ Rene Brehmer }-
Well, I definitely don't enjoy the 45 euro I have to pay for my 512 kbit 
SDSL ... the prices have halfed over the past 2 years, but it's still above 
and beyond what the quality of service deserves  but this is as cheap 
as it gets for SDSL here ... the ADSL is cheaper, but I need the high upload...

Rene
At 12:34 05-11-2004, Francisco M. Marzoa Alonso wrote:
That's true for Germany and France and probably another european 
countries, but in Spain by example we've just 512/128kbps paying the same 
that a french by 6Mbps/512kbps. Never mind, this dammed country continues 
being more the North of Africa than the South of Europe...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Newbie pattern question

2004-11-05 Thread -{ Rene Brehmer }-
At 19:59 05-11-2004, Greg Donald wrote:
On Fri, 5 Nov 2004 20:55:00 +0200, Phpu <[EMAIL PROTECTED]> wrote:
>   if(ereg("^[a-zA-Z0-9_]{2,30}$", $name)) {
if(ereg("^[a-zA-Z0-9_\ ]{2,30}$", $name)) {
If you use ereg, use [[:blank:]] instead of an actual space, that allows 
for tabs and other variants too

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


Re[2]: [PHP] VOTE TODAY

2004-11-03 Thread -{ Rene Brehmer }-
At 17:16 03-11-2004, Richard Davey wrote:
Hello Ryan,
Wednesday, November 3, 2004, 3:56:27 PM, you wrote:
RA> Motto: Be respectful to other people from every nation AND DONT
RA> POST POLITICS to the PHP list jackass.
Calm down, please, and for the love of God stop replying to these
morons. Or at least, if you must vent your frustration somehow, stop
doing it to the list. It *is* just as annoying as the original posts.
Although agreeing that increasing traffic by replying morons is dumb, the 
replies do for the most part come as rather fun to me ... atleast that's 
refreshing compared with all the repeat questions.

Rene
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: [users@httpd] November 2, 2004

2004-11-02 Thread -{ Rene Brehmer }-
You forgot the members from the ~74 other countries subscribed to this 
list. We have absolutely no interest in American politics, and def did not 
signup to this list to participate in same.

Just because my server is in Utah, doesn't mean I'm USAnian or really care 
about the next incompetent corruptee to become president.

Flame away, but do it offlist.
Rene
At 18:50 02-11-2004, Ryan A wrote:
People have different political opinions,  and different
religions...discussing them in a forum or a list just starts
arguments,flaming and does not make sense.
People receive this list's mailings for php.thats it.
To the original person who started this thread (I deleted the original so I
cant reply to you directly), shoot yourself in the head and not only us but
both the candidates should thank you and maybe you'll get 70 virgins in the
next life.
This list gets enough "traffic" as is and a crapload of repeat
questions/questions that are easily solved by looking in google or the
manual (aka RTFM questions) and we don't need to add politics to it, I also
ask the rest of the list to forgive me for this totally OT reply.if any
of you still want to act like an idiot and start flaming medo it offlist
at this address so it wont bother anyone else and I can read your email, add
your name to the jackass list and delete the mail.
Thanks,
Ryan
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] VOTE TODAY

2004-11-02 Thread -{ Rene Brehmer }-
At 18:50 02-11-2004, Grant wrote:
> I can't wait for the replies...
Here's a reply:
Don't vote for Bush.
if (eregi('(george)?bush',$message[$this]->body)) { 
$message[$this]->destroy() }

Rene
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Scaling select lists

2004-11-02 Thread -{ Rene Brehmer }-
At 16:18 02-11-2004, Chris Gregors wrote:
When working with select lists that grow over time, what are some solutions
people have applied to the problem of massive select lists?
This is pretty cumbersome for the users to navigate. They end up scrolling
up and down and getting annoyed.
Example:

fred
bob
... 800 more 

I've considered going to dual select boxes like the one @
http://www.philwebb.com/code/list_box.asp
Has anyone applied a solution that users appreciated to overcome massive
select lists ?
Yeah, don't use them. I use a search feature that allows users to select 
which fields, from 1 specific to all, and anything in between, to search 
in, and whether to use exact or partial (free text) search. Thus only the 
entries they actually want displayed come up, and they can then filter 
onward from that. I don't like using list/select boxes without first having 
the user pick what part of the information available they actually want. 
Firstly it's an unnessecary drain on the DB to pull data that is never 
used, secondly it's an annoyance to users to be forced to wade through 
endless amounts of options. My users prefer being able to narrow down what 
they want before being presented with it. It makes the system more flexible 
and more enjoyable to use. The more work there is in using it, the less 
it'll be used. And then its purpose is defeated.

Rene
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] MultiSelect List Box in PHP

2004-10-31 Thread -{ Rene Brehmer }-
Would be easier if you didn't send it as HTML ... bad boy you
Rene
At 10:00 31-10-2004, M. Sokolewicz wrote:
-[ input.html ]--
 one two three 
-[]--
-[ input.php  ]--

-[]--
-[   output   ]--
Array
(
 [select] => Array
 (
 [0] => 1
 [1] => 2
 )
 [submit] => submit
)
-[]--
Above output is with #1 and #2 selected, and #3 not selected. Easy, huh?
- Tul
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] MultiSelect List Box in PHP

2004-10-31 Thread -{ Rene Brehmer }-
You can use this to work with. It's something I made some time ago, so it's 
probably not the most optimal solution, but it gets the job done...

In this case it builds parameters for a SQL query, but it's easily modified 
to suit your needs. The reason it's a 'for' loop and not a 'foreach' is 
simply to make it simpler to keep track of how many items there IS in the 
list, so that the OR part of the SQL query gets built correctly.

// load field list [multiselect box] from $_POST
$fields = $_POST['fields'];
// walk through all fields and build WHERE clause
for ($i = 0; $i < count($fields); $i++) {
  if ($i > 0) {
$addtoquery .= ' OR ';
  }
  switch ($fields[$i]) {
case 'nick':
  $addtoquery .= "`nickname` LIKE '%$search%' OR `akanick` LIKE 
'%$search%'";
  break;
case 'real':
  $addtoquery .= "`fname` LIKE '%$search%' OR `lname` LIKE 
'%$search%'";
  break;
case 'email':
  $addtoquery .= "`email` LIKE '%$search%'";
  break;
case 'icq':
  $addtoquery .= "`icq` LIKE '%$search%'";
  break;
case 'aim':
  $addtoquery .= "`aim` LIKE '%$search%'";
  break;
case 'msn':
  $addtoquery .= "`msn` LIKE '%$search%'";
  break;
case 'yim':
  $addtoquery .= "`yim` LIKE '%$search%'";
  break;
  }
} // end for - fields builder

The accompanying part of the form looks like this (don't ask why this is 
done with a for loop, guess we had about those when I did it):

  Search in:

  
$fieldarray = 
array('nick','real','email','icq','aim','msn','yim');
$fieldnames = array('Nickname','Real 
name','Email','ICQ','AIM','MSN','YIM');
for ($i=0; $i < count($fieldarray); $i++) {
  echo('
  if (! empty($_POST['fields'])) {
foreach($_POST['fields'] as $field) {
  if ($fieldarray[$i] == $field) {
echo(' selected');
  }
}
  } else if ($fieldarray[$i] == 'nick') {
echo(' selected');
  }
  echo('>'.$fieldnames[$i]);
}
  ?>


FWIW
Rene
At 09:21 31-10-2004, Andy B wrote:
Sorry that doesn't do me a huge bit of good since I have no clue how to
write java in the first place. Does anybody know where I can find or get an
example of php code that shows how to get all the selected items from a
multiselect listbox and loop through them printing them on the screen??
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Gawd I hate those useless error messages...

2004-10-30 Thread -{ Rene Brehmer }-
At 15:56 29-10-2004, Richard Davey wrote:
Hello -{,
Friday, October 29, 2004, 3:28:39 PM, you wrote:
RB> since this is the test-server, I run with all errors, alerts, and messages
RB> on, but isn't there someway to make PHP just a little more helpful when
RB> this happens ???
Use an IDE that high-lights typos like this for you? Before it even
gets are far as PHP debugging it? Zend Studio for example would do
this (it did it to me several times this morning!)
Thanks ... will look into it :)
Rene
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Gawd I hate those useless error messages...

2004-10-29 Thread -{ Rene Brehmer }-
At 17:00 29-10-2004, Robby Russell wrote:
On Fri, 2004-10-29 at 16:28 +0200, -{ Rene Brehmer }- wrote:
> Hi gang
>
> I do realise that this error means I've forgotten a curly brace or
> semi-colon somewhere, but seriously ...
>
> Parse error: parse error, unexpected $end in 
E:\web\Metalbunny\addguest.php
> on line 274
>
> where line 274 would be the last line, obviously (since it's always the
> last line when it does this)...
[snip]
Yeah, don't make errors in your code. ;-)
Oh, that I do try ... perfectionist at heart :p

Also, try to seperate your html and php code as much as possible. Use a
template system of some form. (ie. smarty)
I am, trust me :) ... There are just some cases where it's not really 
practical to split the scripts anymore than I do. Like in this case where 
it's the submission form for the guestbook ... First I've got about 200 
lines of code (ok, 30 of them is an array with country names that I only 
use on this page and nowhere else) that handle the part of the form 
evaluation and SQL generation that is unique to this page, and outputting 
error and thank you notices as needed. Then there's the form itself with 
the embedded PHP code to refill the form in case of errors. It's the last 
part where I jump in and out of PHP, since it really IS the simplest way to 
get the PHP to put data into an otherwise static chunk of HTML.

I use my own made template system. It's made in a shell form, where the 
scripts simply put the top and the bottom in so the generated body goes in 
between. It's not the most elegant solution, but my latest revision is a 
bit more intelligent made so the templates keeps track of basically 
everything but the body generation. But it works fast, and speed is my main 
concern, since some of the pages can get a bit lengthy depending on 
queries. All longer text pieces are in seperate text/html-files and are 
simply included if/when needed.

I haven't really looked at special-made template systems because my own 
works well enough for my needs ... and as long as it can generate even the 
heaviest page in 10 secs I'm happy.

Use a PHP editor with syntax highlighting..click on one curly brace and
then find where the other highlighted brace is and make sure that it
where it should end.
Anyone you can recommend ? ... I've been using HomeSite for 6 years, and 
it's admittedly a little annoying when it comes to PHP, cuz although the 
colour-/bold-ing highlighting works for most commands, it's made to handle 
JavaScript, JSP, and ASP, so its understanding of PHP isn't the best.

Learn how to debug your code. See how far it's getting for each
thing..add test messages and die() in different scopes of code.
That I know ... but I've only been at PHP for 2 years, so still alot to 
learn ... but it's gotten better, and the errors are fewer. That said, the 
$end errors I run into nowadays are mostly caused when I rewrite my first 
scripts and delete large chunks of it that are no longer needed cuz I've 
got objects/functions that handle that now. Sometimes it's just the "ok, 
what does it look like now" approach that makes errors occur, when trying 
to run unfinished code.

Rene
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Gawd I hate those useless error messages...

2004-10-29 Thread -{ Rene Brehmer }-
Hi gang
I do realise that this error means I've forgotten a curly brace or 
semi-colon somewhere, but seriously ...

Parse error: parse error, unexpected $end in E:\web\Metalbunny\addguest.php 
on line 274

where line 274 would be the last line, obviously (since it's always the 
last line when it does this)...

now I'm lucky that this script in question has alot of HTML in it, so 
there's only about 180 lines of actual code, but is there really not 
something that can be done to PHP to make errors like these just a LITTLE 
easier to debug ???

It's not that bad in this particular case ... but when we have scripts of 
500-800 lines code, or even more, it tends to be a rather not very helpful 
message... and it gets worse when you jump in and out of PHP ...

the '$end' and the '$' error are by far the most annoying errors, so hard 
to debug ... atleast with 'unexpected {' you have a slight chance as it 
limits the part you have to search through ...

since this is the test-server, I run with all errors, alerts, and messages 
on, but isn't there someway to make PHP just a little more helpful when 
this happens ???

Rene
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] How to optimize select of random record in DB ?

2004-10-14 Thread -{ Rene Brehmer }-
I made this code to pick a random record from a changeable number of 
records in a given table.
I'm just curious if any of the more awake coders out there can see a way to 
optimize this for better performance, since there's several other DB 
queries on the same page.

  $records = mysql_query("SELECT COUNT(*) AS count FROM persons") or 
die('Unable to get record count'.mysql_error());
  $totalcount = mysql_result($records,0) - 1;
  $rndrecord = rand(0,$totalcount);
  $personquery = mysql_query("SELECT personID FROM persons LIMIT 
$rndrecord,1") or die('Unable to get random record'.mysql_error());
  $personID = mysql_result($personquery,0);
--
Rene Brehmer
aka Metalbunny

If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] UNSUBSCRIBE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2004-10-01 Thread -{ Rene Brehmer }-
At 17:08 30-09-2004, Pankaj Kafley wrote:
What an ass !
And my filters don't even catch the many exclamation marks cuz this list is 
white-listed . *sigh*

--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] World time convertor

2004-10-01 Thread -{ Rene Brehmer }-
At 11:19 30-09-2004, Phpu wrote:
Howdy
Is there a time convertor written in php?
I mean to convert a specific hour/date in all world countries.
I've been looking for something like this as well, but have come up empty 
... apparently noone's felt comfortable dealing with the Daylight Saving 
Time issues for 184 countries in 24 time zones ... (and some of those don't 
even have DST). But if you stumble across something useful, do let us know :)
--
Rene Brehmer
aka Metalbunny

If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] How do I produce a random database query for each day or week?

2004-10-01 Thread -{ Rene Brehmer }-
At 10:31 01-10-2004, Graham Cossey wrote:
A couple of thoughts:
As you want to cycle through the list rather than randomly (with repetition)
picking from the list, have you considered storing the last CD shown details
in the DB?
If each CD has a sequential ID then each week (or day) you increment the
number which will determine what CD is shown. If the incremented CD id
exceeds the highest id in the DB, restart back at the first id.
Just incrementing the ID is not a good idea. It does not allow for the 
flexibility required if you suddenly delete a CD in the middle. So it'd be 
better doing something like "SELECT * FROM cds WHERE `CDid`>'$LastCDid' ". 
Then obviously you'd need to check if the last shown was the last in the 
base, you'd get 0 rows. But this can be circumvented by just checking the 
number of rows returned, and if the rowcount is < 1, simply do a new SELECT 
with CDid > 0.

You could also include a column (or two) in the CD info table to record when
it was last displayed and check that this is > 29 days ago.
I agree that this would be the easiest way. On every display you do an 
update to store the date, then on each page load just calculate how long 
ago the CD show must've been shown last.

What about cookies? Each visitor could then have their own 'cycle' through
the list.
This is a per need basis. With the "last shown date" you don't need the 
cookies.

--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mailing to hotmail

2004-09-25 Thread -{ Rene Brehmer }-
At 18:23 24-09-2004, Diana Castillo wrote:
for some reasons my mails I send to hotmail are never arriving,  (using
mail($email,$subject_line,$msg,$headers);)
anyone ever heard of this?
Usually if mail is not accepted by hotmail you'll get a very long and 
polite error message about it after some time, usually almost immediately 
... (for some reason they can deliver error messages immediately, but 
regular mail takes hours to days)...

Have you checked the junk folder??? ... atleast I assume you've tested with 
your own hotmail account...

--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mailing to hotmail

2004-09-25 Thread -{ Rene Brehmer }-
At 19:05 24-09-2004, you wrote:
Diana Castillo wrote:
for some reasons my mails I send to hotmail are never arriving,  (using 
mail($email,$subject_line,$msg,$headers);)
anyone ever heard of this?
Does the box that you're running php on have a dynamic address?  Do you 
have reverse DNS?
You can actually have a static IP and still be listed as dynamic in the 
databases. That's the problem I have. My secondary MX, which is also my 
workstation and thus test-bed, is on a privately leased static IP, but alot 
of databases lists it as "dial-up pool" which is incorrect, and thus they 
don't accept mail from my server. Luckily sofar all the mail that's been 
refused because of this have been my server's auto-generated complaints to 
spamhouses.

--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Does PHP need another mailing list???

2004-09-22 Thread -{ Rene Brehmer }-
At 22:43 22-09-2004, Greg Donald wrote:
On Wed, 22 Sep 2004 15:31:09 -0500, Jay Blanchard
<[EMAIL PROTECTED]> wrote:
> [snip]
> php-db exists already.
> [/snip]
>
> That's too general, don't you think? :7)
I dunno, maybe.  I ask my database questions on an actual database
list if possible.  I think most people probably feel the same, I'm on
php-db and it doesn't get much traffic.
PHP-DB is meant for PHP related database questions ... but alot of the 
traffic on that list is not as much PHP as it is basic database specific 
SQL stuff ... which honestly is better suited for the MySQL or the PostGres 
list (since those are the two most used and most mentioned servers on that 
list) ... (although I can't remember where the PostGres list is, I'm not 
subscribed to it)

--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] List Etiquette

2004-09-21 Thread -{ Rene Brehmer }-
While we're in the middle of it:
Don't top-post to a message that's already been bottom-posted ... it's 
unbelivably messy and makes it loads harder to figure out what you're 
replying to than needs be ... stay in the format ... if the message you 
reply to is top-posted, continue that way, if it's been bottom-posted, 
continue that way  shifting between top & bottom posting in the middle 
of the thread is a major reason why we're even having this debate in the 
first place 

NOTE: Original message left complete to proove how confusing it gets...
Rene
At 08:44 21-09-2004, Octavian Rasnita wrote:
No, there is no way for customizing the headers Outlook Express use to put
in the email messages.
I wish there was, because I don't like them also...
Teddy
- Original Message -
From: "- Edwin -" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 20, 2004 2:51 PM
Subject: Re: [PHP] List Etiquette
> Hi,
>
> On Mon, 20 Sep 2004 04:01:47 +0300
> "Octavian Rasnita" <[EMAIL PROTECTED]> wrote:
> > My email client (Outlook Express) puts a lot of information
> > at the top of the message automaticly, like:
> >
> > The signature,
> > --- original message ---
> > The From line
> > - The to line
> > - The date line
> > - The subject line.
>
> There should be a way to customize that, no?
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] empty variable

2004-09-19 Thread -{ Rene Brehmer }-
At 01:54 20-09-2004, Chris Mach wrote:
What is the best way to determine if a variable is empty?
I have a feeling there is a better way than the way I'm doing it now...
if ($variable == "")
there's 2:
if (isset($variable))
or
if (isempty($variable))
what's most appropriate depends on how the variable is set or not
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] List Etiquette

2004-09-19 Thread -{ Rene Brehmer }-
At 16:57 19-09-2004, Octavian Rasnita wrote:
Hi,
From: "John Nichel" <[EMAIL PROTECTED]>
Do the words get smaller at the bottom?  Having to scroll thru line
after line of message doesn't deal with top vs. bottom posting...that
stems from people not trimming non-releative parts out of the message.
---
The rules should be made to make the reading process easier for the readers
and the top posting versus bottom posting has nothing to do with the
trimming of the messages.
It is much easier to trim a message when top posting, just as I explained
you.
In other words it's easier for you to reach your Delete key when you top 
post than when you bottom post ???

--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] List Etiquette

2004-09-18 Thread -{ Rene Brehmer }-
At 01:40 19-09-2004, Robert Cummings wrote:
On Sat, 2004-09-18 at 18:46, Jason Wong wrote:
> On Sunday 19 September 2004 06:33, Robert Cummings wrote:
>
> [snip]
>
> > Happy top posting,
>
> Have fun driving on the wrong side of the road.
What side is that? Doesn't it depend on national preference?
When I overtake others, I usually take to the other lane ... is that the 
wrong side, or the right side of the road, for what I'm doing ?

Rene
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] List Etiquette

2004-09-18 Thread -{ Rene Brehmer }-
Most mail programs have their default settings set for top posting ... 
while most news clients are set for bottom posting  which way is the 
most preferable depends on what's most useful for your reply ... but those 
that enjoy mixing top and bottom posting are the daft ones ... once a 
thread goes into top posting, it's easier to simply continue that way ... 
otherwise it gets utterly confusing 

But some kinds of replies, especially to long windy posts, are better made 
at the bottom or inline ... or a mix  especially lists like this one 
where it's alot of programming code, are usually easier to read when 
bottom/inline posted  while regular commentary lists benefit more from 
the top posting ...

There's advantages and disadvantages to both principles, and some people 
prefer one over the other ... but it's really depending on the actual 
content and nature of the discussion whether the one is preferable to each 
other...

In either method, learn to trim, and everyone will be much happier nomatter 
how you reply ... any properly configured signature will be removed 
automatically by a properly written client program ... but the rest of the 
crud you really need to peel out with manual labour ...

Rene
At 00:33 19-09-2004, Robert Cummings wrote:
*RUH ROH* Better watch out, top posting is an extremely unpopular
discussion. Some members of the list will attempt to lambaste you and
tell you that because the rules are written, then they must be the final
word. Feel free to post however you please, while the dogs might bark
loudly, they are at a safe distance. You'll notice that many, many
people top post. Some people top post, some bottom post, and almost
everyone at some point interlace posts. Don't forget that at one time
people thought the world was flat because people said it was so, of
course we know better now, but change usually comes at the price of old
customs, and some old dogs hate new tricks.
Happy top posting,
Rob.
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Nevermind ... Re: OK ... WHY does this work ?????

2004-09-14 Thread -{ Rene Brehmer }-
At 07:30 15-09-2004, Curt Zirzow wrote:
* Thus wrote -{ Rene Brehmer }-:
> OK, obviously I wasn't awake last night ... figured out what I was 
actually
> doing here ... specifying the index for the 2nd array instead of the value
> in the first ... *sigh* *blushes* ... how do you say "tanketorsk" in
> English ??? 

scheißen or  geschissen!!
:)
Curt
LOL! ... thanks Curt, I'll try to remember that :P
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Nevermind ... Re: OK ... WHY does this work ?????

2004-09-14 Thread -{ Rene Brehmer }-
OK, obviously I wasn't awake last night ... figured out what I was actually 
doing here ... specifying the index for the 2nd array instead of the value 
in the first ... *sigh* *blushes* ... how do you say "tanketorsk" in 
English ???  anyway, sorry for wasting bandwidth, I'll go hide in the 
corner now :P

At 06:46 15-09-2004, -{ Rene Brehmer }- wrote:
This is some experimental code I did to try and find a way to recycle the 
same query multiple times as efficient as possible. With the purpose of 
efficiently comparing the results of 2 queries where the resultset from 
both queries won't match in the size (in this sample test it coincidently 
does, but I've tried with a variant where it doesn't, and it works just as 
beautiful). Although it's nice that it actually works like intended, I'm a 
little baffled to exactly WHY it works (this being why the 2 dimensional 
array I build actually works like intended). I tried looking through the 
manual to find how PHP build the associate arrays when no key is 
specified, but came out empty. So if anyone can explain how this come to 
function like intended despite immediate logic dictating it shouldn't, I'd 
really appreciate it ... I hate when I get the code to work, but don't get 
why it works...

This is the code (pieced together from much larger script ... that does 
lots more than this in between:


// global data pull of base configuration
$config_query = "SELECT setting,value FROM hf_config";
$config = mysql_query($config_query) or die('Unable to get base 
configuration'.mysql_error());

while ($config_data = mysql_fetch_array($config)) {
  if ($config_data['setting'] == 'admin_level') {
$lvl_admin = $config_data['value'];
  } elseif ($config_data['setting'] == 'new_member_level') {
$lvl_new = $config_data['value'];
  } elseif ($config_data['setting'] == 'guest_level') {
$lvl_guest = $config_data['value'];
  }
}
// load levels and build array
$level_query = "SELECT levelID,levelname,description FROM hf_levels ORDER 
BY `levelorder` ASC";
$levels = mysql_query($level_query);
while ($leveldata = mysql_fetch_array($levels)) {
  $arrlevels[$leveldata['levelID']] = array('levelname' => 
$leveldata['levelname'],
'description' => $leveldata['description']);
}
?>


  
General configuration
  
Administrator level


  
New member level

  
Guest level

  


The query results look like this:
mysql> SELECT setting,value FROM hf_config;
+--+---+
| setting  | value |
+--+---+
| admin_level  | 1 |
| new_member_level | 50|
| guest_level  | 99|
+--+---+
3 rows in set (0.00 sec)
mysql> SELECT levelID,levelname,description FROM hf_levels ORDER BY 
`levelorder`
 ASC;
+-++---+
| levelID | levelname  | description   |
+-++---+
|   1 | Admin  | System administrators |
|  50 | New member | new members   |
|  99 | Guest  | Guest users   |
+-++---+
3 rows in set (0.00 sec)

Output of the script looks like this:
General configuration
Administrator level 1 - Admin
New member level 50 - New member
Guest level 99 - Guest
Unless I misunderstand how PHP make unspecified arrays (and I probably do 
since this works), when you have an array of 3 elements on the first 
dimenstion like I do, and then ask for 
$arrlevels[$lvl_guest]['levelname'], which in this case actually means it 
asks for $arrlevels[99]['levelname']  how come it pick the correct 
element, and not error out that element 99 don't exist ??

My only conclusion (based on the fact that this actually works) is that 
PHP makes the key the same as the value if the key isn't specified. But is 
this actually correct  Or is there something "going on" that I don't 
know about ???

I've got another sample, that uses the same "query recycling" method, but 
with much, much more complex database queries, and it works just as 
perfectly well

I really just wanna understand why this actually work, and how ... it can 
be rather confusing to stumble across a useful functionality and solution 
when you're still learning how to do the more complex things in PHP.
--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] replace accents

2004-09-14 Thread -{ Rene Brehmer }-
At 17:51 14-09-2004, Diana Castillo wrote:
Anyone know of any function to replace letters with accents with just the
regular letter, for instance replace á with a,
ç with c, ñ with n ?
How about this ??? This is the one I made for this purpose
function stripAccents($string) {
  $returnString = strtr($string,
  'àáâãäçèéêëìíîïñòóôõöšùúûüýÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕ֊ÙÚÛÜÝ', 
'acnosyACNOSY');
  $returnString = str_replace('æ','ae',str_replace('Æ','AE',$returnString));
  $returnString = str_replace('ø','o',str_replace('Ø','O',$returnString));
  $returnString = str_replace('å','a',str_replace('Å','å',$returnString));
  $returnString = str_replace('ß','ss',$returnString);
  $returnString = str_replace(''','',str_replace("'",'',$returnString));
  $returnString = str_replace('"','',str_replace('"','',$returnString));
  return $returnString;
}

obviously there's room for improvement, but it's from a QAD script (not 
production)

--
Rene Brehmer
aka Metalbunny
If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] OK ... WHY does this work ?????

2004-09-14 Thread -{ Rene Brehmer }-
This is some experimental code I did to try and find a way to recycle the 
same query multiple times as efficient as possible. With the purpose of 
efficiently comparing the results of 2 queries where the resultset from 
both queries won't match in the size (in this sample test it coincidently 
does, but I've tried with a variant where it doesn't, and it works just as 
beautiful). Although it's nice that it actually works like intended, I'm a 
little baffled to exactly WHY it works (this being why the 2 dimensional 
array I build actually works like intended). I tried looking through the 
manual to find how PHP build the associate arrays when no key is specified, 
but came out empty. So if anyone can explain how this come to function like 
intended despite immediate logic dictating it shouldn't, I'd really 
appreciate it ... I hate when I get the code to work, but don't get why it 
works...

This is the code (pieced together from much larger script ... that does 
lots more than this in between:


// global data pull of base configuration
$config_query = "SELECT setting,value FROM hf_config";
$config = mysql_query($config_query) or die('Unable to get base 
configuration'.mysql_error());

while ($config_data = mysql_fetch_array($config)) {
  if ($config_data['setting'] == 'admin_level') {
$lvl_admin = $config_data['value'];
  } elseif ($config_data['setting'] == 'new_member_level') {
$lvl_new = $config_data['value'];
  } elseif ($config_data['setting'] == 'guest_level') {
$lvl_guest = $config_data['value'];
  }
}
// load levels and build array
$level_query = "SELECT levelID,levelname,description FROM hf_levels ORDER 
BY `levelorder` ASC";
$levels = mysql_query($level_query);
while ($leveldata = mysql_fetch_array($levels)) {
  $arrlevels[$leveldata['levelID']] = array('levelname' => 
$leveldata['levelname'],
'description' => $leveldata['description']);
}
?>


  
General configuration
  
Administrator level


  
New member level

  
Guest level

  


The query results look like this:
mysql> SELECT setting,value FROM hf_config;
+--+---+
| setting  | value |
+--+---+
| admin_level  | 1 |
| new_member_level | 50|
| guest_level  | 99|
+--+---+
3 rows in set (0.00 sec)
mysql> SELECT levelID,levelname,description FROM hf_levels ORDER BY 
`levelorder`
 ASC;
+-++---+
| levelID | levelname  | description   |
+-++---+
|   1 | Admin  | System administrators |
|  50 | New member | new members   |
|  99 | Guest  | Guest users   |
+-++---+
3 rows in set (0.00 sec)

Output of the script looks like this:
General configuration
Administrator level 1 - Admin
New member level 50 - New member
Guest level 99 - Guest
Unless I misunderstand how PHP make unspecified arrays (and I probably do 
since this works), when you have an array of 3 elements on the first 
dimenstion like I do, and then ask for $arrlevels[$lvl_guest]['levelname'], 
which in this case actually means it asks for $arrlevels[99]['levelname'] 
 how come it pick the correct element, and not error out that element 
99 don't exist ??

My only conclusion (based on the fact that this actually works) is that PHP 
makes the key the same as the value if the key isn't specified. But is this 
actually correct  Or is there something "going on" that I don't know 
about ???

I've got another sample, that uses the same "query recycling" method, but 
with much, much more complex database queries, and it works just as 
perfectly well

I really just wanna understand why this actually work, and how ... it can 
be rather confusing to stumble across a useful functionality and solution 
when you're still learning how to do the more complex things in PHP.
--
Rene Brehmer
aka Metalbunny

If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] newbie questions

2004-08-31 Thread -{ Rene Brehmer }-
Documented research indicates that on Sun, 29 Aug 2004 21:00:06 +, Paul
Waring wrote about "Re: [PHP] newbie questions":

>> The constructor for Content accepts an
>>  object ... why is &$db used instead of $db?
>
>&$variable means to pass the variable by reference (as opposed to
>passing by value, which is the default). Instead of making a copy of
>the variable, you are telling $this->db to point to the same point in
>memory as the original $db - in effect you are using two names to
>point to the same data. If you modify $this->db, $db will also be
>modified and vice versa.

heh ... nice reply Paul ... much clearer than when my programming teacher
tries to explain it heh  (I'm studying for Programmer/System Developer,
and our C++ teacher is rather crummy at explaining stuff)

-- 
Rene Brehmer
aka Metalbunny

If your life was a dream, would you wake up from a nightmare, dripping of sweat, 
hoping it was over? Or would you wake up happy and pleased, ready to take on the day 
with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] Browser back button

2004-08-30 Thread -{ Rene Brehmer }-
Documented research indicates that on Fri, 27 Aug 2004 15:20:58 -0600,
Michael Gale wrote about "[PHP] Browser back button":

>Hello,
>
>   I am sure this has been asked more then a few times but ... I have a web site 
> where almost every page is dynamically
>created. So if at some point in the site if you hit your browsers back button a popup 
>window occurs and asks if you want
>to resubmit the data. Upon clicking yes the page is properly displayed.
>
>That is a pain in the a$$ and I get many user complaints -- so far I have thought 
>about saving the requested URL and
>query string in a session variable and loading a back button on every page.
>
>This seems to work create if the previous page can be loaded using a GET request but 
>if the previous page was loaded
>using a HTTP POST it seems I an up the creek with out a paddle :(
>
>Any one have any ideas ... 

The way I do it is urlencode the query string and then store it with a 32
character cut of a md5'ed version of the query + timestamp in the database,
then the MD5 version is used to create GET urls back and force and to
back-reference to the actual page itself to allowed for changing sort orders
on tables and such...

the links to the pages then look like
link

the script-pages then have a simple if-structure:

if (isset($_GET['query'])) {
   // load $_GET['query'] from the database and urldecode it
} elseif (isset($_POST['submitted'])) {
   // do whatever you do when form is submitted
} else {
   // dummy default to handle page load without submitted data
}

it's admittedly a little clumsy, but it was the most efficient way I could
find that allowed to store queries and pull them out later, and do it in a
way that prevented loading the URL with a get string that's too long to work
... the reason I add the timestamp is simply to prevent similar codes when
cutting them down ... sofar I've not had any problems with this...

all there is to remember is to add the right code to the links, for whether
uou're going backwards or forwards, or referencing the page itself I use
this method with great success on pages that have user-changable sort order
and and sub-queries on the fly ... 

probably a prettier way to do it, but it gets the job done...

oh, and I save a timestamp with the query, then clean them out as they pass
7 days of age ... that way it's also possible to link directly to a query,
and it prevents the database from overload on past queries...


Rene
-- 
Rene Brehmer
aka Metalbunny

If your life was a dream, would you wake up from a nightmare, dripping of sweat, 
hoping it was over? Or would you wake up happy and pleased, ready to take on the day 
with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] How to determine if date/time is with DST or not ?

2004-08-15 Thread -{ Rene Brehmer }-
which tells you if the locale where the server is was in DST or not on that
date - atleast if I understand the PHP documentation right... since the
timestamps don't contain locale info ... I wanna know if a specific locale
was in DST on that given date  

I hate having to work with dates ... I know it basically requires to code
the dst days for the entire globe into the system, but had hoped someone had
already done that  as much as I hate using others code, this is one
thing I'd rather avoid having to program...


Documented research indicates that on Sun, 15 Aug 2004 10:31:17 +0300,
Burhan Khalid wrote about "Re: [PHP] How to determine if date/time is with
DST or not ?":

>-{ Rene Brehmer }- wrote:
>
>> hi gang
>> 
>> I'm trying to find a simple way to determine if a given date/time is with
>> DST for a given locale at any point in time ... the point is basically to
>> convert date strings into accurate GMT timestamps for storage in the
>> database...
>
>http://www.php.net/date
>
>I (capital i)  Whether or not the date is in daylights savings time1 if 
>Daylight Savings Time, 0 otherwise.
>
>[ snipped rest ]

-- 
Rene Brehmer
aka Metalbunny

If your life was a dream, would you wake up from a nightmare, dripping of sweat, 
hoping it was over? Or would you wake up happy and pleased, ready to take on the day 
with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



[PHP] How to determine if date/time is with DST or not ?

2004-08-14 Thread -{ Rene Brehmer }-
hi gang

I'm trying to find a simple way to determine if a given date/time is with
DST for a given locale at any point in time ... the point is basically to
convert date strings into accurate GMT timestamps for storage in the
database...

Like I've got date strings looking like:

Thursday, July 22, 2004 8:50:01 PM 
July 22, 2004 6:42 PM 

the strings are submitted through a form, together with a variable
determining the time zone these times are in. I just want to figure out if
the dates are with or without dst for that locale, at that given time, so
that I can properly convert them to GMT times ... but I have no clue how to
do that ... haven't been able to find anything useful in the manual or the
PHP Cookbook ... the time zone is submitted negative of the actual value ...
so a time offset of -0700 is submitted as +7 and +0200 as -2 ... this is
simply to make the time conversion simpler...

these are extracts of the current time calculation codes, including some
debugging code for the time conversion:



/* the following part is an extra of a larger table ... the formatting of
the time zone is merely for displaying purposes atm. The goal is to create
RFC2822 dates to be stored in the database alongside messages...
*/

Workdate: 
  Time difference:  0) {
  $format = '-';
} else {
  $format = '+';
}
if (abs($tzone) > 9) {
  $format .= '%u00';
} else {
  $format .= '0%u00';
}
printf($format,abs($tzone)); ?>
  Unix timestamp: 
  GMT date: 


if anyone has any ideas for determining whether DST is on or off, I'd
appreciate it. right now I have no clue how to do this the easiest...

TIA

Rene
-- 
Rene Brehmer
aka Metalbunny

If your life was a dream, would you wake up from a nightmare, dripping of sweat, 
hoping it was over? Or would you wake up happy and pleased, ready to take on the day 
with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] creating a mailing list

2004-04-30 Thread -{ Rene Brehmer }-
Documented research indicates that on Thu, 29 Apr 2004 15:49:41 +0530, Vinod
Panicker wrote about "Re: [PHP] creating a mailing list":

>Chris,
>Mass mailing is ideally done using mailing lists - in this case i
>assume that you would want to frequently send updates to the ppl who
>have signed up.
>
>majordomo/listserv etc can be used to implement mailing lists...

Or Mercury Mail server if you're on Windows (it's free and based upon
Listerv, Majordomo/Listserv definitely is not free)...


Rene

-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] Nonsense mail

2004-04-30 Thread -{ Rene Brehmer }-
Documented research indicates that on Thu, 29 Apr 2004 11:18:11 -0400,
[EMAIL PROTECTED] wrote about "Re: [PHP] Nonsense mail":

>On 29 Apr 2004 Brent Clark wrote:
>
>> Could someone please tell me why I keep getting this mail, when I send
>> something to the list
>
>It's an autoresponder on an email address that is subscribed to the 
>list.  I get three autoresponder messages for every list message I 
>send.

Actually, my investigation shows it's a malformed server error ... so
someone out there is subscribed with a mail server that sends out false
error messages ... which CAN indicate an address harvester confirming sender
addresses by sending that junk back to see if it's deliverable ...


Not saying it IS an address harvester, but it's possible... there's a few of
those on this list for sure ... there normally are a couple on ALL
high-traffic lists ... 


Rene
-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] OR

2004-04-25 Thread -{ Rene Brehmer }-
According to historical records, on Sun, 25 Apr 2004 17:14:13 +1000 Aidan
Lister wrote about "[PHP] OR":

>if (cond || cond2)
>
>OR
>
>if (cond OR cond2)
>
>
>What do you use, and why?

I always use ||

basically because to me it's easier to read in more complex statements ...
like this:

if ((($del_own == 1 && $post_userID == $userID) || $del_other == 1) &&
($postID != $first_postID || $del_thread == 1)) {

I always stick to the symbols ... just easier ...

|| && |! &! 
^ being OR, AND, NOR, and NAND (believe NOR is actually called XOR, can't
remember ...)


Rene
-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] Re: Microsoft Update and how its done question

2004-04-24 Thread -{ Rene Brehmer }-
According to historical records, on Sat, 24 Apr 2004 17:49:42 +0200 Torsten
Roehr wrote about "[PHP] Re: Microsoft Update and how its done question":

>"Anton Krall" <[EMAIL PROTECTED]> wrote in message
>news:!~!UENERkVCMDkAAQACABgAyt+Udpm8KEiSEdKfabIEWMKA
>[EMAIL PROTECTED]
>> Guys.. Ive been wondering this.. when you visit microsofts update sites,
>if
>> you click on look for updates, it loads something into your computer, an
>vb,
>> activex or whatever, and looks into your computer for some stuff to
>update,
>> then it download and installs it... all showing nice windows, process %,
>> etc.
>>
>> How can this be done using PHP?
>>
>> Thx for any comments.
>>
>> Anton Krall
>
>I don't think this can be done with PHP. You can't access the client's
>system. What you're describing is a specific Windows feature that is built
>into the operating system.

It's not "built in" ... the site loads an ActiveX module that talks to an
.exe file that comes with windows. If the .exe is outdated, the ActiveX
module downloads a new one ... 

It's the ActiveX module that generates the progress bar and all that stuff
... but it's the .exe file that does the actual disk investigation


Rene

-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] mouse over problem on php

2004-04-24 Thread -{ Rene Brehmer }-
According to historical records, on 24 Apr 2004 17:41:14 +0530 gowthaman
ramasamy wrote about "[PHP] mouse over problem on php":

{snip}
>2)even if i hyperlink  the text with title attribute... only the text
>before the first space (the very first word) is displayed. Not the
>entire sentence.

Using proper HTML will solve this ... just use the "" around the attributes
like you're supposed to. 

linktext

or

cell-contents

the TITLE attribute will work with any block or inline tag... IF you use
proper HTML to do it


Rene

-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] php/apache/mysql on ntfs

2004-04-24 Thread -{ Rene Brehmer }-
Because someone that's subscribed to the list has a full mailbox ... I get
it too ... all the time ... just like the address harvesters masquerading as
banks ... "Advance Credit Suisse Bank" <[EMAIL PROTECTED]> and
"Information Desk" <[EMAIL PROTECTED]>


Rene

According to historical records, on Sat, 24 Apr 2004 07:28:07 -0400 Andy B
wrote about "Fw: [PHP] php/apache/mysql on ntfs":

>does anybody have any idea why this message keeps coming up every time i
>send a msg to the list?? im sort of confused now
>
>- Original Message - 
>From: <[EMAIL PROTECTED]>
>To: "Andy B" <[EMAIL PROTECTED]>
>Sent: Saturday, April 24, 2004 7:17 AM
>Subject: NDN: [PHP] php/apache/mysql on ntfs
>
>
>> Sorry. Your message could not be delivered to:
>>
>> PHP Net List [Conference] (Mailbox or Conference is full.)
>>
>>

-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] Scripting practices

2004-04-24 Thread -{ Rene Brehmer }-
Same here ... I only initialize variables where's there any point to it ...
like the booleans I use for error checking ... all the others are normally
never initialized


Rene

According to historical records, on Fri, 23 Apr 2004 17:15:58 -0400 Travis
Low wrote about "Re: [PHP] Scripting practices":

>Also, for the lazy variable typing.  To me, strong typing means pounding the 
>keyboard extra hard.
>
>cheers,
>
>Travis
>
>Travis Low wrote:
>> It's not necessary.  If you want to go to that much trouble, I would 
>> switch to Java for the speed.  I stick with PHP for the shorter 
>> development time.
>> 
>> cheers,
>> 
>> Travis
>> 
>> Gabe wrote:
>> 
>>> When scripting in a language (such as PHP) that doesn't require you to 
>>> determine the variable type before you use it, is it still considered 
>>> good technique to initialize it to the type you're going to use it as? 
>>> Or is it considered ok to just use it?
>>>
>>> e.g.
>>>
>>> $strText = "";//initialize
>>> $strText = "now i'll give it a useful value";
>>>
>>> Or is it just better to skip the first line?  Just curious, thanks!
>>>
>>> Gabe

-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] php/apache/mysql on ntfs

2004-04-24 Thread -{ Rene Brehmer }-
Sure you can :) ... I've been doing it for a very long time now ... works
alot better than FAT32 actually ... much faster...

The programs don't care about the file system, that's for the OS to deal
with. Only pure DOS programs have problems with the NTFS ... for all other
programs they can't see what FS it is anyway, since it's not for them to
worry about ... 


Rene

According to historical records, on Sat, 24 Apr 2004 07:18:40 -0400 Andy B
wrote about "[PHP] php/apache/mysql on ntfs":

>hi...
>we are upgrading test servers to xp home and want to know if its possible to
>run php/apache/mysql and all that sort of stuff on ntfs or does the servers
>have to run fat32??

-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

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



Re: [PHP] PHP Web Hosting

2004-04-22 Thread -{ Rene Brehmer }-
According to historical records, on Thu, 22 Apr 2004 06:48:00 -0400 David
T-G wrote about "Re: [PHP] PHP Web Hosting":

>Rene, et al --
>
>...and then -{ Rene Brehmer }- said...
>% 
>% According to historical records, on Tue, 20 Apr 2004 10:39:33 -0400 John
>% Nichel <[EMAIL PROTECTED]> wrote about "Re: [PHP] PHP Web Hosting":
>% 
>% >-{ Rene Brehmer }- wrote:
>% >> At 21:19 19-04-2004, John Nichel wrote:
>% >> 
>% >>> Greg Donald wrote:
>% >>>
>% >>>> Your signature is twice the rfc1855 suggested limit.
>...
>% >>>
>% >>> And the RFC1885 'guidelines' are also almost 10 years old.  I think 
>...
>% >> 
>...
>% >
>% >A, but the almost 10 year old RFC says this...
>% >
>% >"Limit line length to fewer than 65 characters and end a line with a 
>% >carriage return."
>% 
>% Hmm ... why the heck 65 characters ??? ... Old EGA screens were 80x34
>
>Because by the time you get to the fourth or fifth reply, just as in this
>top-heavy example, the original 65-char line will be shifted over by
>quote markers and be nearing the 80-char screen limit after all.

Ehm ... yes and no ... the client is not supposed to include the signature
when replying ... so that's a mood point ...

>/me fondly remembers a quoting war where the various posters'
>contributions made a string of gibberish over 40 chars long ...
>/me fondly remembers days when different quoting prefixes were
>accepted -- nay, expected -- as well

Many still do their own quote markers (which is bloody annoying when that
means they use spaces as well)...

>% characters, VGA is 80x43 characters ... The reason Usenet standard is 76
>% chars wide messages (today anyways) is that text-mode readers need the last
>% 4 characters to display window borders and control chars along the message
>% lines ...
>
>What "text-mode readers" bother with "window borders"? :-)

The old DOS readers did :p ... well, some of the did ... I never did get
SLRN to work properly ... but that could've been my modem not being entirely
Linux compatible (years ago, I don't use Linux for workstations anymore)...


Rene

-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/

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



Re: [PHP] A good search tutorial

2004-04-21 Thread -{ Rene Brehmer }-
According to historical records, on Wed, 21 Apr 2004 12:28:27 +0300 Phpu
wrote about "[PHP] A good search tutorial ":

>Hi there
>I have a site driven by a database and I need a search engine...when someone enter a 
>word the script to search the entire database for that word and return the results.
>Could someone give me the link to that kind of tutorial?
>Please email me asap 

I'd say it largely depends on what kinda data you're searching in, and how
you want it displayed ... 

The search engine I wrote for the CPU database on my site
(http://metalbunny.net/computers/cpudb.php) does wildcard/free searching in
3 fields in the one table in the database simultaneously, and allows for
selective reduction of the result set and custom sorting of all the 12
columns it displays. (thanks alot btw to everyone on this list and PHP DB
that helped me make this!). It's a few hundred lines long because of the
many options...

My point with mentioning this is merely that depending on how complex data
you want to search in, and how flexible you want to make the search option
... and how you want to display the results of the search, the method of and
approach to  building the search engine differs ...

The code Brent posted is the basic start for the SQL string for the search
engine ... you need to find out what you want it to be able to do and build
it from there ... 

I don't know if my code would help you any bit ... but I'd gladly post it
upon request  it's just that it's made when I was still a rookie at SQL,
so it's not very elegant, and not very well commented ... and looking at it
now I can find several ways to improve it ...just don't have the time for
it...

FWIW

Rene
-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/

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



Re: [PHP] redirection with PHP and closing windows?

2004-04-21 Thread -{ Rene Brehmer }-
According to historical records, on Tue, 20 Apr 2004 23:02:50 -0500 Andre
wrote about "[PHP] redirection with PHP and closing windows?":

>I want to be able to process a PHP script and then if successful redirect to
>another page. Is there a good way to do this with PHP or do I need to stick
>to Javascript?

I always use META redirects for this (trying to avoid anything but PHP
whatever it takes) ... but I believe there are other ways ...

>Also, is it possible to close a window that is running a .PHP page via a
>link or again, just stuck with Javascript?

I don't think it gets any simpler than the JavaScript:

// method 1
Close window

// method 2
Close window

Not entirely sure how cross-browser compatible this is. May have to use
this.window.close() or windows.close(this) ... I can't remember the exact
syntax, sorry, haven't worked much with JavaScript except for mouseovers in
several years


Rene

-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/

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



Re: [PHP] PHP Web Hosting

2004-04-21 Thread -{ Rene Brehmer }-
According to historical records, on Wed, 21 Apr 2004 13:16:35 +0800 Jason
Wong <[EMAIL PROTECTED]> wrote about "Re: [PHP] PHP Web Hosting":

>On Tuesday 20 April 2004 23:38, -{ Rene Brehmer }- wrote:
>
>> I've got mine registered at enom through Westhost, and westhost gives me a
>> registrar interface so I can do whatever I want with my domain ... make new
>> TLDs, 
>
>Make new TLDs!?! Is ICANN aware of this ;)

Sorry ... meant SLDs ... obviously ... :-/


Rene

-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/

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



Re: [PHP] Why NNTP is not default protocol for php groups

2004-04-20 Thread -{ Rene Brehmer }-
According to historical records, on Tue, 20 Apr 2004 18:31:19 +0200 Red
Wingate <[EMAIL PROTECTED]> wrote about "Re: [PHP] Why NNTP is not default
protocol for php groups":

>[...]
>> That is mostly Outlook and OE that are real good at trashing the Xref ...
>> others (old) clients do it too, but OE is the biggest sinner in that
>> aspect... (and Outlook runs on the OE engine when it comes to mail).
>[...]
>
>who is outlook ? :-)

Rumor will have it that it's a mail-program ... I've yet to see proof of
that claim.


Rene
-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/

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



Re: [PHP] PHP Web Hosting

2004-04-20 Thread -{ Rene Brehmer }-
According to historical records, on Tue, 20 Apr 2004 10:39:33 -0400 John
Nichel <[EMAIL PROTECTED]> wrote about "Re: [PHP] PHP Web Hosting":

>-{ Rene Brehmer }- wrote:
>> At 21:19 19-04-2004, John Nichel wrote:
>> 
>>> Greg Donald wrote:
>>>
>>>> Your signature is twice the rfc1855 suggested limit.
>>>> http://www.faqs.org/rfcs/rfc1855.html
>>>>  - If you include a signature keep it short.  Rule of thumb is no longer
>>>> than 4 lines.
>>>
>>>
>>> And the RFC1885 'guidelines' are also almost 10 years old.  I think 
>>> most people today have a fast enough connection to handle the 500+/- 
>>> bytes of my signatureeven if they're still on dial-up.  Of course, 
>>> I could be mistaken and there may still be someone out there using 
>>> 900baud. ;)
>> 
>> 
>> Most usenet netiquette guidelines I've read suggest max. 4-6 lines of 
>> sig content, with "permitted" divider lines at either end ... and in 
>> this case a line is 75 chars ...
>
>A, but the almost 10 year old RFC says this...
>
>"Limit line length to fewer than 65 characters and end a line with a 
>carriage return."
>
>;)

Hmm ... why the heck 65 characters ??? ... Old EGA screens were 80x34
characters, VGA is 80x43 characters ... The reason Usenet standard is 76
chars wide messages (today anyways) is that text-mode readers need the last
4 characters to display window borders and control chars along the message
lines ...

But "end a line with carriage" return is Mac standard ... in DOS an endline
is NL\CR, while in Unix it's NL, and on old Mac CR ... I took a peak at that
RFC ... and I think most of it is in the 10 year old 1200 page Internet book
I have ... That book also throughly describes the hazards of using 8 bit
characters because of the old 7 bit servers ... (AFAIK, Africa and rural
China are the only places today where you can expect to find 7 bit servers)


In most Usenet groups I've participated in,  you generally only get pounded
by a long sig if it's very long or longer than the actual message ... these
days 4 or 8 lines makes the difference of 1/10 second for most of the users
on slow 56K connections ... for anyone else it's not noticeable...


Rene

-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/

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



Re: [PHP] Unwanted e-mails

2004-04-20 Thread -{ Rene Brehmer }-
At 00:16 20-04-2004, Andy B wrote:
> BUT that does not help at all. btconnect is my service provider, and I
> have to send my eMails through them. The messages are caused by
> lists.php.net not accepting my messages 
>but your messages *ARE* getting accepted otherwise i >would not be
>reading this email right now!
>chris.

when i talked to my internet people about those sorts of emails like
btconnect and pandasoft virus warnings all they told me was that some
spammer person had probably tagged the php mailinglist database of email
addresses and are now bouncing emails around all the php mailing list
people... it happened to be figured out that way at least on my end because
the mysql mailing list server sent me an email today saying that it had
received lots of emails that bounced off my email address and will now take
me off the list the next time it happens.. so even though that list email is
valid the bounces to that list are spammers trying to do whatever it is they
get their highs out of.
Only problem with this theory is that I receive timeout messages from 
BTconnect as well everytime I post, despite me living in Denmark and having 
Tiscali for provider ... and everytime I get one, it fits with my messages 
never showing up on list ... I've got a filter setup to specifically find 
my messages that come back from the lists, and the ones I get timeout 
messages for never come back ...

Rene

--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Why NNTP is not default protocol for php groups

2004-04-20 Thread -{ Rene Brehmer }-
Isn't there a european mirror of that server ??? ... I can't even get a 
connection to news.php.net

Rene

At 21:46 19-04-2004, Red Wingate wrote:
Same here, just installed some Newsgroup Software and everything works
just fine for me :-)
 -- red

Justin Patrin wrote:

Curt Zirzow wrote:

* Thus wrote T. H. Grejc ([EMAIL PROTECTED]):

Hello,

I've seen this subject before, but never really got any answer. PHP 
have news server at news.php.net but it is 'always' down and it is only 
a mailing list mirror, so some messages get lost or get 'out of thread'.
--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] PHP Web Hosting

2004-04-20 Thread -{ Rene Brehmer }-
Yes...

Of course you can, it's yours.

I've got mine registered at enom through Westhost, and westhost gives me a 
registrar interface so I can do whatever I want with my domain ... make new 
TLDs, add/remove pointers, and stuff like that ... not sure what other 
hosts provide just as simple a way to manage the domain, but I love this 
one :) ... It's hosted 6000 miles from where I am, but I've got about as 
much control over my domain and my server there as I have over the one that 
sits right next to me...

Rene

At 21:34 19-04-2004, Martin, Stanley G [Contractor for Sprint] wrote:
I've received a number of suggestions as to where I should go to for my
web hosting but it doesn't seem that anyone has any experience with
Domehost. This brings up another question; transferring my Domain name.
If I do move to another hosting site, can I take my domain name with me?
Stanley G. Martin
--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP Web Hosting

2004-04-20 Thread -{ Rene Brehmer }-
At 21:19 19-04-2004, John Nichel wrote:
Greg Donald wrote:
Your signature is twice the rfc1855 suggested limit.
http://www.faqs.org/rfcs/rfc1855.html
 - If you include a signature keep it short.  Rule of thumb is no longer
than 4 lines.
And the RFC1885 'guidelines' are also almost 10 years old.  I think most 
people today have a fast enough connection to handle the 500+/- bytes of 
my signatureeven if they're still on dial-up.  Of course, I could be 
mistaken and there may still be someone out there using 900baud. ;)
Most usenet netiquette guidelines I've read suggest max. 4-6 lines of sig 
content, with "permitted" divider lines at either end ... and in this case 
a line is 75 chars ...

Rene

--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP Web Hosting

2004-04-20 Thread -{ Rene Brehmer }-
Don't know about that particular host either ...

But I'm very happy with Westhost (http://westhost.com/) ... I moved over 
from DotServ ... Nomatter what my question's been, I've gotten response 
from Westhost within the matter of 30 minutes ... and it's been kind 
responses too, even when I've critized their home-made management interface 
:) ... basically everything I missed at DotServ (I'll recommend anyone 
against them, they're largely incompetent)...

Rene

At 20:20 19-04-2004, Adam Voigt wrote:
Not sure about that particular host, but if your looking for one with
good features, and high reliability, I would suggest Spenix.
http://www.spenix.com

I asked them a question about my hosting plan (not even a support
request) at 9PM and was sent a response within 5 minutes. Very good
support, I would definitely recommend them.
--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Why NNTP is not default protocol for php groups

2004-04-20 Thread -{ Rene Brehmer }-
At 16:29 19-04-2004, Curt Zirzow wrote:
* Thus wrote T. H. Grejc ([EMAIL PROTECTED]):
> Hello,
>
> I've seen this subject before, but never really got any answer. PHP have
> news server at news.php.net but it is 'always' down and it is only a
> mailing list mirror, so some messages get lost or get 'out of thread'.
I've never had any problems with news.php.net being down or loosing
messages.  As for 'out of thread', that is usually due to the
person's email/newsreader client not replying correctly to a
thread.
That is mostly Outlook and OE that are real good at trashing the Xref ... 
others (old) clients do it too, but OE is the biggest sinner in that 
aspect... (and Outlook runs on the OE engine when it comes to mail).

Rene

--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Removing line breaks...

2004-04-17 Thread -{ Rene Brehmer }-
str_replace("\n",'',$string);

don't think it'd be any faster with the regex ones...

Rene

At 01:18 18-04-2004, Russell P Jones wrote:
How do i turn this...

[br]
  [b]My Title [/b]
[br]
into

[br][b]My Title[/b][br]

--- I just need to have line breaks removed basically...

any ideas?

Russ Jones
--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Never mind ... stupid me :-/ {was Re: [PHP] ereg-replace ... how to catch :'( [crying smiley] ???}

2004-04-14 Thread -{ Rene Brehmer }-
At 15:02 14-04-2004, Tom Rogers wrote:
Hi,

Thursday, April 15, 2004, 12:51:20 AM, you wrote:
RB> Never mind y'all ... me stupid ...
RB> obviously the ( has meaning, and needs to be escaped ... was starting to
RB> think it could only do 2 ereg's in 1 script *sigh*
RB> Sorry for wasting time and bandwidth ... the function now looks like this
RB> and works :
You might find this very useful :)

http://weitz.de/regex-coach/

Helps my old brain 
Hmm ... that looks like it only does Perl-based regex ???  Thing is the 
programs I normally do regex in either use Posix based or Unix (Cshell) 
based (mostly used at the latter, cuz that's what Forte Agent uses for its 
filters) ... how big a difference is there from the posix based to the perl 
based anyway ??? ... the samples in the manual ain't the same for 
preg_replace() and ereg_replace(), so it's a bit hard to get a quick 
glimpse of how big the difference really is ... (or for the _match() ones 
for that matter)...

But thx ... looks useful :)

Rene

--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Never mind ... stupid me :-/ {was Re: [PHP] ereg-replace ... how to catch :'( [crying smiley] ???}

2004-04-14 Thread -{ Rene Brehmer }-
Never mind y'all ... me stupid ...

obviously the ( has meaning, and needs to be escaped ... was starting to 
think it could only do 2 ereg's in 1 script *sigh*

Sorry for wasting time and bandwidth ... the function now looks like this 
and works :

function gfx_smiley($text) {
  $smiley_path = 'smiley';
  $text = eregi_replace(':-?D','',$text);
  $text = ereg_replace(':-?\?','',$text);
  $text = ereg_replace(':'-?\(','',$text);
  $text = ereg_replace(':-?\(','',$text);

  return $text;
}
At 15:43 14-04-2004, -{ Rene Brehmer }- wrote:
I'm trying to do graphical smileys for my guestbook, but I've run into a 
problem with the crying smilies:

I need to replace :'( and :'-( ... or as they look in the post after being 
entered through htmlentities with ent_quotes on:

:'(
:'-(
this causes the entire message to disappear:

$text = ereg_replace(':'-?(','',$text);

only the format of the search part differs from my other smiley 
replacements, so obviously that's where the problem is ... afaik, neither 
&, # or ; have any meaning in regex, so I don't get what causes it ... 
I've tried escaping all of those chars, and it still causes $text to come 
back empty...

any ideas will be highly appreciated...
--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] ereg-replace ... how to catch :'( [crying smiley] ???

2004-04-14 Thread -{ Rene Brehmer }-
I'm trying to do graphical smileys for my guestbook, but I've run into a 
problem with the crying smilies:

I need to replace :'( and :'-( ... or as they look in the post after being 
entered through htmlentities with ent_quotes on:

:'(
:'-(
this causes the entire message to disappear:

$text = ereg_replace(':'-?(','',$text);

only the format of the search part differs from my other smiley 
replacements, so obviously that's where the problem is ... afaik, neither 
&, # or ; have any meaning in regex, so I don't get what causes it ... I've 
tried escaping all of those chars, and it still causes $text to come back 
empty...

any ideas will be highly appreciated...

TIA

Rene
--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: commercial autoresponses (was "Re: [PHP] Wanted: ...")

2004-04-13 Thread -{ Rene Brehmer }-
At 16:40 12-04-2004, David T-G wrote:
Hi again, all --

...and then David T-G said...
%
...
% Any recommendations?
I was amazed to receive from this

  - an entirely-in-German post apparently wishing me a happy Easter
  - a note from Credit Suisse letting me know they'd process my request
  - a promise from Astral Security and Finance to get back to me
and wondered for a moment if I'd really sent it to the right place!  Have
I really missed so much in a month of being too busy to post on the list?
I'd prefer that to this, which I keep getting on basically everything I 
send to the PHP lists:

Your message was not delivered to:
[EMAIL PROTECTED]
for the following reason:
Diagnostic was Unable to transfer, Message timed out
Information Message timed out
Rene

--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Looking for a comprehensive PHP tutorial

2004-04-09 Thread -{ Rene Brehmer }-
I've got a "Lean C++ in 24 hours" which has only proven useless to me ... 
and that's after nearly 20 years programming in nearly all other 
programming languages... so I basically don't like them ... the "Learn ... 
in 21 days seems alot better written" ... both series are by Sams btw

Rene

At 16:38 09-04-2004, jon roig wrote:
People always mock me when I mention it, but I really dig the "Learn in
24 Hours" books.
-- jon
--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] ATTN: List Admins

2004-04-09 Thread -{ Rene Brehmer }-
I'll second that ... keep getting this in response from them:

Thank you !!

Your message has been received; we will treat your message and get back to 
you as soon as possible.

Besides the fact that mailman more or less makes this list useless for me 
... this is just another annoyance...

Rene

At 16:19 09-04-2004, Ryan A wrote:
Please take out these two addresses:

"Information Desk" <[EMAIL PROTECTED]>
"Advance Credit Suisse Bank" <[EMAIL PROTECTED]>
everytime we post to the list we get their damn autoresponders.
--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Forwarding to another PHP page

2004-04-09 Thread -{ Rene Brehmer }-
At 11:59 09-04-2004, John W. Holmes wrote:
From: "Ash.." <[EMAIL PROTECTED]>

> What are the various ways of forwarding to another page. I tried
header()..
> based on an example I found it in, but it doesnt work if I have done an
> include before calling the header. What are the other alternatives of
> forwarding. (I tried searching the PHP manual, but didnt find any clue.
Nor
> did I come across any learn material which seemed to deal with this.)
header() is the only way you're going to redirect with PHP. Alternatives
include a JavaScript redirection or a meta-refresh header.
I prefer having a meta-refresh header in my template. Since the template is 
shared across multiple scripts, some needs to forward, some don't I use a 
$forward variable that contains the URL to forward to, and simply check if 
it's set or not in the template header...

Something like:


\r\n");
}
?>
...

the \r\n is probably irrelevant in HTML headers, but force of habit from 
doing MIME headers...

naturally there's possible variation to this according to the actual 
project ... but it's how I do it ...

Rene

--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Looking for a comprehensive PHP tutorial

2004-04-09 Thread -{ Rene Brehmer }-
I've been recommended the book "PHP Developer's Cookbook" by several PHP 
developers ... there's a new version of it out (3rd edition I believe) at 
the end of this month ... thus I haven't bought it yet...

FWIW

Rene

At 10:34 09-04-2004, Ash.. wrote:
Hi,

I am looking for a comprehensive handholder tutorial, that introduces the
various aspects
of PHP, step by step and let's u see the big picture.
I have come across tons of PHP learnware which is like "how to do this" and
"how to do that".
But that still doesn't introduce the language to the beginner in an orderly
manner.
Any suggestions, links, will be greatly appreciated.
Or, if someone (experienced in PHP) thinks we must come up with such a
comprehensive tutorial, we can perhaps team up ;)
Ash
--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums @ http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] determining number of rows in a mysql table

2004-03-29 Thread -{ Rene Brehmer }-
Thought it looked fishy  hehe ...

My only problem is: Sometimes you actually need the data from that table 
later in the same script, so instead of doing another data pull, I have 
alot of cases where this is alot more useful (not actual code from any of 
my work, but I've used this structure in the past):

$query = mysql_query("SELECT $fields FROM $table WHERE $crit") or 
die('fetch error'.mysql_error());

if (mysql_num_rows($query) > 0) {
  $result = mysql_fecth_array($query);
  // and so on ...
}
combined, this is actually faster than doing the COUNT(*) first, and 
another query later IF (and only IF) you need the data as is ... but if you 
need the number of rows to figure out how many pages you need to display 
all of the data, then counting first, and then doing a data pull with the 
limits on is faster ...

No rules without exceptions :)

Rene

At 06:48 30-03-2004, Andy B wrote:
"Hmmm, have you ever actually tried it? And got the result you wanted?"

my screwup...forgot some code here... heres the whole thing that actually
works...(thats what you get for being in tons of different windows at the
same time)...

echo $count['count'];
?>
--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Namespaces in PHP

2004-03-29 Thread -{ Rene Brehmer }-
At 00:59 30-03-2004, Justin Patrin wrote:
Richard Davey wrote:

Hello Justin,
Tuesday, March 30, 2004, 12:42:12 AM, you wrote:
JP> P.S. Why do a lot of people email off list?  I get doubles.
They are too lazy to remove your email when doing a reply-to-all
basically.
More people should use the newsgroupsit makes things so much simpler.
Except that requires the use of a news client that can do multiple servers 
... and we're some that are still waiting for Agent 2 :)

Rene

--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Namespaces in PHP

2004-03-29 Thread -{ Rene Brehmer }-
Simple: the list is setup to send replies in private per default. If you 
just hit reply it will go in private. So we hit "reply to all" and the 
reply goes private and on list ... thus you get doubles...

My system sometimes confuses the private replies with the list mail, and 
puts both in the list box, instead of keeping the private reply in the 
unfiltered inbox...

Only annoying thing with Eudora is that you have to use "reply to all" for 
it to write the original posters name instead of just "you wrote" ... but 
that's a totally different story ...

Rene

At 00:42 30-03-2004, Justin Palmer wrote:

P.S. Why do a lot of people email off list?  I get doubles.

Regards,

Justin Palmer
--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Namespaces in PHP

2004-03-29 Thread -{ Rene Brehmer }-
At 23:40 29-03-2004, Justin Palmer wrote:
Rene, no need to email me personally, please keep it on list.
Sorry 'bout that ... I just hit Ctrl+R, and it goes private and on list... 
force of habit, since this list is set to reply in private...

If you have worked with Java then you should know the true reason for
using namespaces.  See my previous email to this topic for my
explanation.  Namespace collision is a large cause for software blowing
up when multiple programmers use their own objects from their toolkits
into one large project.
Yeah, but in Java things are contained in the classes ... only some IDE's 
(mostly JDeveloper that I worked with), thinks that anything without 
private in front of it is global (which is incorrect according to Sun) ...

I'm only on the first semester of my "Advanced Computer Studies", so 
haven't gotten very far with C++ ... but sofar there's been no indication 
of what the point in the namespaces is ...

Namespaces are only for the use of Classes.  Unless we are talking XML
or other technologies.  As far as PHP, Java, VB(which uses namespaces
now), C++.
I basically haven't touched VB since I learned PHP and Java ... except for 
VBA in Excel, but that's not exactly the same ... so I can't comment on that...

Rene


Regards,

Justin Palmer
IT Administrator
--
Rene Brehmer
aka Metalbunny
~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] HELP! Apache dies on regular MySQL query :-/

2004-03-20 Thread -{ Rene Brehmer }-
Okay ... I've run into the strangest error situation.

Running Apache 2.0.48 on WinXP Pro SP1, and just upgraded PHP from 4.2.3 to 
4.3.0 and didn't do anything but to delete the 4.2.3 binaries and replace 
them with the 4.3.0 binaries.

Problem is I get this error message:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable 
to complete your request.

Please contact the server administrator, [EMAIL PROTECTED] and 
inform them of the time the error occurred, and anything you might have 
done that may have caused the error.

More information about this error may be available in the server error log.

--
Apache/2.0.48 (Win32) Server at localhost Port 80
The log says this:

[Sat Mar 20 15:54:56 2004] [error] [client 127.0.0.1] Premature end of 
script headers: php.exe

The script that causes this looks like this:

require('sql.php');

$link = mysql_connect($dbhost,$dbuser,$dbpass)
  or die('Could not connect : '.mysql_error());
// echo('Connected successfully');
mysql_select_db($database) or die('Could not select database');
function stripAccents($string) {
  $returnString = strtr($string,
  'àáâãäçèéêëìíîïñòóôõöšùúûüýÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕ֊ÙÚÛÜÝ', 
'acnosyACNOSY');
//  $returnString = str_replace('æ','ae',str_replace('Æ','AE',$returnString));
  $returnString = str_replace("'",'',$returnString);
  return $returnString;
}

$updated = 0; $totalupd = 0;
for ($i = ord("a"); $i < ord("z")+1; $i++) {
  echo('Working on '.strtoupper(chr($i)).'');
// commenting out this query makes the error go away, but then the script 
fails of course
  $query = mysql_query("SELECT * FROM girlz WHERE `lastname` LIKE 
'".chr($i)."%' ORDER BY `lastname` ASC");
  $numrows = mysql_num_rows($query);
  echo('Loaded/working on '.$numrows.' rows');
  $updated = 0;
  while ($row = mysql_fetch_array($query)) {
$girlID = $row['ID'];
$lastname = $row['lastname'];
$firstname = $row['firstname'];
$middlename = $row['middlename'];

$firstsort = stripAccents(html_entity_decode($firstname),ENT_QUTES);
$middlesort = stripAccents(html_entity_decode($middlename),ENT_QUOTES);
$lastsort = stripAccents(html_entity_decode($lastname),ENT_QUOTES);
echo("$firstname $middlename $lastname");
echo("$firstsort $middlesort 
$lastsort\n");
$result = mysql_query("UPDATE girlz SET 
`lastsort`='$lastsort',`firstsort`='$firstsort',`middlesort`='$middlesort' 
WHERE `ID`='$girlID'") or die('Unable to update '.mysql_error());

$updated++;
echo("Updated $updated rows\n");
  }
  $totalupd += $updated;
}
echo("Total updated: $totalupd rows\n");

mysql_close();

I upgraded to 4.3.0 only to be able to use html_entity_decode(), and 
because my new host is using 4.3.0, and I try to keep the same version 
level for proper testing purposes.
It only happens on this one script, which only purpose is to transpose some 
names with HTML entities into something that MySQL can sort properly... the 
weird thing is: I had the html_entity_decode in a sub-function, and it 
worked fine. Then I moved it into the main script and removed the function, 
and it does this error.
I've got 2 other much bigger and much more complex scripts that work on the 
same DB/table with similar, but double queries with and without limits, and 
they work without any problems at all.

What causes this? ... And how the heck do I make it work properly ???

TIA

Rene
--
Rene Brehmer
aka Metalbunny
http://metalbunny.net/
References, tools, and other useful stuff...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Stupid newbie question = Why don't I need a ; after this line?

2004-01-27 Thread -{ Rene Brehmer }-
I always use them ... but it's mainly 'cause if I ever need to expand the
code, I won't have to remember to add them ... it's for the same reason I
always use the braces '{ ... }' even though the short form would work just
as well in many cases ... 

I tend to expand my code alot with time (as I make it more advanced), and
recycle it across multiple projects ... it's simply easier if all the
thingies are there already, as it produces far less errors when copy/pasting
from file to file

Rene

Fate would have it, that on Tue, 27 Jan 2004 09:56:02 -0600, Paul wrote:

>Thanks guys. Duhhh. I was taught to always put ;'s and any dev software that
>writes it's own code does the same. I also remember adding them because I
>was getting error's at some point, perhaps PHP3.
>
>Is it considered better practice to use them? Otherwise I've been wasting
>keystrokes. I only noticed this when I was going over some code.

-- 
Rene Brehmer
aka Metalbunny

http://metalbunny.net/
References, tools, and other useful stuff...

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



Re: [PHP] Using templates (Code & User Interface)

2004-01-24 Thread -{ Rene Brehmer }-
I wrote my own template system that works very well... I've got an outer
control file that handles the user input, sets the variables for what the
template should use of stylesheets and menus and such, and a variable for
what body to use. All my body files are either PHP programs in themselves
mixed with HTML presentation (I try to keep near all the PHP in the start,
and the actual presentation generation at the end).

Basically it means that the template only holds the basic table structure of
the site, and a little code to include the files that are needed to make it
into what it's suppose to look like.

The way I made it I can use the same template file all over the site, or
make another template and tell the control scripts to use that instead. I
still haven't made it possible for the menu system to change looks though,
but I plan to add that in the future...

It would be very easy to change my system to allow it to use different
templates or other elements based on various conditions

FWIW

Rene

Fate would have it, that on Sat, 24 Jan 2004 09:53:16 +0300, Hamid Hossain
wrote:

>Hi,
>
>Always I have a problem that I don't know how to make my code away from the 
>user interface files.
>
>I tried to use some template classes, but I did'nt like what I tired because 
>some if statments are used inside the template.
>
>How can I prepare my code to be working in more that one template? Should I 
>use some methodology like FuseBox.org
>
>Regards,
>Hamid Hossain

-- 
Rene Brehmer
aka Metalbunny

http://metalbunny.net/
References, tools, and other useful stuff...

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



Re: [PHP] JavaScript question

2003-12-24 Thread -{ Rene Brehmer }-
you can simply call:

Window.location.href = 
'http://yourdomain.com/phpscripttocall.php?variable1=value1&variable2=value2'

^works in all browsers supporting JavaScript ... there's a few variants of 
this that will only work in IE or Netscape, but this one is vague enough to 
work in both... (not sure about Opera, it doesn't run well on my setup, so 
testing with it is a basically impossible for me)...

if you use frames, it's a bit more tricky, but I trust you don't, otherwise 
just ask ... :) ... I've got the complete JavaScript code to change the 
content of frames criss-cross of each other in any way and pattern you can 
dream off... (my site used to be a JS driven monster before I got my 
webhotel and the option to do it all with PHP) ...

Rene

At 19:58 02-11-2003, you wrote:
Good morning.

I know this may be off-topic but I don't know where to turn.

I'm building a dynamic web page system with PHP and need to figure out in
JavaScript how to do something. I have the timer figured out in JavaScript
but what I need is a way to automatically submit a request back to the web
server after the timer runs out. What I'm trying to do is display slides in
sequence. When the timer expires, it sends back to the web server the
parameters of slide group and the last slide displayed. The PHP on the
server end builds a new page and sends it to the browser with the next slide
in the sequence.
Any help would be greatly appreciated and my PHP skills are vastly above my
JavaScript skills (very basic beginner).
Robin 'Sparky' Kopetzky
Black Mesa Computers/Internet Service
Grants, NM 87020
--
Rene Brehmer
aka Metalbunny
http://metalbunny.net/
References, tools, and other useful stuff...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] URL correctimizer ... how to make one?

2003-07-18 Thread -{ Rene Brehmer }-
Hi gang

Finally I've got the time to finish up my guestbook script ... so little 
left that I can actually see the light at the end of the tunnel now..

The guestbook data is stored in a text file. When opening the guestbook, 
this file is parsed and the named fields are used to construct different 
HTML structures according to which optional information signers have entered.

One of the optional fields is an URL, and rather than enforcing a specific 
format, I'd like to have the script, in as much as possible, to 
automagically correctify the URL as far as possible without reaching too 
far into guessing and assumption...

I mean, I want the script to automagically add http:// when needed, turn 
slashes the right way, and remove excess double slashes ... but I'm 
uncertain as to what else I can/should make it do automatically, and what I 
shouldn't ...

Also, I'm not sure which characters and structures are actually 
permitted/required in a "legal" URL, so I'm not sure what I should make it 
look for to detect an impossible URL ...

Anyone able to offer some help here?

I know I could've probably just picked up someone's script out there ... 
but I'm trying to do it on my own, as I figure I'd learn more that way ...

Rene
--
Rene Brehmer
aka Metalbunny
http://metalbunny.net/
References, tools, and other useful stuff...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Compiling 4.2.3 with MySQL ... what does it look for?

2003-07-05 Thread -{ Rene Brehmer }-
X-posted to PHP General, PHP DB, and MySQL

Hi gang

Attempting to get my Linux test-server working, but ran into a problem when 
"making" PHP...

System is RedHat 8, Apache 1.3.27 (compiled myself, tested OK), MySQL 4.0.13.

The Apache 2.0.40 and PHP 4.2.2 that came w. RH8 didn't work correctly, 
thus I've ventured into my own creation.

Trying to build PHP 4.2.3 (because that's what my webhost runs, so need 
that version to test correctly) w. support for MySQL. Running

./configure --with-mysql=/[path to mysql] --with-apxs=/[path to apxs]

Found the path to the apxs to be /usr/local/apache/bin/apxs, but for the 
life of me I cannot figure out what path to give it for MySQL. I installed 
MySQL from the the RPM files:
MySQL-client-4.0.13-0.i386.rpm
MySQL-devel-4.0.13-0.i386.rpm
MySQL-embedded-4.0.13-0.i386.rpm
MySQL-server-4.0.13-0.i386.rpm
MySQL-shared-4.0.13-0.i386.rpm

client and server first, the rest second ... used --force to get them in, 
because it complained about version issues with the one already there (even 
though the package manager was told not to put the Mysql in, it still put 
MySQL 3.something in...)

When doing the configure above, I get this error:

configure: error: Cannot find header files under /usr/include

or whatever path I give it ... I'm having a hard time figuring out where 
the RPM puts everything, and an even harder time figuring out what path to 
stick to PHP ...

Some detective work gave me these paths:

MySQL (bins):
/usr/bin
/usr/share/mysql
MySQL daemon (mysqld):
/usr/libexec
/usr/sbin
MySQL headers (.h):
/usr/include/mysql
I've tried them all, but they all result in the above error. Anyone care to 
guess which path I should give to the configure?

Or is it something else that causes this?
I haven't ever used MySQL before, or any other SQL for that matter, so got 
0 experience in getting the system up and running with it...

TIA

Rene
--
Rene Brehmer
aka Metalbunny
http://metalbunny.net/
References, tools, and other useful stuff...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Headers in body - what am I doing wrong???

2003-06-12 Thread -{ Rene Brehmer }-
It's not future when I send them ... my clock's within the 15 second limit 
my NTP sync allows... but maybe the time difference causes ezmlm to do some 
dancing when sending it out ?? I know listserv based lists can get confused 
about the time differences...

but thanks anyway ;-)

Rene

At 22:50 11-06-2003, Chris Hayes wrote:
(darn, this one was already answered, i hate it that some people ask 
questions with a future time.)
--
Rene Brehmer
aka Metalbunny
http://metalbunny.net/
References, tools, and other useful stuff...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


  1   2   >