php-general Digest 14 Jan 2009 15:27:52 -0000 Issue 5901

Topics (messages 286293 through 286314):

Re: Suggestions?
        286293 by: Phpster

Re: PHP, Smarty, and Text
        286294 by: Phpster
        286299 by: Daniel Kolbo
        286301 by: Robert Cummings
        286310 by: Phpster

php.ini
        286295 by: gishaust
        286303 by: Thodoris
        286305 by: Stuart

Re: php session GC error
        286296 by: Chris

Re: RewriteRules
        286297 by: Eric Butera

problem using crypt() without a salt
        286298 by: port23user
        286304 by: Thodoris
        286307 by: port23user

Re: Holy crap
        286300 by: Robert Cummings

Re: iconv is messing up a spreadsheet generated by the Spreadsheet Excel Writer
        286302 by: Thodoris
        286308 by: Nisse Engström
        286309 by: Thodoris

Re: Can I make EasyPHP on Windows allow remote connections?
        286306 by: clive

ArrayObject - Posibillity to add key => value pair per default?
        286311 by: Edmund Hertle
        286313 by: Edgar da Silva (Fly2k)
        286314 by: Nathan Nobbe

Re: PHP unlink Permission Error
        286312 by: Alice Wei

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message --- I have a fiscal calendar table that I use for the same thing, storing the date, day of the week and a column indicating whether the day is a weekday, a weekend or a holiday. This allows me flexibility to also use the table to set business shutdowns as a holiday.

A simple date query can return the number of holidays/weekends to do the business day calculation.

Bastien

Sent from my iPod

On Jan 13, 2009, at 2:28 PM, "Dan Shirah" <mrsqua...@gmail.com> wrote:

On Tue, Jan 13, 2009 at 2:14 PM, <c...@l-i-e.com> wrote:


Hard to say without knowing the data structures...

You can't do a simple count of the holidays and add that, because you might
end up with yet another holiday in the result.

Start at 12/23 and want to add 6 business days.

You find 1 holiday in between, so you add 7 business days and end up on New
Year's Day, a non-business day.

12/23
12/24
12/25 X
12/26
12/27
12/28
12/29
12/30
12/31
01/01 X

I think MySQL has built-in holiday / work day calculations, come to think
of it...

Exactly, ceo!

That's why I'm thinking of creating the array and then running a foreach()
loop on the array.

$day = date("w");

$today = date("m-d-Y");

if ($day == 4 || $day == 5) {
$two_day = mktime(0, 0, 0, date("m"), date("d")+4, date("Y"));
$two_day = date("m-d-Y", $two_day);
} else {
$two_day = mktime(0, 0, 0, date("m"), date("d")+2, date("Y"));
$two_day = date("m-d-Y", $two_day);
}

foreach ($holiday as $h) {
 if ($h >= $today && $h <= $two_day) {
$two_day = mktime(0, 0, 0, date("m", $two_day), date("d", $two_day)+1,
date("Y", $two_day));
   $two_day = date("m-d-Y", $two_day);
 }
}

That should add a day for each instance of a holiday that falls between the
dates, right?

--- End Message ---
--- Begin Message --- What about stripping out all the 'nuances' and just reducing it to just the text where you then control the display and using your templates and css?

Bastien

Sent from my iPod

On Jan 13, 2009, at 9:49 PM, Daniel Kolbo <kolb0...@umn.edu> wrote:

Hello,

I've been using PHP and Smarty for several years now and I am happy with this "division" of data from presentation. With this philosophy in mind, i am a bit perplexed as to how to handle the text on my sites. That is, the text is data, so i am motivated to store the text in a database, files, or the like, but then text is loaded with little markup nuances (random italics/weight/colors, etc...) that make template design rather ugly. This motivates me to put markup (maybe even my own brand of markup) around the text, and to store this markup-text combination in a database. But I don't like this either, because a lot of the people writing the content/ text know word/writer not markup. So i am motivated to have them save their text as .html, and I parse this file and modify accordingly. However, i don't like this either as not all word/ writer styles are 1-to-1 with CSS. Without any options I am back to thinking "hard code" the text with markup in included templates, but it hurts just thinking of updating/modifying.

I have looked (briefly) at Web Content Management Systems, but this seems like overkill really, maybe i'm ignorant.

What would the community suggest? The text can take on many forms, introduction text, about text, product information, articles, blurbs, (some changes daily, some doesn't) etc...where does all this text live in 'properly' designed site.

Thanks in advance,
dK


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


Phpster wrote:
What about stripping out all the 'nuances' and just reducing it to just the text where you then control the display and using your templates and css?

Bastien

Sent from my iPod

On Jan 13, 2009, at 9:49 PM, Daniel Kolbo <kolb0...@umn.edu> wrote:

Hello,

I've been using PHP and Smarty for several years now and I am happy with this "division" of data from presentation. With this philosophy in mind, i am a bit perplexed as to how to handle the text on my sites. That is, the text is data, so i am motivated to store the text in a database, files, or the like, but then text is loaded with little markup nuances (random italics/weight/colors, etc...) that make template design rather ugly. This motivates me to put markup (maybe even my own brand of markup) around the text, and to store this markup-text combination in a database. But I don't like this either, because a lot of the people writing the content/text know word/writer not markup. So i am motivated to have them save their text as .html, and I parse this file and modify accordingly. However, i don't like this either as not all word/writer styles are 1-to-1 with CSS. Without any options I am back to thinking "hard code" the text with markup in included templates, but it hurts just thinking of updating/modifying.

I have looked (briefly) at Web Content Management Systems, but this seems like overkill really, maybe i'm ignorant.

What would the community suggest? The text can take on many forms, introduction text, about text, product information, articles, blurbs, (some changes daily, some doesn't) etc...where does all this text live in 'properly' designed site.

Thanks in advance,
dK

Hello Bastien,
The difficulty with implementing your suggestions is that say in a paragraph of text that has random bold or italics (etc...) (as determined by the one drafting the text), how would i recover these bold/italics if i remove them?
dK

--- End Message ---
--- Begin Message ---
On Tue, 2009-01-13 at 18:18 -1000, Daniel Kolbo wrote:
> 
> Phpster wrote:
> > What about stripping out all the 'nuances' and just reducing it to 
> > just the text where you then control the display and using your 
> > templates and css?
> >
> > Bastien
> >
> > Sent from my iPod
> >
> > On Jan 13, 2009, at 9:49 PM, Daniel Kolbo <kolb0...@umn.edu> wrote:
> >
> >> Hello,
> >>
> >> I've been using PHP and Smarty for several years now and I am happy 
> >> with this "division" of data from presentation.  With this philosophy 
> >> in mind, i am a bit perplexed as to how to handle the text on my 
> >> sites.  That is, the text is data, so i am motivated to store the 
> >> text in a database, files, or the like, but then text is loaded with 
> >> little markup nuances (random italics/weight/colors, etc...) that 
> >> make template design rather ugly.  This motivates me to put markup 
> >> (maybe even my own brand of markup) around the text, and to store 
> >> this markup-text combination in a database.  But I don't like this 
> >> either, because a lot of the people writing the content/text know 
> >> word/writer not markup.  So i am motivated to have them save their 
> >> text as .html, and I parse this file and modify accordingly.  
> >> However, i don't like this either as not all word/writer styles are 
> >> 1-to-1 with CSS.  Without any options I am back to thinking "hard 
> >> code" the text with markup in included templates, but it hurts just 
> >> thinking of updating/modifying.
> >>
> >> I have looked (briefly) at Web Content Management Systems, but this 
> >> seems like overkill really, maybe i'm ignorant.
> >>
> >> What would the community suggest? The text can take on many forms, 
> >> introduction text, about text, product information, articles, blurbs, 
> >> (some changes daily, some doesn't) etc...where does all this text 
> >> live in 'properly' designed site.
> >>
> >> Thanks in advance,
> >> dK
> >>
> Hello Bastien,
> The difficulty with implementing your suggestions is that say in a 
> paragraph of text that has random bold or italics (etc...) (as 
> determined by the one drafting the text), how would i recover these 
> bold/italics if i remove them?

Strip all tags except bold and italics. Then replace <b> with <strong>
and <i> with <em> since the former tags are deprecated. If semantic
meaning is not intended by <b> and <i> then replace with <span
class="bold"> and <span class="italic"> and create those CSS styles.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


--- End Message ---
--- Begin Message --- Only allow a few markup tags, strip_tags() allows a limited lIst to be kept


Bastien

Sent from my iPod

On Jan 13, 2009, at 11:18 PM, Daniel Kolbo <kolb0...@umn.edu> wrote:



Phpster wrote:

What about stripping out all the 'nuances' and just reducing it to just the text where you then control the display and using your templates and css?

Bastien

Sent from my iPod

On Jan 13, 2009, at 9:49 PM, Daniel Kolbo <kolb0...@umn.edu> wrote:

Hello,

I've been using PHP and Smarty for several years now and I am happy with this "division" of data from presentation. With this philosophy in mind, i am a bit perplexed as to how to handle the text on my sites. That is, the text is data, so i am motivated to store the text in a database, files, or the like, but then text is loaded with little markup nuances (random italics/weight/colors, etc...) that make template design rather ugly. This motivates me to put markup (maybe even my own brand of markup) around the text, and to store this markup-text combination in a database. But I don't like this either, because a lot of the people writing the content/text know word/writer not markup. So i am motivated to have them save their text as .html, and I parse this file and modify accordingly. However, i don't like this either as not all word/writer styles are 1-to-1 with CSS. Without any options I am back to thinking "hard code" the text with markup in included templates, but it hurts just thinking of updating/modifying.

I have looked (briefly) at Web Content Management Systems, but this seems like overkill really, maybe i'm ignorant.

What would the community suggest? The text can take on many forms, introduction text, about text, product information, articles, blurbs, (some changes daily, some doesn't) etc...where does all this text live in 'properly' designed site.

Thanks in advance,
dK


Hello Bastien,
The difficulty with implementing your suggestions is that say in a paragraph of text that has random bold or italics (etc...) (as determined by the one drafting the text), how would i recover these bold/italics if i remove them?
dK

--- End Message ---
--- Begin Message ---
hi php lovers,

I have a debian lamp stack and I want to use php to send a form to my email server that is on the same network. Someone suggested to me why don't i use php.ini mail function.
But it says in the php.ini file for  win 32 only.

Does anyone know how I can get php to direct my forms request across the network
to  the email server?

gishaust

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

hi php lovers,

I have a debian lamp stack and I want to use php to send a form to my email server

Do you mean that you need to send a mail directly from a web form?

If that is the case check this out:

http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_form_mail

Doesn't even need php.

that is on the same network. Someone suggested to me why don't i use php.ini mail function.
But it says in the php.ini file for  win 32 only.

What did you find in php.ini that works only for windowz?


Does anyone know how I can get php to direct my forms request across the network
to  the email server?

I am not sure what you mean by that...


gishaust


--
Thodoris


--- End Message ---
--- Begin Message ---
2009/1/14 Thodoris <t...@kinetix.gr>:
>
>> hi php lovers,
>>
>> I have a debian lamp stack and I want to use php to send a form to my
>> email server
>
> Do you mean that you need to send a mail directly from a web form?
>
> If that is the case check this out:
>
> http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_form_mail
>
> Doesn't even need php.

But it does require the user to have an email client set up which is
not necessarily the case.

>> that is on the same network. Someone suggested to me why don't i use
>> php.ini mail function.
>> But it says in the php.ini file for  win 32 only.
>
> What did you find in php.ini that works only for windowz?

The SMTP host only works on Windows.

>> Does anyone know how I  can get php to direct my forms request across the
>> network
>> to  the email server?
>
> I am not sure what you mean by that...

They mean not using sendmail but instead talking SMTP with a remote mail server.

I believe PHPMailer supports this - check it out...
http://phpmailer.codeworxtech.com/

-Stuart

-- 
http://stut.net/

--- End Message ---
--- Begin Message ---
Frank Stanovcak wrote:
I'm trying to make sure that my sessions are timed out by my server.
I'm running it on winxp, and my php.ini contains the following

session.gc_probability = 1
session.gc_divisor     = 1

; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 30

I am now getting this error

PHP Notice: session_start() [function.session-start]: ps_files_cleanup_dir: opendir(C:\WINDOWS\TEMP\) failed: No such file or directory (2) in C:\Inetpub\wwwroot\Envelope1\edit\EditMain.php on line 2

Point session_save_path to a proper location.

--
Postgresql & php tutorials
http://www.designmagick.com/


--- End Message ---
--- Begin Message ---
On Tue, Jan 13, 2009 at 5:27 PM, Ashley Sheridan
<a...@ashleysheridan.co.uk> wrote:
> On Tue, 2009-01-13 at 13:29 -0500, Eric Butera wrote:
>> On Tue, Jan 13, 2009 at 1:14 PM, Jason Pruim <japr...@raoset.com> wrote:
>> >
>> > On Jan 13, 2009, at 9:46 AM, Ashley Sheridan wrote:
>> >
>> >> On Tue, 2009-01-13 at 09:33 -0500, tedd wrote:
>> >>>
>> >>> At 2:33 PM +0000 1/13/09, Ashley Sheridan wrote:
>> >>>>
>> >>>> On Tue, 2009-01-13 at 09:20 -0500, tedd wrote:
>> >>>>>
>> >>>>>  Jason:
>> >>>>>
>> >>>>>  In addition to what everyone else has said, try this:
>> >>>>>
>> >>>>>  $self = basename($_SERVER['SCRIPT_NAME'])
>> >>>>>
>> >>>>>  I use it for forms -- you might find it useful.
>> >>>>>
>> >>>>>  Cheers,
>> >>>>>
>> >>>>>  tedd
>> >>>>>  --
>> >>>>>  -------
>> >>>>>  http://sperling.com  http://ancientstones.com  http://earthstones.com
>> >>>>>
>> >>>> No need to use it on forms, as leaving the action attribute empty means
>> >>>> the form sends to itself anyway.
>> >>>>
>> >>>> Ash
>> >>>
>> >>>
>> >>> Ash:
>> >>>
>> >>> That's what I've said for years, but (I think it was on this list,
>> >>> but too lazy to look) there was a concern that some browsers may not
>> >>> follow that default behavior.
>> >>>
>> >>> However, using what I provided will work regardless.
>> >>>
>> >>> Cheers,
>> >>>
>> >>> tedd
>> >>>
>> >>> --
>> >>> -------
>> >>> http://sperling.com  http://ancientstones.com  http://earthstones.com
>> >>>
>> >> I've not yet seen a browser that doesn't do this, and it's pretty old
>> >> HTML really, so I don't see a reason why any new browsers wouldn't
>> >> incorporate it.
>> >
>> > I prefer to be specific in my programming :)
>> >
>> > What I typically do with self submitting forms is:
>> > <?PHP
>> > $self = $_SERVER['PHP_SELF'];
>> >
>> >
>> > echo <<<HTML
>> >        <form method="post" action="{$self}">
>> > ...
>> >
>> > </form>
>> > HTML;
>> > ?>
>> >
>> > But to each his (Or her) own right?
>> >
>> >
>> > --
>> > Jason Pruim
>> > japr...@raoset.com
>> > 616.399.2355
>> >
>> >
>> >
>> >
>>
>> You know that's asking for xss, right?
> How would you go about XSS on this? As I see it, you'd need
> register_globals on for that to work.
>
>
> Ash
> www.ashleysheridan.co.uk
>
>

Read the examples in the link I provided.

--- End Message ---
--- Begin Message ---
I have a problem with using crypt(), passing only one parameter (ie, no
salt).  When I do that, I get an empty string.  When I do use a salt, it
returns the expected value.  Does anybody have any ideas what might be
causing my problem?  It only happens when I run it on my linux server, but
not when I run it on my Windows dev machine.  Thanks in advance.
-- 
View this message in context: 
http://www.nabble.com/problem-using-crypt%28%29-without-a-salt-tp21449541p21449541.html
Sent from the PHP - General mailing list archive at Nabble.com.


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

I have a problem with using crypt(), passing only one parameter (ie, no
salt).  When I do that, I get an empty string.  When I do use a salt, it
returns the expected value.  Does anybody have any ideas what might be
causing my problem?  It only happens when I run it on my linux server, but
not when I run it on my Windows dev machine.  Thanks in advance.

I am not sure what exactly is the problem. But check this from the manual:

If no salt is provided, PHP will auto-generate a standard two character salt by default, unless the default encryption type on the system is MD5, in which case a random MD5-compatible salt is generated.

http://gr2.php.net/manual/en/function.crypt.php

Perhaps your PHP compilation or the package are broken.

--
Thodoris


--- End Message ---
--- Begin Message ---
I figured out that I was running an older version of Suhosin.  Apparently
this bug is fixed in Suhosin version 0.9.23 .  I upgraded and everything
works great now.  Thanks for the help.

Thodoris wrote:
> 
> 
> If no salt is provided, PHP will auto-generate a standard two character 
> salt by default, unless the default encryption type on the system is 
> MD5, in which case a random MD5-compatible salt is generated.
> 
> http://gr2.php.net/manual/en/function.crypt.php
> 
> Perhaps your PHP compilation or the package are broken.
> 
> -- 
> Thodoris
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/problem-using-crypt%28%29-without-a-salt-tp21449541p21453524.html
Sent from the PHP - General mailing list archive at Nabble.com.


--- End Message ---
--- Begin Message ---
On Tue, 2009-01-13 at 20:49 -0500, Daniel Brown wrote:
> On Tue, Jan 13, 2009 at 20:34, Kyle Terry <k...@kyleterry.com> wrote:
> >
> > www.idonttrustmicrosoftwithmywebsite.com/ps/i/hate/them/
> 
>     Couldn't reach the site.  Try restarting IIS.

I think it's a beta^H^H^H^Hweb 2.0 site.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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

On Tue, 13 Jan 2009 15:51:01 +0200, Thodoris wrote:

Hi gang,
I am generating a spreadsheet using the contents of a mysql table. I guess that there is something in the data that causes iconv used in the module's script to generate this error:

*Notice*: iconv() [function.iconv <file:///C:/Documents%20and%20Settings/tgol/Local%20Settings/Temp/function.iconv>]: Detected an incomplete multibyte character in input string in */usr/local/share/pear/Spreadsheet/Excel/Writer/Worksheet.php* on line *1547*

This causes the production of weird characters in a cell in the spreadsheet and after that cell everything is printed out of order.

The data in the mysql table are filtered for non-printable character before the data import.

What data goes into that cell?

I am selecting from a mysql table where only text and numeric data exist.

Can you provide a hex dump of the data?

I am no sure how to do that in that case :-( .

How do you filter the data?

The data are being filtered by stripping all the non-printable characters and by form validation using regxp.

How do you write it to the worksheet?

Using the pear extension Spreadsheet_Excel_Wrtiter.

What character encoding did you set?

UTF-8


/Nisse


--
Thodoris


--- End Message ---
--- Begin Message ---
On Wed, 14 Jan 2009 11:33:25 +0200, Thodoris wrote:

>> On Tue, 13 Jan 2009 15:51:01 +0200, Thodoris wrote:
>>
>>   
>>> Hi gang,
>>>     I am generating a spreadsheet using the contents of a mysql table. I 
>>> guess that there is something in the data that causes iconv used in the 
>>> module's script to generate this error:
>>>
>>> *Notice*: iconv() [function.iconv 
>>> <file:///C:/Documents%20and%20Settings/tgol/Local%20Settings/Temp/function.iconv>]:
>>>  
>>> Detected an incomplete multibyte character in input string in 
>>> */usr/local/share/pear/Spreadsheet/Excel/Writer/Worksheet.php* on line 
>>> *1547*
>>>
>>> This causes the production of weird characters in a cell in the 
>>> spreadsheet and after that cell everything is printed out of order.
>>>
>>> The data in the mysql table are filtered for non-printable character 
>>> before the data import.
>>>     
>>
>> What data goes into that cell?
>>   
> 
> I am selecting from a mysql table where only text and numeric data exist.
> 
>> Can you provide a hex dump of the data?
>>   
> 
> I am no sure how to do that in that case :-( .
> 

<?php echo bin2hex ($theData), "\n"; ?>

What's the output of:

  SHOW VARIABLES LIKE 'character_set%'

What's the character set of the column you get the data from?


/Nisse

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



<?php echo bin2hex ($theData), "\n"; ?>

What's the output of:

  SHOW VARIABLES LIKE 'character_set%'

Variable_name   Value
character_set_client    utf8
character_set_connection        utf8
character_set_database  latin1
character_set_filesystem        binary
character_set_results   utf8
character_set_server    latin1
character_set_system    utf8



What's the character set of the column you get the data from?

The charset: latin1 and the collation: latin1_swedish_ci.

/Nisse


--
Thodoris


--- End Message ---
--- Begin Message ---
Rahul wrote:
I have EasyPHP installed on my Windows system and can connect to the php+mysql using localhost in the browser but I was wondering if I can connect to this computer (which is at my office) from my home. I have a web address alloted to my computer at office.


If that 'web address' is a public ip address or uri then it should not be a problem, otherwise your going to need to configure the internet gateway at work to route http (or any other port you choose) to your desktop at work, this is not a php question by the way, best to brush up on your network knowledge.


--- End Message ---
--- Begin Message ---
Hey,
I've just discovered the ArrayObject class, but it seems to not be well
documented, so here is my problem:

You can use ArrayObject::append() to add a new value to the array, but is
there also a method to add a new key and value?

And I know that I could extend the class and write my own method but isn't
this quite a base method for arrays in php? So maybe I just missed a obvious
point?

Quick example:

Without ArrayObject:
1. $array[] = $value
2. $array[$key] = $value

With ArrayObject:
1. $arrayObject->append($value)
2. ???

-eddy

--- End Message ---
--- Begin Message ---
Did you try:

$a = new ArrayObject;
$a['sometest'] = 'somevalue';

?

On Wed, Jan 14, 2009 at 10:42 AM, Edmund Hertle <farn...@googlemail.com> wrote:
> Hey,
> I've just discovered the ArrayObject class, but it seems to not be well
> documented, so here is my problem:
>
> You can use ArrayObject::append() to add a new value to the array, but is
> there also a method to add a new key and value?
>
> And I know that I could extend the class and write my own method but isn't
> this quite a base method for arrays in php? So maybe I just missed a obvious
> point?
>
> Quick example:
>
> Without ArrayObject:
> 1. $array[] = $value
> 2. $array[$key] = $value
>
> With ArrayObject:
> 1. $arrayObject->append($value)
> 2. ???
>
> -eddy
>



-- 
Abraços
Edgar Ferreira da Silva
Engenheiro de Software
Campinas - SP
(19) 8110-0733
http://edgarfs.com.br
-----
Aprenda PHP, cole códigos, saiba das vagas de empregos:
http://www.manjaphp.com.br

--- End Message ---
--- Begin Message ---
On Wed, Jan 14, 2009 at 6:18 AM, Edgar da Silva (Fly2k) <
silva.ed...@gmail.com> wrote:

> Did you try:
>
> $a = new ArrayObject;
> $a['sometest'] = 'somevalue';
>

its also worth pointing out, the above syntax is available b/c ArrayObject
implements the ArrayAccess interface.

http://www.php.net/~helly/php/ext/spl/interfaceArrayAccess.html

-nathan

--- End Message ---
--- Begin Message ---
> Subject: RE: [PHP] PHP unlink Permission Error> From: 
> a...@ashleysheridan.co.uk> To: aj...@alumni.iu.edu> CC: 
> php-gene...@lists.php.net> Date: Tue, 13 Jan 2009 17:07:34 +0000> > On Tue, 
> 2009-01-13 at 11:49 -0500, Alice Wei wrote:> > > > > > > > > Subject: RE: 
> [PHP] PHP unlink Permission Error> > > From: a...@ashleysheridan.co.uk> > > 
> To: aj...@alumni.iu.edu> > > CC: php-gene...@lists.php.net> > > Date: Tue, 13 
> Jan 2009 16:50:31 +0000> > > > > > On Tue, 2009-01-13 at 11:33 -0500, Alice 
> Wei wrote:> > > > Hi, Ashley:> > > > > > > > Sorry. To answer the question 
> from your previous entry, it looks> > > > like that my permission could be 
> set and changed for the folder,> > but> > > > when I do it on the "file", I 
> only get 0666. I have the latest> > code on> > > > another entry. > > > > > > 
> > > Thanks a lot for your help.> > > > > > > > Alice> > > > > > > > > > > > > 
> > > > > > > > Alice Wei> > > > > > > > Indiana University, Master of 
> Information Science> > > > > > > > Application Programmer > > > > ProCure 
> Treatment Centers, Inc.> > > > 420 N. Walnut St.> > > > Bloomington, IN 
> 47404> > > > > > > > 812-330-6644 (office)> > > > 812-219-5708 (mobile)> > > 
> > > > > > alice....@procurecenters.com(email)> > > > 
> http://www.procurecenters.com/index.php (web) > > > > > > > > > > > > > > > > 
> > > > > > > > > > > > >> > 
> ______________________________________________________________________> > > > 
> Subject: RE: [PHP] PHP unlink Permission Error> > > > From: 
> a...@ashleysheridan.co.uk> > > > To: aj...@alumni.iu.edu> > > > CC: 
> php-gene...@lists.php.net> > > > Date: Tue, 13 Jan 2009 16:36:36 +0000> > > > 
> > > > > <snip/>> > > > > > > > No, we tend to bottom-post on this list. It's 
> just how we roll...> > > > > > > > > > > > Ash> > > > 
> www.ashleysheridan.co.uk > > > > > > > > > > > >> > 
> ______________________________________________________________________> > > > 
> Check the weather nationwide with MSN Search Try it now!> > > > > > The user 
> that your web server is running under (I'm guessing apache> > of> > > wwwrun) 
> , does this have permission to write to the file. If not, it> > > won't be 
> able to set the permissions for it. You may need to exec> > out a> > > sudo 
> command to do it, but I wouldn't recommend this.> > > > > > If you need PHP 
> to be able to delete the file, what put it there in> > the> > > first place?> 
> > > > > > > > > Ash> > > www.ashleysheridan.co.uk> > > > > > > What I am 
> trying to do here is that a user would be pushing a button> > so that the 
> data entries would generate an outfile. The only issue is> > that the lines 
> would be appended in the file, (I have no issues with> > this part writing to 
> the file, no permission errors, etc). Therefore,> > before the outfile is 
> generated, I need to have the prexisting outfile> > removed and recreated to 
> be written to so that it always stays a new> > file for use. > > > > This is 
> why this script as you have seen is as it is so that I can> > constantly 
> check if the file exists, and generate a new file if there> > is. > > In this 
> case, is there something I could do?> > > > > > Thanks in advance.> > > > 
> Alice> > > > > > > > > > 
> ______________________________________________________________________> > 
> All-in-one security and maintenance for your PC. Get a free 90-day> > trial! 
> Learn more!> > If your script is writing to the file, and the directory has 
> 777> permissions, then there should be no trouble deleting the file. If> 
> that's still a problem, why not each time the file needs to be created> anew, 
> open the file with a w flag, which will open it for writing, and> will try to 
> create the file if it doesn't already exist, so you wouldn't> ever need to 
> delete it at all.> > > Ash> www.ashleysheridan.co.uk> Hi, 
 
  It is weird, because what is on my code for appending and writing looks like 
this:
 
$myFile = "testFile.txt";
$fh = fopen($myFile, 'a');
fwrite($fh, $hello); 
fwrite($fh, "\r\n"); 
fclose($fh); 
 
The file itself gets executed continuously based on the number I have on the 
loop. 
And, my file for creating the file, I have shortened it to only 2 lines:
 
$handle = fopen("testFile.txt", "w");
fclose($handle);
 
What is interesting is that the files seem to be working, but the file keeps on 
getting appended rather than recreated when the my code to "w" the file get 
executed. I am using this with Actionscript, which calls the first function to 
open and write the file (or clean up the file), and then do whatever is needed 
in the second function to append the text to the file. 
 
Am I doing anything wrong here?
 
Thanks in advance.
_________________________________________________________________
Use Messenger to talk to your IM friends, even those on Yahoo!
http://ideas.live.com/programpage.aspx?versionId=7adb59de-a857-45ba-81cc-685ee3e858fe

--- End Message ---

Reply via email to