|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 6 Jan 2007 11:52:15 -0000 Issue 4554
php-general-digest-help
lists.php.net
Date: Sat Jan 06 2007 - 05:52:15 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 6 Jan 2007 11:52:15 -0000 Issue 4554
Topics (messages 246639 through 246677):
Posix Shared Memory Support?
246639 by: David George
246642 by: Jochem Maas
246643 by: David George
246646 by: Jochem Maas
246652 by: Richard Lynch
246662 by: David George
246665 by: Jochem Maas
Re: How to suppress error messages when using 'new mysqli(...)'
246640 by: Jochem Maas
246656 by: Richard Lynch
246657 by: Richard Lynch
246661 by: Richard Morris
Re: Re:[PHP]clases en sesiones
246641 by: Stut
246653 by: Richard Lynch
246658 by: Jochem Maas
246660 by: Stut
Problem with copy() function
246644 by: R B
246647 by: Jochem Maas
246655 by: Richard Lynch
Re: IE, Word documents and Content Types
246645 by: Richard Lynch
Re: Removing UTF-8 from text
246648 by: Richard Lynch
Re: Question regarding include() and symlinks to directories
246649 by: Richard Lynch
246650 by: Richard Lynch
Re: E_RECOVERABLE_ERROR - 5.1.6 to 5.2.0
246651 by: Roman Neuhauser
Re: is_writable() not working on PHP 5.1.6
246654 by: Jochem Maas
Re: [PHP-DEV] FastCGI optmized Windows build of 5.2.1RC2
246659 by: Andi Gutmans
Problem with displaying image
246663 by: Budi Setiawan
246664 by: Jim Lucas
246672 by: Budi Setiawan
246673 by: Jim Lucas
newbie question regarding URL parameters
246666 by: Jim the Standing Bear
246667 by: Nicholas Yim
246668 by: tg-php.gryffyndevelopment.com
246669 by: Robert Cummings
246670 by: Jim the Standing Bear
246671 by: Ryan Fielding
246677 by: Robert Cummings
php, curl and aol addressbook import problem
246674 by: Iqbal Naved
File reading code2
246675 by: Delta Storm
246676 by: Peter Lauri
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
I have an application on Linux 2.6.9 which uses posix shared memory and
I need to access the shared memory via a web page using php. Looks like
PHP only supports System V shared memory, which isn't an option for me
in this case.
Thanks,
--
David George
Hark Technologies
http://harktech.com
attached mail follows:
David George wrote:
> I have an application on Linux 2.6.9 which uses posix shared memory and
> I need to access the shared memory via a web page using php. Looks like
> PHP only supports System V shared memory, which isn't an option for me
> in this case.
is this what your looking for?
http://php.net/manual/en/ref.shmop.php
>
> Thanks,
>
attached mail follows:
On 1/5/2007 5:41 PM, Jochem Maas wrote:
> David George wrote:
>
>> I have an application on Linux 2.6.9 which uses posix shared memory and
>> I need to access the shared memory via a web page using php. Looks like
>> PHP only supports System V shared memory, which isn't an option for me
>> in this case.
>>
>
> is this what your looking for?
>
> http://php.net/manual/en/ref.shmop.php
>
>
I thought shm and shmop were both system V? I may have misunderstood
because in PHP they are accessed with a key, whereas POSIX shm is
usually accessed via a name.
Of course I could be wrong. :-)
Thanks,
--
David George
Hark Technologies
http://harktech.com
attached mail follows:
David George wrote:
> On 1/5/2007 5:41 PM, Jochem Maas wrote:
>> David George wrote:
>>
>>> I have an application on Linux 2.6.9 which uses posix shared memory and
>>> I need to access the shared memory via a web page using php. Looks like
>>> PHP only supports System V shared memory, which isn't an option for me
>>> in this case.
>>>
>>
>> is this what your looking for?
>>
>> http://php.net/manual/en/ref.shmop.php
>>
>>
> I thought shm and shmop were both system V? I may have misunderstood
> because in PHP they are accessed with a key, whereas POSIX shm is
> usually accessed via a name.
>
> Of course I could be wrong. :-)
that goes for both of us, I was going on guess work really, based on the fact
that this page mentions System V:
http://www.php.net/manual/en/ref.sem.php
but this pages mentions only 'Unix Shared Memory':
http://php.net/manual/en/ref.shmop.php
I was kind of hoping thse 2 extensions were not actually [doing] the
exact same thing hiding behind 2 different (which seems silly)
maybe a bigger egghead can shed some real light on the matter
(including the discrepancy between key/name that you mentioned).
>
> Thanks,
>
attached mail follows:
On Fri, January 5, 2007 5:09 pm, Jochem Maas wrote:
> David George wrote:
>> On 1/5/2007 5:41 PM, Jochem Maas wrote:
>>> David George wrote:
>>>
>>>> I have an application on Linux 2.6.9 which uses posix shared
>>>> memory and
>>>> I need to access the shared memory via a web page using php.
>>>> Looks like
>>>> PHP only supports System V shared memory, which isn't an option
>>>> for me
>>>> in this case.
>>>>
>>>
>>> is this what your looking for?
>>>
>>> http://php.net/manual/en/ref.shmop.php
>>>
>>>
>> I thought shm and shmop were both system V? I may have
>> misunderstood
>> because in PHP they are accessed with a key, whereas POSIX shm is
>> usually accessed via a name.
>>
>> Of course I could be wrong. :-)
>
> that goes for both of us, I was going on guess work really, based on
> the fact
> that this page mentions System V:
>
> http://www.php.net/manual/en/ref.sem.php
>
> but this pages mentions only 'Unix Shared Memory':
>
> http://php.net/manual/en/ref.shmop.php
>
> I was kind of hoping thse 2 extensions were not actually [doing] the
> exact same thing hiding behind 2 different (which seems silly)
>
> maybe a bigger egghead can shed some real light on the matter
> (including the discrepancy between key/name that you mentioned).
The User Contributed Notes (*always* read those!) make it clear that
shmod is NOT Sys V.
It looks like it's not POSIX either, but I could be reading too much
into it...
Seems more similar to POSIX than Sys V, from my limited
experience^H^H^H^H^H^H^H^H^H^H reading. :-)
It's possible that "name" was changed to "key" just to be more
consistent with the SysV stuff as a migration.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On 1/5/2007 6:25 PM, Richard Lynch wrote:
<snip>
>
> The User Contributed Notes (*always* read those!) make it clear that
> shmod is NOT Sys V.
>
> It looks like it's not POSIX either, but I could be reading too much
> into it...
>
> Seems more similar to POSIX than Sys V, from my limited
> experience^H^H^H^H^H^H^H^H^H^H reading. :-)
>
> It's possible that "name" was changed to "key" just to be more
> consistent with the SysV stuff as a migration.
>
>
Ok, I just downloaded the source and looked at it. shmop is definitely
using the System V Shared Memory interface. The user contributed notes
say it differs from sysvshm. I take that to mean PHP's sysvshm module.
shmop uses shmget, shmctl, and shmat which are the System V shm
functions (need to use ipcs and ipcrm to manage them). Posix shared
memory uses shm_open(), mmap(), and shm_unlink().
Guess I'll take the source for shmop and make posixshm and contribute it
back to PHP. Unless someone else has already done it.
Thanks for checking into this for me. Gotta love open source, when in
doubt read the source. :-)
--
David George
Hark Technologies
http://harktech.com
attached mail follows:
David George wrote:
> On 1/5/2007 6:25 PM, Richard Lynch wrote:
>
> <snip>
>>
>> The User Contributed Notes (*always* read those!) make it clear that
>> shmod is NOT Sys V.
>>
>> It looks like it's not POSIX either, but I could be reading too much
>> into it...
>>
>> Seems more similar to POSIX than Sys V, from my limited
>> experience^H^H^H^H^H^H^H^H^H^H reading. :-)
>>
>> It's possible that "name" was changed to "key" just to be more
>> consistent with the SysV stuff as a migration.
>>
>>
> Ok, I just downloaded the source and looked at it. shmop is definitely
> using the System V Shared Memory interface. The user contributed notes
> say it differs from sysvshm. I take that to mean PHP's sysvshm module.
>
> shmop uses shmget, shmctl, and shmat which are the System V shm
> functions (need to use ipcs and ipcrm to manage them). Posix shared
> memory uses shm_open(), mmap(), and shm_unlink().
>
> Guess I'll take the source for shmop and make posixshm and contribute it
> back to PHP.
> Unless someone else has already done it.
if you didn't find it and we didn't find it then it's not out there
(in the open at least)
but to be sure check with the guys at internals
lists.php.net ;
and they might have some tips/pointers/gotchas for you.
>
> Thanks for checking into this for me. Gotta love open source, when in
> doubt read the source. :-)
>
attached mail follows:
Richard Lynch wrote:
> On Fri, January 5, 2007 12:29 pm, Richard Morris wrote:
>> I am having this problem that I hope can be worked around. I make a
>> connection to our MySQL database using the object version of mysqli.
>> If
>> access is denied because of an incorrect username or password, mysqli
>> displays an error. Is there any way to suppress the error message?
>
> To suppress a single error message in a single line you can use the
> operator in PHP:
>
>
this_code_errors_but_youll_never_see_the_error(...);
>
> To catch errors in a more general manner:
> http://php.net/set_error_handler
>
> Also, since mysqli is new-fangled, it's probably using that fancy
> try/catch/throw stuff, so you could PROBABLY wrap it in a try/catch
if that was the case his error would have mentioned something about an
uncaught exception.
as it stands I find the WARNING inappropriate - you are forced
to use an
if using this new-fangled object ALWAYS because a failed
connection may occur (it's a valid but undesired program state, no?) and you
have no way of checking this before the WARNING is spat out.
in this case, mainly because the WARNING is being generated inside an
object constructor, php/mysqli should be throwing an exception - which can be handled
in a programmatically sane way ... e.g.:
try {
$db = new mysqli('localhost', 'user', 'badpass', 'test');
} catch (DBServerException) {
echo "I'm sorry our database server seems to be sleeping"; exit;
} catch (DBNotFoundException) {
echo "I'm sorry our database seems to have been deleted by a digruntled ex-sysadmin"; exit;
} catch (DBConnectException) {
echo "I'm sorry our database doesn't like the look of you - your not coming in"; exit;
}
(and I seen/heard php devs state multiple times that failed object
constructors should throw exceptions on failure - actually there not much else
you can do given that return values are invalid from within the context
of an object constructor)
sidenote: where exactly do you put the
to suppress the error in this line?:
$db = new mysqli('localhost', 'user', 'badpass', 'test');
> block and that will somehow magically suppress the error message,
> maybe... I really don't know (or want to know) much about this, but
> you're welcome to research it and find out.
>
attached mail follows:
On Fri, January 5, 2007 4:35 pm, Jochem Maas wrote:
> sidenote: where exactly do you put the
to suppress the error in this
> line?:
>
> $db = new mysqli('localhost', 'user', 'badpass', 'test');
Since it is the 'new' operator which is issuing the WARNING, as far as
I can tell, you should put it in like this:
$db =
new mysqli(...);
It's POSSIBLE to put
in front like this:
$db = new mysqli(...);
when the assignment itself issues the error, such as:
list($x, $y, $z) = each(array(1, 2));
//note the lack of a third element to assign to $z
But it seems excessive here to need it in front of $db...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Fri, January 5, 2007 4:35 pm, Jochem Maas wrote:
> Richard Lynch wrote:
>> On Fri, January 5, 2007 12:29 pm, Richard Morris wrote:
>>> I am having this problem that I hope can be worked around. I make
>>> a
>>> connection to our MySQL database using the object version of
>>> mysqli.
>>> If
>>> access is denied because of an incorrect username or password,
>>> mysqli
>>> displays an error. Is there any way to suppress the error message?
>>
>> To suppress a single error message in a single line you can use the
>>
>> operator in PHP:
>>
>>
this_code_errors_but_youll_never_see_the_error(...);
>>
>> To catch errors in a more general manner:
>> http://php.net/set_error_handler
>>
>> Also, since mysqli is new-fangled, it's probably using that fancy
>> try/catch/throw stuff, so you could PROBABLY wrap it in a try/catch
>
> if that was the case his error would have mentioned something about an
> uncaught exception.
With all the __toString and SPL array/object mumbo-jumbo going on, I
never know what's going on anymore with these things...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Richard Lynch wrote:
> On Fri, January 5, 2007 4:35 pm, Jochem Maas wrote:
>
>> Richard Lynch wrote:
>>
>>> On Fri, January 5, 2007 12:29 pm, Richard Morris wrote:
>>>
>>>> I am having this problem that I hope can be worked around. I make
>>>> a
>>>> connection to our MySQL database using the object version of
>>>> mysqli.
>>>> If
>>>> access is denied because of an incorrect username or password,
>>>> mysqli
>>>> displays an error. Is there any way to suppress the error message?
>>>>
>>> To suppress a single error message in a single line you can use the
>>>
>>> operator in PHP:
>>>
>>>
this_code_errors_but_youll_never_see_the_error(...);
>>>
>>> To catch errors in a more general manner:
>>> http://php.net/set_error_handler
>>>
>>> Also, since mysqli is new-fangled, it's probably using that fancy
>>> try/catch/throw stuff, so you could PROBABLY wrap it in a try/catch
>>>
>> if that was the case his error would have mentioned something about an
>> uncaught exception.
>>
>
> With all the __toString and SPL array/object mumbo-jumbo going on, I
> never know what's going on anymore with these things...
>
>
I found out that new mysqli doesn't throw an exception during it's
construction. The way I figured out how to deal with it was to do this:
$db =
new mysqli('localhost', 'user', 'badpass', 'test');
With this in place no warning messages are displayed and then I can
follow it up with a check for any errors using mysqli_connect_errno().
I was a little surprised to see it not use an exception as I thought
that would be a better mechanism to know something is wrong when dealing
with objects. Either way, it was a simple fix. I just want to thank
Fernando Chure for pointing me in the right direction.
--
*Richard Morris*
Toll Free: (866) 960-3331
International: +1 250 474-6022
Fax: +1 250 474-6099
E-Mail: richard
hddbroker.com <mailto:richard
hddbroker.com>
Web Site: www.hddbroker.com <http://www.hddbroker.com>
attached mail follows:
Richard Lynch wrote:
> WILD GUESS
>
> Search on php.net for __autoload
>
> I think that will let you figure out a way to get the auto_start
> session to automatically load your .class.php files, when it needs
> them.
Nice idea, unfortunately it doesn't work that way. In order to have the
__autoload function work properly for session'd objects it needs to be
declared before the session is started. AFAIK when auto_start is on the
session is started before any PHP is evaluated. I had to shift one of my
frameworks around so that the __autoload was declared before
session_start was called.
I think Jochem may be on to something with the idea of using
auto_prepend_file but I can't say for certain whether this is done
before or after the auto_start. If it is before then you could declare
the __autoload function in the prepended file and it should work.
-Stut
attached mail follows:
On Fri, January 5, 2007 4:36 pm, Stut wrote:
> Richard Lynch wrote:
>> WILD GUESS
>>
>> Search on php.net for __autoload
>>
>> I think that will let you figure out a way to get the auto_start
>> session to automatically load your .class.php files, when it needs
>> them.
>
> Nice idea, unfortunately it doesn't work that way. In order to have
> the
> __autoload function work properly for session'd objects it needs to be
> declared before the session is started. AFAIK when auto_start is on
> the
> session is started before any PHP is evaluated. I had to shift one of
> my
> frameworks around so that the __autoload was declared before
> session_start was called.
>
> I think Jochem may be on to something with the idea of using
> auto_prepend_file but I can't say for certain whether this is done
> before or after the auto_start. If it is before then you could declare
> the __autoload function in the prepended file and it should work.
Another possibility...
Do a session_write_close() to kill of the auto_start session.
Then, using session_name() and session_id() and
session_set_cookie_params() force your OWN session control, completely
independent of the auto_start session, which you can do AFTER you have
done your include()s
This should allow you to do what you want with the fewest conceptual
changes, at the price of a bogus auto_start session being wastefully
used by your webhost -- which seems pretty brain-dead to me, but there
it is.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
Richard Lynch wrote:
> On Fri, January 5, 2007 4:36 pm, Stut wrote:
>> Richard Lynch wrote:
>>> WILD GUESS
>>>
>>> Search on php.net for __autoload
>>>
>>> I think that will let you figure out a way to get the auto_start
>>> session to automatically load your .class.php files, when it needs
>>> them.
>> Nice idea, unfortunately it doesn't work that way. In order to have
>> the
>> __autoload function work properly for session'd objects it needs to be
>> declared before the session is started. AFAIK when auto_start is on
>> the
>> session is started before any PHP is evaluated. I had to shift one of
>> my
>> frameworks around so that the __autoload was declared before
>> session_start was called.
>>
>> I think Jochem may be on to something with the idea of using
>> auto_prepend_file but I can't say for certain whether this is done
>> before or after the auto_start. If it is before then you could declare
>> the __autoload function in the prepended file and it should work.
>
> Another possibility...
>
> Do a session_write_close() to kill of the auto_start session.
>
> Then, using session_name() and session_id() and
> session_set_cookie_params() force your OWN session control, completely
> independent of the auto_start session, which you can do AFTER you have
> done your include()s
you sneaky oldskool b'std ;-)
>
> This should allow you to do what you want with the fewest conceptual
> changes, at the price of a bogus auto_start session being wastefully
> used by your webhost -- which seems pretty brain-dead to me, but there
> it is.
>
attached mail follows:
Richard Lynch wrote:
> On Fri, January 5, 2007 4:36 pm, Stut wrote:
>> Richard Lynch wrote:
>>> WILD GUESS
>>>
>>> Search on php.net for __autoload
>>>
>>> I think that will let you figure out a way to get the auto_start
>>> session to automatically load your .class.php files, when it needs
>>> them.
>> Nice idea, unfortunately it doesn't work that way. In order to have
>> the
>> __autoload function work properly for session'd objects it needs to be
>> declared before the session is started. AFAIK when auto_start is on
>> the
>> session is started before any PHP is evaluated. I had to shift one of
>> my
>> frameworks around so that the __autoload was declared before
>> session_start was called.
>>
>> I think Jochem may be on to something with the idea of using
>> auto_prepend_file but I can't say for certain whether this is done
>> before or after the auto_start. If it is before then you could declare
>> the __autoload function in the prepended file and it should work.
>
> Another possibility...
>
> Do a session_write_close() to kill of the auto_start session.
>
> Then, using session_name() and session_id() and
> session_set_cookie_params() force your OWN session control, completely
> independent of the auto_start session, which you can do AFTER you have
> done your include()s
>
> This should allow you to do what you want with the fewest conceptual
> changes, at the price of a bogus auto_start session being wastefully
> used by your webhost -- which seems pretty brain-dead to me, but there
> it is.
Evil. Pure evil.
Personally I'd rather go through the hassle of either mail-bombing my
current host until they realise how stupid they're being, or simply
switch host.
-Stut
attached mail follows:
Hi,
I'm trying to copy a file like this:
copy("home/xxx/public_html/yyy/zzz/index.php",
"home/xxx/public_html/yyy/www/index.php")
and have this error:
*Warning*: Wrong parameter count for copy() in */home/.....*
Someone can help me please?
Thanks,
attached mail follows:
R B wrote:
> Hi,
>
> I'm trying to copy a file like this:
>
> copy("home/xxx/public_html/yyy/zzz/index.php",
> "home/xxx/public_html/yyy/www/index.php")
^ -- your missing a slash (although that shouldn't be the problem)
>
> and have this error:
>
> *Warning*: Wrong parameter count for copy() in */home/.....*
is that your actual code you posted??
>
> Someone can help me please?
>
> Thanks,
>
attached mail follows:
On Fri, January 5, 2007 5:01 pm, R B wrote:
> I'm trying to copy a file like this:
>
> copy("home/xxx/public_html/yyy/zzz/index.php",
> "home/xxx/public_html/yyy/www/index.php")
>
> and have this error:
>
> *Warning*: Wrong parameter count for copy() in */home/.....*
>
> Someone can help me please?
You are probably missing a quote in your real code...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Thu, January 4, 2007 8:09 pm, Roman Neuhauser wrote:
> # jochem
iamjochem.com / 2007-01-04 23:36:44 +0100:
>> Roman Neuhauser wrote:
>> > # ceo
l-i-e.com / 2007-01-03 15:48:31 -0600:
>> >> On Wed, January 3, 2007 2:52 pm, Philip Thompson wrote:
>> >>> I have a form where a user can upload different types of
>> documents. A
>> >>> valid file type they will be able to upload is a Word Document.
>> >>> However, when I view the $_FILES 'type' of a word document in
>> Internet
>> >>> Explorer, it says it's type 'application/octet-stream' instead
>> of
>> >>> 'application/msword' or 'application/vnd.ms-word'. It works fine
>> in
>> >>> Firefox and Safari.
>> >>>
>> >>> Any ideas why IE does this and/or how I might be able to get
>> around
>> >>> this?
>> >> IE does this because MS is not interested in interoperability.
>> >
>> > Back this statements with some references, will you?
>>
>> do a quick google on anti-trust or something. there is plenty of
>> evidence
>> that Microsoft has and does continue to hamper and/or ignore
>> interoperability
>> on many fronts.
>
> Yes I know. I don't care.
>
> I was asking if he could back his statement that IE sends CT: a/o-s to
> harm interoperability. I don't care what MS did elsewhere.
It's a theory, more than fact, obviously, as I wasn't involved in the
meetings where MS engineers decided to design/code this specific bit
of IE.
Consider these facts, however:
MS has brain-dead simple .xyz -> file-type-handler Operating System.
'.doc' extensions could have been trivially mapped to
'application/msword' or 'application/vnd.ms-word'
Instead, IE falls back to a generic and content-devoid
'application/octet-stream'
I suppose we could attribute this to sheer stupidity, but I'm going
with malice as the operating factor.
> I'm simply
> fed up with his bashing MS for artificial reasons (like his foaming
> over
> the allegedly MS-originated Content-Disposition header).
The "Content-Disposition" header was originated in MIME email.
It was then abused by MS IIS for HTTP, for which it was never intended.
And it *still* doesn't work across the board, no matter who made it up.
> *Especially* as the value carries no information since it's under the
> control of a (potentially) malicious user (he later mentioned that
> himself)! The net effect is that a naive programmer who would
> otherwise
> merrily fall prey to an exploit has to DTRT, which is inspect the
> file.
>
> That makes the whole thing a non-issue, and the opening remark was
> completely unwarranted, unasked for.
I am sorry you find my posts inflammatory and non-issue with
unwarranted and unasked for information.
Please feel free to use the delete key.
>> >> Note that application/octet-stream is valid for any kind of
>> document
>> >> whatsoever for an upload. For output, that would require the
>> browser
>> >> to download the document rather than attempt to display it. More
>> on
>> >> that here:
>> >> http://richardlynch.blogspot.com/
>> >
>> > To the OP: read that rant for amusement, but don't use the
>> "advice"
>> > rlynch gives, it's nonsense. If you don't believe me, check the
>> RFCs
>>
>> richard's practical experience in dealing with this things is
>> nonsense?
>
> It's "advice", not "experience".
>
>> he has been dealing with this kind of stuff [I'm referring just to
>> his
>> experience/work with php for the purpose of this reply] for longer
>> than
>> most of us have even heard of php - and for companies that most of
>> us
>> would give our right arm to work for. his rant is based on lots of
>> experience
>> on how to make things that work, rather than making that should work
>> because
>> they adhere to any/every given standard (but don't work because of
>> any number
>> of real world situations)
>
> I already wrote it:
>
>> > If you don't believe me, check the RFCs
>
> Really, please do it, I beg you. Read the RFCs I quoted in the last
> installment of the Content-Disposition discussion.
Please take the time to figure out WHY QualComm wrote that RFC.
Pay particular attention to the history of MIME EMAIL and HTTP server
headers.
Also take note: QualComm does not, to the best of my knowledge, have
any invested stake in HTTP servers. MS does. MIME Email, QualComm
has much invested. As with any documentation, pay attention to the
players, and where their money comes from, while you read.
> Richard Lynch:
>
>> It *HAS* to prompt you for a filename and do a download, by the
>> original HTTP RFC spec. Please read more RFCs until you find the
>> one
>> about "application/octet-stream"
>
>> If the UA opens up "application/octet-stream" it is in direct
>> violation of one of the few HTTP standards that every other UA on
>> the
>> planet actually honors!
>
> The HTTP standard:
>
> Nothing, zip, nada. HTTP doesn't generally discuss presentation of
> entities
> contained in responses.
Errrrr.
One of the earliest HTTP RFCs specifically states that the client
program MUST treat application/octet-stream as a file to be
downloaded. Not MAY, not SHOULD. MUST.
Unfortunately, I cannot find it right now, as I keep finding these
stupid MIME email crap RFCs instead, which apply to email.
All I know is that the RFC number is a heck of a lot lower than 1521.
And I know that every web browser ever built works this way, but not
every web browser ever built works with Content-Disposition, not by a
long shot.
> Richard Lynch:
>
>> Not to mention that it's a STUPID thing for MS IE to have done in
>> the
>> first place, to re-purpose a MIME email header for HTTP.
>
> The HTTP standard:
>
> HTTP/1.1 uses many of the constructs defined for Internet Mail (RFC
> 822 [9]) and the Multipurpose Internet Mail Extensions (MIME [7])
> to
> allow entities to be transmitted in an open variety of
> representations and with extensible mechanisms. However, RFC 2045
> discusses mail, and HTTP has a few features that are different from
> those described in RFC 2045.
>
> Indeed, how stupid of the HTTP authors to repurpose the MIME
> Content-Type
> header! The "application/octet-stream" names a *MIME type*, FFS! Those
> repurposes weren't stupid?
MIME *email* headers, specifically introduced to deal with HTML
enhanced (cough, cough) email, being back-ported to HTTP, is the
stupid part.
Sorry I wasn't clear.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Thu, January 4, 2007 6:30 pm, Roman Neuhauser wrote:
> # ceo
l-i-e.com / 2007-01-04 16:19:19 -0600:
>> On Thu, January 4, 2007 2:28 am, Roman Neuhauser wrote:
>> > # dotancohen
gmail.com / 2007-01-04 08:21:37 +0200:
>> >> to grasp, so I use the English version. That may not be a problem
>> >> for you, but it is for me.
>> >
>> > Your written English is very good. If you can understand what you
>> > wrote and can read replies (in English) from the list, you should
>> > have no problems understanding the manual.
>>
>> Well that's funny.
>>
>> As a native speaker, I often have trouble understanding the manual,
>> especially the PCRE bits.
>>
>> I understand all the words, and all the sentences make perfect
>> grammatical sense.
>>
>> But how they apply and what the implications are and WHEN they
>> apply...
>
> A picture is worth of a thousand words. If you're confused,
> experiment!
A good experimenting tool for Regex is "The Regex Coach"
I can't recommend it highly enough.
There's a couple places where it differs from PHP, and you have to
escape stuff in PHP once you figure out what PCRE wants, but it's
definitely a very good laboratory for PCRE.
Sometimes, though, experimenting only leads to more and more
frustration, as PCRE can seem quite random, rather than designed...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Thu, January 4, 2007 2:47 pm, Karl Pflästerer wrote:
> In my opinion include() should respect symlinks to directories and not
> dereference them before finding the file to include. Or am I wrong
> here?
> The PHP version is 5.1.6 (will soon be updated).
Honestly...
My answer would be "Don't do that."
Use include_path so that you never need to use ".." in your includes,
and use full pathnames when you go to read
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
On Thu, January 4, 2007 2:47 pm, Karl Pflästerer wrote:
> In my opinion include() should respect symlinks to directories and not
> dereference them before finding the file to include. Or am I wrong
> here?
> The PHP version is 5.1.6 (will soon be updated).
WHOOPS!
My fingers slipped and I keyboarded to "Send" button.
SORRY!
... and use full pathname when you go to read a file.
Anything else is more like playing an Adventure Game than Programming.
I can see arguments both ways for when to work out the symlink, so
you'd have to take this up with Internals to get a change made...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
attached mail follows:
# ceo
l-i-e.com / 2007-01-05 16:29:04 -0600:
> Pretend you are using some library of software with a lot of code, and
> you have a lot of your own code.
>
> There are try/catch blocks all over the place.
>
> The library does something with try/catch, and you don't like the way
> it handles the error.
>
> It's very difficult to change that behaviour.
How does that differ from a situation where you're unhappy with a way
a procedural library handles error situations?
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
attached mail follows:
lists
dwsasia.com wrote:
> Thanks for your answer,
>
> It was a bit late because we already disabled selinux just to try, and
> it worked :) But hopefully this could help someone that bumps into the
> same problem.
>
> On a live webserver, what security issues would disableing the selinux
> cause? Any?
I have no idea - it's rather out of my league.
I guess you'll have to ask the NSA, but be clever what you say - we're
foreigners remember and never know when they might drag you to Guantanemo.
PS - they hung Saddam for murdering 100,000 iraqi's ... thing
is George is not that far off his score (http://www.iraqbodycount.org/) ...
they have the death penalty in Texas right?
attached mail follows:
Edin,
Thanks for taking care of this!
Andi
> -----Original Message-----
> From: Edin Kadribasic [mailto:edink
emini.dk]
> Sent: Friday, January 05, 2007 5:28 AM
> To: PHP internals; php-general
lists.php.net
> Subject: [PHP-DEV] FastCGI optmized Windows build of 5.2.1RC2
>
> Hello,
>
> I have made a second build of 5.2.1RC2 for Windows with no
> thread safety enabled. This will only work for non threaded
> SAPIs such as CGI/FastCGI and CLI. The reason for this is
> that managing per thread state takes some CPU time from the
> main task of running PHP scripts making non thread safe PHP
> significantly faster. My initial benchmarks show 20-30%
> performance increase.
>
> This, together with the new fastcgi implementation for IIS
> from Microsoft should bring PHP performance on Windows to a new level.
>
> http://downloads.php.net/edink/php-5.2.1RC2-nts-Win32.zip
> (76aa90a7fdb0bd2eb62c1172501d6c6e)
> http://downloads.php.net/edink/pecl-5.2.1RC2-nts-Win32.zip
> (a493bdf794a5d44d749f6dcd2a55f9da)
> http://downloads.php.net/edink/php-debug-pack-5.2.1RC2-nts-Win32.zip
> (cbfd474fcdb61522d4c750b5c02d3df9)
>
> Edin
>
> --
> PHP Internals - PHP Runtime Development Mailing List To
> unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
hi, im Budi,
recently i have some problems here with displaying jpeg image in firefox
browser. at first, when i tested my web page using IE it jsut works fine,
but when i decided to test it using Firefox 2 the problem occurs. some of my
images left undisplayed. but the things that i cant still understand is the
other images (which is have the same type -- jpeg) are still displayed well.
another unusual thing is :
1. when drag on the image it still indicating that there is an image, but
with full white color.
2. say that my image file name is tes.jpg 200x200 px, then, when i copy the
image location, it is still showing the right name, say fooofoo.com/tes.jpg,
but when open that image (typing the name fooofoo.com/tes.jpg in the
browsers address bar) my browsers window title displaying "tes.jpg (GIF
Image, 1x1 pixels)"
so.. what problem that i really dealt with?
// im beginner in everything, including my english, so, i hope you can
understand what i just wrote above..
// best, regard
attached mail follows:
Budi Setiawan wrote:
> hi, im Budi,
>
> recently i have some problems here with displaying jpeg image in firefox
> browser. at first, when i tested my web page using IE it jsut works
> fine,
> but when i decided to test it using Firefox 2 the problem occurs. some
> of my
> images left undisplayed. but the things that i cant still understand
> is the
> other images (which is have the same type -- jpeg) are still displayed
> well.
>
>
> another unusual thing is :
> 1. when drag on the image it still indicating that there is an image, but
> with full white color.
> 2. say that my image file name is tes.jpg 200x200 px, then, when i
> copy the
> image location, it is still showing the right name, say
> fooofoo.com/tes.jpg,
> but when open that image (typing the name fooofoo.com/tes.jpg in the
> browsers address bar) my browsers window title displaying "tes.jpg (GIF
> Image, 1x1 pixels)"
>
> so.. what problem that i really dealt with?
>
>
> // im beginner in everything, including my english, so, i hope you can
> understand what i just wrote above..
> // best, regard
>
do you have an example/page that we can look at?
attached mail follows:
>
> do you have an example/page that we can look at?
here is one of them :
http://10.126.11.246/schematics2007/main_logic.php
and the image URL :
http://10.126.11.246/schematics2007/image/banner/mainlog.jpg
all will be be displayed in an unusual manner in FFox..
thanks
attached mail follows:
Budi Setiawan wrote:
>>
>> do you have an example/page that we can look at?
>
>
> here is one of them :
> http://10.126.11.246/schematics2007/main_logic.php
>
> and the image URL :
> http://10.126.11.246/schematics2007/image/banner/mainlog.jpg
>
> all will be be displayed in an unusual manner in FFox..
>
> thanks
>
OK, how about something that is hosted on a public server???
10.x.x.x is private :(
Jim
attached mail follows:
Hello,
I have a newbie question regarding URL parameters. The PHP script I
wrote need to read parameters passed in from a URL, so as an example
http://my.domain/myscript.php?name=me&age=27
and my script would use $name to get the value for name and $age to
get the value for age.
Everything was working fine until the sysadmin did a upgrade of the
PHP server, and $name and $age both give me nothing.
I am just wondering if the latest version of PHP has changed the way
to access url parameters. If so, what would be the correct way of
doing it? Please help. Thanks.
- Jim
attached mail follows:
Hello Jim the Standing Bear,
register_global
try use
$name=$_GET['name'];
$age=$_GET['age'];
Best regards,
======= At 2007-01-06, 10:05:40 you wrote: =======
>Hello,
>
>I have a newbie question regarding URL parameters. The PHP script I
>wrote need to read parameters passed in from a URL, so as an example
>
>http://my.domain/myscript.php?name=me&age=27
>
>and my script would use $name to get the value for name and $age to
>get the value for age.
>
>Everything was working fine until the sysadmin did a upgrade of the
>PHP server, and $name and $age both give me nothing.
>
>I am just wondering if the latest version of PHP has changed the way
>to access url parameters. If so, what would be the correct way of
>doing it? Please help. Thanks.
>
>- Jim
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
= = = = = = = = = = = = = = = = = = = =
Nicholas Yim
nick.yim
taowap.com
2007-01-06
attached mail follows:
You'll probably get 50 answers to this, but here's probably what happened.
There's a setting called "register globals" that will turn your name=me and age=27 into $name = "me" and $age = "27". It used to be turned ON by default. This was generally considered to be bad security, so it now defaults to OFF.
To get these variables, just use the $_GET system variable.
$name = $_GET['name'];
$age = $_GET['age'];
Easy!
Best of luck!
-TG
= = = Original message = = =
Hello,
I have a newbie question regarding URL parameters. The PHP script I
wrote need to read parameters passed in from a URL, so as an example
http://my.domain/myscript.php?name=me&age=27
and my script would use $name to get the value for name and $age to
get the value for age.
Everything was working fine until the sysadmin did a upgrade of the
PHP server, and $name and $age both give me nothing.
I am just wondering if the latest version of PHP has changed the way
to access url parameters. If so, what would be the correct way of
doing it? Please help. Thanks.
- Jim
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
attached mail follows:
On Fri, 2007-01-05 at 20:57 -0500, Jim the Standing Bear wrote:
> Hello,
>
> I have a newbie question regarding URL parameters. The PHP script I
> wrote need to read parameters passed in from a URL, so as an example
>
> http://my.domain/myscript.php?name=me&age=27
>
> and my script would use $name to get the value for name and $age to
> get the value for age.
>
> Everything was working fine until the sysadmin did a upgrade of the
> PHP server, and $name and $age both give me nothing.
>
> I am just wondering if the latest version of PHP has changed the way
^^^^^^^^^^^^^^^^^^^^^
Ummm, pull your head out of the sand (or whatever other dark recess you
have it stuck in). Register globals ini setting was defaulted to "off"
about 3 or more years ago :/
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Thanks, everyone. Yeah, I really need to dig myself out of the sand. :D
On 1/5/07, Robert Cummings <robert
interjinn.com> wrote:
> On Fri, 2007-01-05 at 20:57 -0500, Jim the Standing Bear wrote:
> > Hello,
> >
> > I have a newbie question regarding URL parameters. The PHP script I
> > wrote need to read parameters passed in from a URL, so as an example
> >
> > http://my.domain/myscript.php?name=me&age=27
> >
> > and my script would use $name to get the value for name and $age to
> > get the value for age.
> >
> > Everything was working fine until the sysadmin did a upgrade of the
> > PHP server, and $name and $age both give me nothing.
> >
> > I am just wondering if the latest version of PHP has changed the way
> ^^^^^^^^^^^^^^^^^^^^^
>
> Ummm, pull your head out of the sand (or whatever other dark recess you
> have it stuck in). Register globals ini setting was defaulted to "off"
> about 3 or more years ago :/
>
> Cheers,
> Rob.
> --
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting |
> | a powerful, scalable system for accessing system services |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for |
> | creating re-usable components quickly and easily. |
> `------------------------------------------------------------'
>
>
--
--------------------------------------
Standing Bear Has Spoken
--------------------------------------
attached mail follows:
Robert Cummings wrote:
> On Fri, 2007-01-05 at 20:57 -0500, Jim the Standing Bear wrote:
>
>> Hello,
>>
>> I have a newbie question regarding URL parameters. The PHP script I
>> wrote need to read parameters passed in from a URL, so as an example
>>
>> http://my.domain/myscript.php?name=me&age=27
>>
>> and my script would use $name to get the value for name and $age to
>> get the value for age.
>>
>> Everything was working fine until the sysadmin did a upgrade of the
>> PHP server, and $name and $age both give me nothing.
>>
>> I am just wondering if the latest version of PHP has changed the way
>>
> ^^^^^^^^^^^^^^^^^^^^^
>
> Ummm, pull your head out of the sand (or whatever other dark recess you
> have it stuck in). Register globals ini setting was defaulted to "off"
> about 3 or more years ago :/
>
> Cheers,
> Rob.
>
Mate is this kind of behaviour really neccesary? Some people don't know
everything that you do, and he has already stated he isn't responsible
for administering the server.
attached mail follows:
On Sat, 2007-01-06 at 13:31 +1100, Ryan Fielding wrote:
> Robert Cummings wrote:
> > On Fri, 2007-01-05 at 20:57 -0500, Jim the Standing Bear wrote:
> >
> >> Hello,
> >>
> >> I have a newbie question regarding URL parameters. The PHP script I
> >> wrote need to read parameters passed in from a URL, so as an example
> >>
> >> http://my.domain/myscript.php?name=me&age=27
> >>
> >> and my script would use $name to get the value for name and $age to
> >> get the value for age.
> >>
> >> Everything was working fine until the sysadmin did a upgrade of the
> >> PHP server, and $name and $age both give me nothing.
> >>
> >> I am just wondering if the latest version of PHP has changed the way
> >>
> > ^^^^^^^^^^^^^^^^^^^^^
> >
> > Ummm, pull your head out of the sand (or whatever other dark recess you
> > have it stuck in). Register globals ini setting was defaulted to "off"
> > about 3 or more years ago :/
> >
> > Cheers,
> > Rob.
> >
> Mate is this kind of behaviour really neccesary?
I'm leaning towards yes.
> Some people don't know everything that you do
I don't know everything either, but register globals has been covered
here in depth for the entire length of time since the default value was
switched. There's this thing called the archives. There's also this
thing called "knowing the technology you use".
> and he has already stated he isn't responsible for administering the
> server.
Not responsible for administering the server is fine, but php.ini is
part of PHP and he did state he wrote the script. If you're suggesting a
PHP developer shouldn't need to be aware of the associated ini
configuration (regardless of whether they can admin it) then you also
need to get your head out of the sand.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Hi,
I am desparately looking for a solution for importing address book from aol
webmail to my browser. I found some commercial solution (such as,
http://svetlozar.net) which was done using cURL. But couldnt find any php
classes to implement it. Anyone can help me how to implement this ? As far
as i could go is this code which can successfully log in to aol :
<?php
$login = 'abcd';
$pass = '1234';
$url = "https://my.screenname.aol.com/_cqr/login/login.psp";
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$postvars =
"screenname=".$login."&password=".$pass."&submitSwitch=1&siteId=aolcomprod&mcState=initialized&authLev=1";
$cookie = "cookies/test";
unlink($cookie);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_CAINFO, "E:/aol_grab/curl-ca-bundle.crt");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec ($ch);
file_get_contents("http://d02.webmail.aol.com/22250/aol/en-us/Suite.aspx");
//print_r(curl_getinfo($ch));
//echo "\n\ncURL error number:" .curl_errno($ch);
//echo "\n\ncURL error:" . curl_error($ch);
curl_close ($ch);
unset($ch);
echo "<PRE>".htmlentities($content);
?>
and I was able to log in to it successfully..the output is as below
HTML Code:
<pre>HTTP/1.0 200 OK Date: Wed, 20 Dec 2006 09:31:47 GMT Server: Apache
Pragma: No-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie:
RSP_COOKIE=type=23&name=SXFiYWxuYXZlZA%3D%3D&stype =100;
Domain=.aol.com; Expires=Sat, 15-Dec-2007 09:31:47 GMT; Path=/ Set-Cookie:
SNS_TT=AAppcWJhbG5hdmVkRYkDAwAAEAABADzZgUOA2md9Z10
eZXKIoglrjoCeCrbwVT0pwLi4eVd8mDKn%2BVKco%2FRRi%2F5
rNTsm5vMgc1UlyzEDQ%2BXxYeQ%3D; Domain=my.screenname.aol.com; Expires=Fri,
19-Jan-2007 09:31:47 GMT; Path=/ Set-Cookie: MC_CMP_ESK=NonSense;
Domain=.aol.com; Path=/ Set-Cookie:
SNS_SKWAT=diAyLjAga2lkIDEgdDF5SDJxYmROcHhxN0FHbEh6
V1hDMmJLc0djPQ%3D%3D-b0o7Q4xCU%2F39IESbtoTm9mBdSL47fxxUnmD4X1Pn82%2Fol%
2B03%2BtxOLynThOHeQsaL5xdmerZnzZT34sulbmtlrezipaPL
kGMHiXQBbDQpCZb53AT7EPRZ2sWEvYfeP0a9rf%2FDn%2F2ER3
2h0rLA5%2B7UMs6NmHharvEJQCFkTVYUHyjUa6btTL8twXF4Jm
siXUX0uXBuOHibk6Pl9lKtKJj779U%2BiXUU4oBiSpcg6Q%2FY
KJUvGNsk4cjDURDglR9SsQL0iCJ2S1w4YGA%3D; Domain=screenname.aol.com ; Path=/
Set-Cookie: SNS_SC=diAxLjAga2lkIDEgQ2R1RXNSeDJGTDZ3SmNNMXRkMUt
hQ25kdEhZPQ%3D%3D-dwYGM2lmn8IsM5qbIMCD4cF876hxn28LVqa2CrLuSNY%2FClN5
8OIf%2Bg1GbhwkQ8c4%2BoZTQgtZjkKb0gS4x9xI2v1HzzyBQU
7%2FUGAuyvgR9SWpqJmjzOpUJldJIJHA43WwgahRfwXBKCp8Ci
B%2FPMLCa4bSsNdpgaEVUgc%2FrdXCOOU%3D; Domain=my.screenname.aol.com; Path=/
Set-Cookie: SNS_L0=diAxLjAga2lkIDEgUUpsdVVrUWtzb21SOFhPdGo1SFo
2R2swQzJzPQ%3D%3D-RgHJcTIzyWP%2BQIb7S6lE%2BpdmQv1XVmfP; Domain=
screenname.aol.com ; Expires=Tue, 15-Jul-2036 09:31:47 GMT; Path=/
Set-Cookie: SNS_LDC=1 aolcomprod 1 1166607107 0 1166607107 0; Domain=
my.screenname.aol.com; Expires=Fri, 19-Jan-2007 09:31:47 GMT; Path=/
Set-Cookie: SNS_AA=asrc=2&sst=1166607107; Domain=.aol.com; Path=/ P3P:
CP="PHY ONL PRE STA CURi OUR IND" Content-length: 1505 Cache-control:
no-cache Content-language: en-US Content-type: text/html;charset=utf-8
Connection: close <html><head><title>Scr
But i dont know how to fetch the email addresses from the contact list. Any
one can help me on this ?
Thanks in Advance
Naved
attached mail follows:
Hi,
Can someone make me an example of simple reading a *.txt file on a hard
drive
and displaying that file with a echo command or some loop or anything
path to file:
(C:\Program Files\XAMPP\xampp\htdocs\test_folder\test1.txt) btw the
script is in this folder to.
Full code please.
Thanks in advance!
attached mail follows:
This just dumps the content to the browsers. You could use file() instead if
you want to loop thru every line.
$file = "test1.txt";
if(file_exists($file)) {
if(is_readable($file)) {
if($file_content = get_file_contents($file)) {
echo "<pre>";
echo $file_content;
echo "</pre>";
} echo "Something went wrong";
} else echo "Cannot read the file '$file', check permissions";
} else echo "The file '$file' does not exist in this directory";
You should learn how to read the manual, because in the end we will not do
this kind of things if it already is in the manual.
http://th.php.net/manual/en/function.file-get-contents.php
http://th.php.net/file
Best regards,
Peter Lauri
www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free
-----Original Message-----
From: Delta Storm [mailto:delta.storm
hi.t-com.hr]
Sent: Saturday, January 06, 2007 10:39 AM
To: php-general
lists.php.net
Subject: [PHP] File reading code2
Hi,
Can someone make me an example of simple reading a *.txt file on a hard
drive
and displaying that file with a echo command or some loop or anything
path to file:
(C:\Program Files\XAMPP\xampp\htdocs\test_folder\test1.txt) btw the
script is in this folder to.
Full code please.
Thanks in advance!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]