php-general Digest 15 Dec 2006 19:13:42 -0000 Issue 4516
Topics (messages 245851 through 245867):
LDAP and character encoding
245851 by: Andreas Dahlen
Re: RegExp
245852 by: Jochem Maas
Re: learning classes not sure how to do this correctly
245853 by: Jochem Maas
Re: google video like site
245854 by: Jochem Maas
245855 by: Robert Cummings
Re: How php works?
245856 by: Kai Xiang
Re: Having problem sending XML over HTTP
245857 by: Nauman Akbar
Re: Having problem sending XML over HTTP (disregard last message)
245858 by: Nauman Akbar
PDO::prepare deallocate & PDOStatement::closeCursor()
245859 by: Yonatan Ben-Nes
Re: date() and timezone
245860 by: Fernando M. M.
245862 by: Jochem Maas
245864 by: Fernando M. M.
245866 by: Jochem Maas
Curl and cookies
245861 by: Fernando M. M.
245863 by: Ray Hauge
245865 by: Marcus
Re: PHP and connection to mail account
245867 by: Richard Lynch
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Hej!
I'm running PHP 5.1.2 on Suse 10.
The LDAP server is openldap 2.3.19
I've problem with swedish characters and DN.
DN: cn=åäö,dc=example,dc=com
$res = ldap_search($ds, 'dc=example,dc=com', '(objectClass=*)');
$dn = ldap_get_dn($ds,$res);
==> $dn is cn=\C3\85\C3\84\C3\96,dc=example,dc=com
How do I convert $dn to a readable format?
I've tried utf8_decode, but it doesnt work.
utf8_decode works on the entries returnd by ldap_get_attributes.
/Andreas
----------------------------------------------------------------
This message was sent using IMP (http://www.horde.org).
Running on PHP 5.1.2, Apache 2.0.55, Ubuntu Dapper.
--- End Message ---
--- Begin Message ---
WeberSites LTD wrote:
> I'm trying to limit the text someone can submit in a text area with :
>
>
> Code:
> if(!preg_match("/^[א-תA-Za-z0-9_():,@\/\.\s\-\" ]*$/i",$FieldValue)) {
^^ ^-- no need for the space
given you already have '\s'
^^
^^--- these brackets need escaping
>
avoid sticking your regexps in double quotes strings - you just end up
giving yourself an escaping headache.
what is exactly is the goal of the 'limit' you are imposing - wouldn't something
like strip_tags() be much easier?
> }
>
>
> It works well but I'm having problems with the " (double quote).
> If there is a double quote (") it fails.
>
>
--- End Message ---
--- Begin Message ---
Macha wrote:
> I'm not sure if it matters or not, but this is happening on the page
> that you are sent to from hitting the submit button from the other
> page...test.php is a form that sends you to test2.php after hitting the
> submit button and its test2.php page that is having this issue with the
> $keclass.
>
> with that on test2.php if i use var_dump($keclass) i get *'Notice*:
> Undefined variable: keclass' and *'Fatal error*: Call to a member
> function on a non-object' on any $keclass -> function call witch makes
> since, but if i try to declare the class in test2.php with
> var_dump($keclass) i get object(keclass)(0) but i get *Fatal error*:
> Cannot redeclare class keclass. so i guess that information changes the
> question down to why is it saying that i am redeclaring $keclass when it
> hasnt been declared in that page before? is it something do to with
> test.php when u hit submit and being redirected to test2.php?
>
> If this dosnt really make any sense let me know..i have been told
> serveal times in the past i dont really explain my self well hehe
I got as far as determining it was english you were using - then I gave up.
seems to sound like you have no idea what an object is, or maybe no idea what
the difference between a variable and a class definition - this may be
incorrect,
but like I said I gave up trying to figure out what you were talking about.
why don't you send the code from test2.php
>
> Richard Lynch wrote:
>> var_dump($keclass);
>>
>> It's not an object...
>>
>>
>> On Thu, December 14, 2006 9:16 am, [EMAIL PROTECTED] wrote:
>>
>>> just starting to get used to classes, trying to figure out what i am
>>> doing wrong, i know its going to be something stupid on my part,
>>> probably really shouldn't be using a if statement or something heh
>>>
>>> just doing a basic email verification to make sure its looks like
>>> email
>>> addy
>>>
>>> so i take the post to a var
>>>
>>> PHP Code:
>>> $email_address = $_POST['email_address'];
>>>
>>>
>>> run it through this function in my class
>>>
>>> PHP Code:
>>> function check_email($address){
>>> if
>>> (ereg('[EMAIL PROTECTED]',
>>> $address))
>>> return true;
>>> else
>>> return false;
>>> }
>>>
>>>
>>> and then if true i want it to continue on with the script or error out
>>> and quit back to the other page and display the error. so i have tried
>>> something like this and stuff similar but get a error
>>> Fatal error: Call to a member function on a non-object in
>>>
>>> PHP Code:
>>> if (!$keclass->check_email($email_address)) {
>>> $keclass->seterr(555);
>>> include('test.php');
>>> exit();
>>> }
>>>
>>> $keclass->seterr(000);
>>> include('test.php');
>>> exit();
>>>
>>>
>>> the seterr is just a simple thing that takes the number and puts in a
>>> session var for latter display...
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>>
>>
>>
>>
>
--- End Message ---
--- Begin Message ---
Robert Cummings wrote:
> On Thu, 2006-12-14 at 23:40 +0100, Jochem Maas wrote:
>> [EMAIL PROTECTED] wrote:
>>> Hi,
>>>
>>> I applogize if this isn't really related to php-programming, but it's
>>> related to
>>> php.
>>>
>>> I'm wondering if anyone knows what program sites like google video or
>>> break.com
>>> use? is it a software like php-nuke, or phpBB or drupal? They all look
>>> pretty
>>> much the same, so I'm guessing it's a package they use. Anyone know what it
>>> is?
>>> or are they all really writing everything from scratch?
>> google video - running on php-nuke - no I don't think so.
>>
>> they write from scratch, with the odd billion dollars lying around they can
>> afford
>> to :-) (also note that youtube was bought by google for something like 1.3
>> billion dollars -
>
>
>> I doubt they were stupid enough to shell out that kind of cash to on a
>> php-nuke install,
>
> Why not? It's not the code they want, it's the traffic. You can have the
> best code in the world and if 0 people visit it, it's pretty worthless
> to anyone but you.
you are right - I was implicitly thinking along the lines that there is no
way in hell a php-nuke install could stand up to amount of requests/processing
youtube must cope with.
there is a good reason that properties like Yahoo (which uses php of course)
stick all
the heavy lifting code in php extensions written in C.
then there is the issue of differentiation - would *you* settle for some
generic POS
piece of software if you had billions of dollar to invest in build a custom,
killer app?
okay, sure, everything in software land is eventually comoditized and available
as
open source eventually, but right now there are no google-video type
applications out
there that can handle the amount of traffic the mentioned sites handle.
there is also the premise that youtube wouldn't be youtube if it were running
on php-nuke,
for the simple fact it would have been hacked to death. no?
oh well time for some work ;-)
>
> Cheers,
> Rob.
--- End Message ---
--- Begin Message ---
On Fri, 2006-12-15 at 09:30 +0100, Jochem Maas wrote:
> Robert Cummings wrote:
> > On Thu, 2006-12-14 at 23:40 +0100, Jochem Maas wrote:
> > > I doubt they were stupid enough to shell out that kind of cash to on a
> > > php-nuke install,
> >
> > Why not? It's not the code they want, it's the traffic. You can have the
> > best code in the world and if 0 people visit it, it's pretty worthless
> > to anyone but you.
>
> you are right - I was implicitly thinking along the lines that there is no
> way in hell a php-nuke install could stand up to amount of requests/processing
> youtube must cope with.
Definitely not on one computer, but if you offload to say 30 servers,
you can probably process 100 million hits per day. Servers are probably
cheap compared to their bandwidth costs.
> there is a good reason that properties like Yahoo (which uses php of course)
> stick all
> the heavy lifting code in php extensions written in C.
True, but nothing stopping a site like youtube from taking a shoddy app
and moving some of the heavy lifting into extensions themselves.
> then there is the issue of differentiation - would *you* settle for some
> generic POS
> piece of software if you had billions of dollar to invest in build a custom,
> killer app?
Probably not, but I know that millions of people everyday settle for
Microsoft ;) Some of these people probably have a few spare billion
dollars... not me though :|
> okay, sure, everything in software land is eventually comoditized and
> available as
> open source eventually, but right now there are no google-video type
> applications out
> there that can handle the amount of traffic the mentioned sites handle.
Id on't think the code is the bottleneck, I think the bottle neck is the
200 to 400 terabytes of data youtube transfers everyday.
> there is also the premise that youtube wouldn't be youtube if it were running
> on php-nuke,
> for the simple fact it would have been hacked to death. no?
Well, that's definitely a valid point, no argument from me there heheh.
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. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
On 12/15/06, Richard Lynch <[EMAIL PROTECTED]> wrote:
On Wed, December 13, 2006 12:15 am, Kai Xiang wrote:
> 1. I heard there is a zend engine inside PHP playing the role as a
> virtual
> machine, and PHP excution have 2 step, first compile to opcode and
> then
> excute the opcode,
> so is that means the php are compiled only once per file? or still
> need to
> recompile when another request issued to the server? also I heard
> about the
> caching extention about php, is it talking about caching the opcode?
> is't
> caching the opcode or excute results? how it shares between the
> requests?
There is a Zend Engine inside the guts of PHP, and it does compile to
opcode and execute.
You can buy or find "opcode cache" software that will cache the
compiled opcode and run that on the next request.
Note that the BIG win there is not the compilation, but the hard drive
not getting hit to load in the PHP script.
Oh, that's interesting to know, is that from certain test of design goals? I
suspect this for I thought the most time-consuming work in PHP should be
compiling.
Refer to the early descussion, because all the thread share the same
opcode, so it could save memory usage at the same time, is that true? say if
there is a lot of requests at the same time, that could be a lot of
memories. is that the design goal? or why not just implement a PHP file
cache.
> 2. Is there some alternative choise except zend engineen, why need a
> zend
> engine? for performance advantage or just easy for porting to
> different
> platform?
The original PHP guts were a hand-crafted parser by Rasmus Lerdorf,
who, and this is NOT meant to be pejorative, had no idea what he was
doing :-)
He didn't know that there were tools out there to write new computer
languages, and didn't use them.
So his parser was, well, kinda buggy, actually.
Ze'ev and Andi gutted the system with a shiny new parser using the pro
tools for homework, and ended up being Core PHP Developers by
accident. :-)
So, that became the Zend Engine, as Ze'ev and Andi's idea of a Good
Time is not building PHP websites, but building cool tools to improve
the guts of PHP, which is also why they started Zend ( http://zend.com)
to sell high-end tools to high-end customers, like the Zend Cache.
:) PHP change it's gut to make it more fresh.
> 3. Take linux apache for example, if compiled as a apache module, and
> using
> prefork threading model, for example, if I have 100 process, is that
> means I
> have 100 copy of PHP library local data(I assume only one reentrant
> excutable image) in each process? compare to a worker model, like 10
> process
> and 10 threads in each one process, should it make a difference that
> we only
> have 10 copy of PHP library local data ?
Yes, but if you don't use prefork, you have some serious thread safety
Risks, particularly in the extensions, and most especially in any
extensions that aren't getting heavy use already by people trying to
push into the threaded environment...
Stick with pre-fork unless your testing budget is 10 X your dev budget.
> I'm not sure if this is the right place to talk about this, anyway, if
> you
> know a better place, help me out :)
This is probably about as on-topic a post as one can get, though much
of the info is "out there" if you can sift through the junk to find
it.
--
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?
--- End Message ---
--- Begin Message ---
Hello!
Thanx for reminding me that I can use a regular POST as well rather then
sending XML over HTTP directly :). Perhaps I was quite tired by then.
Anyways I tried that. Unfortunately, it seems POST data is not getting
through at all. I sent the same query with GET and it is returned fine. But
var_dump on both $_POST and $HTTP_RAW_POST_DATA return empty strings even
with a regular POST with Curl. Yes the data is urlencoded.
My server is RHEL4 with Plesk 8.x. I got PHP upgraded to PHP 5 yesterday. I
know POST requests are working fine through browser. I have tried Opera and
IE and both work just fine. So my guess is; it is probably curl causing the
problem. Can someone point me to some resource or documentation on this
issue?
Regards,
Nauman Akbar
Concise Solutions
-----Original Message-----
From: Brad Fuller [mailto:[EMAIL PROTECTED]
Sent: Friday, December 15, 2006 2:16 AM
To: [email protected]
Subject: RE: [PHP] Having problem sending XML over HTTP
> -----Original Message-----
> From: Nauman Akbar [mailto:[EMAIL PROTECTED] On Behalf Of Nauman
> Akbar
> Sent: Thursday, December 14, 2006 3:32 PM
> To: [email protected]
> Subject: [PHP] Having problem sending XML over HTTP
>
> Hello!
>
>
>
> I picked up an example from Curl section on php.net. I am able to access
> the
> remote page fine with a custom header. Unfortunately, I am not able to
> retrieve the XML I am sending at the remote end. I have tried both
> $HTTP_RAW_POST_DATA and php://input but neither of them returns anything.
> I
> am putting my code below just in case anyone can point out the problem in
> there.
>
>
>
> $xmlstr = <<<XML
>
> <query>
>
> <username>fff-bbbb</username>
>
> <password>alphanumeric</password>
>
> <function>GetPackageVersion</function>
>
> </query>
>
> XML;
>
>
>
> $header[] = "MIME-Version: 1.0 \r\n";
>
> $header[] = "Content-type: multipart/mixed; boundary=----doc \r\n";
>
> //$header[] = "Accept: text/xml \r\n";
>
> $header[] = "Content-length: ".strlen($xmlstr)." \r\n";
>
> $header[] = "Cache-Control: no-cache";
>
> $header[] = "Connection: close \r\n\r\n";
>
> $header[] = $xmlstr;
>
>
>
> print("setting url<BR>");
>
> $request = curl_init("http://mrcod.concisehosting.com/index.php");
>
> print("setting options<BR>");
>
> curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
>
> curl_setopt($request, CURLOPT_TIMEOUT, 4);
>
> curl_setopt($request, CURLOPT_HTTPHEADER, $header);
>
> curl_setopt($request, CURLOPT_CUSTOMREQUEST, 'POST');
>
>
>
> print("connecting...<BR>");
>
> $response = curl_exec($request);
>
> //curl_exec($request);
>
> curl_close($request);
>
> print($response);
>
>
>
> I have checked the ini file. Memory reserved for POST is 8M. Moreover, I
> even tried turning 'always_populate_http_raw_post_data' but it doesn't
> work.
> Any one any ideas, I am in real need for help on this.
>
>
>
> Regards
>
> Nauman Akbar
>
> Concise Solutions
Try this:
--------------------------------
The code for the sending script:
<?php
$xmlstr =
"<query><username>fff-bbbb</username><password>alphanumeric</password><funct
ion>GetPackageVersion</function></query>";
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, "http://example.com/your-accepting-page.php");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "xmlstr=".urlencode($xmlstr));
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$buffer = curl_exec($ch);
curl_close($ch);
print_r($buffer);
?>
----------------------------------
The code for the receiving script:
<?php
if(!empty($_POST)) {
echo "You sent me some data... here is what I received:\n";
print_r($_POST);
}
?>
Then open a browser and surf to the sending script. It should print the
response from the receiving page.
Here is the output:
You sent me some data... here is what I received:
Array
(
[xmlstr] =>
<query><username>fff-bbbb</username><password>alphanumeric</password><functi
on>GetPackageVersion</function></query>
)
I tested this and its working (at least on my server).
Sorry I don't have the time to tell you what is wrong with your code but
it's easier for me to just provide something that works.
I hope that helps you,
Brad
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello again!
Please disregard my last message. Thank you Brad for reminding me to use
regular POST. I still wish I was able to send a 'text/xml' content type. But
this will do and is working great.
Regards
Nauman Akbar
Concise Solutions
-----Original Message-----
From: Nauman Akbar [mailto:[EMAIL PROTECTED] On Behalf Of Nauman
Akbar
Sent: Friday, December 15, 2006 5:25 PM
To: 'Brad Fuller'; [email protected]
Subject: RE: [PHP] Having problem sending XML over HTTP
Hello!
Thanx for reminding me that I can use a regular POST as well rather then
sending XML over HTTP directly :). Perhaps I was quite tired by then.
Anyways I tried that. Unfortunately, it seems POST data is not getting
through at all. I sent the same query with GET and it is returned fine. But
var_dump on both $_POST and $HTTP_RAW_POST_DATA return empty strings even
with a regular POST with Curl. Yes the data is urlencoded.
My server is RHEL4 with Plesk 8.x. I got PHP upgraded to PHP 5 yesterday. I
know POST requests are working fine through browser. I have tried Opera and
IE and both work just fine. So my guess is; it is probably curl causing the
problem. Can someone point me to some resource or documentation on this
issue?
Regards,
Nauman Akbar
Concise Solutions
-----Original Message-----
From: Brad Fuller [mailto:[EMAIL PROTECTED]
Sent: Friday, December 15, 2006 2:16 AM
To: [email protected]
Subject: RE: [PHP] Having problem sending XML over HTTP
> -----Original Message-----
> From: Nauman Akbar [mailto:[EMAIL PROTECTED] On Behalf Of Nauman
> Akbar
> Sent: Thursday, December 14, 2006 3:32 PM
> To: [email protected]
> Subject: [PHP] Having problem sending XML over HTTP
>
> Hello!
>
>
>
> I picked up an example from Curl section on php.net. I am able to access
> the
> remote page fine with a custom header. Unfortunately, I am not able to
> retrieve the XML I am sending at the remote end. I have tried both
> $HTTP_RAW_POST_DATA and php://input but neither of them returns anything.
> I
> am putting my code below just in case anyone can point out the problem in
> there.
>
>
>
> $xmlstr = <<<XML
>
> <query>
>
> <username>fff-bbbb</username>
>
> <password>alphanumeric</password>
>
> <function>GetPackageVersion</function>
>
> </query>
>
> XML;
>
>
>
> $header[] = "MIME-Version: 1.0 \r\n";
>
> $header[] = "Content-type: multipart/mixed; boundary=----doc \r\n";
>
> //$header[] = "Accept: text/xml \r\n";
>
> $header[] = "Content-length: ".strlen($xmlstr)." \r\n";
>
> $header[] = "Cache-Control: no-cache";
>
> $header[] = "Connection: close \r\n\r\n";
>
> $header[] = $xmlstr;
>
>
>
> print("setting url<BR>");
>
> $request = curl_init("http://mrcod.concisehosting.com/index.php");
>
> print("setting options<BR>");
>
> curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
>
> curl_setopt($request, CURLOPT_TIMEOUT, 4);
>
> curl_setopt($request, CURLOPT_HTTPHEADER, $header);
>
> curl_setopt($request, CURLOPT_CUSTOMREQUEST, 'POST');
>
>
>
> print("connecting...<BR>");
>
> $response = curl_exec($request);
>
> //curl_exec($request);
>
> curl_close($request);
>
> print($response);
>
>
>
> I have checked the ini file. Memory reserved for POST is 8M. Moreover, I
> even tried turning 'always_populate_http_raw_post_data' but it doesn't
> work.
> Any one any ideas, I am in real need for help on this.
>
>
>
> Regards
>
> Nauman Akbar
>
> Concise Solutions
Try this:
--------------------------------
The code for the sending script:
<?php
$xmlstr =
"<query><username>fff-bbbb</username><password>alphanumeric</password><funct
ion>GetPackageVersion</function></query>";
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, "http://example.com/your-accepting-page.php");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "xmlstr=".urlencode($xmlstr));
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$buffer = curl_exec($ch);
curl_close($ch);
print_r($buffer);
?>
----------------------------------
The code for the receiving script:
<?php
if(!empty($_POST)) {
echo "You sent me some data... here is what I received:\n";
print_r($_POST);
}
?>
Then open a browser and surf to the sending script. It should print the
response from the receiving page.
Here is the output:
You sent me some data... here is what I received:
Array
(
[xmlstr] =>
<query><username>fff-bbbb</username><password>alphanumeric</password><functi
on>GetPackageVersion</function></query>
)
I tested this and its working (at least on my server).
Sorry I don't have the time to tell you what is wrong with your code but
it's easier for me to just provide something that works.
I hope that helps you,
Brad
--
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
--- End Message ---
--- Begin Message ---
Hi all,
I got 2 questions about PDO:
1. Let's say that I create the following prepared statement:
$PDOStatement = $DB_Conn->prepare("INSERT INTO test (name) values (?)");
And after 50,000 inserts (with $PDOStatement->execute(array('somevalue'));)
I want the database to analyze, compile and optimize it's plan again so it
will be more efficient for it's next inserts (actually is that true at
all?!?), does repeating the same command will deallocate the prepared
statement at the database & replace it with the new prepared statement? (new
plan).
If not, how can I deallocate it then?
2. At the PHP manual of PDOStatement::closeCursor it's written that "This
method is useful for database drivers that do not support executing a
PDOStatement object when a previously executed PDOStatement object still has
unfetched rows. If your database driver suffers from this limitation, the
problem may manifest itself in an out-of-sequence error.".
Anyone know if the PostgreSQL suffer from this problem or not?
Thanks a lot in advance,
Ben-Nes Yonatan
--- End Message ---
--- Begin Message ---
Hello,
>>> But like i said i have lots of scripts inside
this
>>> folder, is there a way to set something on .htaccess to change
the timezone?
>>
>
> why? ;-)
Because i can't set
the timezone for every single script. Inside this folder and subfolders i guess
there
are about 10,000 scripts.
>> What you were pointed to before + >
>> http://us3.php.net/manual/de/ini.php#ini.list
>
> ah, now
you've gone and made it easy for him :-)
>
Actually i don't have
access to php.ini file. Are there any other ways to do this?
--
Blog: http://blog.forumdebian.com.br/fernando
Contato:
http://www.forumdebian.com.br/fernando/contato.php
--- End Message ---
--- Begin Message ---
Fernando M. M. wrote:
>
> Hello,
>
>
>>>> But like i said i have lots of scripts inside
> this
>>>> folder, is there a way to set something on .htaccess to change
> the timezone?
>> why? ;-)
>
> Because i can't set
> the timezone for every single script. Inside this folder and subfolders i
> guess there
> are about 10,000 scripts.
that will teach not to use global include files to init your apps.
even if you we stuck with editing 10,000 scripts (btw it sounds very fishy
to 10,000 scripts with date() calls in them - can anyone say 'code reuse'?)
exactly how hard would it be to write something that would go through all
those php files and add a single line (" ini_set('date.timezone',
'Europe/Amsterdam'); ")
to the top of the script (i.e. just after the first '<?php' | '<?') ?
>
>>> What you were pointed to before + >
>>> http://us3.php.net/manual/de/ini.php#ini.list
>> ah, now
> you've gone and made it easy for him :-)
>
> Actually i don't have
> access to php.ini file.
if you RTFM (and I mean actually READ) then you would know that you
can set the relevant date related ini settings in a .htaccess file
here is the relevant link again:
http://php.net/manual/en/ref.datetime.php#ini.date.timezone
> Are there any other ways to do this?
>
--- End Message ---
--- Begin Message ---
>
> that will teach not to use global include files to init your apps.
>
> even if you we stuck with editing 10,000 scripts (btw it sounds very
fishy
> to 10,000 scripts with date() calls in them - can anyone say 'code
reuse'?)
> exactly how hard would it be to write something that would go through
all
> those php files and add a single line (" ini_set('date.timezone',
'Europe/Amsterdam');
> ")
> to the top of the script (i.e. just
after the first '<?php' | '<?') ?
Those scripts are uploaded by a lot
of people. Unfortunately i can't make all of them change this conf. But now i
know that
i can change this on .htaccess
>
> if you RTFM (and I mean
actually READ) then you would know that you
> can set the relevant date related
ini settings in a .htaccess file
>
> here is the relevant link
again:
>
>
http://php.net/manual/en/ref.datetime.php#ini.date.timezone
>
>
Sorry, i have read it but i was reading the portuguese version and it seens like
it is not completely translated. Just changed to the english version and NOW i
can read
it :)
Thanks,
Fernando.
--
Blog:
http://blog.forumdebian.com.br/fernando
Contato:
http://www.forumdebian.com.br/fernando/contato.php
--- End Message ---
--- Begin Message ---
Fernando M. M. wrote:
>
>> that will teach not to use global include files to init your apps.
>>
>> even if you we stuck with editing 10,000 scripts (btw it sounds very
> fishy
>> to 10,000 scripts with date() calls in them - can anyone say 'code
> reuse'?)
>> exactly how hard would it be to write something that would go through
> all
>> those php files and add a single line (" ini_set('date.timezone',
> 'Europe/Amsterdam');
>> ")
>> to the top of the script (i.e. just
> after the first '<?php' | '<?') ?
>
> Those scripts are uploaded by a lot
> of people. Unfortunately i can't make all of them change this conf.
I was suggesting you write a script to programmatically hack all the files in
question,
but its a moot point you've seen that there is a sane way of tackling the issue.
> But now i know that
> i can change this on .htaccess
>
>
>> if you RTFM (and I mean
> actually READ) then you would know that you
>> can set the relevant date related
> ini settings in a .htaccess file
>> here is the relevant link
> again:
>>
> http://php.net/manual/en/ref.datetime.php#ini.date.timezone
>>
>
> Sorry, i have read it but i was reading the portuguese version and it seens
> like
> it is not completely translated. Just changed to the english version and NOW
> i can read
> it :)
ah that explains alot - my advice is always use the english version of the
manual if you can,
no disrespect to the many hard-working translators out there but there is
almost no chance any
translation team can keep up the number and frequency of updates to the docs.
for the same reason I recommend never using an offline version of the manual
unless you
have no other choice.
>
> Thanks,
>
> Fernando.
--- End Message ---
--- Begin Message ---
Hello,
I have just started using curl and i have some question about
cookies.
The website i'm logging in controls everything using cookies (from
login to the actions inside it).
Is there a way to store the cookie values
into a php session variable ($_SESSION['cookie'])?
How do i make curl receive
the cookie and store in this variable?
How do i make curl send it?
Thanks,
Fernando.
--
Blog:
http://blog.forumdebian.com.br/fernando
Contato:
http://www.forumdebian.com.br/fernando/contato.php
--- End Message ---
--- Begin Message ---
I don't know if you can do what you are asking for, but you could get
around it a little bit. In the curl request you specify the cookie file
and the cookie jar file. Once you have made your requests, you could
read them with file_get_contents() and put that into a $_SESSION
variable. You could then put that information back into the cookie
file(s) with file_put_contents() [PHP5]
--
Ray Hauge
Application Development Lead
American Student Loan Services
www.americanstudentloan.com
-----Original Message-----
From: Fernando M. M. [mailto:[EMAIL PROTECTED]
Sent: Friday, December 15, 2006 8:07 AM
To: [email protected]
Subject: [PHP] Curl and cookies
Hello,
I have just started using curl and i have some question about
cookies.
The website i'm logging in controls everything using cookies (from
login to the actions inside it).
Is there a way to store the cookie values
into a php session variable ($_SESSION['cookie'])?
How do i make curl receive
the cookie and store in this variable?
How do i make curl send it?
Thanks,
Fernando.
--
Blog:
http://blog.forumdebian.com.br/fernando
Contato:
http://www.forumdebian.com.br/fernando/contato.php
--- End Message ---
--- Begin Message ---
1. Set option "HEADER" true for the login part in Curl
2. Take the output of login page, you will notice Set-cookie:
name=cookie_value; parametres returned from the header.
3. Preg match or use (explode,str_replace etc) to get those names and
values. Prepare them for the next Curl fetch
4. Make a new call to a new page, using the cookies with curl option COOKIE.
--aras
-----Original Message-----
From: Fernando M. M. [mailto:[EMAIL PROTECTED]
Sent: Friday, December 15, 2006 4:07 PM
To: [email protected]
Subject: [PHP] Curl and cookies
Hello,
I have just started using curl and i have some question about
cookies.
The website i'm logging in controls everything using cookies (from
login to the actions inside it).
Is there a way to store the cookie values
into a php session variable ($_SESSION['cookie'])?
How do i make curl receive
the cookie and store in this variable?
How do i make curl send it?
Thanks,
Fernando.
--
Blog:
http://blog.forumdebian.com.br/fernando
Contato:
http://www.forumdebian.com.br/fernando/contato.php
--- End Message ---
--- Begin Message ---
If you want to go the route of inbound mail being processed as it
arrives, "man smrsh" made it simple enough for even me to figure out.
On Wed, December 13, 2006 8:17 am, Angelo Zanetti wrote:
> Dear All.
>
> Do u know if its possible with PHP to receive a mail or connect to a
> mail box and do something with an incomming email ? I see there is
> that
> imap_open() but also there are sockets.
>
> Basically I need to connect to a mailbox and then when a mail is
> received it must take that mail and do something with the attachment
> which I know how to do and is not important to this question.
>
> Please maybe advise as to what the best way is and also if you have
> experienced difficulties with a certain way.
>
> Thanks in advance.
>
> --
> ------------------------------------------------------------------------
> Angelo Zanetti
> Systems developer
> ------------------------------------------------------------------------
>
> *Telephone:* +27 (021) 469 1052
> *Mobile:* +27 (0) 72 441 3355
> *Fax:* +27 (0) 86 681 5885
> *
> Web:* http://www.zlogic.co.za
> *E-Mail:* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
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?
--- End Message ---