[PHP] [PHP5] Super constructor?

2004-06-12 Thread FrzzMan
Hi guys, hey don't laugh at the subject, in fact I don't what to call 
it, so let's call it super constructor :D

Let's see following code...
class Base
{
__construct()
{
// Do something
}
}
class One extends Base
{
__construct()
{
// Do nothing
}
}
class OneMore extends One
{
__construct()
{
// Do things :D
}
}
So when I create an instance of OneMore class by:
$OneMoreInstance = new OneMore()
The __construct() method of class OneMore will be called, not the one of 
One and Base, right?

So is there any way around to make the Base class have a contructor that 
will be called everytime one of its child initialize?

My problem, I want all of the classes in my object are extend from one 
base class, so they are all have some common properties and function, 
but PHP won't implicit call the contructor (that's the right way)... 
btw, in my case, this is bad, as bad as every constructor would be called...

Well, hope you understand what I'm trying to say...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Cookie Security?

2004-06-12 Thread phpmail
My login script sets unique, secure, cookies that identify the user. Some of my pages 
only display content if a secure cookie is present. Is this a bad idea for secure 
pages with sensitive details as I have heard that cookies can be faked? I am always 
interested in creating a secure environment for my website visitors and I want to make 
sure I am protecting their privacy. Any help on this matter is greatly appreciated.
 
Thanks, 
 
~Sean V.


Re: [PHP] Re: >>>>>> THREADS IN PHP

2004-06-12 Thread Ryan A

> Please don't "hype" your post, or you'll find, as do many children, no
> one
> will pay it any attention.
 
> YEP, THE ABOVE IS TRUE! <
:-p

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



[PHP] Re: >>>>>> THREADS IN PHP

2004-06-12 Thread Aidan Lister
Please don't "hype" your post, or you'll find, as do many children, no one
will pay it any attention.


"Jack Bauer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi,
>
> i'm looking for a methode to use threads in php (on linux)

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



Re: [PHP] session_start() warnings

2004-06-12 Thread PaoAge
Larry E . Ullman wrote:
When I use session_start function, I receive the following warning 
messages:

Warning: session_start(): Cannot send session cookie - headers already 
sent by (output started at 
/home/w4t3c101/public_html/ListClientInfo.php:2) in 
/home/w4t3c101/public_html/SessionControl.php on line 9
Warning: session_start(): Cannot send session cache limiter - headers 
already sent (output started at 
/home/w4t3c101/public_html/ListClientInfo.php:2) in 
/home/w4t3c101/public_html/SessionControl.php on line 9

Can anyone explain why it happens and how to solve the warnings. 
Thanks :)

Something on or about line 2 of ListClientInfo.php is sending data to 
the Web browser. This could be HTML, plain text, or blank spaces. Get 
rid of that and you'll get rid of the warnings.

Larry

Thanks, I got it. I leave a line of space before I use include directive.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] session_start() warnings

2004-06-12 Thread Larry E . Ullman
When I use session_start function, I receive the following warning 
messages:

Warning: session_start(): Cannot send session cookie - headers already 
sent by (output started at 
/home/w4t3c101/public_html/ListClientInfo.php:2) in 
/home/w4t3c101/public_html/SessionControl.php on line 9
Warning: session_start(): Cannot send session cache limiter - headers 
already sent (output started at 
/home/w4t3c101/public_html/ListClientInfo.php:2) in 
/home/w4t3c101/public_html/SessionControl.php on line 9

Can anyone explain why it happens and how to solve the warnings. 
Thanks :)
Something on or about line 2 of ListClientInfo.php is sending data to 
the Web browser. This could be HTML, plain text, or blank spaces. Get 
rid of that and you'll get rid of the warnings.

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


[PHP] session_start() warnings

2004-06-12 Thread PaoAge
Hi, all:
When I use session_start function, I receive the following warning messages:
Warning: session_start(): Cannot send session cookie - headers already 
sent by (output started at 
/home/w4t3c101/public_html/ListClientInfo.php:2) in 
/home/w4t3c101/public_html/SessionControl.php on line 9
Warning: session_start(): Cannot send session cache limiter - headers 
already sent (output started at 
/home/w4t3c101/public_html/ListClientInfo.php:2) in 
/home/w4t3c101/public_html/SessionControl.php on line 9

Can anyone explain why it happens and how to solve the warnings. Thanks :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] finding text strings in html code

2004-06-12 Thread Curt Zirzow
* Thus wrote Kathleen Ballard ([EMAIL PROTECTED]):
> I am beginning a project that will involve moving data
> from an mssql table to xml files.
> 
> ...
> 
> I have played with code using substr/str_pos, running
> html tidy with exec() and it works.  But searching the
> archives, it seems like the new html tidy tags in php5
> will be more useful.  In most cases the target text is
> in a one row, one cell table. 

> 
> Any advice on how to attack this would be appreciated.
>  I can handle the coding, I just have a feeling I am
> approaching this from the hard way.

I think you're on the right track with using tidy's php5 features.
Here is some more documentation on tidy, hopefully it will push
your approach in the right direction:

   http://www.coggeshall.org/tidy.php


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



[PHP] >>>>>> THREADS IN PHP

2004-06-12 Thread jack bauer
hi,

i'm looking for a methode to use threads in php (on linux)

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



Re: [PHP] PHP pros and cons

2004-06-12 Thread Steve Douville
Yes, pardon me for actually providing to the spirit of this list, to help
people find ways to meet their objectives.  Just saying "no" isn't very
constructive, now is it?  :-)


"Kim Steinhaug" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Steve Douville had a long answer, the short answer : no
>
> --
> --
> Kim Steinhaug
> --
> There are 10 types of people when it comes to binary numbers:
> those who understand them, and those who don't.
> --
> www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
> --
>
>
> "Bob Lockie" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Is it possible to specify the target frame in a "Header" call?
> > I have a form that submits in one frame and I want it to redirect to
> > another frame in some cases.
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>

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



[PHP] Re: Best Lossless Hi-Res Photo Storage with PHP

2004-06-12 Thread Kim Steinhaug
well, there are formats that have impressed me. The Mpg-4 format
which requires plugins all over the place is really amazing, from e-vue.
They also provide a plugin atleast for IE to browse the images.

I dont know if you can compress images outside the windows platform
however.

If your looking for supreme quality however, you would need to stay
away from the lossy formats and probably go for TIFF which is a great
format and is also supported by any major software. PNG however is
abit "strange", woudnt sendt PNG images to a publisher...

You could ZIP the TIF images on the HD to same space, you often
get good results on this. This would also make the downloads better
for the user, and since all the browsing online would use thumbnails you
dont need to waste CPU do depack the images, since you all users
can depack a ZIP file (thats the least you would expect from a user that
purchase a High resolution image).

Ive created such systems myself, and my sollution was another :
Plug in a new harddrive. We save the images as jpg, tif, eps, ai or whatever
the original image was created as, and create thumbnails at various
resolutions in high compressed jpg for fast browsing. Often I tend to
ZIP the lossless images aswell, but then again I dont need to since HD isnt
a problem atleast in my case.

Hope this helps.

--
--
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--

"Galen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm working on a photo site and most of it is working. The intent is to
> store original high-resolution photos that will only be accessed when
> purchased, and then a variety of thumbnails that will be accessed when
> viewing. Because they're high-resolution, I need maximal image
> compression but I can't sacrifice image quality. With hundreds (or
> more) of many megapixel images, space requirements quickly soar.
>
> I am currently using PNG, but that's not all that great for lossless
> photo compression. JPEG 2000 is significantly better in terms of file
> size, but I haven't ever used that with PHP (and it seems I'll have to
> use it via ImageMagick or something). Are there any other (free)
> formats for high image compression out there that I can use (maybe even
> just via the shell) with PHP?

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



[PHP] Multidimensional Array advice from a newbie

2004-06-12 Thread grahama
Hi :)
I am creating an XML file out of a mysql query with nested arrays.
Currently I can get 1 element and 1 child with a properly formatted XML 
file with the below script .

My question is: How do  I  add 3 to 4 more child elements to the below 
'playlist' array ?
Currently ,I have one parent 'Artist' and one child 'english' ...
I need to add more child elements to the 'Artist' array like urlPath, 
spanish, biography, etc

My addled thoughts...
So, would the multidimensional array be like:
$playlist[   [$artist [ ]   ][$media[ ]  ]	[$mediaElement]  
]?

for the  'trackName' child:
$playlist [ "Artist 1" ] [ "Track 1" ]   [ "trackName" ]
or for 'urlPath' child :
$playlist [ "Artist 1" ] [ "Track 1" ] [ "urlPath" ]
Do I have to add another dimension to the 'playlist' array? Do I need 
another  foreach loop ?
Is there an easier more efficient way to do this?
Be nice to spell out the schema in some way in the script...in case you 
need to add more levels...like a 'subCategory'

I am a bit new to this so any help would be greatly appretiated  
head is spinning a bit


$sql = 'SELECT artist.artist_name, media.english, media.path ';
$sql .= 'FROM media, artist ';
$sql .= 'WHERE artist.artist_id = media.artist_id LIMIT 0, 30 ';
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result))
{
$playlist[$row['artist_name']] [] = $row['english'];
//would like to add more children here...
}
$xml = "\n";
foreach ($playlist as $artist => $media)
{
$num_media = count($media);
$xml .= "\n";   

$xml .= "\t\n";   
$xml .= "\t\t".$artist."\n";
$xml .= "\t\n";  

$xml .= "\t\n";
foreach ($media as $mediaVal)
{
$xml .= "\t\t\n";
$xml .= "\t\t\t".$mediaVal."\n";
///add more children
///add more children
$xml .= "\t\t\n";   

}

$xml .= "\t\n";   
$xml .= "\n";  
}
$xml .= "\n";
print $xml
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: array_rand() not random

2004-06-12 Thread Kim Steinhaug
Hmm... Ive been having same problems with mysql and picking random
numbers, I ended up having to program a rather more sofisticated
system to eliminate the stats you were referring to.

You could, not that it will be any better, try another approach :

Something like :

$count = count($your_data_array);
$random = rand(0, $count);
echo $your_data_array[$random];

PHP is maby using the same random function for both the array_rand and
rand for all I know but its worth a go.

The harder way would be to include an internal counter for your elements you
want to be randomized, so that when an item is selected you count it. Then
the
next time you calculate the random element you take the accual hits into
meassure.
There are like a 1000 ways to do this so use your imagination.

One way could be to use some sessions, and when a user hits the page you
precalculate the random sort for all your elements, and store that in the
session.
Then for each and every visit form that visitor you just go along with the
pre-randomed
data. This way your user will get a truly randomized experienced, and youll
be showing
off all the elements even if the random function in itself is abit
"non-random".

Im sure there also exists a mathematical approach calculating a sort of the
elements based
on the earlier views (meaning that we count each view).

--
--
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--

"Nori Heikkinen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

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



[PHP] Re: Header target?

2004-06-12 Thread Kim Steinhaug
Steve Douville had a long answer, the short answer : no

--
--
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--


"Bob Lockie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is it possible to specify the target frame in a "Header" call?
> I have a form that submits in one frame and I want it to redirect to
> another frame in some cases.

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



[PHP] Re: export from mysql to csv file

2004-06-12 Thread Kim Steinhaug
You are also probably using PHPMyAdmin, if not you should be using this.
Exporting to CVS is fairly simple, and if your used to quering the databsae
you should be able to do this very easilly yourself if your looking for a
sollution you can do from scripts.

Basically what you do is simply do a "select * from table", which will give
you
every coloumn of the database, Thereafter loop through the entire dataset
and use the mysql_fetch_array function, then use this :

foreach ($temp AS $key=>$value){
 // $key   = coloumn name
 // $temp[$key]  = coloumn value
 if(!is_numeric($key))
 echo $key . " : " . $temp[$key] . "";
}

Where $temp is the $temp = mysql_fetch_array($dataset_from_query);

If your into >100.000 entries in the database you will need to do some
smart quering, or alter the php.ini to handle more than the standard 30
sec timout. Basically you could also go in "rounds" of limit 0,5
thereafter
limit 5,5 but that wasnt your question.

--
--
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--

"Dustin Krysak" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Can anyone point me to an existing script or tutorial to learn this?
>
> Thanks in advance!
>
> d

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



Re: [PHP] Re: PHP 5/OOP, Functionality similar to an Abstract method?

2004-06-12 Thread Chris
Justin Patrin wrote:
Chris wrote:
I have an abstract class with quite a few 'children'. Essentially I 
want to be able to interchange calls between children (Take a script, 
written with ClassA and redefine the variable as ClassB etc.)

Though there is a large subset of methods all of these children 
declare, there are a few which only *some* declare. What I think I'm 
looking for is a variation on an abstract method that, if not defined 
in a child, will do nothing. Using an abstract method forces me to 
declare the method in the child with an empty body.

AFAIK, there is no support for this explicitly in PHP5. You would have 
to implement something yourself, like putting a die() or exit in the 
abstract method in the parent class.

If you just want an empty funciton anyway, why don't you just put an 
empty function in the parent? I don't see why you would need PHP to 
yell at you when you don't want to do antyhing with it anyway.

When I said "will do nothing" I was meaning the method call, not the 
entire script. I can't put anything into an abstract method, it only 
defines the method name and argument list, a body is nto allowed in an 
abstract method.

Upon further reflection it appears that the abstract method is what I 
really want. I'll just have to implement an empty body.

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


[PHP] Re: PHP 5/OOP, Functionality similar to an Abstract method?

2004-06-12 Thread Justin Patrin
Chris wrote:
I have an abstract class with quite a few 'children'. Essentially I want 
to be able to interchange calls between children (Take a script, written 
with ClassA and redefine the variable as ClassB etc.)

Though there is a large subset of methods all of these children declare, 
there are a few which only *some* declare. What I think I'm looking for 
is a variation on an abstract method that, if not defined in a child, 
will do nothing. Using an abstract method forces me to declare the 
method in the child with an empty body.

AFAIK, there is no support for this explicitly in PHP5. You would have 
to implement something yourself, like putting a die() or exit in the 
abstract method in the parent class.

If you just want an empty funciton anyway, why don't you just put an 
empty function in the parent? I don't see why you would need PHP to yell 
at you when you don't want to do antyhing with it anyway.

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


[PHP] finding text strings in html code

2004-06-12 Thread Kathleen Ballard
I am beginning a project that will involve moving data
from an mssql table to xml files.

In addition to fixing non-xml compliant html in the
text fields and outputting the data to a new xml
format, I need to find certain chunks of text marked
by standard html comments at the start and end,
comment out everything between the comments, and
insert the found text into its own xml element (which
will in some cases be inline).

I have played with code using substr/str_pos, running
html tidy with exec() and it works.  But searching the
archives, it seems like the new html tidy tags in php5
will be more useful.  In most cases the target text is
in a one row, one cell table. 

Any advice on how to attack this would be appreciated.
 I can handle the coding, I just have a feeling I am
approaching this from the hard way.

Kathleen

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



Re: [PHP] Limit the number of characters in a string

2004-06-12 Thread Richard Harb
actually it is:
substr($string, 0, 100);

http://www.php.net/substr

-Original Message-
From: php-general
Sent: Friday, June 11, 2004, 3:17:15 PM
> substr( xxx, 1, 100)

>>>
>>>Hi
>>>
>>>Anyone know how to clip the number of characters in a string? For instance,
>>>I have a string carrying a long piece of text, say, of 200 characters, but I
>>>want to reduce this to just the first 100 characters.
>>>
>>>
>>>Thanks in advance.
>>>
>>>Russell

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



[PHP] re: return string size in bytes

2004-06-12 Thread Dascalu Marius
php4web wrote:
 
>I now there are function to calc file size but I want function to get
string size in bytes
 
Maybe what you want is strlen()?
http://www.php.net/strlen  
 
HTH
 
Marius