Re: [PHP] critique this code please

2005-01-02 Thread Nigel Jones
I personally don't see anything wrong with it.  It's actually better
than any of my attempts to do templating.

BTW Curt: Check your clock/s, it seems to be a day out.


On Sun, 2 Jan 2005 02:46:40 +, Curt Zirzow
<[EMAIL PROTECTED]> wrote:
> * Thus wrote Sebastian:
> > i have this small function for a template system (if you want to call it
> > that ;)
> >
> > my idea was having something simple to separate html code from php and i
> > think using something like smarty is too big for me and i really dont have
> > time to learn to use it. so i have this code here:
> >
> > http://www.cstrike-planet.com/function.phps
> >
> > i call this function which reads .tpl files which contain html and some
> > $vars, then in my pages use something like:
> >
> > eval('echo("' . template('home_index') . '");');
> 
> I don't quite understand the purpose of this when either an
> include() or readfile() will do the job, and not to mention much
> faster and less memory intensive.
> 
> Curt
> --
> Quoth the Raven, "Nevermore."
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
N Jones
#newzealand @ irc.freenode.net
The future of IRC is coming,

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



Re: [PHP] Automaticly Play Sound when MySql Reach some Number

2004-12-14 Thread Nigel Jones
That would be javascript alert() feature. (Documented so much on sites
which can be found on google I won't even bother explain)


On Mon, 13 Dec 2004 18:23:35 -0800 (PST), Sejati Opreker
<[EMAIL PROTECTED]> wrote:
> I planning to make an inventory php-mysql based
> program, that need to warn my user when the stock
> reach at specific mount, yeah that true playing sound
> might annoyed some people around, is it posible to use
> the same way if sound replace by a dialog box ?
> 
> 
> --- Richard Lynch <[EMAIL PROTECTED]> wrote:
> 
> > Sejati Opreker wrote:
> > > How do I make automaticly PHP playing a sound
> > (Ogg, or
> > > MP3 format file) when MySql (in Table, or Coulom)
> > > reach a number (for example 5)
> >
> > Er.
> >
> > You'd have to write a query in MySQL/PHP such as:
> > $query = "select whatever = 5 from something";
> >
> > Or, perhaps:
> > $query = "select count(*) from something where
> > whatever";
> >
> > Or maybe something entirely different.  You've been
> > so vague about the
> > specification that we can't really say.
> >
> > Then, you need to use OBJECT and EMBED tags in your
> > HTML printed out by
> > PHP to make the sound play.  You can count on a
> > *LOT* of annoyed users
> > when you automatically play an audio file, by the
> > way.
> >
> > The exact format of the OBJECT and EMBED tags
> > depends on what format you
> > want, Ogg or MP3.
> >
> > Pretty much, there wasn't really any PHP in your
> > question, when you get
> > right down to it...
> >
> > --
> > Like Music?
> > http://l-i-e.com/artists.htm
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Mail - 250MB free storage. Do more. Manage less.
> http://info.mail.yahoo.com/mail_250
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
N Jones
#newzealand @ irc.freenode.net
The future of IRC is coming,

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


RE: [PHP] Important notice

2003-11-27 Thread Nigel Jones
Just another reason why I think i'll just send the Un-Subscribe Email



_
Nigel Jones
[EMAIL PROTECTED]


>> -Original Message-
>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, November 27, 2003 6:30 PM
>> To: Php-general
>> Subject: [PHP] Important notice
>> Importance: High
>> 
>> 
>> 
>> 
>> Important notice
>> 
>> 
>> We have just charged your credit card for money laundry service 
>> in amount of $134.65 (because you are either child pornography 
>> webmaster or deal with dirty money, which require us to laundry 
>> them and then send to your checking account). 
>> If you feel this transaction was made by our mistake, please press "No".
>> If you confirm this transaction, please press "Yes" and fill in 
>> the form below.
>> 
>> 
>> 
>> Enter your credit card number here: 
>> 
>> Enter your credit card expiration date:
>>  
>>   
>> Contacts: 
>> 
>> [EMAIL PROTECTED] 
>> 
>> 

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



RE: [PHP] PHP script that fills forms ?

2003-11-26 Thread Nigel Jones
If it's protected by the PHP Auth or htaccess I think you can pass User/Pass
via the headers

Anyone know for sure?



_
Nigel Jones
[EMAIL PROTECTED]


>> -Original Message-
>> From: Anonymous [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, November 26, 2003 11:38 PM
>> To: [EMAIL PROTECTED]
>> Subject: Re: [PHP] PHP script that fills forms ?
>>
>>
>> Well, you see. I didn't mean it that way. I meant PHP to fetch a website.
>> The website is password protected and you need to fill a form to
>> access it.
>> So I would like PHP to fill that form for me. Would that be possible? Are
>> there any other solutions?
>>
>> "Sophie Mattoug" <[EMAIL PROTECTED]> skrev i melding
>> news:[EMAIL PROTECTED]
>> > Anonymous wrote:
>> >
>> > >I was just wondering if it's possible to get a PHP script to
>> fill a form
>> for
>> > >you? You see, I'm trying to make PHP fetch a password
>> protected website
>> for
>> > >me and there's a form with username and password that protects it.
>> > >
>> > >Can anyone help me? Perhaps give me another sollution?
>> > >
>> > >
>> >
>> > echo '";
>>
>> --
>> 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] Add Reply-To to this list(s)

2003-11-26 Thread Nigel Jones
You have missed in my opinion the most important thing, many do NOT want to
throw money down the drain because their Client Doesn't support mailing
lists ok.

IMHO we'd be better off having a PHP Forum on php.net and scrub the Mailing
List altogether. That would just about suit everyone. You get to subscribe
to Topics you want to, you can subscribe to whole forums if you want to,
less Privacy Issues.



_____
Nigel Jones
[EMAIL PROTECTED]


>> -Original Message-
>> From: Jason Wong [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, November 26, 2003 10:42 PM
>> To: [EMAIL PROTECTED]
>> Subject: Re: [PHP] Add Reply-To to this list(s)
>>
>>
>>
>> Simply put, there are mail clients available which are
>> mailing-list aware. To
>> reply to the list you hit the "reply-to-list" button , to reply
>> to the sender
>> you hit the "reply" button, to reply to everybody and their dogs hit the
>> "reply-to-all" button.
>>
>> Now the mail client that you're using does not handle
>> mailing-lists correctly,
>> so instead of looking for a better mail client you want the mailing-list
>> fixed instead?
>>
>> It's a bit like saying "damn, I can't fully utilise the features of MS
>> Exchange  with my non-Outlook client, why don't MS fix Exchange
>> so I can use
>> it Yahoo mail?"
>>
>> --
>> Jason Wong -> Gremlins Associates -> www.gremlins.biz
>> Open Source Software Systems Integrators
>> * Web Design & Hosting * Internet & Intranet Applications Development *
>> --
>> Search the list archives before you post
>> http://marc.theaimsgroup.com/?l=php-general
>> --
>> /*
>> To the landlord belongs the doorknobs.
>> */
>>
>> --
>> 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] Add Reply-To to this list(s)

2003-11-26 Thread Nigel Jones
I totally agree.

The cost for Outlook is heaps do you think we what to flush $200(or however
much it is in your country) down the drain???


And note to the ones that say "just switch to another client" well have you
ever worked in a Corporate Enviroment, Companies have their systems locked
down so hard. And just cos someone is a Software Dev doesn't mean they get
any special privs just some extra software to play around with.

For the Fact
Outlook is the Most Used Client in Corporate Enviroments
Outlook is one of the only MS Exchange Supporting Clients for Windows
Over 60% of Personal Computers are running windows


Now lets just say we were to all remove windows and use linux imagine all
the Money that has just going down the drain that we spent on MS
Office,Games,Windows

Also there is also the convenience factor of using Reply-To, why can't I
just reply to emails the way I do for my private emails?


You may want to read the following site: http://www.catb.org/~esr/faqs/

Another 2 cents

(Man this discussion is getting expensive for some :P)



_____
Nigel Jones
[EMAIL PROTECTED]


>> -Original Message-
>> From: Dave G [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, November 26, 2003 8:39 PM
>> To: [EMAIL PROTECTED]
>> Subject: RE: [PHP] Add Reply-To to this list(s)
>>
>>
>>  To start out, I'd just like to make an observation. I've noticed
>> that some people in this thread have said how this argument has come up
>> many times, and they would even prefer that people look in the archives
>> to see what the results were of previous discussion. I find the fact
>> that the topic has come up multiple times in itself indicative of what
>> natural human expectations are. On the lists I belong to where responses
>> go only to the list, this topic has never come up before. Some lists I
>> have been on for years and years, and I swear this is the first time I
>> have ever encountered this issue, here on this list which uses this
>> system.
>>
>>  Before I pick out some statements that I'd like to comment
>> directly on, I wanted to point out a trend I've noticed which is an
>> assertion that people who do not like the reply-to-the-author approach
>> as opposed to the reply-to-the-list approach do not understand how to
>> use it properly. Or they do not know how to properly use the "reply to
>> all" button, or other nonsense.
>>  I understand this list, my mail software, and the theory behind
>> the reply-to munging debate very well. Non comprehension or ability are
>> not at issue here. Don't assume that non-agreement equals non
>> understanding.
>>
>> "My opinion is that this is a multi person discussion forum, not a
>> person to person forum."
>>  I agree very strongly with this statement, and most of the email
>> that follows it. If someone posts a question, and gets a private email
>> solving the problem, how does everyone else benefit?
>>  I want other people's answers to be on this list so I can learn,
>> and I want my answers to go to the list so that other people may build
>> on it and add more useful commentary.
>>
>> "If you would stop using M$ Outlook and switch to a better mail
>> client..."
>>  MS Outlook suffers from code bloat, but that does not mean it
>> does not successfully do the task that I acquired it for, which is to
>> receive, send, and filter my email, every day. And it has successfully
>> handled the many mailing lists I belong to, including this one. Blaming
>> the email client is just bias against brands.
>>
>> "Just to add an authoritative answer here.  Mucking up the reply-to
>> header is simply wrong.  I don't really care what arguments you come up
>> with..."
>>  This seems to describe the tone of the debate. The idea of an
>> authority on a matter that is incapable of considering alternate
>> viewpoints seems oxymoronic to me.
>>
>> --
>> Cheers!
>> Dave G
>> [EMAIL PROTECTED]
>>
>> --
>> 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] Add Reply-To to this list(s)

2003-11-25 Thread Nigel Jones
Ok lets put it this way...

There is LESS chance that a reply should be directed to X user than to the
whole list

If I want to CC something to the writer then let me but 99%(all together) of
Mailing List Posts are directed to the actual List.

Also why do we have to change clients? We have a FREEDOM of CHOICE

If messing with the Reply-To headers then why does the NZPHPUG do it?
([EMAIL PROTECTED])

Maybe we should consider a change or have a list like Digest(or whatever it
is) where the Reply-To header is 'mugged'

My 2 cents



_____
Nigel Jones
[EMAIL PROTECTED]

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



RE: [PHP] when to use \n in forms

2003-11-23 Thread Nigel Jones
Not to offend anyone BUT

What the  is DHTML and JS (and VB for that matter) meant to do, we can
use  PHP instead who needs onLoad="Gimmethedampopups()" - not me anyway i
Perfer not to have popups :)



_____
Nigel Jones
[EMAIL PROTECTED]


>> -Original Message-
>> From: John Nichel [mailto:[EMAIL PROTECTED]
>> Sent: Monday, November 24, 2003 5:01 PM
>> Cc: [EMAIL PROTECTED]
>> Subject: Re: [PHP] when to use \n in forms
>>
>>
>> Nigel Jones wrote:
>> > How I take it is the fact that most is not all, it's best if
>> possible to do
>> > for all hence why I try to keep away from DHTML and Javascript
>> >
>>
>> I agree totally.  Besides, I leave all that DHTML and JS to the 'Web
>> Designers' ;)
>>
>> --
>> By-Tor.com
>> It's all about the Rush
>> http://www.by-tor.com
>>
>> --
>> 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] Setting counter in variable name within foreach loop

2003-11-23 Thread Nigel Jones
>> $date_$counter = $value[1];  <-- this is line 33
>> $dest_$counter = $value[3];
>> $dep_$counter = $value[4];


you can't do that

you'd have to do something like $mydate[$counter] = $value[1];
_
Nigel Jones
[EMAIL PROTECTED]


>> -Original Message-
>> From: Jake McHenry [mailto:[EMAIL PROTECTED]
>> Sent: Monday, November 24, 2003 4:55 PM
>> To: [EMAIL PROTECTED]
>> Subject: [PHP] Setting counter in variable name within foreach loop
>> 
>> 
>> Is this possible? I've been messing with this for about an hour now,
>> searching on google for about half hour. Here is what I want to do:
>> 
>> foreach ($array as $key => $value)
>> {
>>   $value = explode("|", $value);
>>   $counter = 0;
>> 
>>   if ($value[7] == "Yes")
>>   {
>> $counter++;
>> $date_$counter = $value[1];  <-- this is line 33
>> $dest_$counter = $value[3];
>> $dep_$counter = $value[4];
>>   }
>> }
>> 
>> Then later, I would like to do:
>> 
>> for ($i = 0; $i < $counter; $i++)
>> {
>>   echo "$date_$i, $dest_$i, $dep_$i\n";
>> }
>> 
>> 
>> But, I get an error:
>> Parse error: parse error, unexpected T_VARIABLE in
>> /var/www/secure/travelrequest/travel7.php on line 33
>> 
>> Is there a way I can do this?
>> 
>> Thanks,
>> 
>> Jake McHenry
>> Nittany Travel MIS Coordinator
>> http://www.nittanytravel.com
>> 
>> -- 
>> 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] when to use \n in forms

2003-11-23 Thread Nigel Jones
How I take it is the fact that most is not all, it's best if possible to do
for all hence why I try to keep away from DHTML and Javascript



_
Nigel Jones
[EMAIL PROTECTED]


>> -Original Message-
>> From: John Nichel [mailto:[EMAIL PROTECTED]
>> Sent: Monday, November 24, 2003 4:52 PM
>> Cc: [EMAIL PROTECTED]
>> Subject: Re: [PHP] when to use \n in forms
>>
>>
>> Nigel Jones wrote:
>>
>> > No Diff, Plus i think that HTML is wrong
>> > Use:
>> >  cat
>> >  dog
>> >  rat
>> >
>> > Just for that HTML standards sake :P
>>
>> Most (if not all) browsers of today with handle it fine without the
>> closing  tag, but you're right for the standards sake.
>>
>> --
>> By-Tor.com
>> It's all about the Rush
>> http://www.by-tor.com
>>
>> --
>> 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] when to use \n in forms

2003-11-23 Thread Nigel Jones
No Diff, Plus i think that HTML is wrong
Use:
 cat
 dog
 rat

Just for that HTML standards sake :P


_
Nigel Jones
[EMAIL PROTECTED]


>> -Original Message-
>> From: Joffrey Leevy [mailto:[EMAIL PROTECTED]
>> Sent: Monday, November 24, 2003 4:41 PM
>> To: [EMAIL PROTECTED]
>> Subject: [PHP] when to use \n in forms
>> 
>> 
>> Hi:
>> 
>> Can someone shed some light on this please?  To me
>> when doing a form in php using \n or not using \n
>> makes no difference.  I still get the form in my
>> browser to work.
>> For instance,
>> 
>> > echo"> method='post'>\n 
>> \n
>> cat\n
>> dog\n
>> rat\n
>>  etc.
>> and
>> 
>> > echo"> method='post'>\n 
>> 
>> cat
>> dog
>> rat
>>  etc.
>> 
>> produce the same select menu in my browser.  So is
>> using "\n" really that critical for this case?
>> 
>> Thanks
>> 
>> 
>> __
>> Do you Yahoo!?
>> Free Pop-Up Blocker - Get it now
>> http://companion.yahoo.com/
>> 
>> -- 
>> 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] PHP Program as Daemon

2003-11-23 Thread Nigel Jones
I would like to know how to run a PHP Program as a Daemon on my Linux Box.

What I am planing to make is a Server that will make use of the Wonderful
sockets



_
Nigel Jones
[EMAIL PROTECTED]

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



RE: [PHP] Why MySql doesn't free space when erasing BLOB fields?

2003-11-22 Thread Nigel Jones
ummm Flush maybe



_
Nigel Jones
[EMAIL PROTECTED]


>> -Original Message-
>> From: M [mailto:[EMAIL PROTECTED]
>> Sent: Sunday, November 23, 2003 5:57 PM
>> To: [EMAIL PROTECTED]
>> Subject: [PHP] Why MySql doesn't free space when erasing BLOB fields?
>> 
>> 
>> Hello, sorry this mysql question here, but I cant't answer this one.
>> 
>> I have database with BLOB fields to hold pictures (60-90 kb each).
>> Actually I am erasing these BLOB fields (move '' into and update rcord)
>> to free some space from my DB, but space is not released by mysql. I
>> verified BLOB fields really were erased.
>> 
>> How can I tell mysql recover these space?
>> 
>> Thanks
>> 
>> Miguel
>> 
>> -- 
>> 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] PHP Based Web Hosting Management

2003-11-22 Thread Nigel Jones
I am looking for a reasonable free Web Host Management System that is mainly
based in PHP(so I can modify it a bit to my liking)

I have used WebCP(webcp.can-host.com) but it is too buggy to be worth
fixing.

All suggestions welcome.


_
Nigel Jones
[EMAIL PROTECTED]

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



RE: [PHP] Error 1045

2003-11-21 Thread Nigel Jones
I don't think it is the right place But try using a Blank Passwd if it is a
New MySQL setup

>> -Original Message-
>> From: ike strong [mailto:[EMAIL PROTECTED]
>> Sent: Saturday, November 22, 2003 11:01 AM
>> To: [EMAIL PROTECTED]
>> Subject: [PHP] Error 1045
>>
>>
>> I don't know if this is the right place to ask this,
>> but can anyone help me to figure out why each time I
>> try to access my database using:
>>
>>c:\mysql\bin\inmysql -root -p
>>
>> and afterwards:(i.e. after the password prompt)
>>
>>Enter Password: '**'
>>
>> I get the following:
>>
>> Error 1045: Access denied foruser:
>> '[EMAIL PROTECTED]'(Using password: YES)
>>
>> This is rather confusing to me, as I'm pretty sure
>> that I had used the same password to pass through this
>> particular 'door' yesterday.
>>
>> Really the password that I'm using is exactly the same
>> one I had assigned to my root few days ago after
>> installing MySQL, PHP and APACHE successfuly.
>>
>> Has anyone tackled or know how to tackle this problem?
>> I'd appreciate your help
>>
>> Thanks
>>
>> Ike
>>
>>
>> __
>> Do you Yahoo!?
>> Free Pop-Up Blocker - Get it now
>> http://companion.yahoo.com/
>>
>> --
>> 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] tar and ownership

2003-11-21 Thread Nigel Jones
it's part of Tar (see: tar --help)

I'm sure there are restrictions to Non-Root users (I don't think many *nix
developers are stupid enough to let open that sort of bug

>> -Original Message-
>> From: Wouter van Vliet [mailto:[EMAIL PROTECTED]
>> Sent: Saturday, November 22, 2003 8:53 AM
>> To: 'Nigel Jones'; 'Rodney Green'
>> Cc: [EMAIL PROTECTED]
>> Subject: RE: [PHP] tar and ownership
>>
>>
>> Nigel Jones wrote:
>> > I think if you are using the Unix Tar Version you can do tar
>> > -C /scripts/ -zxv -f  ./scripts/mailfiles.tar.gz
>> > --owner=REPLACEME --group=REPLACEME
>> >
>>
>> I sure hope this is NOT possible, since it would be a major security
>> problem. Think for example in terms of the php safe_mode. When you'd do
>> this, you would be able to create files as any user thinkable,
>> and thus well
>> .. Need I go any further.
>>
>> Knowing that 'chown' only lets you change the 'group' part of
>> the ownership
>> to a group you actually belong to FROM files that are owned by
>> yourself and
>> I think even the group part has to mach too.
>>
>>

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



RE: [PHP] FW: [ERR] RE: [PHP] tar and ownership

2003-11-21 Thread Nigel Jones
I second that it's annoying

CC'ed to List Owner :P

>> -Original Message-
>> From: Wouter van Vliet [mailto:[EMAIL PROTECTED]
>> Sent: Saturday, November 22, 2003 7:57 AM
>> To: 'PHP General list'
>> Subject: [PHP] FW: [ERR] RE: [PHP] tar and ownership
>> 
>> 
>> [EMAIL PROTECTED] wrote:
>> > Transmit Report:
>> > 
>> >  To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED])
>> 
>> Is someone able to unsubscribe [EMAIL PROTECTED] .. I'm getting 
>> annoyed by
>> all those "User inbox full" replies.
>> 

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



RE: [PHP] tar and ownership

2003-11-21 Thread Nigel Jones
I think if you are using the Unix Tar Version you can do
tar -C /scripts/ -zxv -f
 ./scripts/mailfiles.tar.gz --owner=REPLACEME --group=REPLACEME

>> -Original Message-
>> From: Wouter van Vliet [mailto:[EMAIL PROTECTED]
>> Sent: Saturday, November 22, 2003 7:42 AM
>> To: 'Rodney Green'; [EMAIL PROTECTED]
>> Subject: RE: [PHP] tar and ownership
>>
>>
>> Rodney Green wrote:
>> > Marek Kilimajer wrote:
>> >
>> >> Rodney Green wrote:
>> >>
>> >>> Greetings!
>> >>>
>> >>> I'm writing a script that downloads a tarball from an FTP server and
>> >>> unpacks it into a directory. Here's the line of code that does this.
>> >>>
>> >>> exec("tar -C /scripts/ -zxv --preserve-permissions -f " .
>> >>> "/scripts/mailfiles.tar.gz") or die('Tar failed!');
>> >>>
>> >>> My problem is that the files' ownership is changed when the tarball
>> >>> is unpacked. I'm executing the script from a web browser and Apache
>> >>> is running as the user "apache" so the files are unpacked and
>> >>> ownership given to the user apache. How can I make it so the files
>> >>> will keep the original ownerships? This is important because the
>> >>> files are mail files and the script is used to restore the mail
>> >>> files from backup so the users can access them.
>> >>
>> >>
>> >> Only root can change file ownership.
>> >>
>> > Thanks for replying. Any suggestions on how to do this then?
>> >
>> > Rod
>>
>> Multiple solutions, some better, easier, faster or securer than others
>>
>>  - Make a 'cron' script, executing as root, which handles ownerships.
>>  - Make a 'cron' script, executing as your own user, that extracts
>> the tarball
>>  - Use the suexec wrapper, to change the using user of your virtual
>> host
>>  - Run Apache as another user
>>  - Make the users member of group 'apache', and give g+r file
>> permissions (group gets read)
>>
>> With some inspiration you can probably come up with a few more, just as I
>> could if I wanted too ;P
>>
>> Good luck!
>>
>> --
>> 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] encyption using sha1?

2003-11-21 Thread Nigel Jones
Last Message Messed Up So here goes again...

$hashed_string = sha1{$string); is correct except use $hashed_string =
sha1($string); - watch out for Curly Brackets they give you those annoying
Phase Errors


Resource: http://nz2.php.net/manual/en/function.sha1.php

-Original Message-
From: Erin [mailto:[EMAIL PROTECTED]
Sent: Friday, November 21, 2003 10:34 PM
To: [EMAIL PROTECTED]
Subject: [PHP] encyption using sha1?


Hi all,
I need some help with storing passwords does anyone have any thoughts on
sha1()?

Any other ideas are welcome.

Am i right in thinking that to use sha1 ya do this:

$hashed_string = sha1{$string);


R

--
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