php-general Digest 25 Jan 2005 16:30:01 -0000 Issue 3248

Topics (messages 207205 through 207244):

Re: Get full url
        207205 by: Santa

Re: Id_num = ""
        207206 by: Steve Slater

Re: String to Date and Date to String Functions?
        207207 by: David Robley
        207211 by: Ford, Mike

Re: PHP editor suggestion?
        207208 by: Merlin

Re: php5 --enable-soap compile error
        207209 by: Marten Lehmann

Re: Allowing Users to Edit HTML
        207210 by: trlists.clayst.com

[NEWBIE GUIDE] For the benefit of new members
        207212 by: Jay Blanchard
        207214 by: Jason Barnett
        207217 by: Chris Ramsay
        207220 by: Richard Davey
        207221 by: Jay Blanchard
        207222 by: Chris Ramsay
        207223 by: Richard Davey
        207224 by: Jay Blanchard
        207225 by: Jason Barnett
        207227 by: Joe Harman
        207228 by: Jay Blanchard
        207229 by: Jason Barnett
        207232 by: Jay Blanchard
        207233 by: John Nichel
        207234 by: Jason Barnett
        207235 by: Jochem Maas
        207236 by: Jochem Maas
        207237 by: Jay Blanchard
        207243 by: Jason Barnett

php 5.1.0 release - when?
        207213 by: Sergio Gorelyshev

Help with file not writing
        207215 by: Joey

PHP Cache
        207216 by: Merlin
        207219 by: Tom
        207230 by: Matthew Weier O'Phinney

ldap functionality
        207218 by: Bruce Douglas

Re: debugging modules
        207226 by: Arshavir Grigorian

Re: DOM->removeChild Problem
        207231 by: Christian Stocker

Replace credit card numbers with X ???
        207238 by: Joe Harman
        207239 by: Jay Blanchard
        207240 by: Afan Pasalic
        207242 by: Jochem Maas
        207244 by: tg-php.gryffyndevelopment.com

Re: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numbers with X 
???)]
        207241 by: Afan Pasalic

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 ---
В сообщении от Вторник 25 Январь 2005 04:31 Dmitry написал(a):
> How?
>
> Dont tell me about simple solutions such as
> $_SERVER["HTTPS"] .
> $_SERVER["REMOTE_ADDR"] .
> $_SERVER["SERVER_PORT"] .
> $_SERVER["PHP_SELF"] .
> $_SERVER["QUERY_STRING"]
>
> I want get really good solution.
>
> Thanks.

how about

$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] ?

--- End Message ---
--- Begin Message ---
>     $id_num = $_POST["id_num"];
$id_num = $_GET['id_num'];

RTFM -> diffrent between _GET & _POST

You can also use $_REQUEST['id_num'] if you don't care how the variable gets there (GET, POST, or COOKIE).

Note that if the value is set in more than one input (say both a
GET and a COOKIE set id_num), the variables_order variable in
php.ini determines which one will overwrite the other.

Steve


------------------ Steve Slater [EMAIL PROTECTED] PHP / MySQL / Web App Security (LAMP) Training: http://www.handsonsecurity.com/training.html

--- End Message ---
--- Begin Message ---
On Tuesday 25 January 2005 03:01, Ben Edwards wrote:

> Being trying to work out haw to handle dates.  Basically I need a
> function to convert a Date to a String and another function to convert
> a string to a date.
> 
> Exactly what format the date is held in is not relevant as long as it
> is some type of  standard (i.e. Unix Timestamps).
> 
> Both the functions will require a format string (such ad DD/MM/YYY)
> and again the format/syntax of this is irrelevant, as long as they are
> the same for both .
> 
> String to Date Function
> ----------------------------
> return date stringToDate( str Date, str Format )
> e.g. $todayDt = stringToDate( '01/01/2003','DD/MM/YYYY' );
> 
> Date to String Function
> ----------------------------
> return str dateToString( date Date, str Format )
> e.g. $todayStr = dateToString ( $todayDt,'DD/MM/YYYY' );
> 
> Anyone know of any functions that do this or have pointers as to how
> it can be done.
> 
> Ben

Have you looked at date() and strtotime() ?

-- 
David Robley

How do you make Windows faster ? Throw it harder

--- End Message ---
--- Begin Message ---
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



On 25 January 2005 00:25, Ben Edwards wrote:

> On Mon, 24 Jan 2005 20:15:15 -0000, Ford, Mike
> <[EMAIL PROTECTED]> wrote:
> > To view the terms under which this email is distributed,
> please go to http://disclaimer.leedsmet.ac.uk/email.htm
> > 
> > On 24 January 2005 19:01, Ben Edwards wrote:
> > 
> > > On Mon, 24 Jan 2005 12:58:52 -0500, [EMAIL PROTECTED]
> > > <[EMAIL PROTECTED]> wrote:
> > > > How about the strtotime() function?
> > > > http://us4.php.net/manual/en/function.strtotime.php
> > > 
> > > No good, it douse not take a format string.  What if I wanted to
> > > convert the timestamp to 'DD-MM-YYY', display it on a form,
> > > validate it, and then convert it back to a timestamp.
> > 
> > Well, if you're going to validate it, you'll have to figure out
> > which bits are the day, month and year -- having done that, you'll
> > have them as three separate bits of information, so you can use
> > mktime() on them, or glue them back together to feed to strtotime()
> > in one of the various formats it recognizes.  Seems to me a format
> > string is pretty irrelevant in all of this.
> 
> Different users have can have the date displayed in there local form.

Which means you've got to know what format any submitted date should be in,
which means you've got to know which bits are day, month and year.

> And no, I dont have to split the date up, the date() function should
> be able to be used to validate the date.  I asume it returns null, or
> something sensable, if the date is invalid.

date() won't do this, it's the function used to display a given timestamp in
a human-readable format.  Functions like mktime() accept apparently invalid
values so as to allow for easy date arithmetic (date('d-M-Y', mktime(0, 0,
0, 1, 32, 2005)) will give you '01-Feb-2005', for example; strtotime() does
something similar).  The only built-in function that does the checking you
are after is checkdate(), and that also wants day, month and year as three
integers.

So yes, you do have to split the input date up.

>   Anyway as the date format
> is user defined I need both functions.

No, you don't *need* them.  You may prefer to have the function to decode
according to a format string, but you don't need it -- it's pretty trivial
to do the task without it.

(    $aDate = explode('-', $inDate);    // or preg_split("#[/.-]#", $inDate)
     if (checkdate($aDate[1], $aDate[0], $aDate[2])):
         $timestamp = mkdate(12, 0, 0, $aDate[1], $aDate[0], $aDate[2]);
     else:
         $timestamp = NULL;
     endif;
)

> In this case it is a back end administration form as the (power) user
> does not want to have to fiddle about with drop downs.  In fact they
> can use / or - or . as a seperater.  The split function can handle
> that. 

Well, but then you're splitting the date up into its constituent components
anyway -- so what's all the fuss about???

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

--- End Message ---
--- Begin Message --- Robert Cummings schrieb:
On Mon, 2005-01-24 at 12:26, Merlin wrote:

Hi there,

I am now using Homesite 4.5.x since a few years since I found it the most relieble editor arround.

Now I would like to have a look around to see if there are better solutions nowadays.

I am looking for a relieable, stable and quick PHP/HTML editor.

Can anybody suggest a good one? I tried phpdesigner, but it seems to have lots of bugs and is quite slow.

Thank you for any suggestions,

Merlin


Let me recommend something far better: A SEARCH ENGINE

If that should fail: A BRAIN

At the very least: RTFA

This topic spams the list every week or two. It was just on last week.
At least have a little self respect and try to find an answer for
yourself before posting the same old off topic crap.

Cheers,
Rob.

It seems like you did have a very bad day. Maybe you should consider not to spoil the good spirit that this nice php list offers. There are lots of great people on here. To bad that such answers also find its way to the board.


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

Try posting the error messages  and your exact configure line to
php-install for the maximum odds of a useful response.

the configure line is as follows:

CFLAGS="-I/usr/kerberos/include" ./configure \
        --prefix=/webserver/php-5.0.3 \
        --enable-bcmath \
        --enable-calendar \
        --enable-exif \
        --enable-ftp \
        --enable-magic-quotes \
        --enable-mbstring \
        --enable-soap \
        --enable-sockets \
        --enable-trans-id \
        --enable-wddx \
        --with-bz2 \
        --with-curl \
        --with-db4 \
        --with-dom \
        --with-gdbm \
        --with-gettext \
        --with-imap \
        --with-imap-ssl \
        --with-kerberos \
        --with-ldap \
        --with-mhash=/webserver/mhash \
        --with-mysql=/usr \
        --with-openssl \
        --with-pspell \
        --with-gd \
        --with-jpeg-dir=/usr/include \
        --with-freetype-dir=/usr/include \
        --with-zlib

All errors I got have been mailed before.

Regards
Marten

--- End Message ---
--- Begin Message ---
On 24 Jan 2005 Richard Lynch wrote:

> Assuming you are authenticating them correctly so that a Bad Guy can't
> change the HTML out from under them, it seems reasonable to me -- Not much
> point to cross-site vandalism on one's own site, eh?

Exactly, that was my thought as well ...

--
Tom

--- End Message ---
--- Begin Message ---
=========================================================
Please feel free to add more points and send to the list. 
=========================================================

1. If you have any queries/problems about PHP try
http://www.php.net/manual/en first. You can download a copy and use it
offline also. 

Please also try http://www.php.net/manual/faq.php for answers to
frequently answered questions 
about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Searching for "php YOUR QUERY" may
fetch you relevant 
information within the first 10 results.

3. There is a searchable archive of the mailing list discussion at
http://phparch.com/mailinglists. Many of the common topics are discussed
repeatedly, and you may get answer to your query from the 
earlier discussions. 

For example: One of the repeatedly discussed question in the list is
"Best PHP editor". Everyone has his/her favourite editor. You can get
all the opinions by going through the list archives. If you want a
chosen list try this link :
http://www.thelinuxconsultancy.co.uk/phpeditors/
(contributed by Christophe Chisogne).

4. Not sure if PHP is working or you want find out what extensions are
available to 
you?

Just put the following code into a file with a .php extension and access
it through your 
webserver:

<?php
phpinfo();
?> 

If PHP is installed you will see a page with a lot of information on it.
If PHP is not installed (or not working correctly) your browser will try
to download the file.
(contributed by Teren and reworded by Chris W Parker)

5. If you are stuck with a script and do not understand what is wrong,
instead of posting 
the whole script, try doing some research yourself. One useful trick is
to print the variable/sql query using print or echo command and check
whether you get what you expected. 

After diagnosing the problem, send the details of your efforts
(following steps 1, 2 & 3) and ask for help.

6. PHP is a server side scripting language. Whatever processing PHP does
takes place BEFORE the output reaches the client. Therefore, it is not
possible to access users' computer related information (OS, screen size
etc) using PHP. Nor can you modify any the user side settings. You need 
to go for JavaScript and ask the question in a JavaScript list.

On the other hand, you can access the information that is SENT by the
user's browser when a client requests a page from your server. You can
find details about browser, OS etc as reported by 
this request. 
(contributed by Wouter van Vliet and reworded by Chris W Parker.)

7. Provide a clear descriptive subject line. Avoid general subjects like
"Help!!", "A Question" etc. Especially avoid blank subjects. 

8. When you want to start a new topic, open a new mail composer and
enter the mailing list address [email protected] instead of
replying to an existing thread and replacing the subject and body with
your message.

9. It's always a good idea to post back to the list once you've solved
your problem. People usually add [SOLVED] to the subject line of their
email when posting solutions. By posting your solution you're helping
the next person with the same question. 
[contribued by Chris W Parker]

10. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

11. Do not send your email to the list with attachments. If you don't
have a place to upload your code, try the many pastebin websites (such
as www.pastebin.com). 
(contributed by Burhan Khalid)

Following these guidelines will ensure that you get effective responses
from the list members. Otherwise, your questions might not be answered.

===============================================
Hope you have a good time programming with PHP.
===============================================

--- End Message ---
--- Begin Message ---
Great list Jay.  The only other thing that I would add is this:

The people on this list are not your paid support specialists that *have* to answer you on your slightest whim. Most of this "netiquette" is covered by http://www.catb.org/~esr/faqs/smart-questions.html, but basically if you make it easy for us to help you then we probably will.

I personally find it *very* irritating when I get emails sent to me asking for help. I am more than happy to answer questions on the list, but please respect my privacy and realize that I answer questions in the newsgroup when / if I get the time to do so. There will be times to send me private emails which are ok, but generally keep all PHP help questions on the list.


-- Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

--- End Message ---
--- Begin Message ---
I too agree - the list raises some really important points...
Just a thought, but would it be worth someone posting the list once a week
to catch new users as they sign up?

Might be worth it in the interest of keeping the list tidy?

Chris Ramsay
-----------------------------------------------------------------
Web Developer - The Danwood Group Ltd.
T: +44 (0) 1522 834482
F: +44 (0) 1522 884488
e: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
w: http://www.danwood.co.uk
-----------------------------------------------------------------

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

Tuesday, January 25, 2005, 2:03:09 PM, you wrote:

CR> Just a thought, but would it be worth someone posting the list
CR> once a week to catch new users as they sign up?

Isn't it posted once a month as it is?

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

--- End Message ---
--- Begin Message ---
[snip]
CR> Just a thought, but would it be worth someone posting the list
CR> once a week to catch new users as they sign up?

Isn't it posted once a month as it is?
[/snip]

It used to be, but it seems that it hasn't been posted in a while. So I
retrieved it and posted it. I was thinking about setting up a cron to
post it every other day or so.

--- End Message ---
--- Begin Message ---
Richard & TheList...

>Isn't it posted once a month as it is?

Hot damn! That'll be why I have never seen it then! :/

Apologies to all!!!

Chris Ramsay
-----------------------------------------------------------------
Web Developer - The Danwood Group Ltd.
T: +44 (0) 1522 834482
F: +44 (0) 1522 884488
e: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
w: http://www.danwood.co.uk
-----------------------------------------------------------------

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

Tuesday, January 25, 2005, 2:33:32 PM, you wrote:

JB> It used to be, but it seems that it hasn't been posted in a while. So I
JB> retrieved it and posted it. I was thinking about setting up a cron to
JB> post it every other day or so.

I think once a week would be more than enough. You have to actually
hope the newbies even read it, most of them don't even think they are
"newbies" :)

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

--- End Message ---
--- Begin Message ---
[snip]
JB> It used to be, but it seems that it hasn't been posted in a while.
So I
JB> retrieved it and posted it. I was thinking about setting up a cron
to
JB> post it every other day or so.

I think once a week would be more than enough. You have to actually
hope the newbies even read it, most of them don't even think they are
"newbies" :)
[/snip]

Then we should chnage the header
[NEWBIE GUIDE] - READ THIS OR YOU'LL NEVER GET ON THE ISLAND

--- End Message ---
--- Begin Message --- Jay Blanchard wrote:
[snip]
JB> It used to be, but it seems that it hasn't been posted in a while.
So I
JB> retrieved it and posted it. I was thinking about setting up a cron
to
JB> post it every other day or so.

I think once a week would be more than enough. You have to actually
hope the newbies even read it, most of them don't even think they are
"newbies" :)
[/snip]

Then we should chnage the header
[NEWBIE GUIDE] - READ THIS OR YOU'LL NEVER GET ON THE ISLAND

Hope there are some hot chicks on this island. Heck I'm a newbie, if all the newbies get lei'd once they're accepted on the island ;)


Definitely seems worthy of cron to me.

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

--- End Message ---
--- Begin Message ---
Great List...

although.. .just having a sense humor here... i think every topic has
been covered a number of times... which means no one should be posting
questions at the php list... cause they are all in the archive :0)

cheers!
Joe


On Tue, 25 Jan 2005 09:48:53 -0500, Jason Barnett
<[EMAIL PROTECTED]> wrote:
> Jay Blanchard wrote:
> > [snip]
> > JB> It used to be, but it seems that it hasn't been posted in a while.
> > So I
> > JB> retrieved it and posted it. I was thinking about setting up a cron
> > to
> > JB> post it every other day or so.
> >
> > I think once a week would be more than enough. You have to actually
> > hope the newbies even read it, most of them don't even think they are
> > "newbies" :)
> > [/snip]
> >
> > Then we should chnage the header
> > [NEWBIE GUIDE] - READ THIS OR YOU'LL NEVER GET ON THE ISLAND
> 
> Hope there are some hot chicks on this island.  Heck I'm a newbie, if
> all the newbies get lei'd once they're accepted on the island ;)
> 
> Definitely seems worthy of cron to me.
> 
> --
> Teach a man to fish...
> 
> NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
> STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
> STFM | http://www.php.net/manual/en/index.php
> STFW | http://www.google.com/search?q=php
> LAZY |
> http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

--- End Message ---
--- Begin Message ---
[snip]
although.. .just having a sense humor here... i think every topic has
been covered a number of times... which means no one should be posting
questions at the php list... cause they are all in the archive :0)
[/snip]

Maybe...except for PHP5 :) !

--- End Message ---
--- Begin Message --- Jay Blanchard wrote:
[snip]
although.. .just having a sense humor here... i think every topic has
been covered a number of times... which means no one should be posting
questions at the php list... cause they are all in the archive :0)
[/snip]

Maybe...except for PHP5 :) !

That and XML / SOAP. I've noticed that while some of those questions go answered there are a *lot* of times when they don't. I guess a lot of people on the list don't use it? That or the answers are sent privately / much later because I seldom see them answered.



-- Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

--- End Message ---
--- Begin Message ---
[snip]
...stuff...
[/snip]

This is interesting, I set up the mail line for the CRON to read

mail("[email protected]", "[NEWBIE GUIDE] - For benefit of new
list members", $msg, "From: [EMAIL PROTECTED]" . "Reply-To:
[EMAIL PROTECTED]" . "X-Mailer: PHP/" . phpversion());

And the test mail did not appear on the list. Would php-general not
recognize itself as a member?

--- End Message ---
--- Begin Message --- Jay Blanchard wrote:
[snip]
CR> Just a thought, but would it be worth someone posting the list
CR> once a week to catch new users as they sign up?

Isn't it posted once a month as it is?
[/snip]

It used to be, but it seems that it hasn't been posted in a while. So I
retrieved it and posted it. I was thinking about setting up a cron to
post it every other day or so.

Didn't it used to get sent out to people when they subscribed to the list too? Anyone know if that still happens?


--
John C. Nichel
�berGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message --- Jay Blanchard wrote:
[snip]
....stuff...
[/snip]

This is interesting, I set up the mail line for the CRON to read

mail("[email protected]", "[NEWBIE GUIDE] - For benefit of new
list members", $msg, "From: [EMAIL PROTECTED]" . "Reply-To:
[EMAIL PROTECTED]" . "X-Mailer: PHP/" . phpversion());

And the test mail did not appear on the list. Would php-general not
recognize itself as a member?

To be honest: I simply don't know. I'm guessing John Holmes might know the answer to this one? ...


--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

--- End Message ---
--- Begin Message --- Jay Blanchard wrote:
[snip]
...stuff...
[/snip]

This is interesting, I set up the mail line for the CRON to read

mail("[email protected]", "[NEWBIE GUIDE] - For benefit of new
list members", $msg, "From: [EMAIL PROTECTED]" . "Reply-To:
[EMAIL PROTECTED]" . "X-Mailer: PHP/" . phpversion());

And the test mail did not appear on the list. Would php-general not
recognize itself as a member?


maybe it doesn't work on purpose - possibly to avoid mail loops?

---

Jay, great list BTW - I was thinking maybe we could drop it on a site/wiki
or something which could also contain stuff that comes up again and again,
or stuff that even the 6month y/o newbie finds trivial or just good stuff
thats been condensed from the list (kind of a good practice/cool code
repository). I know there are lots of places out there already but I think
,for instance, the mail archives suck for searching - and often there is
plenty of FUD in among the cherries. someone could then send out a weekly
NEWBIE email that points them to said site - which in turns introduces them
to netiquette, list faqs, etc. having a Wiki type thing would relieve the
list of lots of 'O-T' stuff on 'NEWBIE email enhancements'?

--- End Message ---
--- Begin Message --- John Nichel wrote:
Jay Blanchard wrote:

[snip]
CR> Just a thought, but would it be worth someone posting the list
CR> once a week to catch new users as they sign up?

Isn't it posted once a month as it is?
[/snip]

It used to be, but it seems that it hasn't been posted in a while. So I
retrieved it and posted it. I was thinking about setting up a cron to
post it every other day or so.


Didn't it used to get sent out to people when they subscribed to the list too? Anyone know if that still happens?


yes - the answer is no (if it ever did - I can't recall).

--- End Message ---
--- Begin Message ---
[snip]
> This is interesting, I set up the mail line for the CRON to read
> 
> mail("[email protected]", "[NEWBIE GUIDE] - For benefit of new
> list members", $msg, "From: [EMAIL PROTECTED]" .
"Reply-To:
> [EMAIL PROTECTED]" . "X-Mailer: PHP/" . phpversion());
> 
> And the test mail did not appear on the list. Would php-general not
> recognize itself as a member?

To be honest: I simply don't know.  I'm guessing John Holmes might know 
the answer to this one? ...
[/snip]

I just tried with a different From address...mine....and still no
appearance on the list. Interesting to say the least.

--- End Message ---
--- Begin Message --- Jochem Maas wrote:
Jay Blanchard wrote:

...
Jay, great list BTW - I was thinking maybe we could drop it on a site/wiki
or something which could also contain stuff that comes up again and again,
or stuff that even the 6month y/o newbie finds trivial or just good stuff
thats been condensed from the list (kind of a good practice/cool code
repository). I know there are lots of places out there already but I think

I think that Justin Patrin started up a wiki for PHP, but he hasn't been on the list in a while and I can't remember what the url for his wiki was. But he had a fair amount of useful code in there that would be a great start for this project.


,for instance, the mail archives suck for searching - and often there is
plenty of FUD in among the cherries. someone could then send out a weekly
NEWBIE email that points them to said site - which in turns introduces them
to netiquette, list faqs, etc. having a Wiki type thing would relieve the
list of lots of 'O-T' stuff on 'NEWBIE email enhancements'?

Yeah the list is pretty high volume... it would be great if we could help relieve the stress on the servers a bit.



-- Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

--- End Message ---
--- Begin Message ---
Hello all. Is anyone aware of php 5.1.0 release date?
Thanks.
-- 
RE5PECT
Sergio Gorelyshev

--- End Message ---
--- Begin Message ---
I'm not too good with classes, in the below class I can get the hit counter
to write to the hit counter file, but I can't get it to write the log file,
I know security is done correctly on the file because it's the same as the
counter log file, but I can't figure out why the other file isn't being
written to.
Also while the IP address works within the code prior to calling the class
 
Thanks!
 
<%
class counter {
 var $log_file = 'counters/google_log.txt';
 var $file = 'counters/google_counter.txt'; 
 function counter()
 {
  $this->readFile();
  $this->writeFile();
  $this->writeLog();
 }
 
 function readFile()
 {
  $hiti = fopen($this->file, "r");
  while(!feof($hiti)){
   $this->$hits .= fgets($hiti,128);
  }
  $this->$hits=1+$this->$hits;
  echo $this->$hits;
  fclose($hiti);
 }
 
 function writeFile()
 {
  $hito = fopen($this->file,"w+");
  fputs($hito,$this->$hits);
  fclose($hito);
 }
 
 function writeLog()
 {
  $ip_address=$REMOTE_ADDR;
  $date_stamp=date("F j, Y, g:i a");
   $log_entry=$date_stamp . "  :  " . $ip_address . "\n" ;
   echo "TEST-> " . $log_entry ;
  $log = fopen($this->log_file,"w+");
  fputs($log,$this->$log_entry );
  fclose($log);
 }
 
}
%>

--- End Message ---
--- Begin Message ---
Hi there,

I am trying to find a open source PHP Cache extension. After trying out ionCube PHP Accelerator (http://www.php-accelerator.co.uk) I had to remove it from the system since it brought down the server every few weeks due to some memory leak. There is also APC, but the latest build is over 3 years old.

Is there a working alternative for Zend? I am not sure if it is worth for me to spend that much money for a lizence.

Thank you for any suggestion.

Regards,

merlin
--- End Message ---
--- Begin Message --- Squid any good to you? You can configure it to cache based on page name, GET and POST params (personally don't like to use POST params for static or semi static content, but that's a personal preference, not a hard and fast rule), farside domains....
You set it up above your php servers so it doesn't care what language you are using to provide the content.


Tom
Merlin wrote:

Hi there,

I am trying to find a open source PHP Cache extension. After trying out ionCube PHP Accelerator (http://www.php-accelerator.co.uk) I had to remove it from the system since it brought down the server every few weeks due to some memory leak. There is also APC, but the latest build is over 3 years old.

Is there a working alternative for Zend? I am not sure if it is worth for me to spend that much money for a lizence.

Thank you for any suggestion.

Regards,

merlin


--- End Message ---
--- Begin Message ---
* Merlin <[EMAIL PROTECTED]>:
> I am trying to find a open source PHP Cache extension. After trying
> out ionCube PHP Accelerator (http://www.php-accelerator.co.uk) I had
> to remove it from the system since it brought down the server every
> few weeks due to some memory leak.  There is also APC, but the latest
> build is over 3 years old.
>
> Is there a working alternative for Zend? I am not sure if it is worth
> for me to spend that much money for a lizence.

I haven't used it yet, but I've heard some good reports about it:

    http://eaccelerator.sourceforge.net/Home

It's a fork of Turckk mmcache.

-- 
Matthew Weier O'Phinney           | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

--- End Message ---
--- Begin Message ---
hi...

i'm in need of an app that has/should have directory/user/member functionality. 
i want to setup a process to allow an adim to create different fields and 
categories for a user to enter. think of a company employee database, where you 
have the employe name, and then the various groups/projects the employee might 
belong to...

i'm trying to figure out if there's already an app that you may have run across 
that kind of does this, and if you haven't, what might be the best soln/easiest 
soln to implement.. i've started to research ldap, but i'm not sure that this 
is the best approach (given that i have no experience with ldap!)

i'm open to a php/perl/linux/mysql/apache solution.

searching through php/google hasn't turned up anything as of yet...

if you have any thoughts let me know...


thanks

bruce
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Rasmus Lerdorf wrote:

Arshavir Grigorian wrote:

Hi,

I am having trouble debugging a PECL module (APC) because while I am able to --enable-debug when configuring the PHP course, I cannot do the same for APC (no such configure option). Does anyone know how to do that?

PHP Warning: Unknown(): apc: Unable to initialize module\nModule compiled with module API=20020429, debug=0, thread-safety=0\nPHP compiled with module API=20020429, debug=1, thread-safety=0\nThese options need to match\n in Unknown on line 0


You need to make install after compiling PHP with --enable-debug to get phpize and php-config to inherit the debug flag which will cause apc to be built with debug mode when you run phpize in the apc directory.

-R

What I really needed to do was to manually delete bin/php*, lib/php/ and include/php/ before attempting a reinstall.



Arshavir

--- End Message ---
--- Begin Message ---
On Fri, 21 Jan 2005 12:02:51 +0100, Mike Blank
<[EMAIL PROTECTED]> wrote:
> Hi Guys!
> 
> I've got a problem with Dom and php 5.0.2. I'm trying to access an xml
> node with $item = $objDom->documentElement->childNodes->item(0);. That
> seems to work, because on the next line I can output the node Value with
> echo $item->nodeValue. But when I use the command
> $objDom->removeChild($item); on the next line, dom throws a
> DOMException:

$objDom has to to be the parent node of $item., not the document itself.

$objDom->documentElement->removeChild($item);
should work in your case. or more general

$item->parentNode->removeChild($item);

chregu

> 
> Fatal error: Uncaught exception 'DOMException' with message 'Not Found
> Error' in
> /opt/lampp/htdocs/www/snap_chubb/extensions/features/mitarbeiter/main.fe
> a.php:13 Stack trace: #0
> /opt/lampp/htdocs/www/snap_chubb/admin/admin.class.php(179): require()
> #1 /opt/lampp/htdocs/www/snap_chubb/admin/admin.class.php(154) :
> eval()'d code(1): Admin->editFeature(Object(DOMElement)) #2
> /opt/lampp/htdocs/www/snap_chubb/admin/admin.class.php(154): eval() #3
> /opt/lampp/htdocs/www/snap_chubb/admin/index.php(142):
> Admin->drawContent() #4 {main} thrown in
> /opt/lampp/htdocs/www/snap_chubb/extensions/features/mitarbeiter/main.fe
> a.php on line 13
> 
> Below you can see my code:
> 
> Index.php
> -----------------------------------------------------------------------
> 
> $objDom = new DomDocument(); // neues dom objekt
> $strXML = $this->loadXMLTree($objDATA->fields['pfe_con_id']); //
> funktion, die eine xml datei als string aus der db ausliest if ($strXML
> != false) {
>         $objDom->loadXML($strXML); // string wird in das dom objekt
> geladen } $item = $objDom->documentElement->childNodes->item(0); //
> adressierung eines knoten echo $item->nodeValue; // ausgabe funktioniert
> ohne probleme
> $objDom->removeChild($item); // diese zeile spuckt den oben genannten
> Error aus!
> 
> Geladener XML string
> -----------------------------------------------------------------------
> 
> <?xml version="1.0"?>
> <root>
>         <mitarbeiter>
>                 <image>/images/43/team_fabian-bischof_kl.jpg</image>
>                 <name>Fabian Bischof</name>
>                 <detailpage>45</detailpage>
>         </mitarbeiter>
>         <mitarbeiter>
>                 <image>/images/43/team_sandra-varela_kl.jpg</image>
>                 <name>Sandra Varela</name>
>                 <detailpage>0</detailpage>
>         </mitarbeiter>
>         <mitarbeiter>
>                 <image>/images/43/team_sandra-varela_kl.jpg</image>
>                 <name>Sandra Varela</name>
>                 <detailpage>0</detailpage>
>         </mitarbeiter>
> </root>
> -----------------------------------------------------------------------
> 
> I hope somebody can help me somehow! I'm really desperate!
> 
> Cheers
> 
> mike
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  [EMAIL PROTECTED]  |  gnupg-keyid 0x5CE1DECB

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

I need to replace all the numbers of a credit card except for the last
4 with an 'X' ... can't seem to locate the string function for this...
can someone point me in the right direction here to what php item i
should be using.

Thanks!
Joe

--- End Message ---
--- Begin Message ---
[snip]
I need to replace all the numbers of a credit card except for the last
4 with an 'X' ... can't seem to locate the string function for this...
can someone point me in the right direction here to what php item i
should be using.
[/snip]

ROFLMMFAO! It's all been discussed before Joe! 

http://www.php.net/ereg_replace

--- End Message ---
--- Begin Message ---
this is my way.

       $cc_stars = '';
       $cc_no_lenght = strlen($cc_number);
       $cc_info_first4 = substr($cc_number, 0, 4);
       $cc_info_last4 = substr($cc_number, (strlen($cc_number) - 4), 4);
       for($i=0; $i<($cc_no_lenght-8); $i++) $cc_stars .= '*';
       $cc_number = $cc_info_first4 .$cc_stars. $cc_info_last4;


-afan

Joe Harman wrote:

Hello,

I need to replace all the numbers of a credit card except for the last
4 with an 'X' ... can't seem to locate the string function for this...
can someone point me in the right direction here to what php item i
should be using.

Thanks!
Joe




--- End Message ---
--- Begin Message --- Joe Harman wrote:
Hello,

I need to replace all the numbers of a credit card except for the last
4 with an 'X' ... can't seem to locate the string function for this...
can someone point me in the right direction here to what php item i
should be using.

that'll be:

string php_replace_all_but_last_four_chars_of_creditcard_number(string input[, 
string pad_string])

actually that func doesn't exist - what you need to do (well its one way to do 
it)
is use a combination of substr() and str_pad() e.g:

echo str_pad(substr($cc, -4), 20, 'X', STR_PAD_LEFT);

where $cc is the previously checked/verified/sanitized creditcard no.
and 20 is the length of a creditcard no. - forgive me if I'm wrong about the CC
number length, I don't have a creditcard.


Thanks! Joe


--- End Message ---
--- Begin Message ---
In addition to what was mentioned already, using ereg_replace, if you're 
pulling the CC# string out of a database of off of some POST data or something, 
just use a substr() function to pull the last 4 digits and prepend a bunch of 
X's.

$ccnum = "342342522342342";  # fake CC #, prob not even correct # of digits :)
$maskedccnum = "XXXXXXXXXXX" . substr($ccnum,strlen($ccnum)-5,4);


If you're trying to do it in a form, realtime as the user enters it, you'd have 
to use some funky javascript or do something with a password form type or 
something.  But sounds like you want it like when you display an invoice 
afterwards or display a "Would you like to use this CC that's already on file?" 
type thing without exposing the whole CC#.

-TG

= = = Original message = = =

Hello,

I need to replace all the numbers of a credit card except for the last
4 with an 'X' ... can't seem to locate the string function for this...
can someone point me in the right direction here to what php item i
should be using.

Thanks!
Joe


___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

--- End Message ---
--- Begin Message ---
Hey!
I just got this emai lfrom RIPN mail processor at Moscow ?!?!?!?!?

What's going on?

-afan

-------- Original Message --------
Subject: DNS.050125191312.29782 (Re: Re: [PHP] Replace credit card numbers with X ???)
Date: Tue, 25 Jan 2005 19:13:27 +0300
From: RIPN NCC <[EMAIL PROTECTED]>
To: [email protected],[EMAIL PROTECTED]




Dear Madam/Sir,

Here are results of  processing your  request:

From:    Afan Pasalic <[EMAIL PROTECTED]>
Subject: Re: [PHP] Replace credit card numbers with X ???
Date:    Tue, 25 Jan 2005 10:06:21 -0600
Msg-Id:  <[EMAIL PROTECTED]>

this is my way.
unrecognized statment - line ignored.

$cc_stars = '';
unrecognized statment - line ignored.
$cc_no_lenght = strlen($cc_number);
unrecognized statment - line ignored.
$cc_info_first4 = substr($cc_number, 0, 4);
unrecognized statment - line ignored.
$cc_info_last4 = substr($cc_number, (strlen($cc_number) - 4), 4);
unrecognized statment - line ignored.
for($i=0; $i<($cc_no_lenght-8); $i++) $cc_stars .= '*';
unrecognized statment - line ignored.
$cc_number = $cc_info_first4 .$cc_stars. $cc_info_last4;
unrecognized statment - line ignored.


-afan
unrecognized statment - line ignored.

Joe Harman wrote:
unrecognized statment - line ignored.

>Hello,
unrecognized statment - line ignored.
>
unrecognized statment - line ignored.
>I need to replace all the numbers of a credit card except for the last
unrecognized statment - line ignored.
>4 with an 'X' ... can't seem to locate the string function for this...
unrecognized statment - line ignored.
>can someone point me in the right direction here to what php item i
unrecognized statment - line ignored.
>should be using.
unrecognized statment - line ignored.
Too many warnings (max. 2) - FATAL ERROR!
>
>Thanks!
>Joe
>
> >


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


Your current request counter: 1.
You may send us 119 in this hour.


Thank you, RIPN mail processor. Tue Jan 25 19:13:27 MSK/MSD 2005 Moscow, Russia.

--- End Message ---

Reply via email to