[PHP] please help me I try to post my question to Php.net 2-3 times

2006-02-15 Thread wvolks
text file problem

read text file to array string. I use function File(). but when I display
data in text file it compress space in each lines such as first record
contain "1_2__3__4__" ( _ = blank )
when store in array string is "1 2 3 4" . I want you tell me howto do?
+

// data in text file is "1_2_3_4" < _ = blank>
// output is "1 2 3 4"
// I want fixed possition . please help me ?
from Wvolks

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



Re: [PHP] HN CAPTCHA at http://www.phpclasses.org

2006-02-15 Thread Roger Thomas
Quoting Kim Christensen <[EMAIL PROTECTED]>:


> To solve your problem, replace the generate_private() function in
> hn_captcha.class.php - starting at row 756 - with this code:
> 
>function generate_private($public="")
>{
>   $letters = "1234567890abcdefghijklmnopqrstuvwxyz";
>   $maxsize = strlen($letters)-1;
>   for($i=0;$i<6;$i++){
> $rstring .= $letters{mt_rand(0, $maxsize)};
>   }
>   return $rstring;
>}
> 
> This should yield a 6 char "random" string containing digits 0-9 and
> letters a-z.
> 
> Good luck!
> 
> --
> Kim Christensen
> [EMAIL PROTECTED]
> 


Thank you Kim.

--roger


---
Sign Up for free Email at http://ureg.home.net.my/
---

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



Re: [PHP] how to build custom/private pear packages

2006-02-15 Thread Paul Scott
On Wed, 2006-02-15 at 22:02 -0800, Curt Zirzow wrote:

> This is one of the new features of pear, i sat through a talk on
> pear given by Tobias Schlitt, and introduced this channel concept.
> 
I attended Tobias' talk as well, and was quite impressed.

> I'd very much like to see you to get this to work, the more
> exposure of this could make pear more like perl's CPAN.
> 

After the talk that I went to, I ran home and immediately rolled out my
own channel server! The channel is at http://pear.uwc.ac.za and there is
a CVS project for using it at http://avoir.uwc.ac.za/projects/pearchan/
I haven't quite had the time to get around to actually *publishing*
anything on the channel server yet, as I am currently porting a
_massive_ PHP4 project to PHP5...but from what I can see, its not very
difficult, and can probably be automated quite nicely from CVS.

--Paul

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



Re: [PHP] HN CAPTCHA at http://www.phpclasses.org

2006-02-15 Thread Roger Thomas
Quoting Curt Zirzow <[EMAIL PROTECTED]>:

> On Thu, Feb 16, 2006 at 09:44:33AM +0800, Roger Thomas wrote:
> > I am currently testing HN CAPTCHA and noticed that the range of
> alphabets that were produced ranges from A..F only. My PHP skill is
> quite limited to change that to A..Z so if ppl here have any
> experience with that class, appreciate your thoughts. TIA.
> > 
> > HN CAPTCHA: http://www.phpclasses.org/browse/package/1569.html
> 
> I'd say contact the author about this.
>  
> Curt.

I did. Waited for a week. No response. Hence this list :(

--roger




---
Sign Up for free Email at http://ureg.home.net.my/
---

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



Re: [PHP] how to build custom/private pear packages

2006-02-15 Thread Curt Zirzow
On Thu, Feb 16, 2006 at 08:09:23AM +0200, Paul Scott wrote:
> On Wed, 2006-02-15 at 22:02 -0800, Curt Zirzow wrote:
> 
> > This is one of the new features of pear, i sat through a talk on
> > pear given by Tobias Schlitt, and introduced this channel concept.
> > 
> I attended Tobias' talk as well, and was quite impressed.
> 
> > I'd very much like to see you to get this to work, the more
> > exposure of this could make pear more like perl's CPAN.
> > 
> 
> After the talk that I went to, I ran home and immediately rolled out my
> own channel server! The channel is at http://pear.uwc.ac.za and there is
> a CVS project for using it at http://avoir.uwc.ac.za/projects/pearchan/
> I haven't quite had the time to get around to actually *publishing*
> anything on the channel server yet, as I am currently porting a
> _massive_ PHP4 project to PHP5...but from what I can see, its not very
> difficult, and can probably be automated quite nicely from CVS.

with more research I came accross this place:

  http://pearadise.net/

Hopefully the more people take advantage of this the more it will
get used, i really like ;this concept.

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] HN CAPTCHA at http://www.phpclasses.org

2006-02-15 Thread Kim Christensen
On 2/16/06, Roger Thomas <[EMAIL PROTECTED]> wrote:
> I am currently testing HN CAPTCHA and noticed that the range of alphabets 
> that were produced ranges from A..F only. My PHP skill is quite limited to 
> change that to A..Z so if ppl here have any experience with that class, 
> appreciate your thoughts. TIA.

The reason this CAPTCHA class only returns letters between A-F is
because it uses the md5() function in php to get a (more or less)
random string. MD5 hashes contains of a 32-character hexadecimal
numbers, which in turn ranges from 0 to F.

To solve your problem, replace the generate_private() function in
hn_captcha.class.php - starting at row 756 - with this code:

   function generate_private($public="")
   {
  $letters = "1234567890abcdefghijklmnopqrstuvwxyz";
  $maxsize = strlen($letters)-1;
  for($i=0;$i<6;$i++){
$rstring .= $letters{mt_rand(0, $maxsize)};
  }
  return $rstring;
   }

This should yield a 6 char "random" string containing digits 0-9 and
letters a-z.

Good luck!

--
Kim Christensen
[EMAIL PROTECTED]

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



Re: [PHP] how to build custom/private pear packages

2006-02-15 Thread Paul Scott
On Wed, 2006-02-15 at 22:33 -0800, Curt Zirzow wrote:

> with more research I came accross this place:
> 
>   http://pearadise.net/
> 

Well aware of pearadise.net. I was just waiting to actually get some
content going before registering there...

> Hopefully the more people take advantage of this the more it will
> get used, i really like ;this concept.
> 

Absolutely! It is an excellent concept. For us in Africa, I see many
more possibilities too... I would like to see permission from the pear
project to mirror all of the pear packages to localised repositories
like this as bandwidth nodes for low bandwidth countries. Even in a
relatively good environment in South Africa, we sometimes struggle to
get required packages, but this is nullified by local mirrors.

I also see possibilities for distributing entire applications too, as
well as language packs for localising software.

My only complaint with the Channel Server so far, is that the
commandline actions are not multilingual, same with the package2.xml
files... 

--Paul

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



Re: [PHP] how to build custom/private pear packages

2006-02-15 Thread Curt Zirzow
On Wed, Feb 15, 2006 at 11:05:33AM +0100, Jochem Maas wrote:
> hi people,
> 
> I have been thinking about how I rollout some of my code (stuff
> that gets reused alot) and I thought it would be nice if I could have
> basic functionality available for my projects via a custom pear
> package server (referred to as a 'pear channel'??) - so what I would
> like to figure out is how to set up a 'package server' and how to
> roll my own packages.

This is one of the new features of pear, i sat through a talk on
pear given by Tobias Schlitt, and introduced this channel concept.

I'd very much like to see you to get this to work, the more
exposure of this could make pear more like perl's CPAN.

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] Upload via email?

2006-02-15 Thread Curt Zirzow
Michael, 

On Wed, Feb 15, 2006 at 10:37:07PM -0500, Michael Crute wrote:
> On 2/15/06, Nicholas Couloute <[EMAIL PROTECTED]> wrote:
> > How would u make a script that uploads files to ur server via email? 1.
> > user emails the server 2. if there is a audio file (amr) attached then
> > add it a folder! Are there any scripts that can do that?
> 
> 
> This will take some work but what you want to do is setup a email
> account that you designate as the "upload email". You will want to
> write a script to access this email box and download the content
> directory. Will probably cron this script.
>
> To really do this you need to understand how an email works, here is a
> ...
> quick and dirty tutorial you will DEFINITELY want to do some further
> reading on this. The headers define "metadata" (if you will) about the

 This is a rather nice little review on this situation. Ever
 consider writing and publishing this information somewhere?

> ...

-- 
cat .signature: No such file or directory

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



Re: [PHP] Using javascript with php

2006-02-15 Thread Curt Zirzow
On Wed, Feb 15, 2006 at 05:10:53PM -0500, Sugrue, Sean wrote:
> To all,
> 
> I have a check box input which I assign an array to the name. I want to
> pass the array to a javascript and based on a certain criteria check
> the box. I use the syntax: formname.elements['array[]'][index].checked=
> true. It works with IE but since my buddy added an html validator
> to a config file we all use and now the code will not work in Firefox.
> Does anyone out there perform this task differently? Any suggestions?
 
I always assign ID's to my elements and reference them that way.



var element = document.getElementById('array_item_1');
element.checked = true;



-- 
cat .signature: No such file or directory

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



[PHP] installing php 4.4.2 on windows system

2006-02-15 Thread Paul Goepfert
Hello all,

I have been developing a php website.  I have been ftping my php web
pages to a webserver and that works hkowever I don't have an error log
on the webserver.  So I downloaded apache 2.0.55.   I am doing a
manual installation and I am at the point where it tells me where to
place the php.ini file.  The instructions tell me to put the file in a
number of places. The directions told me that if I were using apache
to use the PHPIniDir directive.  My question is where do I put the
php.ini file? Where do I put this Directive? In the Httpd.conf?

Paul

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



Re: [PHP] PHP !== Hypertext Pre-Processor

2006-02-15 Thread Curt Zirzow
On Thu, Feb 16, 2006 at 01:00:38PM +1000, Ligaya Turmelle wrote:
> On the IRC - been told it's for "Pretty Horny People" ;) LOL

+1

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] Upload via email?

2006-02-15 Thread Paul Scott
On Wed, 2006-02-15 at 22:37 -0500, Michael Crute wrote:
> On 2/15/06, Nicholas Couloute <[EMAIL PROTECTED]> wrote:
> > How would u make a script that uploads files to ur server via email? 1.
> > user emails the server 2. if there is a audio file (amr) attached then
> > add it a folder! Are there any scripts that can do that?
> 
> 
> This will take some work but what you want to do is setup a email
> account that you designate as the "upload email". You will want to
> write a script to access this email box and download the content
> directory. Will probably cron this script.
> 

I contributed a class to phpclasses.org a while back that does this.
Check it out here:

http://www.phpclasses.org/browse/package/2816.html

It relies on PEAR Net_POP3 and Mail_Mime to do the heavy lifting. The
class method that end off the process returns an array of the message
body, subject etc, as well as a reference to the file that is attached.
I use it quite extensively in our e-learning system and framework as
well, so it works well.

--Paul

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



Re: [PHP] HN CAPTCHA at http://www.phpclasses.org

2006-02-15 Thread Curt Zirzow
On Thu, Feb 16, 2006 at 09:44:33AM +0800, Roger Thomas wrote:
> I am currently testing HN CAPTCHA and noticed that the range of alphabets 
> that were produced ranges from A..F only. My PHP skill is quite limited to 
> change that to A..Z so if ppl here have any experience with that class, 
> appreciate your thoughts. TIA.
> 
> HN CAPTCHA: http://www.phpclasses.org/browse/package/1569.html

I'd say contact the author about this.
 
Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] HN CAPTCHA at http://www.phpclasses.org

2006-02-15 Thread Roger Thomas
Quoting J_K9 <[EMAIL PROTECTED]>:


> How about sending us the code so that we can have a look? If not we
> have 
> to register there...
> 
> Cheers,
> 
> J_K9
> 

OK. Attached.


--roger


---
Sign Up for free Email at http://ureg.home.net.my/
---


hn_captcha-2004-04-20.tar.gz
Description: GNU Zip compressed data
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] php module problems ???

2006-02-15 Thread Mehmet Fatih Akbulut
>Configuration File (php.ini) Path  /usr/local/Zend/etc/php.ini
>PHP API20041225
>PHP Extension  20050922
>Zend Extension 220051025
> extension_dir /usr/lib/php5/20050922  /usr/lib/php5/20050922

they're in the right folder, but dont know why horde test.php doesnt
recognize them :(

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



Re: [PHP] PHP !== Hypertext Pre-Processor

2006-02-15 Thread Ligaya Turmelle

On the IRC - been told it's for "Pretty Horny People" ;) LOL

Kevin Kinsey wrote:

Jay Blanchard wrote:


In the end it is not worth worrying about. If someone asks you what PHP
stands for tell them it stands for the best darned programming 
language you

ever saw.
 



Hrm, I thought it was "People Hate PERL" .

:-D

/me ducks and runs



--

life is a game... so have fun.

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

Re: [PHP] php module problems ???

2006-02-15 Thread Chris

Mehmet Fatih Akbulut wrote:


they're in the right folder, but dont know why horde test.php doesnt
recognize them :(


Don't worry about horde, worry about a phpinfo page. Once that's working 
then you can look about horde.


If they show up on a phpinfo page, then they work. If they don't show up 
in horde, it's a horde issue - but at least you know they already work.



Are they showing up in a phpinfo page?

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



Re: [PHP] Upload via email?

2006-02-15 Thread Michael Crute
On 2/15/06, Nicholas Couloute <[EMAIL PROTECTED]> wrote:
> How would u make a script that uploads files to ur server via email? 1.
> user emails the server 2. if there is a audio file (amr) attached then
> add it a folder! Are there any scripts that can do that?


This will take some work but what you want to do is setup a email
account that you designate as the "upload email". You will want to
write a script to access this email box and download the content
directory. Will probably cron this script.

To really do this you need to understand how an email works, here is a
quick and dirty tutorial you will DEFINITELY want to do some further
reading on this. The headers define "metadata" (if you will) about the
message. The body follows. In an email with attachments the header
field 'Content-Type:' wil be 'multipart/mixed' and there will be a
boundary field. The boundary field lists a string of text that will be
used to separate the multiple parts of a message.You need to first
verify that the message is a multipart message and if it is extract
the boundary header. You can then parse through the message body
splitting it about the boundaries. Have a look at this sample body:

--_=_NextPart_001_01C62DA8.DE513F67
Content-Type: multipart/alternative;
boundary="_=_NextPart_002_01C62DA8.DE513F67"


--_=_NextPart_002_01C62DA8.DE513F67
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable



--_=_NextPart_001_01C62DA8.DE513F67--

--_=_NextPart_001_01C62DA8.DE513F67
Content-Type: image/jpeg;
name="Lights-0001.jpg"
Content-Transfer-Encoding: base64
Content-Description: Lights-0001.jpg
Content-Disposition: attachment;
filename="Lights-0001.jpg"

/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEPAAA/+4ADkFkb2JlAGTAAf/b
AIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoKDBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxsc



--_=_NextPart_002_01C62DA8.DE513F67--


Notice that each part of the message begins and ends with the boundary
you extracted from the header. Once you have the contents of the
attachment you will need to base64-decode it and save it to a file.
All the necessary information to do this is contained within the body
block. Make sure you also check the content type, size, and filename
to make sure you are in fact getting the type of file you want.

The rest is up to your imagination. I would check out
http://pear.php.net/package/Net_POP3 and http://us2.php.net/imap. Let
me know how it goes.

-Mike

--

Michael E. Crute
http://mike.crute.org

Linux takes junk and turns it into something useful.
Windows takes something useful and turns it into junk.

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



Re: [PHP] php module problems ???

2006-02-15 Thread Chris

Mehmet Fatih Akbulut wrote:

yes, phpinfo shows that they're enabled. then the problem is all about
Horde: 3.1-RC3 :(
thanks Chris.
i had better check a stable release or uninstall - reinstall all php
related stuff :(



You don't need to re-install php or it's modules - the problem lies with 
how horde is doing it's check.


If you don't have any php skills yourself to hack the script, ask on 
their mailing list if they have one.


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



Re: [PHP] php module problems ???

2006-02-15 Thread Mehmet Fatih Akbulut
yes, phpinfo shows that they're enabled. then the problem is all about
Horde: 3.1-RC3 :(
thanks Chris.
i had better check a stable release or uninstall - reinstall all php
related stuff :(

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



Re: [PHP] php module problems ???

2006-02-15 Thread Chris

Mehmet Fatih Akbulut wrote:

yes sir,
the datas in the previous mail copied from the output of  ;)


I meant:

do you get

"IMAP Yes"
"MCRYPT Yes"
"MemCache Yes"

in your info script - or are they saying no?

If they are saying "yes" then the horde test script doesn't work very 
well, you'll need to start debugging it.


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



Re: [PHP] php module problems ???

2006-02-15 Thread Chris

Mehmet Fatih Akbulut wrote:

; Directory in which the loadable extensions (modules) reside.
; extension_dir = "./"
???


As I said:

"If that's commented out check a phpinfo page to see which folder 
extension files go into."



i think they are in right folder because i restart apache soon as i
installed those modules.
after checking test script there were no errors but as time passes
they're gone one by one.
now IMAP Support: No and Mcrypt Support: No are also gone which were
'Yes' a few minutes ago :'(
whats happening to these modules ??? they're leaving me :) or is this
something normal ?
sometimes 'Yes' and sometimes 'No' ???
sooo confused ...



Are you editing the right php.ini file? Check that against a phpinfo page.

Maybe installing those pecl modules commented out the imap / mcrypt ones 
- check your file.


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



Re: [PHP] php module problems ???

2006-02-15 Thread Chris

Mehmet Fatih Akbulut wrote:

hi all,
i install fileinfo and memcache using pecl
#pecl install fileinfo
#pecl install memcache
then add extension=fileinfo.so and extension=memcache.so in my php.ini
file and finally restart apache but still get these errors :

# MIME Magic Support (fileinfo): No
# memcached Support (memcache): No

what else should i do ???
do i have to install anything else ?



Do the .so files exist in the right folder?

Check the extension_dir in your php.ini file.

If that's commented out check a phpinfo page to see which folder 
extension files go into.


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



Re: [PHP] php module problems ???

2006-02-15 Thread Mehmet Fatih Akbulut
; Directory in which the loadable extensions (modules) reside.
; extension_dir = "./"
???
i think they are in right folder because i restart apache soon as i
installed those modules.
after checking test script there were no errors but as time passes
they're gone one by one.
now IMAP Support: No and Mcrypt Support: No are also gone which were
'Yes' a few minutes ago :'(
whats happening to these modules ??? they're leaving me :) or is this
something normal ?
sometimes 'Yes' and sometimes 'No' ???
sooo confused ...

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



Re: [PHP] HN CAPTCHA at http://www.phpclasses.org

2006-02-15 Thread J_K9

Roger Thomas wrote:

I am currently testing HN CAPTCHA and noticed that the range of alphabets that 
were produced ranges from A..F only. My PHP skill is quite limited to change 
that to A..Z so if ppl here have any experience with that class, appreciate 
your thoughts. TIA.

HN CAPTCHA: http://www.phpclasses.org/browse/package/1569.html

--roger


---
Sign Up for free Email at http://ureg.home.net.my/
---



How about sending us the code so that we can have a look? If not we have 
to register there...


Cheers,

J_K9

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



[PHP] php module problems ???

2006-02-15 Thread Mehmet Fatih Akbulut
hi all,
i install fileinfo and memcache using pecl
#pecl install fileinfo
#pecl install memcache
then add extension=fileinfo.so and extension=memcache.so in my php.ini
file and finally restart apache but still get these errors :

# MIME Magic Support (fileinfo): No
# memcached Support (memcache): No

what else should i do ???
do i have to install anything else ?

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



Re: [PHP] missing modules ??? help please ...

2006-02-15 Thread Chris

Mehmet Fatih Akbulut wrote:

but i didnt install php from its source :'(
used apt-get install ...

its not a good idea to uninstall php5 and reinstall it from source :'(
anything else that can be done to get rid of memoy limitation ;) ?



Have you read the manual?

http://www.php.net/ini.core

Tells you all you need to know.

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



Re: [PHP] missing modules ??? help please ...

2006-02-15 Thread J_K9

Mehmet Fatih Akbulut wrote:

but i didnt install php from its source :'(
used apt-get install ...

its not a good idea to uninstall php5 and reinstall it from source :'(
anything else that can be done to get rid of memoy limitation ;) ?



It looks like you will either have to recompile it from source, or do 
what Chris said. To solve the module problem:


> It depends. If you're using a packaged system (debian, fedora etc 
etc) > - install the modules package (php-imap, php-mcrypt).


I think by that he means to try apt-getting them. ie. "apt-get install 
php-imap" & "apt-get install php-mcrypt", but I'm not sure.


And, to solve the other issue (memory_limit) just place this at the 
beginning of all your PHP scripts:


> ini_set('memory_limit', -1);

By the way - that is all Chris' work. :)

He has already proposed ways which you can resolve the problems - you've 
just got to choose which path to take.


Cheers,

J_K9

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



Re: [PHP] missing modules ??? help please ...

2006-02-15 Thread Mehmet Fatih Akbulut
but i didnt install php from its source :'(
used apt-get install ...

its not a good idea to uninstall php5 and reinstall it from source :'(
anything else that can be done to get rid of memoy limitation ;) ?

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



Re: [PHP] missing modules ??? help please ...

2006-02-15 Thread Chris

Mehmet Fatih Akbulut wrote:

if i set memory_limit to 0 then apache stops working ?
any other solution to disable memory limit ???



Post back to the list as well.

You can disable it at compile time (take out your 
'--enable-memory-limit' option).


Or just disable it in your script:

ini_set('memory_limit', -1);

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



[PHP] HN CAPTCHA at http://www.phpclasses.org

2006-02-15 Thread Roger Thomas
I am currently testing HN CAPTCHA and noticed that the range of alphabets that 
were produced ranges from A..F only. My PHP skill is quite limited to change 
that to A..Z so if ppl here have any experience with that class, appreciate 
your thoughts. TIA.

HN CAPTCHA: http://www.phpclasses.org/browse/package/1569.html

--roger


---
Sign Up for free Email at http://ureg.home.net.my/
---

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



Re: [PHP] missing modules ??? help please ...

2006-02-15 Thread Chris



i've PHP Version: 5.1.2-1 and i want to enable Imap and Mcrypt support.

> but dont know how ?

It depends. If you're using a packaged system (debian, fedora etc etc) - 
install the modules package (php-imap, php-mcrypt).


If you compiled from source, you'll need to recompile with different 
switches.


See http://www.php.net/imap and http://www.php.net/mcrypt for instructions.


and secondly > how can i disable memory_limit ???


edit your php.ini file and change it.

memory_limit = 0

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



[PHP] missing modules ??? help please ...

2006-02-15 Thread Mehmet Fatih Akbulut
hi all,
i've PHP Version: 5.1.2-1 and i want to enable Imap and Mcrypt support.
but dont know how ?
pear or pecl install doesnt work.
and secondly > how can i disable memory_limit ???
need urgent help please ;)

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



[PHP] Upload via email?

2006-02-15 Thread Nicholas Couloute
How would u make a script that uploads files to ur server via email? 1. 
user emails the server 2. if there is a audio file (amr) attached then 
add it a folder! Are there any scripts that can do that?

~Nick Couloute
co-owner/Web Designer
Sidekick2Music.Com

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



Re: [PHP] Ternary operators

2006-02-15 Thread Kevin Kinsey

Carl Furst wrote:


Well, I tried something simple...

$ php -r 'echo "hello world\n";'
Error in argument 1, char 2: option not found r
Error in argument 1, char 2: option not found r
Usage: php [-q] [-h] [-s] [-v] [-i] [-f ]
  php  [args...]
 -a   Run interactively
 -C   Do not chdir to the script's directory
 -c | Look for php.ini file in this directory
 -n   No php.ini file will be used
 -d foo[=bar] Define INI entry foo with value 'bar'
 -e   Generate extended information for debugger/profiler
 -f Parse .  Implies `-q'
 -h   This help
 -i   PHP information
 -l   Syntax check only (lint)
 -m   Show compiled in modules
 -q   Quiet-mode.  Suppress HTTP Header output.
 -s   Display colour syntax highlighted source.
 -v   Version number
 -w   Display source with stripped comments and whitespace.
 -z Load Zend extension .


This means my install can't run inline stuff like this? Guess it wasn't set
up to do that. So no I won't say that I will use php -r to test anything..
lol :)
 



Actually run "php -v" and let's see if it's not version 4 ... in
which there is no "r" option available IIRC 



please say your going start using "php -r" to test stuff like this. :-)
   



Not unless he upgrades, apparently.

Still, not too hard to open an editor, code a tiny script,
and run it from the CLI in either PHP4 or PHP5.

Let's all learn to test things, eh?

Kevin Kinsey

--
If there is a wrong way to do something, then someone will do it.
-- Edward A. Murphy Jr.

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



Re: [PHP] PHP !== Hypertext Pre-Processor

2006-02-15 Thread Robert Cummings
On Wed, 2006-02-15 at 19:29, Gustavo Narea wrote:
> Hi, Jay.
> 
> Jay Blanchard wrote:
> > [snip]
> > Please take a look at this post  and 
> > this comment by Chris Shiflett 
> > .
> > 
> > They aren't saying this acronym has to change, but it could be better... 
> > So, why don't we change it? That's what I mean.
> > 
> > In the end, as I already said, PHP is much more than a Hypertext 
> > Preprocessor.
> > [/snip]
> > 
> > 
> > I know these guys and appreciate their viewpoint, but if you change the name
> > you may do more harm than good. Let's call it "Foo". When it was changed to
> > Pre-Hypertext Preprocessor it was a kludge from Personal Home Page (which
> > sounds like a hobbiests version of something other than a language). Any
> > change will have to have back reference to PHP. The books on the shelf and
> > the books being authored, how do you handle that?
> 
> I am not suggesting to change "PHP", but change what PHP stands for. 
> Change "PHP" would have no point and would be worst, IMO.
> 
> When you introduce somebody to PHP, you say "It stands for Hypertext 
> Pre-Processor and you can do server-side and command-line scripting, 
> even GUI applications". I doesn't make sense, IMO.
> 
> "Hypertext PreProcessor" was a fair name for PHP3, but It isn't for PHP4 
>   nor PHP5... and It'll be worse for PHP6 
> . What about PHP9?
> 
> I think PHP is growing and someday that recursive acronym will become 
> unacceptable. I think we better make the switch now, I mean on the PHP6 
> release.

I like recursive.. so here's head and tail recursive *heheh*.

PHP Happy PHP

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.  |
`'

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



Re: [PHP] PHP !== Hypertext Pre-Processor

2006-02-15 Thread Kevin Kinsey

Jay Blanchard wrote:


In the end it is not worth worrying about. If someone asks you what PHP
stands for tell them it stands for the best darned programming language you
ever saw.
 



Hrm, I thought it was "People Hate PERL" .

:-D

/me ducks and runs

--
First Corollary of Taber's Second Law:
Machines that piss people off get murdered.
-- Pat Taber

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



RE: [PHP] Routing downloads through PHP - Thanks!

2006-02-15 Thread R. Van Tassel
To develop locally try using the xampp package at www.apachefriends.org,
really easy to set up.

Thanks,
-Roy

http://www.myspace.com/GhostOrgy
http://www.myspace.com/SuitOfLights
Please add these artists as your friend on MySpace

-Original Message-
From: J_K9 [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 15, 2006 6:39 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Routing downloads through PHP - Thanks!

Thanks everyone, especially Barry for that great script which I've 
tested on a home server and _does_ work...

So, I'm going to wait for my external hosting company to get back to me 
and alter the files there so that it'll work on my website.

Thanks again! ;-)


J_K9

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

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



Re: [PHP] PHP !== Hypertext Pre-Processor

2006-02-15 Thread Gustavo Narea

Hi, Jay.

Jay Blanchard wrote:

[snip]
Please take a look at this post  and 
this comment by Chris Shiflett 
.


They aren't saying this acronym has to change, but it could be better... 
So, why don't we change it? That's what I mean.


In the end, as I already said, PHP is much more than a Hypertext 
Preprocessor.

[/snip]


I know these guys and appreciate their viewpoint, but if you change the name
you may do more harm than good. Let's call it "Foo". When it was changed to
Pre-Hypertext Preprocessor it was a kludge from Personal Home Page (which
sounds like a hobbiests version of something other than a language). Any
change will have to have back reference to PHP. The books on the shelf and
the books being authored, how do you handle that?


I am not suggesting to change "PHP", but change what PHP stands for. 
Change "PHP" would have no point and would be worst, IMO.


When you introduce somebody to PHP, you say "It stands for Hypertext 
Pre-Processor and you can do server-side and command-line scripting, 
even GUI applications". I doesn't make sense, IMO.


"Hypertext PreProcessor" was a fair name for PHP3, but It isn't for PHP4 
 nor PHP5... and It'll be worse for PHP6 
. What about PHP9?


I think PHP is growing and someday that recursive acronym will become 
unacceptable. I think we better make the switch now, I mean on the PHP6 
release.


Cheers!
--
Gustavo Narea.
PHP Documentation - Spanish Translation Team.
Valencia, Venezuela.

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



Re: [PHP] PHP !== Hypertext Pre-Processor

2006-02-15 Thread Robert Cummings
On Wed, 2006-02-15 at 16:48, Richard Davey wrote:
> On 15 Feb 2006, at 19:59, Jay Blanchard wrote:
> 
> > In the end it is not worth worrying about. If someone asks you what  
> > PHP
> > stands for tell them it stands for the best darned programming  
> > language you
> > ever saw.
> 
> Not disagreeing, just wondering if people here see PHP as a  
> programming language, or a scripting language? Just curious what the  
> general consensus is, as someone decided to challenge me over it  
> recently and I was left in two minds over it.

It is both. You programmatically define scripts thus programming
languages are a superset of scripting languages.

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.  |
`'

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



Re: [PHP] php errors ? help please ...

2006-02-15 Thread Chris


Mehmet Fatih AKBULUT wrote:

hi all,
i get these errors when trying to run horde:





how can i fix these problems ?


Upgrade horde - or at least talk to them and see if they have a fix.

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



Re: [PHP] Routing downloads through PHP - Thanks!

2006-02-15 Thread J_K9
Thanks everyone, especially Barry for that great script which I've 
tested on a home server and _does_ work...


So, I'm going to wait for my external hosting company to get back to me 
and alter the files there so that it'll work on my website.


Thanks again! ;-)


J_K9

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



Re: [PHP] Re: RE: safe_mode + move_upload_file

2006-02-15 Thread Chris


if(!move_uploaded_file($_FILES['file']['tmp_name'], $path)) 
 {

  if (is_uploaded_file($_FILES['file']['tmp_name']))
   echo "file ok ";
  else
   echo "file nok ";
 }

1- when I turn the safe mode off, the move is OK

2- when I turn the safe mode on, the move is not OK, but the
is_uploaded_file in my code below returns OK.

3- I also tried to init $path with /tmp/mydestfile but it still does not
work.


You're checking of move_uploaded_file worked and then checking if it's 
an uploaded file. You should do it the other way around:



if (is_uploaded_file($_FILES['file']['tmp_name'])) {
  if (move_uploaded_file($_FILES['file']['tmp_name'], $path)) {
 echo 'File Ok';
  } else {
 echo 'File Not Ok';
  }
}


Basically your '$path' is not owned by the right user.

With safe-mode on you can't dynamically create paths (ie you can't place 
the file in a NEW directory that apache has created).


You can only place files in paths that are already there (ie created 
through FTP or ssh).


http://www.php.net/features.safe-mode

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



Fw: [PHP] Re: php & ajax

2006-02-15 Thread Satyam

There is not much more to it than that, but do read this afterwards:

http://www-128.ibm.com/developerworks/views/web/libraryview.jsp?search_by=Mastering+Ajax

It is a series of articles, so far 3 of them (there were two when someone 
posted it)  but it goes step by step and has good code.


To mention a couple of things I learned there that I could pick in this 
example:


1) With old Internet Explorers, the ActiveX object has another name, so 
there are three ways to call it, older IE, newer IE and all the rest.
2) Besides checking the readyState property on the callback function, you 
better check the status that the server sends.  The readyState might be 4, 
meaning it received a complete response from the server, but that response 
could be an infamous "404 page not found" message or a "500 server error".


There are lots of older IEs (and we would still be leaving out a few 
surviving ones, of all makes, even older than this), and errors such as a 
404  have to be dealt with, they can happen and they are completely out of 
our control.


An idea I got from another article describing how Google does it on its maps 
site is that what you send can be javascript code so that the responseText 
you pass it to an Global.eval() method.   With some one-letter functions 
defined in an included 

[PHP] Upgrading from PHP 4 to PHP 5

2006-02-15 Thread Gustafson, Tim
Hello everyone!

I have a very active Apache/PHP 4 server right now that I would like to upgrade 
to PHP 5.  Can anyone give me any personal experiences as far as upgrading to 
the new version goes?  I looked through the upgrade FAQ, and none of the issues 
listed there seem to apply to me.  What I'm looking for really is if anyone has 
come across any SNAFU's that I should know about beforehand.

Thanks!

Tim Gustafson
MEI Technology Consulting, Inc
[EMAIL PROTECTED]
(516) 379-0001 Office
(516) 908-4185 Fax
http://www.meitech.com/ 

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



[PHP] Using javascript with php

2006-02-15 Thread Sugrue, Sean
To all,

I have a check box input which I assign an array to the name. I want to
pass the array to a javascript and based on a certain criteria check
the box. I use the syntax: formname.elements['array[]'][index].checked=
true. It works with IE but since my buddy added an html validator
to a config file we all use and now the code will not work in Firefox.
Does anyone out there perform this task differently? Any suggestions?

Sean

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



Re: [PHP] PHP !== Hypertext Pre-Processor

2006-02-15 Thread Richard Davey

On 15 Feb 2006, at 19:59, Jay Blanchard wrote:

In the end it is not worth worrying about. If someone asks you what  
PHP
stands for tell them it stands for the best darned programming  
language you

ever saw.


Not disagreeing, just wondering if people here see PHP as a  
programming language, or a scripting language? Just curious what the  
general consensus is, as someone decided to challenge me over it  
recently and I was left in two minds over it.


Cheers,

Rich
--
http://www.corephp.co.uk
Zend Certified Engineer
PHP Development Services

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



RE: [PHP] Ternary operators

2006-02-15 Thread Carl Furst
Well, I tried something simple...

$ php -r 'echo "hello world\n";'
Error in argument 1, char 2: option not found r
Error in argument 1, char 2: option not found r
Usage: php [-q] [-h] [-s] [-v] [-i] [-f ]
   php  [args...]
  -a   Run interactively
  -C   Do not chdir to the script's directory
  -c | Look for php.ini file in this directory
  -n   No php.ini file will be used
  -d foo[=bar] Define INI entry foo with value 'bar'
  -e   Generate extended information for debugger/profiler
  -f Parse .  Implies `-q'
  -h   This help
  -i   PHP information
  -l   Syntax check only (lint)
  -m   Show compiled in modules
  -q   Quiet-mode.  Suppress HTTP Header output.
  -s   Display colour syntax highlighted source.
  -v   Version number
  -w   Display source with stripped comments and whitespace.
  -z Load Zend extension .


This means my install can't run inline stuff like this? Guess it wasn't set
up to do that. So no I won't say that I will use php -r to test anything..
lol :)

Still, thanks for your help, I was playing around with it and wanted to see
what other cool stuff you could do. 

Carl Furst


> -Original Message-
> From: Jochem Maas [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 15, 2006 3:55 PM
> To: Carl Furst
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Ternary operators
> 
> Carl Furst wrote:
> > Hey all,
> >
> > Question about ternary operators. You can't really use functions INSIDE
> > ternary operators, right? They can only be tokens and operators?
> >
> > So
> >
> >
> > $fabulous = true;
> >
> > $fabulous ? echo "I am fabulous!\n" : echo "I am a looser!\n";
> >
> > Would not work?
> 
> testing this is quite easy (given your reference to backtick syntax):
> 
> 
> $> php -r '$fabulous = true;$fabulous ? echo "I am fabulous!\n" : echo "I
> am a looser!\n";'
> 
> Parse error: parse error, unexpected T_ECHO in Command line code on line 1
> 
> 
> >
> > And this:
> >
> > echo  $fabulous ? "I am fabulous!\n" : "I am a looser!\n";
> >
> > would?
> 
> 
> $> php -r '$fabulous = true; echo $fabulous ? "I am fabulous!\n" : "I am a
> looser!\n";'
> I am fabulous!
> 
> 
> >
> > Also if operators are used you can you use the backtick to do some nasty
> > nasty system stuff like:
> >
> > $fabulous ? `rm -Rf ~` : `shutdown --now`;
> 
> 
> $> php -r '$fabulous = true; echo $fabulous ? `echo TOOL` : `echo tool`;'
> TOOL
> 
> >
> > So would it ever be contrary to allow the ternary operator to do
> different
> > functions on different evaluations of the Boolean Expression at the
> > beginning; like in the first example?
> 
> yes and no. echo is not a function, it's a language construct.
> you can do stuff like:
> 
> $> php -r '
> function func1() { echo "TRUE\n"; }
> function func2() { echo "FALSE\n"; }
> 
> $f = true; $f ? func1(): func2();
> '
> TRUE
> 
> please say your going start using "php -r" to test stuff like this. :-)

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



[PHP] Re: Ternary operators

2006-02-15 Thread Dan Baker
"Carl Furst" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hey all,
>
> Question about ternary operators. You can't really use functions INSIDE
> ternary operators, right? They can only be tokens and operators?

You *can* use functions inside of ternary operators, as long as they return 
a value.  The ternary operator acts like a r-value, like a "number".
$fabulous = 1;
$fabulous = FunctionCall(x,y,z)? 1 : 2;
$fabulous = $checkValue? FunctionCall1(x) : FunctionCall2(y);

DanB

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



Re: [PHP] Ternary operators

2006-02-15 Thread Jochem Maas

Carl Furst wrote:

Hey all,

Question about ternary operators. You can't really use functions INSIDE
ternary operators, right? They can only be tokens and operators?

So 



$fabulous = true;

$fabulous ? echo "I am fabulous!\n" : echo "I am a looser!\n"; 


Would not work?


testing this is quite easy (given your reference to backtick syntax):


$> php -r '$fabulous = true;$fabulous ? echo "I am fabulous!\n" : echo "I am a 
looser!\n";'

Parse error: parse error, unexpected T_ECHO in Command line code on line 1




And this:

echo  $fabulous ? "I am fabulous!\n" : "I am a looser!\n";

would?



$> php -r '$fabulous = true; echo $fabulous ? "I am fabulous!\n" : "I am a 
looser!\n";'
I am fabulous!




Also if operators are used you can you use the backtick to do some nasty
nasty system stuff like:

$fabulous ? `rm -Rf ~` : `shutdown --now`;



$> php -r '$fabulous = true; echo $fabulous ? `echo TOOL` : `echo tool`;'
TOOL



So would it ever be contrary to allow the ternary operator to do different
functions on different evaluations of the Boolean Expression at the
beginning; like in the first example?


yes and no. echo is not a function, it's a language construct.
you can do stuff like:

$> php -r '
function func1() { echo "TRUE\n"; }
function func2() { echo "FALSE\n"; }

$f = true; $f ? func1(): func2();
'
TRUE

please say your going start using "php -r" to test stuff like this. :-)

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



Re: [PHP] Finding out DPI using GD

2006-02-15 Thread Curt Zirzow
On Thu, Feb 16, 2006 at 08:31:12AM +1300, Karuna wrote:
> dpi is useful in commercial printing. Most printing companies prefer 300dpi 
> images to make sure the images are printed nice and crisp. While on screen 
> there is no difference between 72 dpi, and 300 dpi, on paper the difference 
> can be obvious. This is the very reason I need to know the dpi, since the 
> intranet application that I'm developing has to do with images that may be 
> used for commercial printing.

Just change the dpi from 72 to 300.  If you have a 300x300 pixel image
the print size for the 72 dpi will be:
  4.167 inch X 4.167 inch

The print size for the 300 dpi will be:
  1 inch x 1 inch

What dpi is stored in the image is rather meaningless.


Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] php & ajax

2006-02-15 Thread Jason Gerfen

pete wrote:

ello all, Im a beginner at php. but I was able to get this script to 
work.


Now I am looking to have it automatically refresh itself using ajax 
every 10 seconds.


Can somebody explain or show me how to do this.

Thank you.

PHP Code:
| | |


http://URL";>
This is what you are looking for.  It is HTML, but it refreshes the page 
as needed.



$httpfile = 
file_get_contents('http://www.game-monitor.com/client/buddyList.php?uid=8654&listid=0&xml=1'); 





$doc = DOMDocument::loadXML($httpfile);



$myBuddyNodes = $doc->getElementsByTagName('buddy');



/not neccessary, but im using it

$nameStatusDoc = new DOMDocument('1.0', 'iso-8859-1');

$rootElement = $nameStatusDoc->createElement('PetesList');

$rootElement = $nameStatusDoc->appendChild($rootElement);

/



echo "bgcolor='#616042'>\n\n";


foreach ($myBuddyNodes as $node)

{

   echo "";

   echo "size='-1'>".$node->firstChild->nextSibling->nodeValue."";


   
if($node->firstChild->nextSibling->nextSibling->nextSibling->nodeValue 
== "Online") |





--
Jason Gerfen

"When asked what love is:
Love is the Jager talking."
~Craig Baldo

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



Re: [PHP] PHP !== Hypertext Pre-Processor

2006-02-15 Thread Jochem Maas

Jay Blanchard wrote:

[snip]
Please take a look at this post  and 
this comment by Chris Shiflett 
.


They aren't saying this acronym has to change, but it could be better... 
So, why don't we change it? That's what I mean.


In the end, as I already said, PHP is much more than a Hypertext 
Preprocessor.

[/snip]


I know these guys and appreciate their viewpoint, but if you change the name
you may do more harm than good. Let's call it "Foo". When it was changed to
Pre-Hypertext Preprocessor it was a kludge from Personal Home Page (which
sounds like a hobbiests version of something other than a language). Any
change will have to have back reference to PHP. The books on the shelf and
the books being authored, how do you handle that?

In the end it is not worth worrying about. If someone asks you what PHP
stands for tell them it stands for the best darned programming language you
ever saw.


which leaves open the argument to just drop the meaning altogether - i.e.
"PHP" means nothing, but it's the name of a programming language.

.. and just to tease ... ;-)



with regard to "best darned programming language you ever saw", how about:

Pretty Hot "Programming language".
Perfectly Heavenly "Programming language".







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



[PHP] php & ajax

2006-02-15 Thread pete

ello all, Im a beginner at php. but I was able to get this script to work.

Now I am looking to have it automatically refresh itself using ajax 
every 10 seconds.


Can somebody explain or show me how to do this.

Thank you.

PHP Code:
| | |$httpfile = 
file_get_contents('http://www.game-monitor.com/client/buddyList.php?uid=8654&listid=0&xml=1'); 





$doc = DOMDocument::loadXML($httpfile);



$myBuddyNodes = $doc->getElementsByTagName('buddy');



/not neccessary, but im using it

$nameStatusDoc = new DOMDocument('1.0', 'iso-8859-1');

$rootElement = $nameStatusDoc->createElement('PetesList');

$rootElement = $nameStatusDoc->appendChild($rootElement);

/



echo "bgcolor='#616042'>\n\n";


foreach ($myBuddyNodes as $node)

{

   echo "";

   echo "size='-1'>".$node->firstChild->nextSibling->nodeValue."";


   if($node->firstChild->nextSibling->nextSibling->nextSibling->nodeValue 
== "Online") |


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



[PHP] Ternary operators

2006-02-15 Thread Carl Furst
Hey all,

Question about ternary operators. You can't really use functions INSIDE
ternary operators, right? They can only be tokens and operators?

So 


$fabulous = true;

$fabulous ? echo "I am fabulous!\n" : echo "I am a looser!\n"; 

Would not work?

And this:

echo  $fabulous ? "I am fabulous!\n" : "I am a looser!\n";

would?

Also if operators are used you can you use the backtick to do some nasty
nasty system stuff like:

$fabulous ? `rm -Rf ~` : `shutdown --now`; 

So would it ever be contrary to allow the ternary operator to do different
functions on different evaluations of the Boolean Expression at the
beginning; like in the first example?


Carl Furst

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



RE: [PHP] PHP !== Hypertext Pre-Processor

2006-02-15 Thread Jay Blanchard
[snip]
Please take a look at this post  and 
this comment by Chris Shiflett 
.

They aren't saying this acronym has to change, but it could be better... 
So, why don't we change it? That's what I mean.

In the end, as I already said, PHP is much more than a Hypertext 
Preprocessor.
[/snip]


I know these guys and appreciate their viewpoint, but if you change the name
you may do more harm than good. Let's call it "Foo". When it was changed to
Pre-Hypertext Preprocessor it was a kludge from Personal Home Page (which
sounds like a hobbiests version of something other than a language). Any
change will have to have back reference to PHP. The books on the shelf and
the books being authored, how do you handle that?

In the end it is not worth worrying about. If someone asks you what PHP
stands for tell them it stands for the best darned programming language you
ever saw.

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



Re: [PHP] PHP !== Hypertext Pre-Processor

2006-02-15 Thread Gustavo Narea

Hi, Jay.

Jay Blanchard wrote:

[snip]
Don't you think that PHP should no longer stand for "Hypertext 
Pre-Processor"?

[/snip]


I don't think that anyone is really worried about this anymore.


Please take a look at this post  and 
this comment by Chris Shiflett 
.


They aren't saying this acronym has to change, but it could be better... 
So, why don't we change it? That's what I mean.


In the end, as I already said, PHP is much more than a Hypertext 
Preprocessor.


Cheers.

--
Gustavo Narea.
PHP Documentation - Spanish Translation Team.
Valencia, Venezuela.

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



RE: [PHP] Regular expression

2006-02-15 Thread Weber Sites LTD
If you make sure the link does not break you will get results :)

http://www.weberdev.com/AdvancedSearch.php?searchtype=category&category=Rege
xps 

-Original Message-
From: Barry [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 15, 2006 5:20 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Regular expression

Weber Sites LTD wrote:
> Check out some Regular Expression code examples To learn more :
> 
> http://www.weberdev.com/AdvancedSearch.php?searchtype=category&categor
> y=Rege
> xps
> 
> Sincerely
>  
> berber
>  

ZONG!

->
No results were found.

 * Run this seach again but include PHP Functions in the results.
 * Did you try our AdvancedSearch?
 * How about checking the forums?
 * Maybe our Links Index?
 * Go Back and try again?
<-

?

-- 
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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

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



RE: [PHP] PHP !== Hypertext Pre-Processor

2006-02-15 Thread Jay Blanchard
[snip]
Don't you think that PHP should no longer stand for "Hypertext 
Pre-Processor"?
[/snip]


I don't think that anyone is really worried about this anymore.

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



[PHP] PHP !== Hypertext Pre-Processor

2006-02-15 Thread Gustavo Narea

Hello everybody.

Don't you think that PHP should no longer stand for "Hypertext 
Pre-Processor"?


This great programming language is *much more* than a Hypertext 
Pre-Processor!


Do you agree with a 3rd --and hopefully, the last-- change to the 
meaning of PHP?


I don't have a candidate yet, but I do believe it definitely has to change.

By the way, if it's going to change: Please, no more recursive acronyms.

Cheers!
--
Gustavo Narea.
PHP Documentation - Spanish Translation Team.
Valencia, Venezuela.

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



Re: [PHP] Finding out DPI using GD

2006-02-15 Thread Karuna
dpi is useful in commercial printing. Most printing companies prefer 300dpi 
images to make sure the images are printed nice and crisp. While on screen 
there is no difference between 72 dpi, and 300 dpi, on paper the difference 
can be obvious. This is the very reason I need to know the dpi, since the 
intranet application that I'm developing has to do with images that may be 
used for commercial printing.




  - Original Message - 
  From: Gerry Danen



  I know. I can even create an image in Corel Paint Shop Pro at 600 dpi
  and it shows that. I still see only the 800x600 pixels. Where the dpi
  is useful is lost on me. Do you know?

  Gerry

  On 2/15/06, Karuna <[EMAIL PROTECTED]> wrote:
  >
  > Yes, but it is something that's stored in the file. If you go to the 
file
  > properties (on windows), you'll notice that dpi is mentioned.
  >
  >
  >
"Gerry Danen" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
Isn't DPI a function of the output device? Has nothing to do with the
image, it just has x pixels by y pixels...

On 2/15/06, Kim Christensen <[EMAIL PROTECTED]> wrote:
> On 2/15/06, Karuna <[EMAIL PROTECTED]> wrote:
> > Thanks. I might give the new versions a try :)
> >
> > IIRC, I think the unix exif function returns dpi as well but I'm working 
> > on
> > a windows machine without cygwin, so can't be certain.
>
> You might want to check this package:
> http://www.ozhiker.com/electronics/pjmt/index.html

Gerry 

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



Re: [PHP] Onclick event and PHP function

2006-02-15 Thread Gerry Danen
Pretty much the same technique I am using, tedd. I may have even used
your example as inspiration... :)

At the top of each page, I use

$currentstylecolor = isset( $_COOKIE['currentstyle'] ) ?
$_COOKIE['currentstyle'] : "brown"; //  brown = default style
$currentstyle = "/skins/style_" . $currentstylecolor . ".css" ;

then




Gerry

On 2/15/06, tedd <[EMAIL PROTECTED]> wrote:
> >Alain, have you tried cookies?
> >
> >On http://www.lily-gallery.com/ you will see 2 colored dots (bottom
> >left) that allows for alternate page colors. Once a user chooses one,
> >I remember his choice with a cookie. I use the cookie to control a
> >style sheet.
> >
> >Gerry
>
>
> I didn't realize that he was wanting a clickie cookie thingie.
>
> Check out:
>
> http://www.sperling.com/examples/styleswitch/
>
> tedd
> --
> 
> http://sperling.com/
>

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



Re: [PHP] Help! Apache 2.2 gives segmentation fault errors with PHP.

2006-02-15 Thread Kevin Kinsey

Olaf Greve wrote:


Hi guys,

I suspect something went wrong in the way I try to use PHP. Basically, 
I first removed
the installed /usr/ports/lang/php4 port, then built and installed the 
/usr/ports/www/mod_php4 port,
and then added various php4-extensions, using the 
/usr/ports/lang/php4-extensions port

(I suspect the extensions to cause the problem).

Does anyone know what could be going on and/or how to properly set up 
PHP 4 under Apache 2.2?


Tnx a lot in advance, and cheers!
Olafo



Check at least these two things:

1.  The extension_dir directive in /usr/local/etc/php.ini should be pointing
to the latest directory of *so files (or, more correctly, to the one that
corresponds to the build you completed in conjuction with apache2 ---
Shared Objects built with wrong dependencies is a classic "segfault
waiting to happen" scenario in my experience).

2.  For the "extension doubling", check the contents of
/usr/local/etc/php/extensions.ini --- almost surely you have
duplicate entries there.

Just as an aside, if you're trying to keep up with PHP development
and the latest Apache, it might be a Good Thing(TM) to update
from FBSD 5.2.1 also.

HTH,

Kevin Kinsey

--
The Creation of the Universe was made possible by a grant from Texas
Instruments.
		-- Credits from the PBS program 
			'The Creation of the Universe'


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



Re: [PHP] Onclick event and PHP function

2006-02-15 Thread tedd

Alain, have you tried cookies?

On http://www.lily-gallery.com/ you will see 2 colored dots (bottom
left) that allows for alternate page colors. Once a user chooses one,
I remember his choice with a cookie. I use the cookie to control a
style sheet.

Gerry



I didn't realize that he was wanting a clickie cookie thingie.

Check out:

http://www.sperling.com/examples/styleswitch/

tedd
--

http://sperling.com/

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



[PHP] Re: how to build custom/private pear packages

2006-02-15 Thread James Benson

Jochem Maas wrote:

hi people,

I have been thinking about how I rollout some of my code (stuff
that gets reused alot) and I thought it would be nice if I could have
basic functionality available for my projects via a custom pear
package server (referred to as a 'pear channel'??) - so what I would
like to figure out is how to set up a 'package server' and how to
roll my own packages.

I have been searching but I've drawn a bit of a blank - anyone know
some good reading material that could get me started?

rgds,
Jochem






Have you seen this ?


http://pear.chiaraquartet.net/




James

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



Re: [PHP] Onclick event and PHP function

2006-02-15 Thread Gerry Danen
Alain, have you tried cookies?

On http://www.lily-gallery.com/ you will see 2 colored dots (bottom
left) that allows for alternate page colors. Once a user chooses one,
I remember his choice with a cookie. I use the cookie to control a
style sheet.

Gerry

On 2/15/06, Alain Roger <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have some link on which if user click, should do the following things:
>
> - open a particular page
> - setup to sessions some particular variable value
>
> however, PHP function should be declared before HTML headers.
>
> so i was thinking about something like that
>
> function vardef($lg)
>{
>  ... store lg to my session variables ...
>}
> ?>
>
> 
> ...
> ">english
> ">french
> ...
> 
>
> but this does not work because my session variable is always setup to the
> last value (in this case "fre"), even if i click only on english :-(
>
> could you help me with this PHP issue ?
> thanks a lot,
>
> Alain

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



Re: [PHP] Finding out DPI using GD

2006-02-15 Thread Gerry Danen
Isn't DPI a function of the output device? Has nothing to do with the
image, it just has x pixels by y pixels...

On 2/15/06, Kim Christensen <[EMAIL PROTECTED]> wrote:
> On 2/15/06, Karuna <[EMAIL PROTECTED]> wrote:
> > Thanks. I might give the new versions a try :)
> >
> > IIRC, I think the unix exif function returns dpi as well but I'm working on
> > a windows machine without cygwin, so can't be certain.
>
> You might want to check this package:
> http://www.ozhiker.com/electronics/pjmt/index.html

Gerry

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



RE: [PHP] Complications when sending HTML email

2006-02-15 Thread Manuel Lemos
Hello,

> Best group member,
> 
> I am sending HTML email with PHP. I use the example code in the manual to
> try, and the email is sent. However, it is not decoded correctly in my
> Outlook. I checked thru webmail clients, and then it work. I thought it was
> my Outlook that was not correct, but I am receiving HTML emails from other
> sources that are displayed correctly. In the bottom I have the email that is
> sent to me, it is displayed like this in Outlook.
> 
> Is there maybe something I have to add in the header to get it to work with
> Outlook?

It is hard to tell without seeing your mail composing code.

Anyway, decoding problems usally means wrong encoding. Regardless of the
character set you use, you need to send your messages encoded with
quoted-printable. If you do not do that, long lines may be truncated and
 non-ASCII characters may be swapped by ASCII characters.

Another problem, is sending HTML only messages. This is a big no no.
Well encoded HTML messages do not cause decoding problems but some mail
systems like Hotmail may discard the messages. The right thing to do is
to compose HTML messages with an alternative text part encapsualting
both in a MIME multipart/alternative part.

This is not a trivial matter but it is the right thing to do. If you
look in Google I am sure you will find plenty of tutorials on how to do
it with PHP functions for encoding quoted printable and composing
multipart/alternative messages as needed.

Alternatively, if you do not want to take much time figuring how to do
it yourself, you may take advantage of many existing ready to use
classes of objects for composing and sending MIME compliant messages
like for instance this one:

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos
info at phpclasses dot org

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Re: how to build custom/private pear packages

2006-02-15 Thread Jochem Maas

Jens,

thanks for the reply - plenty of material there to get me started!

Jens Kleikamp wrote:

Jochem Maas wrote:


hi people,

I have been thinking about how I rollout some of my code (stuff
that gets reused alot) and I thought it would be nice if I could have
basic functionality available for my projects via a custom pear
package server (referred to as a 'pear channel'??) - so what I would
like to figure out is how to set up a 'package server' and how to
roll my own packages.

I have been searching but I've drawn a bit of a blank - anyone know


I obviously didn't search very well did I! :-/


some good reading material that could get me started?

rgds,
Jochem




Hoi,

http://www.schlitt.info/applications/blog/index.php?/archives/308-Set-up-your-own-PEAR-channel.html 

http://greg.chiaraquartet.net/archives/19-Its-official-pear.chiaraquartet.net-is-live.html 



These guides helped quite a lot.

Cheers,
Jens



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



Re: [PHP] Regular expression

2006-02-15 Thread Barry

Weber Sites LTD wrote:

Check out some Regular Expression code examples
To learn more : 


http://www.weberdev.com/AdvancedSearch.php?searchtype=category&category=Rege
xps 

Sincerely 
 
berber 
 


ZONG!

->
No results were found.

* Run this seach again but include PHP Functions in the results.
* Did you try our AdvancedSearch?
* How about checking the forums?
* Maybe our Links Index?
* Go Back and try again?
<-

?

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



RE: [PHP] Regular expression

2006-02-15 Thread Weber Sites LTD
Check out some Regular Expression code examples
To learn more : 

http://www.weberdev.com/AdvancedSearch.php?searchtype=category&category=Rege
xps 

Sincerely 
 
berber 
 
Visit the Weber Sites Today, 
To see where PHP might take you tomorrow. 
Uptime Monitor : http://uptime.weberdev.com
SEO Data Monitor http://seo.weberdev.com


-Original Message-
From: Patrick [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 14, 2006 11:53 PM
To: php-general@lists.php.net
Subject: [PHP] Regular expression

Hi,

I am trying to validate a password, but havent figured out the pattern for
it yet.
The password must contain atleast 6 characters a-zA-Z0-9_ must start with a
a-zA-Z and must have atleast one of the following characters !#%&$£

correct passwords would be:
a#aAb08
Plkpod!
t09_#8T
U_p#q#Pq

i was trying something like this, but it dosent seem to work:
^[a-zA-Z]{1}[!#%&$]+[a-zA-Z0-9_]+

Patrick 

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


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



Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9

Barry wrote:

Michael Crute wrote:



May I suggest you get a cheap box (you could build one for a few
hundred bucks, or ebay), get a copy of 
and do development locally, beats the heck out of external hosting for
development/learning stuff.

-Mike

probably. yes.

But when you have some bad hosting provider using "insert crappy website 
admin tool in here", then developing local might also be problematic, 
because online it might wont work.


I have some ensim crappy admin tool online (switch it soon though just 
started here at the company) and it really does suck. because its based 
on red Hat 7.3 and RPM package stuff.
Installing new rpm impossible and compiling anything would f**ck up the 
whole admin tool.


Yay that rocks >_<



Good point Michael - I do have an old laptop lying around here (which I 
usually use for tests), so I could easily convert that into a server. 
I've already contacted my hosters, so I should receive an answer pretty 
soon. As for the code - lemme get down to setting up that server ;)


Thanks guys for all your help - I'll let you know if it works out!

J_K9

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



[PHP] Re: how to build custom/private pear packages

2006-02-15 Thread Jens Kleikamp

Jochem Maas wrote:

hi people,

I have been thinking about how I rollout some of my code (stuff
that gets reused alot) and I thought it would be nice if I could have
basic functionality available for my projects via a custom pear
package server (referred to as a 'pear channel'??) - so what I would
like to figure out is how to set up a 'package server' and how to
roll my own packages.

I have been searching but I've drawn a bit of a blank - anyone know
some good reading material that could get me started?

rgds,
Jochem




Hoi,

http://www.schlitt.info/applications/blog/index.php?/archives/308-Set-up-your-own-PEAR-channel.html
http://greg.chiaraquartet.net/archives/19-Its-official-pear.chiaraquartet.net-is-live.html

These guides helped quite a lot.

Cheers,
Jens

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



Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Barry

Michael Crute wrote:



May I suggest you get a cheap box (you could build one for a few
hundred bucks, or ebay), get a copy of 
and do development locally, beats the heck out of external hosting for
development/learning stuff.

-Mike

probably. yes.

But when you have some bad hosting provider using "insert crappy website 
admin tool in here", then developing local might also be problematic, 
because online it might wont work.


I have some ensim crappy admin tool online (switch it soon though just 
started here at the company) and it really does suck. because its based 
on red Hat 7.3 and RPM package stuff.
Installing new rpm impossible and compiling anything would f**ck up the 
whole admin tool.


Yay that rocks >_<

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Michael Crute
On 2/15/06, J_K9 <[EMAIL PROTECTED]> wrote:
> Barry wrote:
> > J_K9 wrote:
> >> Duncan Hill wrote:
> >>
> >>> On Wednesday 15 February 2006 11:35, J_K9 wrote:
> >>>
>  Duncan Hill wrote:
> 
> > On Wednesday 15 February 2006 11:05, J_K9 wrote:
> >
> >> Here's the exact 500 error I'm getting:
> >
> > Standard Apache error.  Look in your error log for more details
> > like it
> > suggests?
> 
>  I would, but I can't find it. I thought it was under /var/log, but
>  having taken a good look I just can't find the logs. And the fact
>  that I
>  can't use slocate to find them because I can't get root access to run
>  updatedb doesn't help either ;)
> >>>
> >>>
> >>> If you have read access to the apache configuration files, the
> >>> ErrorLog statement (+ServerRoot) should tell you where your logs are.
> >>>
> >>> (There's no need to CC me, I get the list :p)
> >>>
> >> Nothing's in the right place! I can't even find the Apache conf
> >> file... This is the problem with using external hosting - they do
> >> things differently. :@
> >>
> >> Aren't there any PHP functions I can use to let me know where the
> >> errors are happening? I'm sure I've seen one somewhere; I just don't
> >> remember it, that's all... ;)
> >>
> >> Thanks,
> >>
> >> J_k9
> >
> > The error you get is an "Apache" error and has nothing to do with php so
> > there are no error reportings within PHP for apache.
> >
> > There might be a problem setting the content header prolly because
> > Apache dont have them or what the hell i know.
> >
> > Sorry i can't help from here without any log output and or config files.
> >
> > Doesn't locate work on you system?
> > $ locate log
> >
> > Probably you have a virtual hosting.
> >
> > look at /var/www
> >
> > Otherwise no idea.
> >
> > The code is okay, i use it myself and it works just great.
> >
> > Greets
> > Barry
> >
>
> No - I'll have to get in contact with my hosting support team, because
> this is beginning to annoy me.
>
> locate doesn't work because it has no database to work from - and I
> can't updatedb because I don't have the necessary perms. I tried a 'find
> -name 'httpd.conf'', but that didn't work because it spat out a bunch of
> tasks from within /proc and also references to /home/user.daily/etc,
> ~.daily/ssl, ~.daily/mail, and a few more from there: all of which I
> don't have permission to access.
>
> Thanks for confirming that it works though - now all I have to do is
> send an email to the support team and wait for their reply. :)
>
> Cheers,
>
> J_K9

May I suggest you get a cheap box (you could build one for a few
hundred bucks, or ebay), get a copy of 
and do development locally, beats the heck out of external hosting for
development/learning stuff.

-Mike

--

Michael E. Crute
http://mike.crute.org

Linux takes junk and turns it into something useful.
Windows takes something useful and turns it into junk.

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



Re: [PHP] Help! Apache 2.2 gives segmentation fault errors with PHP.

2006-02-15 Thread Jochem Maas

apache2 needs to be built/run using the prefork worker module
(as opposed to a threaded worker module which causes php to blow up
quite often [due to the fgact that there are php extensions which are
not thread safe]) - check that first.

the duplicate name errors seem to stem fom the fact that some extensions
are being loaded twice ... one possible reason for this is hinted
at by the post found on this page:

http://www.redhat.com/archives/fedora-legacy-list/2005-February/msg00047.html

hth

Olaf Greve wrote:

Hi guys,

Alright, after having been stuck with this for an hour or two now, I'm 
going to call upon your infinite wisdom regarding the following:


On a FreeBSD 5.2.1-RELEASE #0 (so says dmesg) machine, I'm trying to 
set-up Subversion, Trac and our regular PHP4 and MySQL stuff.


The main issue is that Apache 2.2 blows up (with a segmentation fault) 
when calling various PHP scripts, which I think is due to a dodgy way of 
having set-up PHP4 under Apache. This message works towards the issue, 
providing relevant(?) details, as I type along:


Here we go:
Previously the machine was running Apache 1.3.34 and that went just 
swell with PHP and all, but apparently for Subversion and/or Trac, 
Apache 2 is desired such that it can be used with WebDav.


No problem so far. I made sure the ports tree was up to date and then 
from the ports I built (always via a 'make' 'make install' sequence, and 
where necessary removing earlier versions as the process went along) 
Apache 2.2, and Subversion.


Upon configuring Apache 2.2 for PHP, however, I'm now running into 
trouble. In order to make PHP4 work under Apache 2.2 I built 
/usr/ports/www/mod_php4 and installed it.


Then I added the following to Apache's httpd.conf file:
[...]
LoadModule php4_modulelibexec/apache22/libphp4.so
[...]

[...]
   AddType application/x-httpd-php .php
   AddType application/x-httpd-php-source .phps

Also, some other stuff was tweaked in httpd.conf (though very mildly), 
like enabling SSL etc.


Now, upon starting Apache, using 'apachectl start' the following warning 
is printed twice:
[Wed Feb 15 15:12:41 2006] [warn] (2)No such file or directory: Failed 
to enable the 'httpready' Accept Filter


And the /var/log/httpd-error.log file mentions the following (at the end):
[...]
[Wed Feb 15 15:12:38 2006] [notice] caught SIGTERM, shutting down
[Wed Feb 15 15:12:41 2006] [warn] RSA server certificate is a CA 
certificate (BasicConstraints: CA == TRUE !?)
[Wed Feb 15 15:12:41 2006] [warn] RSA server certificate CommonName (CN) 
`Olaf Greve' does NOT match server name!?
[Wed Feb 15 15:12:42 2006] [warn] RSA server certificate is a CA 
certificate (BasicConstraints: CA == TRUE !?)
[Wed Feb 15 15:12:42 2006] [warn] RSA server certificate CommonName (CN) 
`Olaf Greve' does NOT match server name!?
PHP Warning:  Function registration failed - duplicate name - bzopen in 
Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - bzread in 
Unknown on line 0

[...]
..many more similar messages...
[...]
PHP Warning:  Function registration failed - duplicate name - 
ob_gzhandler in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - 
zlib_get_coding_type in Unknown on line 0
PHP Warning:  zlib:  Unable to register functions, unable to load in 
Unknown on line 0
[Wed Feb 15 15:12:42 2006] [notice] Digest: generating secret for digest 
authentication ...

[Wed Feb 15 15:12:42 2006] [notice] Digest: done
[Wed Feb 15 15:12:43 2006] [notice] Apache/2.2.0 (FreeBSD) mod_ssl/2.2.0 
OpenSSL/0.9.7c DAV/2 PHP/4.4.2 configured -- resuming normal operations



So it starts, but it seems pretty much all PHP extensions are doubly 
declared!
When calling phpinfo, the modules do show up as expected, but as soon as 
one tries to use e.g. the 'header()' function in PHP (or quite a few 
other PHP functions for that matter), nothing seems to happen in the 
browser, and the /var/log/httpd-error.log file mentions the following:

[...]
[Wed Feb 15 15:19:29 2006] [notice] child pid 27728 exit signal 
Segmentation fault (11)


And a similar message is written to /var/log/messages, being:
[...]
Feb 15 15:19:28 aceshuttle kernel: pid 27728 (httpd), uid 80: exited on 
signal 11



I suspect something went wrong in the way I try to use PHP. Basically, I 
first removed the installed /usr/ports/lang/php4 port, then built and 
installed the /usr/ports/www/mod_php4 port, and then added various 
php4-extensions, using the /usr/ports/lang/php4-extensions port (I 
suspect the extensions to cause the problem).


Does anyone know what could be going on and/or how to properly set up 
PHP 4 under Apache 2.2?


Tnx a lot in advance, and cheers!
Olafo




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



[PHP] Help! Apache 2.2 gives segmentation fault errors with PHP.

2006-02-15 Thread Olaf Greve

Hi guys,

Alright, after having been stuck with this for an hour or two now, I'm 
going to call upon your infinite wisdom regarding the following:


On a FreeBSD 5.2.1-RELEASE #0 (so says dmesg) machine, I'm trying to 
set-up Subversion, Trac and our regular PHP4 and MySQL stuff.


The main issue is that Apache 2.2 blows up (with a segmentation fault) 
when calling various PHP scripts, which I think is due to a dodgy way of 
having set-up PHP4 under Apache. This message works towards the issue, 
providing relevant(?) details, as I type along:


Here we go:
Previously the machine was running Apache 1.3.34 and that went just 
swell with PHP and all, but apparently for Subversion and/or Trac, 
Apache 2 is desired such that it can be used with WebDav.


No problem so far. I made sure the ports tree was up to date and then 
from the ports I built (always via a 'make' 'make install' sequence, and 
where necessary removing earlier versions as the process went along) 
Apache 2.2, and Subversion.


Upon configuring Apache 2.2 for PHP, however, I'm now running into 
trouble. In order to make PHP4 work under Apache 2.2 I built 
/usr/ports/www/mod_php4 and installed it.


Then I added the following to Apache's httpd.conf file:
[...]
LoadModule php4_modulelibexec/apache22/libphp4.so
[...]

[...]
   AddType application/x-httpd-php .php
   AddType application/x-httpd-php-source .phps

Also, some other stuff was tweaked in httpd.conf (though very mildly), 
like enabling SSL etc.


Now, upon starting Apache, using 'apachectl start' the following warning 
is printed twice:
[Wed Feb 15 15:12:41 2006] [warn] (2)No such file or directory: Failed 
to enable the 'httpready' Accept Filter


And the /var/log/httpd-error.log file mentions the following (at the end):
[...]
[Wed Feb 15 15:12:38 2006] [notice] caught SIGTERM, shutting down
[Wed Feb 15 15:12:41 2006] [warn] RSA server certificate is a CA 
certificate (BasicConstraints: CA == TRUE !?)
[Wed Feb 15 15:12:41 2006] [warn] RSA server certificate CommonName (CN) 
`Olaf Greve' does NOT match server name!?
[Wed Feb 15 15:12:42 2006] [warn] RSA server certificate is a CA 
certificate (BasicConstraints: CA == TRUE !?)
[Wed Feb 15 15:12:42 2006] [warn] RSA server certificate CommonName (CN) 
`Olaf Greve' does NOT match server name!?
PHP Warning:  Function registration failed - duplicate name - bzopen in 
Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - bzread in 
Unknown on line 0

[...]
..many more similar messages...
[...]
PHP Warning:  Function registration failed - duplicate name - 
ob_gzhandler in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - 
zlib_get_coding_type in Unknown on line 0
PHP Warning:  zlib:  Unable to register functions, unable to load in 
Unknown on line 0
[Wed Feb 15 15:12:42 2006] [notice] Digest: generating secret for digest 
authentication ...

[Wed Feb 15 15:12:42 2006] [notice] Digest: done
[Wed Feb 15 15:12:43 2006] [notice] Apache/2.2.0 (FreeBSD) mod_ssl/2.2.0 
OpenSSL/0.9.7c DAV/2 PHP/4.4.2 configured -- resuming normal operations



So it starts, but it seems pretty much all PHP extensions are doubly 
declared!
When calling phpinfo, the modules do show up as expected, but as soon as 
one tries to use e.g. the 'header()' function in PHP (or quite a few 
other PHP functions for that matter), nothing seems to happen in the 
browser, and the /var/log/httpd-error.log file mentions the following:

[...]
[Wed Feb 15 15:19:29 2006] [notice] child pid 27728 exit signal 
Segmentation fault (11)


And a similar message is written to /var/log/messages, being:
[...]
Feb 15 15:19:28 aceshuttle kernel: pid 27728 (httpd), uid 80: exited on 
signal 11



I suspect something went wrong in the way I try to use PHP. Basically, I 
first removed the installed /usr/ports/lang/php4 port, then built and 
installed the /usr/ports/www/mod_php4 port, and then added various 
php4-extensions, using the /usr/ports/lang/php4-extensions port (I 
suspect the extensions to cause the problem).


Does anyone know what could be going on and/or how to properly set up 
PHP 4 under Apache 2.2?


Tnx a lot in advance, and cheers!
Olafo


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



Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9

Barry wrote:

J_K9 wrote:

Duncan Hill wrote:


On Wednesday 15 February 2006 11:35, J_K9 wrote:


Duncan Hill wrote:


On Wednesday 15 February 2006 11:05, J_K9 wrote:


Here's the exact 500 error I'm getting:


Standard Apache error.  Look in your error log for more details 
like it

suggests?


I would, but I can't find it. I thought it was under /var/log, but
having taken a good look I just can't find the logs. And the fact 
that I

can't use slocate to find them because I can't get root access to run
updatedb doesn't help either ;)



If you have read access to the apache configuration files, the 
ErrorLog statement (+ServerRoot) should tell you where your logs are.


(There's no need to CC me, I get the list :p)

Nothing's in the right place! I can't even find the Apache conf 
file... This is the problem with using external hosting - they do 
things differently. :@


Aren't there any PHP functions I can use to let me know where the 
errors are happening? I'm sure I've seen one somewhere; I just don't 
remember it, that's all... ;)


Thanks,

J_k9


The error you get is an "Apache" error and has nothing to do with php so 
there are no error reportings within PHP for apache.


There might be a problem setting the content header prolly because 
Apache dont have them or what the hell i know.


Sorry i can't help from here without any log output and or config files.

Doesn't locate work on you system?
$ locate log

Probably you have a virtual hosting.

look at /var/www

Otherwise no idea.

The code is okay, i use it myself and it works just great.

Greets
Barry



No - I'll have to get in contact with my hosting support team, because 
this is beginning to annoy me.


locate doesn't work because it has no database to work from - and I 
can't updatedb because I don't have the necessary perms. I tried a 'find 
-name 'httpd.conf'', but that didn't work because it spat out a bunch of 
tasks from within /proc and also references to /home/user.daily/etc, 
~.daily/ssl, ~.daily/mail, and a few more from there: all of which I 
don't have permission to access.


Thanks for confirming that it works though - now all I have to do is 
send an email to the support team and wait for their reply. :)


Cheers,

J_K9

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



Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Barry

J_K9 wrote:

Duncan Hill wrote:


On Wednesday 15 February 2006 11:35, J_K9 wrote:


Duncan Hill wrote:


On Wednesday 15 February 2006 11:05, J_K9 wrote:


Here's the exact 500 error I'm getting:


Standard Apache error.  Look in your error log for more details like it
suggests?


I would, but I can't find it. I thought it was under /var/log, but
having taken a good look I just can't find the logs. And the fact that I
can't use slocate to find them because I can't get root access to run
updatedb doesn't help either ;)



If you have read access to the apache configuration files, the 
ErrorLog statement (+ServerRoot) should tell you where your logs are.


(There's no need to CC me, I get the list :p)

Nothing's in the right place! I can't even find the Apache conf file... 
This is the problem with using external hosting - they do things 
differently. :@


Aren't there any PHP functions I can use to let me know where the errors 
are happening? I'm sure I've seen one somewhere; I just don't remember 
it, that's all... ;)


Thanks,

J_k9


The error you get is an "Apache" error and has nothing to do with php so 
there are no error reportings within PHP for apache.


There might be a problem setting the content header prolly because 
Apache dont have them or what the hell i know.


Sorry i can't help from here without any log output and or config files.

Doesn't locate work on you system?
$ locate log

Probably you have a virtual hosting.

look at /var/www

Otherwise no idea.

The code is okay, i use it myself and it works just great.

Greets
Barry

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9

Duncan Hill wrote:

On Wednesday 15 February 2006 11:35, J_K9 wrote:

Duncan Hill wrote:

On Wednesday 15 February 2006 11:05, J_K9 wrote:

Here's the exact 500 error I'm getting:

Standard Apache error.  Look in your error log for more details like it
suggests?

I would, but I can't find it. I thought it was under /var/log, but
having taken a good look I just can't find the logs. And the fact that I
can't use slocate to find them because I can't get root access to run
updatedb doesn't help either ;)


If you have read access to the apache configuration files, the ErrorLog 
statement (+ServerRoot) should tell you where your logs are.


(There's no need to CC me, I get the list :p)

Nothing's in the right place! I can't even find the Apache conf file... 
This is the problem with using external hosting - they do things 
differently. :@


Aren't there any PHP functions I can use to let me know where the errors 
are happening? I'm sure I've seen one somewhere; I just don't remember 
it, that's all... ;)


Thanks,

J_k9

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



RE: [PHP] Problem with php.ini and include_path

2006-02-15 Thread George Pitcher
Richard, et al,

I tried your suggestion of the .htaccess file but that didn't do anything.

I'm using Webmin to administer the linux box and the Apache server configs
has a PHP module and that allowed me to set a directory level include_path.
Problem solved.

Now onwards towards configuring pear.

Cheers

George

> -Original Message-
> From: Richard Lynch [mailto:[EMAIL PROTECTED]
> Sent: 14 February 2006 11:56 pm
> To: George Pitcher
> Cc: php-general@lists.php.net
> Subject: RE: [PHP] Problem with php.ini and include_path
>
>
> http://php.net/set_include_path
>
> .htaccess
> php_value include_path ".:/whatever/you/want/here"
>
> Also, you are comparing the output of php CLI which may or may not be
> the same as --with-apxs compilation, especially if you have an *OLD*
> CLI php sitting around...
>
> From the command line, compare:
> which php
> with the output from your "make install" of PHP and see if you're even
> running the php binary you THINK you are running.
>
> On Tue, February 14, 2006 9:13 am, George Pitcher wrote:
> >> George Pitcher wrote:
> >> > Hi,
> >> >
> >> > I have compiled php-5.1.2 with apache on Debian and have a
> >> problem with the
> >> > include_path.
> >> >
> >> > My configure was './configure' '--with-mysql' '--with-pear'
> >> '--with-apxs'
> >>
> >> the '--with-apxs' suggest your probably running php as an apache
> >> module,
> >> if so then you'll need to restart apache for the settings in php.ini
> >> to take affect.
> >>
> >
> > Jochem,
> >
> > Sorry, I should have said that I'd done that as well. Still no joy.
> >
> > One other thing that I have noticed is that if I do 'php -i |grep
> > include_path' from outside the directory where php.ini is it says
> > 'include_path => .:/usr/lib/php' but if I do that from within the same
> > directory as php.ini I get the include_path that I have set in
> > php.ini.
> >
> > Cheers
> >
> > George
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
>
>

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



Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Duncan Hill
On Wednesday 15 February 2006 11:35, J_K9 wrote:
> Duncan Hill wrote:
> > On Wednesday 15 February 2006 11:05, J_K9 wrote:
> >> Here's the exact 500 error I'm getting:
> >
> > Standard Apache error.  Look in your error log for more details like it
> > suggests?
>
> I would, but I can't find it. I thought it was under /var/log, but
> having taken a good look I just can't find the logs. And the fact that I
> can't use slocate to find them because I can't get root access to run
> updatedb doesn't help either ;)

If you have read access to the apache configuration files, the ErrorLog 
statement (+ServerRoot) should tell you where your logs are.

(There's no need to CC me, I get the list :p)

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



Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9

Duncan Hill wrote:

On Wednesday 15 February 2006 11:05, J_K9 wrote:

Here's the exact 500 error I'm getting:


Standard Apache error.  Look in your error log for more details like it 
suggests?


I would, but I can't find it. I thought it was under /var/log, but 
having taken a good look I just can't find the logs. And the fact that I 
can't use slocate to find them because I can't get root access to run 
updatedb doesn't help either ;)


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



Re: [PHP] make test failures

2006-02-15 Thread Jochem Maas

Chris wrote:


I'm recompiling php 5.1.2 on an up-to-date fedora core 4 system and 
pretty much every test is failing when I run 'make test'.


I figure it's a server issue but I have no idea where to start looking.




make test asks you do you want to send a mail, answer yes



I thought someone might've seen this before and it turned out to be bad 
memory or a bad version of "X"...


I'll see how I go with mailing the report to qa.


I doubt they will look at it if every test is going wrong.

I sometimes have a situation whereby the php I have just built will fail
all test (make test) because the newly built php uses the existing php.ini
and therefore tries to load all the extension that were built for the
currently installed version of php - which doesn't work and causes php
startup errors to be emitted. make test runs a seperate instance of php for
each test - as a result each test will fail because the 'controller script'
running each test get the startup error message each time and sees this message
as meaning the test failed (which is not necessarily true)

anyway that might be what you are experiencing, then again it might not be!



Thanks.



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



Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Duncan Hill
On Wednesday 15 February 2006 11:05, J_K9 wrote:
> Here's the exact 500 error I'm getting:

Standard Apache error.  Look in your error log for more details like it 
suggests?

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



Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9

Barry wrote:

Technically:
PHP is server sided, so anything that is sended to browser like HTML 
output is output.
Any output in text format sended to the browser (HTML headers and such) 
will be recognized as normal output.


The header you set with header() is a HTTP header not HTML header.
that's why it wasn't working.

Well a 500 error is an internal error so probably your php isnt running 
as it has to, probably because it is parsed through cgi or such.*shrug*


By the way, you dont have to add the HTML tags.
You just need plain PHP.


Oh, ok. I've now removed the HTML (but still getting a 500 error)



Misconfigured server?
What server do you use?
What PHP version?

Barry


Apache 1.3.34, with PHP 4.4.1.

Here's the exact 500 error I'm getting:


Internal Server Error
The server encountered an internal error or misconfiguration and was 
unable to complete your request.


Please contact the server administrator, [EMAIL PROTECTED] and inform 
them of the time the error occurred, and anything you might have done 
that may have caused the error.


More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use 
an ErrorDocument to handle the request.



Thanks,

J_K9

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



Re: [PHP] Onclick event and PHP function

2006-02-15 Thread Richard Collyer
Hello,

Your getting confused between server side and client side.

PHP CANNOT be run on the client side which is what Javascript is.

In this case all you are doing is calling that php function twice one for
eng and once for fre.

Instead try using mydomain.com/setlang?=eng as a link which calls
vardef($lg) and then return the user to the original page.

Cheers
Richard


On Wed, February 15, 2006 10:17 am, Alain Roger wrote:
> Hi,
>
> I have some link on which if user click, should do the following things:
>
> - open a particular page
> - setup to sessions some particular variable value
>
> however, PHP function should be declared before HTML headers.
>
> so i was thinking about something like that
>
> function vardef($lg)
>{
>  ... store lg to my session variables ...
>}
> ?>
>
> 
> ...
> ">english
> ">french
> ...
> 
>
> but this does not work because my session variable is always setup to the
> last value (in this case "fre"), even if i click only on english :-(
>
> could you help me with this PHP issue ?
> thanks a lot,
>
> Alain
>


--
Richard Collyer
[EMAIL PROTECTED]

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



Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Barry

J_K9 wrote:


Well, technically that isn't text output - it's only setting a title... ;)

Technically:
PHP is server sided, so anything that is sended to browser like HTML 
output is output.
Any output in text format sended to the browser (HTML headers and such) 
will be recognized as normal output.


The header you set with header() is a HTTP header not HTML header.
that's why it wasn't working.

Anyway, I moved the PHP to the top of the file (ie. before the HTML), 
but now I'm getting a 500 Internal error... Here's the full code I'm using:


Well a 500 error is an internal error so probably your php isnt running 
as it has to, probably because it is parsed through cgi or such.*shrug*


By the way, you dont have to add the HTML tags.
You just need plain PHP.







Downloads






Any idea what could be going wrong?


Misconfigured server?
What server do you use?
What PHP version?

Barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Stut

J_K9 wrote:

Well, technically that isn't text output - it's only setting a 
title... ;)



'Technically' anything that gets sent to the browser is output. Why are 
you trying to set a title when you are sending a binary file? An HTML 
title is only relevant if you're returning HTML to the client.


Anyway, I moved the PHP to the top of the file (ie. before the HTML), 
but now I'm getting a 500 Internal error... Here's the full code I'm 
using:






Downloads



 



I'm no expert but the first thing I'd try is only sending one 
Content-Type header. Which is it? However, I doubt that would cause an 
internal error, but then I can't see anything in this code that would.


Hope that helps.

-Stut

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



Re: [PHP] Regular expression

2006-02-15 Thread Robin Vickery
On 2/14/06, Patrick <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am trying to validate a password, but havent figured out the pattern for
> it yet.
> The password must contain atleast 6 characters
> a-zA-Z0-9_
> must start with a
> a-zA-Z
> and must have atleast one of the following characters
> !#%&$£


As Curt said, it's probably better to do this programatically - if
only so you can work out what it's doing six months down the road.

However if you want to know to do it as a regexp:

start with the letters a-z.

^[a-z]

At least 5 legal characters following that  (use a lookahead assertion
to check):

(?=[!#%&$£\w]{5})

Zero or more non-punctuation characters, followed by a a punctuation
character, followed zero or more of any valid character.

\w*[!#%&$£][!#%&$£\w]*

And then anchor the end of the string with a $.

Put all that together with a bit of case insensitivity and you get.

$regexp = '/^[a-z](?=[!#%&$£\w]{5})\w*[!#%&$£][!#%&$£\w]*$/i';

$status = preg_match($regexp, $password) ? 'PASS' : 'FAIL';

  -robin


Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9



Lines 1-10:




Downloads




Exactly!

HTML "is" output ya know?



Well, technically that isn't text output - it's only setting a title... ;)

Anyway, I moved the PHP to the top of the file (ie. before the HTML), 
but now I'm getting a 500 Internal error... Here's the full code I'm using:






Downloads






Any idea what could be going wrong?

Thanks,

J_K9

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



Re: [PHP] web database template

2006-02-15 Thread Angelo Zanetti


reiner wrote:
Hello friend I am new in PHP and Mysql a have a good background in sql 
server
I need to create a mysql database but I am new in web application so can 
you help me to find a database template in mysql?


I do not have to much time.

Kind regards Reiner



what is a datbase template and why u asking in a PHP forum?

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



Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Barry

J_K9 wrote:

Barry wrote:


J_K9 wrote:


This is what I used:






As you can see, there is no output before the headers are set. In 
fact, the error say that the headers were set on line 6, which is 
default headers?


Thanks,

J_K9



What is before line 6?
Because the 
Lines 1-10:




Downloads




Exactly!

HTML "is" output ya know?

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



[PHP] Onclick event and PHP function

2006-02-15 Thread Alain Roger
Hi,

I have some link on which if user click, should do the following things:

- open a particular page
- setup to sessions some particular variable value

however, PHP function should be declared before HTML headers.

so i was thinking about something like that




...
">english
">french
...


but this does not work because my session variable is always setup to the
last value (in this case "fre"), even if i click only on english :-(

could you help me with this PHP issue ?
thanks a lot,

Alain


Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9

Barry wrote:

J_K9 wrote:

This is what I used:






As you can see, there is no output before the headers are set. In 
fact, the error say that the headers were set on line 6, which is 
default headers?


Thanks,

J_K9


What is before line 6?
Because the 
Lines 1-10:




Downloads


http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] how to build custom/private pear packages

2006-02-15 Thread Jochem Maas

hi people,

I have been thinking about how I rollout some of my code (stuff
that gets reused alot) and I thought it would be nice if I could have
basic functionality available for my projects via a custom pear
package server (referred to as a 'pear channel'??) - so what I would
like to figure out is how to set up a 'package server' and how to
roll my own packages.

I have been searching but I've drawn a bit of a blank - anyone know
some good reading material that could get me started?

rgds,
Jochem

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



Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Barry

J_K9 wrote:

This is what I used:






As you can see, there is no output before the headers are set. In fact, 
the error say that the headers were set on line 6, which is can this be? Is there something I need to turn off like default headers?


Thanks,

J_K9


What is before line 6?
Because the http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9

Barry Krein wrote:

J_K9 wrote:



Barry wrote:


J_K9 wrote:


Curt Zirzow wrote:


On Tue, Feb 14, 2006 at 09:02:50PM +, J_K9 wrote:


Hi,

I'm currently learning PHP, and I'd like to put it into practice 
to help me learn. I want to make a download script so that if the 
value of a certain variable is '1', the first download is 
selected, if it's '2', the second is selected, and so on... But, 
all the time, the download source's URI is not revealed.


As I was saying, I have a vague idea of how to do it - but I know 
it's wrong. With the help of some others, I've managed to come up 
with this:


|---
||



This is a method is rather known as 'security by obscurity'. If you
want to use this method instead of doing some sort of
authentication system, you need to make your file_id's more obscure
by using a more randomized value instead of 1,2,3...
Curt.




Hi,

It is security through obscurity, but I thought it is a technique I 
should learn in case I would like to implement something similar in 
the future. The reason I am not coding an authentication system is 
because I have only just begun PHP, so am going for simple stuff. ;)


The file_id's were just examples as well - to keep what I meant simple.

How can I make that code work though? Is there another function I 
should be using to pass up the file as a download to the user, or is 
this just not possible?


Thanks,

J_K9



Set the stream to download and use readfile.

// Path to your file
$path = "./hidden--files/downloadme.zip";

// fix for IE catching or PHP bug issue
header("Pragma: public");
header("Expires: 0"); // set expiration time
header("Cache-Control: must-revalidate, post-check=0,
pre-check=0");
// browser must download file from server instead of cache

// force download dialog
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");

// use the Content-Disposition header to supply a
// recommended filename and
// force the browser to display the save dialog.
header("Content-Disposition: attachment; filename=".$path.";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($path));

readfile($path);

have phun!

Barry



Hi,

I tried out the code - I get more warnings about not being able to 
modify header information (I get one for each mention of header() in 
the code), and then beneath the warnings there are lines and lines of 
extended ASCII.


^^ That's because the force-download header isn't working, and 
therefore the .zip is being written to the output stream, right?


I wonder why it's telling me that I cannot modify header information. 
Is there anything we've left out, or something like that? It isn't a 
browser issue, because I've tried it in both Firefox and IE...


Thanks,

J_K9



// This script will not work!!
echo "ZOMG! ITS NOT WORKING!";
header ("Loaction: hahaha.php");


// This script will work!
header ("Blah: BLUBB");
echo "ZOMG! IT WORKS!";



This is what I used:






As you can see, there is no output before the headers are set. In fact, 
the error say that the headers were set on line 6, which is can this be? Is there something I need to turn off like default headers?


Thanks,

J_K9

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



Re: [PHP] Class/functions question

2006-02-15 Thread Jochem Maas

Paul Goepfert wrote:

Does anyone know where I can find the error log?  I am using php on a


http://www.google.com/search?q=where+is+apache+error+log


webserver and the only log I found was a connection log in the logs
dir on my webserver.


something like:

/var/log/apache/error_log
/var/log/httpd/error.log

assuming you use a linux server; on windows the
apache error log lives in the apache 'Program Files'
directory. (asuming you use apache as a webserver) -
but basically it _could_ be anywhere on the filesystem.

I think you should read the following section of
the manual to get an understanding of whats available
in terms of error handling, reporting (with a mind to fixing
whatever problem you have at this moment):

http://php.net/manual/en/ref.errorfunc.php



Paul

On 2/14/06, Jochem Maas <[EMAIL PROTECTED]> wrote:


Paul Goepfert wrote:


I was able to get part of my page to load when I created the
Validation class and put a call to the validation class within my
table.  When I did that the  page loaded up until the php code to call
the method and then it does not load the rest of the page.Can
anyone help me with this?  By the way I am calling $_POST["name"] as


it sounds like your class does not exist (or some function or class
it relies on).



the parameter to be passed into the function

so my php code looks like:
checkEmpty($_POST["name"]);
?>


1. check your error log for an error messge.
2. determine if the class exists at the time that the above code is run
e.g. with class_exists('Validation').
3. determine if $a is actually a Validation object (i.e. the creation of a new 
object succeeded)





Paul
On 2/12/06, Chris Shiflett <[EMAIL PROTECTED]> wrote:



Paul Goepfert wrote:



I know how to call functlions, I just just don't know how to
do it in PHP.


Based on the rest of your question, I think you mean methods, not
functlions. :-)

If you're struggling with syntax, you should take one step at a time.
Try this:

myMethod()';
   }
}

$myObject = new myClass;

$myObject->myMethod();

?>

That should help you with any syntax problems, but I suspect your
problem has more to do with logic than with syntax.




if (isset($submit))
{
 class Validation
 {


/* ... */




 }
}
else
{


/* ... */




 $v = new Validation;
 $v->checkEmpty($_POST["name"]);


If the form is submitted, define the class, else use the class. That
doesn't sound right...

Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/








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



  1   2   >