php-general Digest 29 Jun 2004 10:07:55 -0000 Issue 2847

Topics (messages 189183 through 189218):

Re: Works in Mozilla, not in IE
        189183 by: Curt Zirzow
        189184 by: Matthew Sims
        189185 by: Matt M.
        189190 by: Red Wingate

Image support
        189186 by: Gus
        189191 by: Red Wingate
        189194 by: Gus
        189195 by: William Lovaton
        189196 by: Justin Patrin
        189199 by: Gus
        189201 by: raditha dissanayake

Re: Image Problem
        189187 by: Curt Zirzow
        189192 by: Red Wingate

Re: Concatenate PHP code into a string
        189188 by: franciccio

Re: OOP, Classes, Sharing Code
        189189 by: Red Wingate
        189215 by: Gabriel Birke

Re: getting query string from referer website
        189193 by: Curt Zirzow

Question about executing PHP script
        189197 by: Charlie Don
        189198 by: Lars Torben Wilson
        189202 by: Charlie Don
        189217 by: Red Wingate

Re: mail program
        189200 by: Manuel Lemos

DomDocumentType in PHP 5
        189203 by: Dan Phiffer

LDAP and ranges...
        189204 by: Marvin Herbold

disguise as static content
        189205 by: Florin Andrei
        189209 by: Curt Zirzow
        189210 by: Curt Zirzow

Re: pcntl_fork and classes
        189206 by: Manuel Lemos

Re: New changes
        189207 by: Randy C Boland
        189208 by: John W. Holmes

Session file in /tmp
        189211 by: Info.Best-IT
        189214 by: Binay
        189216 by: Red Wingate

Re: sceen grab
        189212 by: Nick W

funny
        189213 by: adrian murphy

LDAPv3
        189218 by: Andrey K. Korolyov

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
* Thus wrote Robert Sossomon:
> That just put me right back at the beginning, IE trying to DL the PHP
> page...

put your disposition back to attachment and send the vnd.ms-excel
content type.

Also, on how the behaviour IE will treat any header is
unpredictable in an unctontrolled environment, so don't be alarmed
if you have someone else claiming that it isn't working for them :)

> 
> I have php 4.2.2 installed at this moment as well...

php really hasn't anything to do with how the browser will handle
the filedownload.  You're at the mercy of the intellegence of the
browser :/

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!

--- End Message ---
--- Begin Message ---
> * Thus wrote Robert Sossomon:
>> That just put me right back at the beginning, IE trying to DL the PHP
>> page...
>
> put your disposition back to attachment and send the vnd.ms-excel
> content type.
>
> Also, on how the behaviour IE will treat any header is
> unpredictable in an unctontrolled environment, so don't be alarmed
> if you have someone else claiming that it isn't working for them :)

Read as: IE sucks.

>
>>
>> I have php 4.2.2 installed at this moment as well...
>
> php really hasn't anything to do with how the browser will handle
> the filedownload.  You're at the mercy of the intellegence of the
> browser :/
>

Read as: IE is stupid.

;)

--Matthew Sims
--<http://killermookie.org>

--- End Message ---
--- Begin Message ---
> That just put me right back at the beginning, IE trying to DL the PHP
> page...
> 
> I have php 4.2.2 installed at this moment as well...

there might be some things you could try in this thread

http://marc.theaimsgroup.com/?l=php-general&m=108361967402210&w=2

--- End Message ---
--- Begin Message ---
I wish there wouldn't be so many ppl using IE anyway :)

Matthew Sims wrote:

* Thus wrote Robert Sossomon:

That just put me right back at the beginning, IE trying to DL the PHP
page...

put your disposition back to attachment and send the vnd.ms-excel content type.

Also, on how the behaviour IE will treat any header is
unpredictable in an unctontrolled environment, so don't be alarmed
if you have someone else claiming that it isn't working for them :)


Read as: IE sucks.


I have php 4.2.2 installed at this moment as well...

php really hasn't anything to do with how the browser will handle the filedownload. You're at the mercy of the intellegence of the browser :/



Read as: IE is stupid.

;)

--Matthew Sims
--<http://killermookie.org>

--- End Message ---
--- Begin Message ---
I have PHP 4.3.6
I want to add image support to manipulate JPEGs.
I downloaded http://www.boutell.com/gd but what I do next?

Thanks.

--- End Message ---
--- Begin Message ---
RTFM

Gus wrote:

I have PHP 4.3.6
I want to add image support to manipulate JPEGs.
I downloaded http://www.boutell.com/gd but what I do next?

Thanks.

--- End Message ---
--- Begin Message ---
I don't understand, but thanks for answering.

"Red Wingate" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> RTFM
>
> Gus wrote:
>
> > I have PHP 4.3.6
> > I want to add image support to manipulate JPEGs.
> > I downloaded http://www.boutell.com/gd but what I do next?
> >
> > Thanks.

--- End Message ---
--- Begin Message ---
Read The F***ing Manual.


El lun, 28-06-2004 a las 17:23, Gus escribió:
> I don't understand, but thanks for answering.
> 
> "Red Wingate" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > RTFM
> >
> > Gus wrote:
> >
> > > I have PHP 4.3.6
> > > I want to add image support to manipulate JPEGs.
> > > I downloaded http://www.boutell.com/gd but what I do next?
> > >
> > > Thanks.

--- End Message ---
--- Begin Message ---
It means read the * manual.

See http://info.astrian.net/jargon/ for definitions of internet lingo.

On Mon, 28 Jun 2004 19:23:01 -0300, Gus <[EMAIL PROTECTED]> wrote:
> 
> I don't understand, but thanks for answering.
> 
> "Red Wingate" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> 
> 
> > RTFM
> >
> > Gus wrote:
> >
> > > I have PHP 4.3.6
> > > I want to add image support to manipulate JPEGs.
> > > I downloaded http://www.boutell.com/gd but what I do next?
> > >
> > > Thanks.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> !DSPAM:40e09731205995239491481!
> 
> 


-- 
paperCrane --Justin Patrin--

--- End Message ---
--- Begin Message ---
I had read it. I didn't understand. So I asked.

"Justin Patrin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> It means read the * manual.
>
> See http://info.astrian.net/jargon/ for definitions of internet lingo.
>
> On Mon, 28 Jun 2004 19:23:01 -0300, Gus <[EMAIL PROTECTED]> wrote:
> >
> > I don't understand, but thanks for answering.
> >
> > "Red Wingate" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
> >
> > > RTFM
> > >
> > > Gus wrote:
> > >
> > > > I have PHP 4.3.6
> > > > I want to add image support to manipulate JPEGs.
> > > > I downloaded http://www.boutell.com/gd but what I do next?
> > > >
> > > > Thanks.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > !DSPAM:40e09731205995239491481!
> >
> >
>
>
> -- 
> paperCrane --Justin Patrin--

--- End Message ---
--- Begin Message ---
Gus wrote:

I had read it. I didn't understand. So I asked.

"Justin Patrin" <[EMAIL PROTECTED]> wrote in message


Not sure if you read the same manual the rest of us did. The manual that these guys refer to have a very nice step by step guide to installing the jpeg extension for GD. Well to be precise the guide lines are in the user contributed notes to the manual, you might have missed those. Fair enough. but i am sure if you look through them closely you will find that most eventualities have been discussed.

--
Raditha Dissanayake.
---------------------------------------------
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.

--- End Message ---
--- Begin Message ---
* Thus wrote Monil Chheda:
> Hi,
> 
> I store images in DB properly... no issues using the
> following code....
> 
> <snip>
> 
> I get an Img with a cross (broken)...
> 
> Whats the error?

its funny, you're error is one click from finding out what it is,
view the source of that image and find it you will...


> 
> Am i missing something?

about 10 or 12 things, but thats far beyond the scope of your
current  problem.


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!

--- End Message ---
--- Begin Message --- Read: The best database to store images in is the Filesystem because thats what it's for :-)

Raditha Dissanayake wrote:

Monil Chheda wrote:

Hi,

I store images in DB properly... no issues using the


Storing an image directly in the database certainly isnt' the proper way of doing it :-)
The common practice is just to store the path to the image name in the database.



--- End Message ---
--- Begin Message ---
$query="INSERT"+" ";
for ($i=0;$i<sizeof($col);$i++) {
    $query+=cols[$i]+" ";
}
    $query+="comment INTO mytable SET";

for ($i=0;$i<sizeof($col);$i++) {
    $query+=cols[$i]+"="+$cols[$i]+",";
}

Bye
Franciccio


"Abrea" <[EMAIL PROTECTED]> ha scritto nel messaggio
news:[EMAIL PROTECTED]
> Dear List,
> How can I include a dynamically generated array:
> e.g. for($i=0; $i<sizeof($cols); $i++)
>       { $cols[$i]= mysql_field_name($fields,$i); }
>
> into a MySQL insert query of the type:
> $sql= "INSERT cols[0],cols[1],cols[2], ..., comment
> INTO mytable SET
> cols[0]= '$cols[0]',
> cols[1]= '$cols[1]',
> cols[2]= '$cols[2]',
> cols[...]= '$cols[...]',
> comment= '$comment'";
>
> The number of $cols is different for each table.
> Thanks in advance for any help
>
> Alberto Brea

--- End Message ---
--- Begin Message ---
Look correct from my point of view...

class Portfolio {
   var $portfolioID ;
   var $albums = array () ;

   function Portfolio ( $newID ) {
      $this->portfolioID = $newID ;
   }
   function addAlbum ( $album ) {
      $this->albums[] = $album ;
   }
   function getAlbum () {
      return current ( $this->album ) ;
   }
   ....
}

some knowlege on the iterator pattern is required though.... But you could even use a stack ( which i prefer )

class main {
   var $stack = NULL ;

   function create ( $ID ) {
      $this->stack = new stack ( $ID , $this->stack );
   }
   function remove ( $ID ) {
      $this->stack = $this->stack->remove();
   }
   function getID () {
      return $this->stack->getID();
   }
}

class stack {
   var $ID ;
   var $prev = NULL ;

   function stack ( $ID , $prev ) {
      $this->ID = $ID ;
      $this->prev = $prev ;
   }
   function getID () {
      return $this->ID ;
   }
   function remove () {
      return $this->prev ;
   }
}

$foo = new main();
$foo->create( 100 );
$foo->create( 200 );
echo $foo->getID();    // 200
$foo->remove();
$foo->create( 300 );
echo $foo->getID();    // 300
$foo->remove();
echo $foo->getID();    // 100
$foo->remove();

unset ( $foo );

[...]
from what you wrote it seems that only the type of display is similar in
both classes. I don't think this is enough to extend them from the same base
class because the class properties and update/insert/load methods will be
different in each.

You have more of a 'is part of' relationship here. So I'd suggest something
like this (simplified):

class Portfolio {
    var $portfolioID;
    var $albums = array();
}

class Album {
    var $albumID;
    var $portfolioID;
    var $photos = array();
}

class Photo {
    var $photoID;
    var $albumID;
    var $name;
}
[...]
--- End Message ---
--- Begin Message ---
Hello!

Another option would be to have a generic "List" class that displays items in a list.

Both your Album and Photo class should implement a method like "getNextItem" or the PHP5-native iterator methods so the List class can iterate over a class assigned to it without knowing what it is.

If the properties of Album and Photo are too different to generate a list, you could make a generic list class and subclass it for Album and Photo.

If you want to know more about OOP, I recommend this book:
http://www.amazon.com/exec/obidos/tg/detail/-/0201715945/ qid=1088493890/sr=8-1/ref=sr_8_xs_ap_i1_xgl14/102-6243709-1202536? v=glance&s=books&n=507846
It helped me a great deal understanding how to "think" object oriented.


A third option would be to use the Smarty templating system. With templates you would only have to write a small portion of HTML code for each list.

With best regards

Gabriel Birke

--
KONTOR4_Neue Medien
Plathnerstraße 5
30175 Hannover
Fax: +49 51184 48 98 99
mailto:[EMAIL PROTECTED]
http://www.kontor4.de
Am 28.06.2004 um 20:32 schrieb Joel Kitching:

I'm kind of new to OOP, so bear with me here...

I have a portfolio which contains albums.  These albums contain
photos.  So it would be natural to declare the classes:

Portfolio
Album
Photo

It seems to me that none of these classes have the "is a"
relationship, and therefore can not be "extended" from each other.
The reason I wish to do this, is because listing albums and listing
photos use almost exactly the same code.

i.e.

// The constructor would automatically fill in the album's variables
from the database.
$album = new Album($album_id);
// This would print out the HTML for the list of photos.
$album->list_photos();

... or the same thing with "Portfolio," which would list the albums.
The only thing that's different is the links to which the anchors are
pointing, and the content.  (Thumbnails.)

So my question is, should I just duplicate the code in each class
(Portfolio and Album), or is there a better way of organizing all of
this?

--
Joel Kitching
http://midgardmanga.keenspace.com/

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



--- End Message ---
--- Begin Message ---
* Thus wrote I.A. Gray:
> Hi all,
> 
> When I use the $_SERVER to get a query string it doesn't ever seem to return
> me anything:
> 
> $queryy = $_SERVER['QUERY_STRING'];
> 
> In my webstats script, 790 are blank and 2 give the value of "loc=uk" and
> "currentID=6" - not very satisfactuary!
> 
> Why is this happening?  Could I get the search string from the referer web
> site?  It sounds like a bit of a faff, but is this what I have to do?

The referer and its query string are in:
  $_SERVER['REFERER']

You'll have to substr() the strpos() of ? to get the query sting.


> 
> Say a referer website is
> http://www.google.co.uk/search?q=web+design+for+performers&ie=UTF-8&hl=en&me
> ta=
> 
> is there a good way of getting the query string "web design for performers"
> ?
> 
> for Yahoo it is different:
> 
> http://search.yahoo.com/search?p=biography+examples&ei=UTF-8&fr=fp-tab-web-t
> &n=20&fl=0&x=wrt
> 
> the search string is followed by "p="

Once you get the query string parsed out of the referer you can
then use that string to pass to parse_str()...

  parse_str($query, $queryparts);

  $queryparts['q'] // the search term from google search
  $queryparts['p'] // the search term from yahoo search

and if $queryparts['btnI'] == "I'm Feeling Lucky" make sure you
keep note of that 'q' search term :)



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!

--- End Message ---
--- Begin Message ---
Hello,

I need to have some scripts that do database maintanance on my cron tab.

However, some might take more time to execute that the maxtime set on php.ini.

These are now web scripts but scripts that I execute on my command prompt or cron tab.

I wonder if there is any way to have on the first line of the script that calls the php engine an option that does not end the script if it exceeds the maximum executin time.

Thanks,

C.

_________________________________________________________________
Make the most of your family vacation with tips from the MSN Family Travel Guide! http://dollar.msn.com

--- End Message ---
--- Begin Message ---
Charlie Don wrote:

Hello,

I need to have some scripts that do database maintanance on my cron tab.

However, some might take more time to execute that the maxtime set on php.ini.

These are now web scripts but scripts that I execute on my command prompt or cron tab.

I wonder if there is any way to have on the first line of the script that calls the php engine an option that does not end the script if it exceeds the maximum executin time.

Thanks,

C.

Searching on Google for something like 'php max execution time' should land you on the correct manual page fairly quickly. To wit:

  http://www.php.net/set_time_limit


Hope this helps,

Torben
--- End Message ---
--- Begin Message ---

Hi Elijah,

I think you understood what I have asked. Thanks.

to run a script at the command shell I do:
php -q script.php

So all I need is to have set_time_limit(0); on the main body of the script to by pass php.ini?

However, I would like to hardcode the php -q just like in perl where you have
a #!/usr/bin/perl -w


can I do a #!/usr/bin/php -q  at the begining of the text file?

Thanks.



From: Elijah Gallatin <[EMAIL PROTECTED]>
To: Charlie Don <[EMAIL PROTECTED]>
Subject: Re: [PHP] Question about executing PHP script
Date: Mon, 28 Jun 2004 19:33:14 -0400

On Mon, 28 Jun 2004 23:29:16 +0000, Charlie Don <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I need to have some scripts that do database maintanance on my cron tab.
>
> However, some might take more time to execute that the maxtime set on
> php.ini.
>
> These are now web scripts but scripts that I execute on my command prompt or
> cron tab.
>
> I wonder if there is any way to have on the first line of the script that
> calls the php engine an option that does not end the script if it exceeds
> the maximum executin time.
>
> Thanks,
>
> C.
>
> _________________________________________________________________
> Make the most of your family vacation with tips from the MSN Family Travel
> Guide! http://dollar.msn.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


set_time_limit(0);

if php is running in safe mode that will have no effect

_________________________________________________________________
Make the most of your family vacation with tips from the MSN Family Travel Guide! http://dollar.msn.com

--- End Message ---
--- Begin Message ---
Yep :-)

[...]
> can I do a #!/usr/bin/php -q  at the begining of the text file?
[...]

--- End Message ---
--- Begin Message ---
Hello,

On 06/28/2004 10:02 AM, Syed Ghouse wrote:
i want to send more than 1000 mails from php program at a time.how
can i send it and will the execution of program become slow.

It depends on your environment. Are you running PHP on Linux/Unix or Windows? If it is Linux/Unix, does it use as local mailer sendmail, qmail, etc? If it is Windows, which version it is? Depending on the answers to these questions, there are optimizations that can be made to drastically boost the mailing performance.


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message ---
Hello,

I'm trying to make use of the getElementById DOM function, but as pointed out in bug #26813 this won't work unless an attribute is explicitely defined in an associated DOCTYPE.

This is fine, but I can't seem to find any relevent examples that show how to apply a DOCTYPE to a DomDocument. The class DomDocumentType seems like a good starting point, but I don't see how that interfaces with DomDocument.

So here's what I want to do:

1. Create a new DomDocument
2. Associate this with a DomDocumentType somehow
3. Build an XML structure using the DOM
4. Query this structure using getElementById

Sorry if I'm missing something obvious.

Also, is there a better list/newsgroup for this?

Thanks,
-Dan

--- End Message ---
--- Begin Message ---
I hope this is the correct newsgroup to ask this!

How do I get ldap_search to return a specified range of results? For example my server limits queries to 1000 results, so how do I get results 1000-2000?

Thanks in advance,
Marvin

--- End Message ---
--- Begin Message ---
My personal website (see signature below) is almost entirely built with
PHP, based on a rudimentary templating engine that i wrote. With the
exception of a few well-defined sections (pictures gallery, blog, etc.)
the most of it is static, i.e. it changes very rarely.

Some Web applications (including but not limited to search engines) seem
to treat differently the static content proper ("true" HTML pages) and
pseudo-static content generated by dynamic pages (such as PHP pages that
change rarely).

I would like to continue to use PHP for my website, but somehow "fool"
the Web clients into believing they're seeing "true" static content.
Since the content changes rarely (like once every other month), there is
no harm in pretending it's "true" static content.

I suspect there are quite a few things that can be done to achieve that
goal:
1. change extensions to .html even though they're PHP files (i know how
to trick Apache into doing that)
2. don't send HTTP headers that indicate dynamic content

I don't know how to achieve #2. I also don't know if there are other
things to care about in order to totally "disguise" the dynamic nature
of the pages.

I'm open to suggestions. Thank you in advance.

-- 
Florin Andrei

http://florin.myip.org/

--- End Message ---
--- Begin Message ---
* Thus wrote Florin Andrei:
> 
> I would like to continue to use PHP for my website, but somehow "fool"
> the Web clients into believing they're seeing "true" static content.
> Since the content changes rarely (like once every other month), there is
> no harm in pretending it's "true" static content.
> 
> I suspect there are quite a few things that can be done to achieve that
> goal:
> 1. change extensions to .html even though they're PHP files (i know how
> to trick Apache into doing that)
> 2. don't send HTTP headers that indicate dynamic content

1. wont do anything as far as the client is concerned.
2. should be worded as 'Send HTTP headers that indicates static'

In truth, the browser has no clue if its static or dynamic, all it
knows is wether it can cache the page or not.

If you're using sessions in your pages then php is going to
instantly send these headers (by default):

  Expires: Thu, 19 Nov 1981 08:52:00 GMT
  Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
  Pragma: no-cache

Ensuring that no caching is going to happen.  If you make php send
a Expires in the future (ie 5 days) and turn off the deny caching
directives, you're browser (depending on its settings) will cache
the document, in most cases, for the lifetime of the browser window
being open.

Now after they close the browser (or force a reload) things get
more complicated :)  When you request a page, after time has
passed, the browser will generally check the cache first:

  1. if expires in the future just show the cached document

This can be bad because in reality, and in your situation, the page
may have been modified, and the user wouldn't see the changes.


  2. Request from the server to see if the document has changed.
     But in order for it to do that it must have some information
     about the document:

     Last-Modified and Content-Length (headers)

     or the etag (a uniq identifier passed in the headers usually
     from the webserver).

       
If the client requests a file only if its been changed (sending
special headers), you're script is going to need to determain if
the changes occured or not. if the latter, then you will simply
send a response code 304 and exit your script. otherwise you send
the file to them.


Now, if you're willing to have you php script handle all the above
(and more) its possible to make you're php script look identical
to html static docs.

The alternative to doing all that, is to generate the static files
(html and all) on the file system, reference those documents
instead of the php scripts and let apache deal with all the
headers.

All the information above can be found in section 13 of rfc2616
  http://www.cse.ohio-state.edu/cgi-bin/rfc/rfc2616.html#sec-13


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!

--- End Message ---
--- Begin Message ---
* Thus wrote Curt Zirzow:
> * Thus wrote Florin Andrei:
> > 
> > I would like to continue to use PHP for my website, but somehow "fool"
> > the Web clients into believing they're seeing "true" static content.
> > Since the content changes rarely (like once every other month), there is
> > no harm in pretending it's "true" static content.
> > 
> > I suspect there are quite a few things that can be done to achieve that
> > goal:
> > 1. change extensions to .html even though they're PHP files (i know how
> > to trick Apache into doing that)
> > 2. don't send HTTP headers that indicate dynamic content
> 
> 1. wont do anything as far as the client is concerned.
> 2. should be worded as 'Send HTTP headers that indicates static'
>
>...
> 
> All the information above can be found in section 13 of rfc2616
>   http://www.cse.ohio-state.edu/cgi-bin/rfc/rfc2616.html#sec-13

I just realized this was a bit long winded. I hope it was clear
enough.

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!

--- End Message ---
--- Begin Message ---
Hello,

On 06/27/2004 05:31 PM, [EMAIL PROTECTED] wrote:
Is it possible to pcntl_fork() withing a class?

Basically I want a web page to load, and when the class is called in the
page, it can fork and the child can run, allowing the webpage to finish,
but the class process can continue 'till it's done.

Is this possible? Would I put the fork in the constructor? Would calling
the class methods after it forked work the same way?

You can fork processes from anywhere in your scripts including from classes as you may see in this class. I just doubt that you the forked processes outlive the current request.


Class: Thread
http://www.phpclasses.org/php_fork


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message ---
Isn't this a moderated list? And if so, how do messages like this keep
getting through?


On Mon, 28 Jun 2004 20:46:50 +1000, Aidan Lister <[EMAIL PROTECTED]> wrote:
> 
> It's a virus, duh

--- End Message ---
--- Begin Message ---
Randy C Boland wrote:

Isn't this a moderated list?

lol

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Code:

session_cache_expire(0);
session_cache_limiter('private');
session_start();

I use this at the beginning of my script that processes data objects for my
users.  The users use multiple machines and login to the web site.  This
prevents the cached information from one user popping up when another user
logs in.  Will this contribute to the solution for my main problem:

When a user exits a window without logging out they have to wait until the
cookie expires or the session file in /tmp is deleted before they can get
back in.  This is the code that executes at login:

            session_cache_expire(0);
            session_cache_limiter('private');
            setcookie("cookie","",0,"/","iffinet.com",1);
            session_start();

I was hoping this would cause the session file in /tmp to be deleted but it
doesnıt work.  I also tried unset($_SESSION[Œidı]) this doesnıt work either.
Anyone have any ideas as to how I can resolve this?

Thanks for your help!

/Tim

--- End Message ---
--- Begin Message ---
If i m getting ur problem correctly then u want to restrict the same user
logging from different machines concurrently. If tht being the case the
snippet u mentioned below alone won't solve the problem . you have maintain
a flag in the database which will be on when the user logs in and off when
he/she logs out.


> Code:
>
> session_cache_expire(0);
> session_cache_limiter('private');
> session_start();
>
> I use this at the beginning of my script that processes data objects for
my
> users.  The users use multiple machines and login to the web site.  This
> prevents the cached information from one user popping up when another user
> logs in.  Will this contribute to the solution for my main problem:
>
> When a user exits a window without logging out they have to wait until the
> cookie expires or the session file in /tmp is deleted before they can get
> back in.  This is the code that executes at login:
>
>             session_cache_expire(0);
>             session_cache_limiter('private');
>             setcookie("cookie","",0,"/","iffinet.com",1);
>             session_start();
>
> I was hoping this would cause the session file in /tmp to be deleted but
it
> doesnıt work.  I also tried unset($_SESSION[Oidı]) this doesnıt work
either.
> Anyone have any ideas as to how I can resolve this?
>
> Thanks for your help!
>
> /Tim
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
i guess what u are looking for is session_destroy();

Binay wrote:

> If i m getting ur problem correctly then u want to restrict the same user
> logging from different machines concurrently. If tht being the case the
> snippet u mentioned below alone won't solve the problem . you have
> maintain a flag in the database which will be on when the user logs in and
> off when he/she logs out.
> 
> 
>> Code:
>>
>> session_cache_expire(0);
>> session_cache_limiter('private');
>> session_start();
>>
>> I use this at the beginning of my script that processes data objects for
> my
>> users.  The users use multiple machines and login to the web site.  This
>> prevents the cached information from one user popping up when another
>> user
>> logs in.  Will this contribute to the solution for my main problem:
>>
>> When a user exits a window without logging out they have to wait until
>> the cookie expires or the session file in /tmp is deleted before they can
>> get
>> back in.  This is the code that executes at login:
>>
>>             session_cache_expire(0);
>>             session_cache_limiter('private');
>>             setcookie("cookie","",0,"/","iffinet.com",1);
>>             session_start();
>>
>> I was hoping this would cause the session file in /tmp to be deleted but
> it
>> doesnıt work.  I also tried unset($_SESSION[Oidı]) this doesnıt work
> either.
>> Anyone have any ideas as to how I can resolve this?
>>
>> Thanks for your help!
>>
>> /Tim
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>

--- End Message ---
--- Begin Message ---
On June 24, 2004 10:36 am, Matthew Holmen wrote:
> I am looking for a way to retrieve data from another website, parse
> through it and then display it as I would like to.  Basically a screen
> grab from say espn.com, then I take the data that is there and form it
> to fit on my site.
>
> The catch here is that my target is an asp page that requires a login to
> get to the page I would like to get to.  They do allow for the check
> here so i will be remembered next time, but will that work with a php
> screen grab.
>
> Any help at all would be appreciated.

I recently wrote a parser to grab stats fro espn if you'd like a 
look...contact me off-list.

>
> Thanks
> Matt

--- End Message ---
--- Begin Message ---
I hate to put a url in but there are some choice words in the extract.
You may have come accross it before but if you are a sys admin u should read this.
It's funny unless u know the guy i suppose.hell it's just funny!
Its a reply email after the guy was given some helpful advice on installing ImageMagick

http://imajes.info/archives/2003/03/30/user_support

a

--- End Message ---
--- Begin Message ---
ldap_rename

Don't work :-(((

I have some problem with this function.

Script
        $res = spliti(",",$dn);
        $res[0] = "ou=".$input['ou'];
        $newrdn = implode(",",$res);
        unset($res[0]);
        $parentdn = implode(",",$res);
        
        echo "<pre>";
        var_dump($dn);
        var_dump($newrdn);
        var_dump($parentdn);
        echo "</pre>";
                
        ldap_rename($this->ldap,$dn,$newrdn,$parentdn,false);

Where $dn - current dn
input['ou'] - new value for ou

Output

string(83) "ou=WinAdmin,ou=otdel,ou=nazvanie,ou=asdf,ou=dsfsdf,ou=builtin,ou=AV,o=fcg,dc=bunker"
string(86) "ou=WinAdmin234,ou=otdel,ou=nazvanie,ou=asdf,ou=dsfsdf,ou=builtin,ou=AV,o=fcg,dc=bunker"
string(71) "ou=otdel,ou=nazvanie,ou=asdf,ou=dsfsdf,ou=builtin,ou=AV,o=fcg,dc=bunker"


Invalid DN syntax
--- End Message ---

Reply via email to