Re: [PHP] Zend PHP Certification test

2004-09-30 Thread Rory Browne
I haven't done the exam, yet, but based on some of the practice
questions, I'm getting worried. I'm finding sample questions whose
answers are not covered in the book. One such question was a list(,
$var) = whatever, and nowhere in the book could I find an explanation
for same.

I've also used count, and strlen many times, but I've never used count
on a non-array, which is what strlen returns.

I'm just don't think I've screwed up enough yet, although I've been
using PHP on and off for four years.

Regards
Rory

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



Re: [PHP] Read word documents on a Linux server

2004-10-05 Thread Rory Browne
I'd also try and find a way of automating openoffice. Check first
though, to ensure that the quality of the converted document is up to
scratch. Having that said, OO.o has a pretty good reputation for this.


On Tue, 05 Oct 2004 21:49:01 +0600, raditha dissanayake
<[EMAIL PROTECTED]> wrote:
> Jacob Larsen wrote:
> 
> > Can I via Php read word documents on a Linux server?
> 
> I haven't tried this but I guess probably not. My suggestion would be to
> look at the star office sdk from sun you will need to use java though.
> 
> >
> > I see COM, but that's only available for the Windows version of PHP.
> >
> > Thanks,
> > Jacob
> >
> 
> -- 
> Raditha Dissanayake.
> 
> http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 128 KB | with progress bar.
> 
> 
> 
> --
> 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] Re: PHP5 and Multi Inheritance?

2004-10-17 Thread Rory Browne
I'm not sure, but I think the only way you are going to get MI in PHP,
is if you implement if yourself. By this I mean, implementing the
correct __get(), __set(), and __call() functions.



On Sun, 17 Oct 2004 18:32:34 +0400, M Saleh EG <[EMAIL PROTECTED]> wrote:
> Thanx Mathew
> I guess I found it, it's disapointing though.
> 
> Here was the answer: http://www.zend.com/php5/andi-book-excerpt.php#Heading3
> 
> 
> 4. Interfaces
> Gives the ability for a class to fulfill more than one is-a
> relationships. A class can inherit from one class only but may
> implement as many interfaces as it wants.
> 
> 
> On 17 Oct 2004 13:30:36 -, Matthew Weier O'Phinney
> 
> 
> <[EMAIL PROTECTED]> wrote:
> > * M Saleh Eg <[EMAIL PROTECTED]>:
> > > Is direct multi inhertance supported in PHP5?
> >
> > I believe so -- this was one of the new features of the object model
> > introduced in PHP5. My understanding is that you have to create
> > interface classes that a class can then implement. Unfortunately,
> > interface classes are abstract -- no code allowed other than
> > declarations.
> >
> > > I'm on PHP4, didnt find this on the docs nor at zend's. It might be
> > > the reason of migrating to PHP5 for me. Any Idea? anyone who tested
> > > it? by this I dont mean the chaining method of inheriting. I mean
> > > direct multi inheritance!
> >
> > I saw a number of mentions of it when PHP5 was first released, but the
> > only reference I can dig up now is at:
> >
> >http://www.zend.com/php5/andi-book-excerpt.php#Heading3
> >
> > and, unfortunately, when it talks about interfaces being how multiple
> > inheritance is achieved, fails to give an example.
> >
> > Surely somebody has a more definitive answer, but I thought I'd give it
> > a shot.
> >
> > --
> > Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
> > Webmaster and IT Specialist   | http://www.garden.org
> > National Gardening Association| http://www.kidsgardening.com
> > 802-863-5251 x156 | http://nationalgardenmonth.org
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> --
> M.Saleh.E.G
> 97150-4779817
> 
> --
> 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] Zend PHP Certification test

2004-10-17 Thread Rory Browne
I've been looking all over the Zend Cert site, trying to find the
passing rate, ie how many questions I have to get right in order to
pass.

Is this information secret, or have I just not looked in the right place.

If it's the latter, please enlighten me.

Thanks
Rory

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



Re: [PHP] File and line that called a function?

2004-10-18 Thread Rory Browne
Sorry accidently replied off-list

I basicly said to check out debug_backtrace()

at http://www.php.net/debug-backtrace


On Mon, 18 Oct 2004 13:56:33 -0600, Adrian Madrid
<[EMAIL PROTECTED]> wrote:
> Is there a way to know which file and line called a function youo are
> in? I want to create an error function that can tell me which file and
> line called it. I know __FILE__ and __LINE__ but they will return the
> file and line that my error function is in, and not the originators.
> 
> Thanks in advance,
> 
> --
> Adrian Madrid
> HyperX Inc.
> Mobile: 801.815.1870
> Office: 801.566.0670
> [EMAIL PROTECTED]
> www.hyperxmedia.com
> 
> 9000 S. 45 W.
> Sandy, UT 84070
> 
> --
> 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] Re: heredoc syntax

2004-10-20 Thread Rory Browne
What OS are you using? On windows, you may have problems with the \r\n
newline system. I read somewhere that the heredoc syntax requires the
use of unix-style \n's

Are you getting any error messages. If it didn't work you should get a
syntax error. If so what was it?


On Wed, 20 Oct 2004 20:46:54 +0200, M. Sokolewicz <[EMAIL PROTECTED]> wrote:
> Adil wrote:
> 
> > anyone know why heredoc syntax might not work with php5/apache installed.  I
> > can't get even the simplest strings in heredoc syntax to work and I've tried
> > just cutting and pasting other peoples stuff in that syntax as well, and
> > still no luck
> >
> > thx.
> > Adil.
> works fine here... using a 5.0.2-CVS from a few days ago
> 
> 
> 
> --
> 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] Re: [users@httpd] Favorite Linux Distribution

2005-02-08 Thread Rory Browne
This question is as much about politics, and religion, as it is technical.

I like mandrake, but I haven't used a distro yet, in which everything
'just worked'. Each distro I tried had some bug in it. Can't remember
what they were, and they were easly circumvented, but if you don't
know much about Linux, then it may not be the best choice.

I haven't tried ubuntu yet, but if you can get it installed okay, it
will probably pay off on the long run, since it is backed by the
strength, and power of Debian. That means that you can use the same
apt system as is used by debian for your package management.

Mandrake does have urpmi, which makes package management much easier
than it is in Fedora, SuSE, or any other rpm(redhat) based distro, but
I think you should know a bit about Linux, before venturing into what
is, if we're going to be honest about it, a buggy operating system.

I haven't tried it myself(costs money), but if I were starting again,
I might give Xandros a try. Make sure that whatever you do, that you
choose one that has a reputation for being newbie friendly.


On Tue, 8 Feb 2005 09:26:21 +0100, Gareth Williams <[EMAIL PROTECTED]> wrote:
> 
> I would agree with the Mandrake recommendation.
> 
> I first installed it a few years back, to help me get started in the
> Linux/Unix world, and had very little trouble with it.  It's hardware
> recognition has always been very impressive.  Since first installing
> Mandrake, I have often thought I should 'grow up' and try a more
> serious distribution, but I always end up coming back.  Being Mandrake,
> it's as easy as you want  to configure stuff, and being Linux, it's
> also as hard as you want.  I've rarely had dependency problems, but
> then I don't really go in for exotic configurations.
> 
> 
> On 8 Feb 2005, at 08:21, [EMAIL PROTECTED] wrote:
> 
> > Pretty difficult question as it's a question of taste :-)
> >
> > If your are new to linux and want to keep your windows (dual-boot),
> > Mandrake would be my advice: in a class with users without experience
> > of
> > linux, they all have been able to install Mandrake (10.1) dual booting
> > windows without a problem in -/+ 2 hours. I also have it on my laptop
> > since 2/3 years now and it works pretty well
> > Fedora Core is really nice, but if I'm not wrong, there is no
> > possibility
> > in the graphical installation to redimension your windows partition (by
> > the way always do a backup and a defrag before)
> >
> > gaël
> >
> > The Disguised Jedi <[EMAIL PROTECTED]> wrote on 08/02/2005
> > 00.25.28:
> >
> >> Hello all -
> >>
> >> I've been a list member for a while, helped out some people, and asked
> >> some questions.  But, today I have a completely off topic, but
> >> somewhat relevant question for y'all.
> >>
> >> What is your favorite Linux distribution?  What would you recommend
> >> for my situation?
> >>
> >> I'm brand new to Linux.  I'm just trying to learn how it works, but I
> >> think I'll catch on quick.  I'm looking for the one with the most
> >> capability, and also one to run my development instance of Apache 2.0
> >> on.
> >>
> >> I've been looking at either RedHat or Fedora.  Is this a good choice?
> >> I'm truly drawing a blank, and I've searched Google, but never really
> >> found anything extremely useful.  Please help me, an old Windows
> >> veteran, escape the Microsoft box!
> >>
> >> Thanks a ton!!
> >>
> >> --
> >> The Disguised Jedi
> >> [EMAIL PROTECTED]
> >>
> >> PHP rocks!
> >> "Knowledge is Power.  Power Corrupts.  Go to school, become evil"
> >>
> >> Disclaimer: Any disclaimer attached to this message may be ignored.
> >> This message is Certified Virus Free
> >>
> >> -
> >> The official User-To-User support forum of the Apache HTTP Server
> > Project.
> >> See http://httpd.apache.org/userslist.html> for more info.
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>"   from the digest: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >
> > --
> > 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
> 
>

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



Re: [PHP] Re: [users@httpd] Favorite Linux Distribution

2005-02-09 Thread Rory Browne
And if you question the political motivations jfgi for osama bin linux.


On Wed, 9 Feb 2005 17:22:47 +, Rory Browne <[EMAIL PROTECTED]> wrote:
> > In all my years of attending Church I never once heard anyone
> > discussing Linux.  Must be a denominational thing.
> 
> Dear Brethren,
> As a follower of st iGNUtious I am troubled by the spiritual blindness
> I see evident in the comment I see here before me. Did not the prophet
> RMS teach the true path? And yet now you have backsliden. Go ye
> therfore to www.gnu.org and you will once more be walking along the
> path of rightiousness.
> 
> PS: I didn't write that, someone else did at
> http://www.kuro5hin.org/story/2001/8/21/15457/2473
> 
> >
> > --
> > Greg Donald
> > Zend Certified Engineer
> > http://destiney.com/
> >
> > --
> > 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] Re: [users@httpd] Favorite Linux Distribution

2005-02-09 Thread Rory Browne
> In all my years of attending Church I never once heard anyone
> discussing Linux.  Must be a denominational thing.

Dear Brethren,
As a follower of st iGNUtious I am troubled by the spiritual blindness
I see evident in the comment I see here before me. Did not the prophet
RMS teach the true path? And yet now you have backsliden. Go ye
therfore to www.gnu.org and you will once more be walking along the
path of rightiousness.


PS: I didn't write that, someone else did at
http://www.kuro5hin.org/story/2001/8/21/15457/2473



> 
> --
> Greg Donald
> Zend Certified Engineer
> http://destiney.com/
> 
> --
> 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] Hi ALL

2005-02-22 Thread Rory Browne
How to use this list best:

Search the archives at lists.php.net for [NEWBIE GUIDE] It was written
by Jay Blanchard earlier this year I believe. Read it.

Then read this: http://www.catb.org/~esr/faqs/smart-questions.html

Then try learning PHP from the PHP manual. If you come across a
problem, then explain the problem, AND WHAT STEPS YOU HAVE TAKEN TO
SOLVE THE PROBLEM YOURSELF BEFORE POSTING TO THE LIST.

Give a little back. After you've learn't a little, and you see someone
else posting a question that you know the answer to an feel you can
explain well, then hit your email clients reply button.

If you want to fit in, and you want to be taken seriously, and most
importantly if you want to learn, then consider the above points.



On Tue, 22 Feb 2005 23:21:48 +0100, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Bret Hughes wrote:
> > On Tue, 2005-02-22 at 05:27, Dhanasekar T wrote:
> >
> >>hi all,
> >>i m new to this group ...now i want to learn php.
> 
> right now? not in five minutes.
> 
> >>i want all u r guidence  to utilise this group...
> >>thanks in advance
> >>dhanas
> >
> Dhanas,
> 
> do you have php installed ?
> can you access http://php.net ? the best place to start
> reading/learning
> 
> >
> >
> > I would start by looking at and dare I say reading the manual at
> > php.net.  Then surf around for a beginners tutorial, and start coding.
> >
> > I suspect the learning curve shape depends on whether you have any
> > previous programming experience or not.
> 
> hey! I was looking forward to being utilized. ;-)
> 
> >
> > Bret
> >
> 
> --
> 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] Hi ALL

2005-02-23 Thread Rory Browne
Jocham:
Uh???

First of all, no that was not intended at you. Dhanasekar asked a
question, and I answered it. I don't think the rest of your
message/attack is particularly relevent, with the above taken into
account.

I simply saw a question that I knew the answer to, and answered it as
best I could. It wasn't meant to talk down, or state obvious, but
rather to mention things, that people generally don't think of, or in
the case of the newbie guide/smart-question guide, just don't know.

If you are going to judge my 'giving a little back' then try to get
your facts straight. I think my 'giving back' greatly outweighs my
'taking' from this and any other tech forum that I've ever used. I'll
provide you with a sample if necessary.


On Wed, 23 Feb 2005 12:35:29 +0100, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Rory Browne wrote:
> > How to use this list best:
> >
> > Search the archives at lists.php.net for [NEWBIE GUIDE] It was written
> > by Jay Blanchard earlier this year I believe. Read it.
> 
> heh Rory, is this aimed at me or did you just reply to my mail for
> convienience? I happen to know the NEWBIE GUIDE quiet intimately
> (n'est pas Jay? :-)
> 
> >
> > Then read this: http://www.catb.org/~esr/faqs/smart-questions.html
> >
> > Then try learning PHP from the PHP manual. If you come across a
> > problem, then explain the problem, AND WHAT STEPS YOU HAVE TAKEN TO
> > SOLVE THE PROBLEM YOURSELF BEFORE POSTING TO THE LIST.
> >
> > Give a little back. After you've learn't a little, and you see someone
> 
> me again. well i have mailed the list 235 times since 12-1-05 (as far as my 
> local
> mail folders go atm) - granted not all are useful/valid answers,
> - compared to your 7 posts. I feel that I have satisfied the 'little' in
> 'give a little back' even if you don't :-).
> 
> anyway its not a pissing content, besides if it was I'd put my money on
> Richard Lynch for all categories:
> 
> 1. total number of posts
> 2. highest average no. of posts/week
> 3. longest post
> 4. total no. of words written
> 5. highest average no. of words/post
> 
> :-)
> 
> > else posting a question that you know the answer to an feel you can
> > explain well, then hit your email clients reply button.
> >
> > If you want to fit in, and you want to be taken seriously, and most
> > importantly if you want to learn, then consider the above points.
> 
> again is this aimed at me? no biggy but really I don't want to fit
> in all that bad
> 
> 
> I wouldn't join any club that would have me as a member ;-)
> 
> 
> ...
> 
> >
> >
> >
> > On Tue, 22 Feb 2005 23:21:48 +0100, Jochem Maas <[EMAIL PROTECTED]> wrote:
> >
> >>Bret Hughes wrote:
> >>
> >>>On Tue, 2005-02-22 at 05:27, Dhanasekar T wrote:
> >>>
> >>>
> >>>>hi all,
> >>>>i m new to this group ...now i want to learn php.
> >>
> >>right now? not in five minutes.
> 
> I was kidding!
> 
> >>
> >>
> >>>>i want all u r guidence  to utilise this group...
> >>>>thanks in advance
> >>>>dhanas
> >>>
> >>Dhanas,
> >>
> >>do you have php installed ?
> 
> Dhana is very welcome to answer this question, and maybe give
> some background as to his/her general skill level
> 
> **give us more input Dhana and maybe we can point you in the
> right direction**
> 
> so come on Dhana - talk to us, tell us what your capable of
> and what you would like to accomplish (be specific and start out
> small if your a 'virgin programmer' ;-)
> 
> >>can you access http://php.net ? the best place to start
> >>reading/learning
> >>
> >>
> >>>
> >>>I would start by looking at and dare I say reading the manual at
> >>>php.net.  Then surf around for a beginners tutorial, and start coding.
> >>>
> >>>I suspect the learning curve shape depends on whether you have any
> >>>previous programming experience or not.
> >>
> >>hey! I was looking forward to being utilized. ;-)
> 
> my hope is that Dhana is not so stupid that he assumes that my bit of
> humor was directly meant to make fun of his command of the english language.
> 
> I can find Dhanas use of words funny without requiring that I also
> must mock him... besides the fact that I made the joke might be useful 
> feedback
> to Dhana with regard to bettering his English - Im sure he/she wishes to be 

Re: [PHP] Hi ALL

2005-02-23 Thread Rory Browne
Sorry didn't mean to accuse you of attacking. Just had a more hectic
day than usual, and maybe lost it a bit.

Anyway, this is rapidly getting off topic, so..


On Wed, 23 Feb 2005 16:52:25 +0100, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Rory Browne wrote:
> > Jocham:
> > Uh???
> >
> > First of all, no that was not intended at you. Dhanasekar asked a
> > question, and I answered it. I don't think the rest of your
> > message/attack is particularly relevent, with the above taken into
> 
> no attack meant - please tell the russians its a false alarm :-)
> I wasn't sure who you were talking to I asked because you actually
> replied to my post not to the OP.
> 


> > account.
> >
> > I simply saw a question that I knew the answer to, and answered it as
> > best I could. It wasn't meant to talk down, or state obvious, but
> > rather to mention things, that people generally don't think of, or in
> > the case of the newbie guide/smart-question guide, just don't know.
> 
> which is actually quite difficult IMHO :-)
> 
> >
> > If you are going to judge my 'giving a little back' then try to get
> > your facts straight. I think my 'giving back' greatly outweighs my
> > 'taking' from this and any other tech forum that I've ever used. I'll
> > provide you with a sample if necessary.
> 
> wasn't judging, sorry if that caught you the wrong way - I thought that maybe
> the 'joke' about Richard winning the pissing content made that clear...
> nevermind, water under the bridge etc
> 
> lets hope Dhana comes back with something we can get our teeth into :-)
> 
>

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



Fwd: [PHP] Word file to PDF

2005-02-24 Thread Rory Browne
Sorry - forgot to cc this to the list. 

[off-topic] Any idea if there is any way to set up gmail so that it
automaticly replys to the list.

-- Forwarded message --
From: Rory Browne <[EMAIL PROTECTED]>
Date: Thu, 24 Feb 2005 13:12:15 +
Subject: Re: [PHP] Word file to PDF
To: Kevin Javia <[EMAIL PROTECTED]>


You could check out wvware. I believe you can find it at
http://wvware.sourceforge.net although I'm not sure.

Alternatively you could probably find some way of automating
openoffice to do it for you. I reckon that OOo has a better filter for
converting them than wvware. If you don't need this urgently, then you
could wait until mid-march for OOo 2.0, which will aparently have
better MSOffice compatability, and use that instead.

If you're on a Windows box, and have MSWord installed, you could
probably install the PDF Printer driver, and then have MSWord open the
file, and 'print' it to the PDF driver, using OLE automation.

So to summerise: Hints: wvware or Office Word Processor + automation

If you want a simple solution that works perfectly all of the time,
then you're probably in bother.


Rory
On Thu, 24 Feb 2005 10:12:18 +0530, Kevin Javia <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> How can I convert a Word file (*.doc) to PDF file? Are there any libraries
> available?
>
> Can you give me some hint how can I do that?
>
> Thanks.
>
> Kevin.
>
> --
> 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] Word file to PDF

2005-02-25 Thread Rory Browne
> Run PHP on a windows platform that has MSWord and the PDF printing libraries
> installed. Use PHP's COM support to load an MSWord object and see if you can
> get it to load the word document and print it out as a PDF file. Once it is
> printed to the file, you can use PHP to read the file and do whatever is 
> needed
> from here.

That's pretty much one of my suggestions, although I considered it
only a suitable/practical solution if s/he was running a windows box
anyway. I wouldn't take on the pain, and cost of switching to a
windows box, solely for the sake of converting word docs.

 
> I've never tried it with PHP, but with experimentation and research you should
> be able to make it work. I know that where I work we convert MS Word, Excel,
> and other kinds of documents to PDFs automatically using this method, though I
> think the appliaction than controls everything is written in C.

I'd like to see the code that you use for that. The COM Methods would
be independent of the language used. Would you be allowed to share it
with us?

> Parsing and MSWord file manually with images et al, then reliably converting 
> it
> to a PDF document... Yikes, if anyone can do this, you're my god.

Check out my initial response to this post. wvWare can reliably
convert a word doc with images. It falls down a bit, when it comes to
embedded charts, or something like that or so I've heard.

It seems like the staroffice/openoffice, and wvware devs, (and anyone
else who has created a word doc importer) have become your god(s).


> 
> Best of luck, let us know what solution you come up with.
> 
> -KBear
> 
> Original Message:
> 
> Hi there,
> 
> How can I convert a Word file (*.doc) to PDF file? Are there any libraries
> available?
> 
> Can you give me some hint how can I do that?
> 
> Thanks.
> 
> Kevin.
> 
> --
> 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] Help Required: How to call .vbs file from .php file?

2005-02-25 Thread Rory Browne
Okay:
You need to be explain yourself in a MUCH CLEARER manner.

You want to 'call' a 'vbscript' from a php file. What exactly do you
mean? Do you want to run server-side vbscript, or do you want to run
client-side vbscript. Do you want to use asp-style vbscript to
generate html, or do you want to use vbscript to manipulate the html
that is already loaded.

Iy looks like, since you are 'double-clicking' on a html file, that
what you want is client-side vbscript. In this case, 'calling' the
vbscript would be the same way as 'calling' javascript, or Jscript.
Simply put it in  tags, and it
would be 'called' similarly to javascript. Bare in mind that you
cannot generally 'double-click' on a php file. You generally have to
load it through a web server(eg apache, or IIS).

As above, you need to restate your question.


On Thu, 24 Feb 2005 14:05:21 +, lef1 <[EMAIL PROTECTED]> wrote:
> Hi,
> I am in desperate need of some help in calling a vbscript file from a php
> file.
> I have searched high and low and have come up with nothing that will do it.
> I have found one example of a html file, which will call a vbscript file when
> the html file is double-clicked, but wont work if the file is viewd from the
> http://localhost.
> I really need a solution to this problem, any help you could offer would be
> appreciated greatly.
> Thanks,
> Laura
> 
> --
> 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] how to move files from one place to another ?

2005-02-28 Thread Rory Browne
I think you should read his post before telling him to RTFM. AFAICT He
wants to move the files, not copy them. I think the command he is
looking for is infact http://www.php.net/rename , which isn't
immediately obvious, when you are infact moving and not just renaming.
It's only something you'd consider, when you have a background of
using the move command on unix(mv) to rename.


On Sun, 27 Feb 2005 17:02:36 +0300, Burhan Khalid <[EMAIL PROTECTED]> wrote:
> Vaibhav Sibal wrote:
> > Hello,
> > Can some please guide me as to how should I move files from one
> > directory to another on the server itself using PHP ? I use PHP 5.0.3
> > and Apache2 and Mysql.
> 
> Please, RTFM > http://www.php.net/manual/en/function.copy.php
> Please, don't cross post.
> 
> --
> 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] a new it company

2005-03-09 Thread Rory Browne
SPAMMER

>From your email address I'm assuming that your name is Sharvan Saxena.
It seems like too much of a coincidence that the contact person on
that site(Tanuj Saxena), and your good self, have the same surname.

Because it seems your are a spammer, and a liar(you concealed your
alleged connection with aforementioned site), I hereby CALL FOR A
BOYCOTT ON http://www.bansalsetech.com/

On Wed, 9 Mar 2005 10:57:39 +0530, shar <[EMAIL PROTECTED]> wrote:
> Hi members,
> 
> How are you. I have seen a very good site www.bansalsetech.com, visit this 
> site for your Seo / design / programming projects. Great people.
> 
> Regards
> 
>

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



Fwd: [PHP] `ls -l /` does not reproduce same info than when executed in bash.

2005-03-10 Thread Rory Browne
Forwarding to list - forgot to cc.
-- Forwarded message --
From: Rory Browne <[EMAIL PROTECTED]>
Date: Thu, 10 Mar 2005 18:50:41 +
Subject: Re: [PHP] `ls -l /` does not reproduce same info than when
executed in bash.
To: Hans Deragon <[EMAIL PROTECTED]>


Perhaps Jay has a point, but I don't think so. To confirm this, you
can probably check some variable in phpinfo, or you can run 'whoami'.

How are you running ls -ld? system? exec? Try backticks or shell_exec().


On Thu, 10 Mar 2005 11:41:31 -0500, Hans Deragon <[EMAIL PROTECTED]> wrote:
> Jay Blanchard wrote:
> > [snip]
> >I did "su - apache" to switch to the same user under which the Apache
> >server is running and tried the "ls -ld /" under bash, and it worked
> >fine.  Thus the server's has all the permissions to read the root
> >directory.  Yet PHP does not seam to have these permissions.
> > [/snip]
> >
> > Good work Sparky, you answered your own question.
> >
> > Who does PHP run as? Does it really run as Apache?
>
> Since PHP runs under Apache, I assume it runs under the apache user.  But if I
> am wrong, please advise.
>
> For the other readers, sorry for submitting twice my email to the list.  I had
> a problem with my mailer...
>
>
> Best regards.
> Hans Deragon
> --
> Consultant en informatique/Software Consultant
> Deragon Informatique inc. Open source:
> http://www.deragon.bizhttp://facil.qc.ca (Promotion du libre)
> mailto://[EMAIL PROTECTED] http://autopoweroff.deragon.biz (Logiciel)
>
> --
> 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



[PHP] Re: Best Server OS

2005-03-28 Thread Rory Browne
Phil

Depends on 

(a) What you want.
(b) Who you are, and what your background is.

What you want:
If you want stability, then I'd go with Debian Stable. If you want
proactive security then I'd go with OpenBSD. I'm not suggesting that
OpenBSD is less stable than Debian, but I reckon that more people use
Debian. If you want a nice GUI, then go SuSE(with YaST). If you want
someone on the otherside of the phone, then consider RHEL or SLES. If
you're feeling suicidal, then go with Fedora(too 'cutting edge' to be
stable enough for a server) or Windows. All in all, personally I'd
settle for Debian(stability, clean-design/layout, and apt-get) or
OpenBSD(proactive security).

Who you are:
Having that said, all this depends on what your background is. There
is no point in installing a rock solid Operating System, if it's going
to fall by the wayside, because the admin doesn't know how to use it.
If you've used Fedora on the Desktop, then RHEL/CentOS may be a good
choice. Likewise if you've used a Debian based desktop distro, then
Debian may be a good choice. However if you've only ever used Windows,
then I'd definatly recommend going with something with a GUI, and
perhaps suggest SLES(although SuSE have a bad habit of installing
packages in /opt, which makes for an unclean system).

Personally I've used various Linux distros for the last four years.
I'm sufficiently comfortable with the differences in various distros,
to make a personal choice. I've recently got my hands wet with
OpenBSD, although I'm not yet sufficiently familiar with it to use it
for a server, and although most of my experience is with RPM based
distros, on the desktop, I'd definatly go Debian for a server.


On Mon, 28 Mar 2005 14:23:50 -0800, "Chris W. Parker"
<[EMAIL PROTECTED]> wrote:
> Phil Neeb 
> on Monday, March 28, 2005 12:19 PM said:
> 
> > I'm lookin for some opinions on this one ...
> > 
> > What do you think the best OS is for running a server with PHP and
> > MySQL?  If you're going to say Linux, please, which Linux OS, there
> > are so many.
> 
> I will throw my vote in for some flavor of Red Hat. Beit the older
> version(s) 8 or 9, or the later Fedora Core 1, 2, or 3.
> 
> I just got FC3 installed yesterday (Gnome gave me lots of trouble so I
> reinstalled for a 3rd time without the GUI, still has a basic X11 GUI
> though). Runs much better now. Never tried Xfce though. That might have
> worked fine.
> 
> Anyway...
> 
> 
> 
> Chris.
> 
> -- 
> 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



[PHP] Re: Create MDB File

2005-03-28 Thread Rory Browne
MDB suggests Access, so why not simply create a CSV, or some other
generic format file from your MySQL, and import it into access, using
COM/OLE, and save it as an MDB file.


On Mon, 28 Mar 2005 22:14:07 +0100, Shaun <[EMAIL PROTECTED]> wrote:
> Thanks for your reply,
> 
> but this only works on Windows. I need a program that will create an MDB 
> file on the fly from a query on the MySQL database...
> 
> 
> "Johannes Findeisen" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> > Sorry,
> >
> > i forgot that link:
> >
> > http://www.convert-in.com/sql2acc.htm
> >
> >
> > On Monday 28 March 2005 22:46, Johannes Findeisen wrote:
> >> Hello,
> >>
> >> i had the same problem some years ago. At this time i have set up all
> >> tables in Access and wrote a script which reads from MySQL and inserts 
> >> into
> >> the MDB file via the ODBC connector. This works but is much work when 
> >> your
> >> database is very big.
> >>
> >> 2 Years ago i had the same problem but it must go as fast as possible so
> 
> >> i
> >> decided to buy a converteer since i didn't find anything free. They are
> >> working very good. I don't know where i have buyed them but i think
> there
> >> is only one company which delivers this software.
> >>
> >> Regards
> >> Johannes
> >>
> >> On Monday 28 March 2005 22:08, Shaun wrote:
> >> > Hi,
> >> >
> >> > Does anyone know if its possible to create an MDB file from a Mysql
> >> > database using a PHP script, I have only managed to find Access to 
> >> > Mysql
> >> > conversion programs so far...
> >> >
> >> > Thanks for your help
> >>
> >> --
> >> # Johannes Findeisen
> >
> > -- 
> > # Johannes Findeisen 
> 
> -- 
> 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] RE: Best Server OS

2005-03-29 Thread Rory Browne
I'd stick OSX in somewhere between fedora and windows. 

Where do you get these security ratings? How does sendmail, or bind
appear in these ratings?

Some ratings suggest that windows is more secure than Unix!!

You don't need a gui in a server.


On Tue, 29 Mar 2005 11:10:18 -0500, Gerald Artman <[EMAIL PROTECTED]> wrote:
> 
> I would recommend OSX
> 
> Top ratings on security compared to Linux or Windows
> Fast processors in many configurations, most include 1000T
> Starting at $500 to $3500 for up to +15MIPS performance
> Excellent GUI interface
> Supported by Apache, PHP, MySQL and comes pre-installed
> 
> Jerry Artman
> 
> --
> 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] Re: Create MDB File

2005-03-31 Thread Rory Browne
I don't think it's a case of 'finding a way'. I think its a case of
writing some code.

Some pseudo code to get you started:

connect_to_mysql();
$ms_Access_handler = use_com_ole_or_odbc_to_open_an_access_db();

while( $row = get_row_from_mysql() ){
  $ms_Access_handler->insert_row($row);
}

$ms_Access_handler->save_db("filename.mdb");

Just a thought. 



On Thu, 31 Mar 2005 12:36:51 -0700, René Fournier <[EMAIL PROTECTED]> wrote:
> Coincidentally, I also need a way to read a table from MySQL and write
> it out to an .MDB file on-the-fly (from within a PHP script).
> 
> The CSV export idea isn't an option in this case.
> 
> Has anyone found a way to create an MDB file (with a single table) from
> PHP?
> 
> ...Rene
> 
> 
> On 28-Mar-05, at 7:18 PM, Rory Browne wrote:
> 
> > MDB suggests Access, so why not simply create a CSV, or some other
> > generic format file from your MySQL, and import it into access, using
> > COM/OLE, and save it as an MDB file.
> >
> >
> > On Mon, 28 Mar 2005 22:14:07 +0100, Shaun
> > <[EMAIL PROTECTED]> wrote:
> >> Thanks for your reply,
> >>
> >> but this only works on Windows. I need a program that will create an
> >> MDB
> >> file on the fly from a query on the MySQL database...
> >>
> >>
> >> "Johannes Findeisen" <[EMAIL PROTECTED]> wrote in message
> >> news:[EMAIL PROTECTED]
> >>> Sorry,
> >>>
> >>> i forgot that link:
> >>>
> >>> http://www.convert-in.com/sql2acc.htm
> >>>
> >>>
> >>> On Monday 28 March 2005 22:46, Johannes Findeisen wrote:
> >>>> Hello,
> >>>>
> >>>> i had the same problem some years ago. At this time i have set up
> >>>> all
> >>>> tables in Access and wrote a script which reads from MySQL and
> >>>> inserts
> >>>> into
> >>>> the MDB file via the ODBC connector. This works but is much work
> >>>> when
> >>>> your
> >>>> database is very big.
> >>>>
> >>>> 2 Years ago i had the same problem but it must go as fast as
> >>>> possible so
> >>
> >>>> i
> >>>> decided to buy a converteer since i didn't find anything free. They
> >>>> are
> >>>> working very good. I don't know where i have buyed them but i think
> >> there
> >>>> is only one company which delivers this software.
> >>>>
> >>>> Regards
> >>>> Johannes
> >>>>
> >>>> On Monday 28 March 2005 22:08, Shaun wrote:
> >>>>> Hi,
> >>>>>
> >>>>> Does anyone know if its possible to create an MDB file from a Mysql
> >>>>> database using a PHP script, I have only managed to find Access to
> >>>>> Mysql
> >>>>> conversion programs so far...
> >>>>>
> >>>>> Thanks for your help
> >>>>
> >>>> --
> >>>> # Johannes Findeisen
> >>>
> >>> --
> >>> # Johannes Findeisen
> >>
> >> --
> >> 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
> >
> >
> >
> >
> 
> --
> 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



[PHP] SQL ternary thing

2005-04-06 Thread Rory Browne
Hi

I appreciate this is an SQL issue, more than a PHP issue, but since it
isn't a DB specific issue, and I'm planning on using it with PHP(and
I'm not subscribed to any SQL lists), I thought I'd post it here.

I have a table a bit like the following:

create table thing (name char(10), value boolean, name_if_true
char(10), name_if_false(10))

Basicly what will be modified will be the value field. name_if_true,
and name_if_false are static(and will in practice be in a different
table). The table may look a bit like the following:

| Accept | 0 | Yes | No |
| Gender | 1 | Female | Male
| State | 0 | Broken |fixed 

Can anyone suggest a query that will return:

| Accept | No
| Gender | Female
| State | fixed

Preferably in a db independent manner.

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



Re: [PHP] Why does PHP have __toString() and not just toString()

2005-04-12 Thread Rory Browne
I was wondering that as well. While I was at it, I wondered why not
use __to_str(), as per the PHP coding guidelines.

While I'm at it, why is grass green, and milk white?

On Apr 12, 2005 10:27 AM, Richard Davey <[EMAIL PROTECTED]> wrote:
> Hello Tim,
> 
> Tuesday, April 12, 2005, 10:07:44 AM, you wrote:
> 
> TB> I'm wondering, why does the toString() of classes have two underscored
> TB> preceding it [e.g. __toString()], as opposed to Java's normal toString()?
> 
> TB> What's the purpose of the two underscores in PHP's classes?
> 
> The short answer: Because PHP isn't Java.
> 
> The long answer: Two underscores denote what PHP refers to as a "magic
> method". You shouldn't have your own functions with the same names
> (unless you require that magical functionality). Have a look in the
> PHP manual under the "Magic Methods" section for more info / examples.
> 
> Best regards,
> 
> Richard Davey
> --
> http://www.launchcode.co.uk - PHP Development Services
> "I do not fear computers. I fear the lack of them." - Isaac Asimov
> 
> --
> 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] a new it company

2005-04-14 Thread Rory Browne
Dan:

My apologies for any negitive psychological effects my reply to the
password sharing thread, may have had on you. It was not a case of
mistaken identity, but rather a case of replying to the last poster,
instead of to the list. gmail has this quick reply box on the bottom,
and I clicked on that, typed my reply and clicked 'send'. I simply
forgot to change it to 'Reply to all' instead of just 'reply'.

Maybe I was a bit quick on the gun, but I felt annoyed by someone
posting that they had 'found' a website, vouched for their staff(Great
People), and failed to address whether or not the site was their own.

I wouldn't have had so much of a problem, with a direct honest
announcement, that they had formed a new IT company, as opposed to
casting the impression that this was a site that they had no intrest
in, and had just hopped across it whilst searching
google/yahoo/whatever.

I can't believe this got 12 replies.

On 3/9/05, Dan Tappin <[EMAIL PROTECTED]> wrote:
> I think Rory has trouble jumping to conclusions.  I was attacked off
> list by Rory thinking I was another list member... another dant
> (remember the OT adult content rant / thread?).
> 
> I would agree that this is not really spam... just bad judgment.  The
> flood of angry replies to this poster should teach them their lesson
> about mailing list etiquette.  If it continues they will simply be
> banned from the list.
> 
> With free speech you have to live with the odd incident like this.
> 
> Dan Tappin (Dan T)
> 
> On Mar 9, 2005, at 11:29 AM, Jochem Maas wrote:
> 
> > Rory Browne wrote:
> >> SPAMMER
> >> From your email address I'm assuming that your name is Sharvan Saxena.
> >> It seems like too much of a coincidence that the contact person on
> >> that site(Tanuj Saxena), and your good self, have the same surname.
> >> Because it seems your are a spammer, and a liar(you concealed your
> >
> > I'd class him as stupid or ignorant maybe - but one hand sent email
> > doesn't
> > really class someone as a spammer does it, I thought the bar was a
> > little
> > higher than 1 email :-)
> 
> --
> 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 and linux shell script

2005-04-15 Thread Rory Browne
I don't think you'll find anything in PHP as simple as the shell
script version of dialog, but you may be able to bang something
together like that using ncurses.

Probably handier if your time is more important than the machines, to
just use the shell version using one of the Program Executions
functions.

Personally I suggest passthru:



On 15 Apr 2005 12:22:05 +0530, Balwant Singh <[EMAIL PROTECTED]> wrote:
> hello,
> 
> 1) first of all i would like to inform you that i have made a PHP script 
> which also have some amount of
> linux shell script in it for converting emails from EVOLUTION to MOZILA 
> THUNDERBIRD just by executing
> this script.  if anybody need it, do let me know, i will send the same.
> 
> 2) i am also exploring possibilities of using linux dialog boxes (used in 
> shell scripting)
> with PHP. has anybody tried it, may please advise me how to call dialog boxes 
> through PHP in CLI.
> also please share with me if u have information on how to use PHP with Shell 
> Scripting.
> 
> thx
> 
> with best wishes
> balwant singh
> [EMAIL PROTECTED]
> 0091-120-2568472
> 
> --
> 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] Re: A question

2005-04-16 Thread Rory Browne
you write a script containing  and  only. You access that script through your web browser, and it will
return a variety of useful information. Amongst it will be information
labeled as SERVER API. If you are running as an apache module, Apache
will appear in the box beside it. If you are using CGI, then CGI will
appear there.


On 4/16/05, Khorosh Irani <[EMAIL PROTECTED]> wrote:
> How I can find it in phpinfo() ?
> 
> On 4/16/05, Amir Mohammad Saied <[EMAIL PROTECTED]> wrote:
> > phpinfo()
> >
> > --
> > 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
> 
>

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



Re: [PHP] Re: A question

2005-04-16 Thread Rory Browne
On 4/16/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> On 16 Apr 2005 Khorosh Irani wrote:
> 
> > How I can find it in phpinfo() ?
> 
> Another (simpler) approach is:

not as versitile though. 

php_sapi_name() is better suited to situations where you will do
something differently depending on the sapi used. An example of this
would be form authentication when using CGI, and HTTP Authentication
when using Apache.

> 
> echo php_sapi_name();
> 
> which will return 'cli', 'cgi', etc.
> 
> --
> Tom
> 
> --
> 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] Re: trying to send mail via localhost

2005-04-16 Thread Rory Browne
I'm not expert, on this area, but unless I'm mistaken, that happens
when the email address you are sending the mail to doesn't exist. For
example if you try to send a mail to [EMAIL PROTECTED], when the actual
address is [EMAIL PROTECTED], the username monk will not exist. Check
your 'to' address.

On 4/16/05, Satyam <[EMAIL PROTECTED]> wrote:
> I think the specs are in  RFC 822.  You should find if there.
> 
> Satyam
> 
> "AndreaD" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > When trying to send mail via localhost I get the following error
> >
> > Warning: mail() [function.mail]: SMTP server response: 550 5.7.1
> >
> >
> > Any ideas?/
> >
> >
> > RH
> 
> --
> 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 + flash, need some help making a small .FLA

2005-04-17 Thread Rory Browne
I've only used flash, a couple of times( many years ago ), so I can't
be of very much help, but you might be able to do something with ming
- http://www.php.net/ming . If I remember correctly it would involve
referencing images by their URL - images which would on the backend be
served up with php.

On 4/17/05, Matt Babineau <[EMAIL PROTECTED]> wrote:
> Hi all -
> 
> Does anyone have any experience with integrating php + flash? Or know of any
> good tutorial sites? Basically what I want to do is have an animated loading
> screen, and then pull pictures from a database and display text from a
> database, text could be scrolling across the bottom like CNN or something.
> Anyone familiar with some techniques on doing this?
> 
> Any examples people may have of this would be great, just send me some
> sample .FLA scripts!!
> 
> If you've got some examples of exactly what I want to do, and you also have
> a paypal account, I can make it worth your time :-D
> 
> Thanks,
> 
> Matt Babineau
> Criticalcode
> w: http://www.criticalcode.com
> p: 858.733.0160
> e: [EMAIL PROTECTED]
> 
>

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



Re: [PHP] Need help with file permissions for PHP files

2005-04-17 Thread Rory Browne
> Two things Rory
> 
> a. You only replied to me, instead of the list. You have to probably
> click on "reply to all" in your mail client. I have included the lists
> address for this reply, so that it will appear there.

Yeah sorry about that mailing you only thing. All the other lists I'm
subscribed have the Reply-To field set so that replys are sent to the
list automaticly, so I keep forgetting when I reply to this one to
'reply to all'. I'll probably try proxying the php mailing list
through my unix server, and set the Reply-To field manually. Any idea
how to do that with GMail?

> 2. "Because it reads out of order."
>"Why?"
>"Top posting is bad."
> III. Trimming is good, because it gets right to the point.

Top-posting/Bottom-posting matters when the emphasis is on presention.
When you're simply trying to get a point across, then its level of
importance, drops significantly.

Finally I was concentrating on saying what I felt was to be said. I
think a free-form, discussion is much better than one where
top-posting / bottom-posting, is more important that the actual
content of the message.

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



Re: [PHP] Need help with file permissions for PHP files

2005-04-17 Thread Rory Browne
Because now it's out of order. 

On 4/18/05, Ryan A <[EMAIL PROTECTED]> wrote:
> PLEASE lets not start on the.

Only Joking.

> 
> > > 2. "Because it reads out of order."
> >

Why?

> > >"Why?"
> >
> > >"Top posting is bad."
> >
> > > III. Trimming is good, because it gets right to the point.
> 
> .top posting  / bottom posting thing again.
> 

You should have sent that message before Jay sent his to me.


> -Ryan
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.9.15 - Release Date: 4/16/2005
> 
>

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



Re: [PHP] Re: CFP: DLS05: ACM Dynamic Languages Symposium

2005-04-18 Thread Rory Browne
There are times when cross-posting is approperate, and times when it
isn't. In this case it's approperate.

In the case of replying to his cross-posting it isn't.

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



Re: [PHP] php and linux shell script

2005-04-19 Thread Rory Browne
> http://gtk.php.net/
> 

Can you elaborate on what gtk has to do with making command line dialog boxes?


> --
> 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
> 
>

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



Re: [PHP] can I join two mp3 files with php

2005-04-19 Thread Rory Browne
Are you on Windoze or Linux. If you're on linux, I'm sure you could
rig up something with mencoder.

If you're on windoze, you might still be able to use mencoder, but I'm
not sure, and you may find yourself with the need to explore other
options.

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



[PHP] explode a string

2005-04-20 Thread Rory Browne
Sorry jocham, for you getting this twice.

I'd assume foreach is recommended because it lends to more readable
code. More readable code, is generally considered better code.

Personally I'd disagree and use while( list() = each() ), because it
doesn't create a copy of the array in memory, especially for the
array. If you're dealing with an array where the elements are large,
or multi-dimentional, you may want to consider a different approach,
such as assigning by reference, like:

for($keys = array_keys($sample_array); $key = each($keys), $val =&
$sample_array[$key]; )

but that is very ugly untested code(and I'm drunk), so I wouldn't
recommend you copy n paste it.

besides for the sake of 200 bytes, with an average of around 5
characters per word, it pretty much doesn't matter, which you use.
Even something as crappy as ASP would easly deal with 200b.

On 4/20/05, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Richard Lynch wrote:
> > On Tue, April 19, 2005 7:03 am, Jochem Maas said:
> >
> >>The 'other' guy mentioned that while() is faster than foreach,
> >>is this true?
> >
> >
> > Don't know ; Don't care.
> >
> > You should never loop through so many things in PHP that it matters in the
> > first place :-)
> >
> >
> >>I read a few days ago somewhere on php.net that foreach() is the
> >>recommended (by php devs) way of iterating over arrays
> >
> >
> > [shrug]
> >
> > That's probably because they're tired of people not understanding the
> > internal pointer array, and asking FAQs about it.  Or maybe not.  Ask them
> > why they prefer it.  I sure don't know.
> >
> >
> >>also, compare these 2 lines:
> >>
> >>while (list(, $idcat) = each($idcats)){ /* ... */ }
> >>foreach ($idcats as $idcat){ /* ... */ }
> >>
> >>now its seems to me that the foreach version is 'up' 2 function calls
> >
> >
> > None of those are function calls.
> >
> > They are all language constructs.  Okay, each() *might* be a function...
> >
> > I'm not sure how much difference there is in the number of language
> > constructs used, nor if they are even comparable in sheer numbers the way
> > functions are.
>
> ah yes, lang constructs rather than function calls.
>
> >
> > foreach is probably slower, I think, because it creates a *copy* of the
> > array to work on, so it won't mess up the original and its internal
> > pointer.
>
> unless I'm mistaken its a copy-on-change, so unless you are changing the
> the array inside the loop you don't suffer the actuall copy penalty - can 
> anyone
> knowledgable on php internals confirm or deny this?
>
> actually now I think of it you can use references in a foreach statement:
>
> php -r '
> $arr = array(1,2,3);
> foreach($arr as $k => &$v) {
> $v++;
> }
> var_dump($arr);
> '
>
> which suggests that a copy is not (always?) being made...
>
> >
> > Again, with 200 bytes, you are wasting your time to worry about any of this.
>
> true, It's purely a theoretical interest - deeper understanding is alway nice 
> :-)
> ...its not even my 200 bytes we're talking about ;-)
>
> >
> >
> >>on the while loop, all else being equal the foreach loop has to be faster
> >>(given that calling functions is relatively very expensive)...
> >>or is foreach() _really_ heavy when compared to while()?
> >
> >
> > Why don't you just benchmark it on your own machine and find out?
>
> because I don't have the skills to write a test/benchmark that I _know_ is
> kosher (and not skewed by a million of my misconceptions, besides I run so 
> much
> stuff on my machine that speed can be severely affected by things like
> apache or firebird running in the background
>
> that and I lazy ;-) (or I just don't care enough to invest time investigating 
> this)
>
> >
> >
> >>not that I care too much, I find foreach() more pleasing to the eye and
> >>there is
> >>less to type (in the given example).
> >
> >
> > I'm an old dog, and I don't quite understand for sure how this new-fangled
> > foreach thingie works.  I'd spend more time looking it up and reading
> > about it than just typing what I *know* works. [shrug]
>
> >
>
> --
> 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



Fwd: [PHP] Re: Can this code go faster?

2005-04-30 Thread Rory Browne
I sent this about a week ago, but I forgot to 'reply to all', and send
it to the list.
Thanks Rolf for pointing that out to me.

I'm not totally sure, but this might work. I'm too tired to understand
rolf's masks, but:

 wrote:
> [EMAIL PROTECTED] (René Fournier) wrote in
> news:[EMAIL PROTECTED]:
>
> > I need to convert a binary number of arbitrary length to a signed
> > integer.
> > This is how I'm doing it now:
> > CODE
> > 
> > function bin2int ($bin) {
> >  if (substr($bin,0,1) == 1) {
> >   $val = 0 - bindec(substr($bin,1)); // NEGATIVE
> >   } else {
> >   $val = bindec(substr($bin,1)); // POSITIVE
> >   }
> >  }
> >
> > echo bin2int("1101").'';
> > echo bin2int("10001101");
> >
> > OUTPUT
> > 
> > 13
> > -13
> >
> > As you can see, if the most-significant bit is 1, then the rest of the
> > value is negative. If the first bit is 0, then the rest is positive.
>
> If this is what you want then your numeric representation of negative
> numbers is not standard. In that case your function is as good as you can
> get.
>
> This is the standard two's complement representation:
> "1101"  is 13
> "0010"  is -13
> "10001101"  is -115
>
> You specify the most-significant bit as sign bit, and that you can have a
> arbitrary lenght string representing a binary number.
> Then "010" will be different than "10", is that correct?
>
> If you on the other hand know that the string should represent an 8 bit in
> two's complement then this could work:
>
> function bin2int ($bin) {
> $a =  bindec($bin);
>
> $val = ($a | 0x80) ? (0xff00 | $a) : $a;
>
> return $val;
> }
>
> //  or by using if instead of ? and :
> //function bin2int ($bin) {
> //$a =  bindec($bin);
> //  if ( $a | 0x80) {
> //  $val = (0xff00 | $a);
> //  } else {
> //  $val =$a;
> //  }
> //
> //return $val;
> //}
>
> If the string represent a 16 bit number use
> $val = ($ | 0x8000) ? (0x | $a) : $a;
>
> If the string represent a 32 bit number use only bindec
>
> If you still want
>  - a leading 1 to represent a negative number,
>  - and that the string can have arbitrary lenght,
>  - but you want correct two's complement representation
> then we need something different, e.g:
>
> function bin2int ($bin) {
> if (substr($bin,0,1) == 1) {
> // NEGATIVE
> $val = bindec(substr("".$bin,-32));
> } else {
>// POSITIVE
> $val = bindec($bin);
> }
> return $val;
> }
>
> --
> Rolf
>
> --
> 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] Re: Can someone help me build a regular expression?

2005-05-02 Thread Rory Browne
> You mite try this. I know that this work with perl.
> 
> =~ m/^[0-9][A-Z][a-z]{2-3} \.[0-9]+$/

I'm not sure what the initial m does(I'm not a perl person), but the
rest of the regex matches as follows.

A string whose first character is a digit between 0 and 9. This is
followed by an Upper case letter, and then two or three lower case
letters. All that is followed by a period(or dot), after which may be
a single-digit number, but nothing else.

It matches the following:

1Abc.2
1Abcd.2
1Abc.
1Abcd.


> 
> I'm still very new to this. But I'm trying to help.
> Thomas
> [EMAIL PROTECTED]
> 
> --
> 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] to pass session from one websever to another webserver

2005-05-04 Thread Rory Browne
Elaborate.

Do you want to pass the sesson from server_1 to server_2, and use the
session on server_2 instead of server_1, or do you want to use the
session on both servers at the same time, or switch frequently between
both machines?

On 04 May 2005 18:24:07 +0530, Balwant Singh <[EMAIL PROTECTED]> wrote:
> hi to all
> 
> i want to pass session variables from  one websever to another
> webserver.  may please help.
> 
> with best wishes
> balwant
> 
> --
> 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



Fwd: [PHP] Re: How do you declare Vars in PHP? -I know it's not necessary, but I still want to know

2005-05-05 Thread Rory Browne
Otherwise you can 'declare' them by assigning them a null/zero/empty value.

$my_number = 0;
$my_string = ""
$my_array = array();

The main reason for 'declaring' variables in PHP, is so that you can
use them in functions without raising an E_NOTICE.


On 5/5/05, Ryan Faricy <[EMAIL PROTECTED]> wrote:
>
> "Jon M." <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >I just found a place here:
> >
> > http://us2.php.net/manual/en/language.oop.php
> >
> > That has this example:
> >
> > /* This is how it should be done. */
> > class Cart {
> >   var $todays_date;
> >   var $name;
> >   var $owner;
> >   var $items = array("VCR", "TV");
> >
> >   function Cart() {
> >   $this->todays_date = date("Y-m-d");
> >   $this->name = $GLOBALS['firstname'];
> >   /* etc. . . */
> >   }
> > }
> >
> > It appears that they are declaring vars like this:
> >
> > var $todays_date;
> >
> >
> > Is this something you can only do inside a class???
>
> Yes, as has been said within this thread several times.
>
> --
> 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] Re: How to declare Vars in PHP?

2005-05-05 Thread Rory Browne
Next time you double post(I'm assuming by accident), could you reply
to one, of the posts declaring it void, and point people to the other,
so that you don't have two people answering the same question in two
different threads.

On 5/5/05, Ryan Faricy <[EMAIL PROTECTED]> wrote:
> 
> "Jon M." <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >I know it's not necessary, but I still want to know how.
> >
> >
> > I know in JavaScript, that you declare vars like so:
> >
> > var = variableName;
> >
> > So I'm assuming that in PHP you do it like this:
> >
> > var = $variableName;
> >
> > But there doesn't seem to be a single shred of documentation on PHP.net
> > (or in ANY book) that covers this. All they say is that it's good
> > practice, but not necessary. Then they always skip telling you how.
> >
> > I always like to declare vars since it helps me keep track of the vars I
> > will be using, and I just like to do things right.
> >
> > So am I right about how you do it? "Yes", "No", example please??
> >
> >
> > -Jon
> 
> It is good practice to define your variables (i.e., set them to 0, or empty,
> etc) at the beginning of a script, for security and reliability reasons.
> 
> With PHP however, there technically is no definition of variables as in
> other languages such as Java or BASIC. To define a variable in PHP simply
> requires a $variableName = ''; or $variableName = 0; or $variableName =
> empty; etc etc. A variable is defined as soon as a value is set for it,
> therefore to define a variable, simply give it a value.
> 
> --
> 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



[PHP] Re: Error suppression operator (@)

2005-05-05 Thread Rory Browne
ditto everyone who said use it if you don't care about errors, but
don't use it in places where you expect errors.

Also don't use it in places where it can be avoided with minimal cost.

For example if you have an optional field, and people usually fill it
in, and rarely leave it empty, then you could use the @ operator then.
Otherwise, if people rarely fill it in and it's causing E_NOTICE
errors frequently then, I'd do some standard error checking instead.

I don't have benchmarks to support this theory(which will probably be
discredited soon), but I've read somewhere that errors(even
E_NOTICES), seriously slow a script down.

Sorry Colin for your receiving this twice.

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



Re: [PHP] to pass session from one websever to another webserver

2005-05-05 Thread Rory Browne
In that case you're probably best to have a single source for the
session data, and simply pass the SessionID as a $_GET variable in the
URL.

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



Re: [PHP] need class to send email w/attachments

2005-05-06 Thread Rory Browne
Try www.phpclasses.org/phpmailer
I've never used it but it's mentioned quite a lot.



On 5/6/05, Bosky, Dave <[EMAIL PROTECTED]> wrote:
> Any recommendations for PHP classes that will send email messages with
> attachments?
> 
> Thanks,
> 
> Dave
> 
> HTC Disclaimer:  The information contained in this message may be privileged 
> and confidential and protected from disclosure. If the reader of this message 
> is not the intended recipient, or an employee or agent responsible for 
> delivering this message to the intended recipient, you are hereby notified 
> that any dissemination, distribution or copying of this communication is 
> strictly prohibited.  If you have received this communication in error, 
> please notify us immediately by replying to the message and deleting it from 
> your computer.  Thank you.
> 
>

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



Re: [PHP] compiling dynamic extensions without root access

2005-05-06 Thread Rory Browne
> yes you can do if u have compiled apache to support apache dynamic extensions.

It doesn't matter how you compile apache. 

It's how you've configured PHP, and what type of server it's running
on, how the server handles multiple clients. Zeus, and IIS don't AFAIK
support dl(). I reckon it's safe to assume that you can't use dl() on
Apache2 if you use the multithread MLM.

> 
> --
> bala> balachandar muruganantham
> blog> lynx http://chandar.blogspot.com
> web> http://www.chennaishopping.com
> 
> --
> 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



[PHP] Re: Reducing size of htm output

2005-05-07 Thread Rory Browne
First of all as Rasmus said, this 'compression' is barely(if at all)
going to make a difference, after your pages have been compressed wth
gzip,

There are two reasons for this:
 1 compression techniques detect repeated strings(such as spaces or
newlines), and replaces them with one instance of that string, and a
record of how many times it appears.
 2 Because Rasmus said so, and considering his long-time involvement
with the php project(as founder), he probably knows what he'e talking
about.

What might be more useful is stripping out comments, If you don't use
javascript it is simply a case of replacing all  with
a blank space. If you do though it's more complicated since it is
considered good practice to place js inside  blocks, and
you have the additional talk of replacing out // and /* .. */
comments.

but if you really want to do it then:

function ob_whitespace_removal($str){
// would need to dbl_check regex/modifiers
return ob_gzhandler(preg_replace("/\s+/m", "  ", $str)); 
}

should work, Although for purists/modularity output buffer stacking
may be a cleaner technique

Re: Internet Explorer Problems:
if you check the ob_start or ob_gzhandler pages on the php
manual(online version) then you'll find a user-submitted comment
saying that MSIE doesn't cache compressed stuff. This doesn't matter
for a dynamic website. Try googling, but don't say ob_gzhandler, since
this is (allegedly) a problem with IE/gzip compatability, and not the
ob_gzhandler implemention(ie search for gzip and not ob_gzhandler).


On 5/7/05, Kirsten <[EMAIL PROTECTED]> wrote:
> >preg_replace('/s+/', ' ', $html);
> >
> > but watch out, this js code will work:
> >
> > var v
> > alert(v)
> >
> > this one will not:
> >
> > var v alert(v)
> 
> Sure
> but now: how do I access the htm output of the current executing script
> before it is send to the user?
> 
> Thanks again
> 
> >
> > >
> > > 1) Is there any function to do this (I'm using PHP 4.2) ? Or maybe some
> user
> > > has already done it?
> > > 2) Is it true that ob_start("ob_gzhandler") can cause problems on IE
> 5.5+?
> >
> > don't know. but you can detect these browsers and turn compression off
> 
> -- 
> 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] Re: Reducing size of htm output

2005-05-07 Thread Rory Browne
> excuse me? since when is this considered /good/ practice???
> It's one of those things that are concidered /bad/ practice according to
>  w3...
Hmmm, didn't know the w3c had an opinion on the usage of 
tags to delimit javascript. I've always been recommended to use them,
to hide the script from browsers that don't support javascript, just
like I use , or  to show messages to browsers that
don't support script or frames.

Can you reference the message/memo/whatever from the w3c that
discourages them. I believe perhaps you took either it or my
suggestion out of context, because I can't fathom a reason why you
wouldn't want to hide js from non-js-capable browsers.


>  and
> > you have the additional talk of replacing out // and /* .. */
> > comments.
> >
> > but if you really want to do it then:
> >
> > function ob_whitespace_removal($str){
> > // would need to dbl_check regex/modifiers
> > return ob_gzhandler(preg_replace("/\s+/m", "  ", $str));
> > }
> >
> > should work, Although for purists/modularity output buffer stacking
> > may be a cleaner technique
> >
> > Re: Internet Explorer Problems:
> > if you check the ob_start or ob_gzhandler pages on the php
> > manual(online version) then you'll find a user-submitted comment
> > saying that MSIE doesn't cache compressed stuff. This doesn't matter
> > for a dynamic website. Try googling, but don't say ob_gzhandler, since
> > this is (allegedly) a problem with IE/gzip compatability, and not the
> > ob_gzhandler implemention(ie search for gzip and not ob_gzhandler).
> >
> >
> > On 5/7/05, Kirsten <[EMAIL PROTECTED]> wrote:
> >
> >>>preg_replace('/s+/', ' ', $html);
> >>>
> >>>but watch out, this js code will work:
> >>>
> >>>var v
> >>>alert(v)
> >>>
> >>>this one will not:
> >>>
> >>>var v alert(v)
> >>
> >>Sure
> >>but now: how do I access the htm output of the current executing script
> >>before it is send to the user?
> >>
> >>Thanks again
> >>
> >>
> 1) Is there any function to do this (I'm using PHP 4.2) ? Or maybe some
> >>
> >>user
> >>
> has already done it?
> 2) Is it true that ob_start("ob_gzhandler") can cause problems on IE
> >>
> >>5.5+?
> >>
> >>>don't know. but you can detect these browsers and turn compression off
> >>
> >>--
> >>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
> 
>

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



Re: [PHP] Re: Reducing size of htm output

2005-05-07 Thread Rory Browne
Besides, whether or not it's considered good practice to comment out
js to non-js-capable browsers, a lot of people do it.

And for the record, I wouldn't condone the removal of comments from
code that someone may need to read sometime. HTML outputted from php
is generally however only meant for the browser to parse, and not for
humans to read.

Which brings me to another suggestion:

If you have a lot of long javascript variable/function names, you
could maybe find a way to automagicly  (I mean automaticly, but
automagicly sounds cooler) shorten local variables, function names,
and perhaps other stuff, although I think for the most part linking
the JS, so that it is cacheable is probably a better option.

How about using xml/xslt to only pass on the content that is unique to
each page to the browser. You could use an ob handler to make sure
that the browser was capable of using xslt, and if not parse the xslt
on the server.

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



Re: [PHP] Sending htm as it's being generated

2005-05-08 Thread Rory Browne
either follow each echo call with a flush() function call, or enable
the implicit_flush in php.ini, or ini_set().

I don't think output buffering as described in the php docs is
particularly relevent in this case.

Bare in mind that some browsers don't display data either until they
have received a certain amount, or have closed the connection AFAIK.

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



[PHP] PHP 5, mySQL and Win XP. I NEED HELP

2005-05-09 Thread Rory Browne
Sorry - forgot to CC to list.

Personally I have a feeling that if you take out the :3306, your
script might just work.

I read somewhere that on unix, mysql used a unix socket whenever the
hostname was localhost. On unix localhost:something means that
something is a unix socket, when it would otherwise be a port, so I
think your system may be looking for a file named 3306(which would
just happen to be a socket.

Failing that replace localhost with 127.0.0.1

This is as well of course just a guess, and probably not a very educated one.


On 5/9/05, Richard Lynch <[EMAIL PROTECTED]> wrote:
> On Sat, May 7, 2005 4:56 am, Deep said:
> > Hi,
> >
> >  If you are using localhost, i dont think u need to
> > specify the port number. Localhost would be enough.
> > Also pls check the user privileges and all in the
> > database.
> >
> > ..Deep..
> >
> > --- Oscar Andersson <[EMAIL PROTECTED]>
> > wrote:
> >
> >> I have made a instal of the latest mySQL and PHP 5
> >> on my computer.
> >> I have made the following changes to my php.ini file
> >>
> >> extension=php_mysql.dll
> >> extension_dir = "c:\php\"
> >>
> >> and i have put the php_mysql. and libmysql.dll in
> >> c:\php\ and in c:\windows
> >> to
> >>
> >> Now i try this in my php-file
> >> $con = mysql_connect("localhost:3306", "buddy",
> >> "bestbuddy");
> >>
> >> I cant connect to mySQL. I dont know what is wrong.
> >> mySQL listen to port
> >> 3306. I have tried with my IP to. I get this warning
> >> Warning: mysql_connect() [function.mysql-connect]:
> >> Too many open links (0)
> >> in myfilename.php.
>
> Too many open links sounds to me like you've set up MySQL to only allow X
> connections, and you are trying to open up X+1 connection.
>
> The 0 would make me guess that X is 0.
>
> So I'd *GUESS* you have a setting in my.cnf that says to limit number of
> connections to 0, and that means you can't have any connections at all...
>
> Just a GUESS.
>
> --
> 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
>
>

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



Re: [PHP] Reducing size of htm output

2005-05-09 Thread Rory Browne
> But I remember gz encoding works fine with IE 5. Shouldn't be a problem with
> 5.5.

Did you try downloading the same compressed page twice, and checking
the server logs, to see if it loaded from cache the second time
around?


> 
> Cheers,
> 
> Prathap
> 
> 
> -- Original Message ---
> From: Rasmus Lerdorf <[EMAIL PROTECTED]>
> To: Prathaban Mookiah <[EMAIL PROTECTED]>
> Cc: Kirsten <[EMAIL PROTECTED]>, php-general@lists.php.net
> Sent: Fri, 06 May 2005 14:31:04 -0700
> Subject: Re: [PHP] Reducing size of htm output
> 
> > Prathaban Mookiah wrote:
> > > Is it true that ob_start("ob_gzhandler") can cause problems on IE 5.5+?
> > > 
> > > Since IE  is on the client side, it shouldn't cause any
> problems
> > > to ob_start(), in that case any other PHP function.
> >
> > That's not true.  ob_gzhandler is extremely browser-dependant since
> > it needs to check to see if the browser sent an appropriate accept-encoding
> > header.  Some of the early IE versions sent accept-encoding: gzip but
> > didn't correctly implement it, so you can run into problems if you
> > use ob_gzhandler with certain older browsers.  It is fine for all
> > the recent releases though.
> >
> > -Rasmus
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> --- End of Original Message ---
> 
> --
> 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] numbers as strings

2005-05-09 Thread Rory Browne
For the most part you can simply treat them as strings. What is
happening that shouldn't be happening, or what should be happening,
but isn't?

> let us say
> $a = 1;
> $b = 2;
> $c = 0;

$str_a = (string)$a;
$str_b = "$b"

 
> I would like to be able to
> $str = $c.$a.$b;
Does that not work? What happens when you do that? Personally I'd use
$str = "$c$a$b";


> to result with
> $str = 012;
> 
I tried:
[EMAIL PROTECTED] ~]$ cat > test.php

[EMAIL PROTECTED] ~]$ php -q test.php
012



> is there something that I have missed or I guess the question should be what
> did I miss
> 
> --
> 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] Re: [PHP-DEV] make new return a reference to existent object

2005-05-09 Thread Rory Browne
I think Leonardo might have a point here. Built-in support for
Singletons could be a nice feature, without the use of static
functions, would be nice. I wouldn't use the 'new' keyword however. I
think something along the lines of existing, or ref

$ref = existing TEST; // which would return an existing instance of
TEST, if one exists, and a new one if it doesn't. ( pretty much like
the singleton code, except no need for singleton code)

I don't think it's anything important, and there are more pressing
matters, to be worked on, I'm sure, but if someone created the code,
and it was secure / bug-free / compliant-with-coding-standards / etc,
I can't see why it couldn't(or shouldn't) be included. When all's said
and done though, it's still just syntactic sugar. It all depends on
how sweet the devs consider it.

On 5/9/05, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Leonardo Pedretti wrote:
> > I would like (for code cleanliness purposes) to make 'new' return a 
> > reference
> > to an already created object under certain circumstances without using a
> > factory, is it possible?
> 
> not unless you hack the php engine (in which case
> your code will only work on your custom php build),
> I'll bet money that none of the php/zend devs feel anything for introducing
> this kind of 'magic' into engine.
> 
> IMHO a factory would be a clean method of handling this behaviour and
> has the benefit that no programmer looking at your code will
> misinterpret occurances of the 'new' keyword. e.g.:
> 
> class Test
> {
> /* ... */
> function __construct() {}
> function get() {}
> }
> 
> // and do:
> 
> $var = Test::get( /* pass ctor args */ );
> 
> // instead of:
> 
> $var = new Test( /* pass ctor args */ );
> 
> ... in this example its only 1 extra char to type when
> using the factory method and you could turn that around by
> doing something evil(tm) like:
> 
> $var = Test::_( /* pass ctor args */ ); // '_' is a function name!!! (ala 
> wordpress-CS)
> 
> maybe reply to generals describing what you are (trying to) do[ing],
> I for one am always interested in other people's realworld php5/oo
> problems/ideas/etc :-)
> 
> rgds,
> Jochem
> 
> ps - I redirected this reply to generals because I didn't really think
> that it was an internals question (and those guys are busy enough :-)
> 
> >
> > Thanx
> 
> --
> 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] A couple questions about templating

2005-05-09 Thread Rory Browne
> I am trying to make a small, fast, and simple templating class...  Now
> I have mastered the art of variable replacement, and have made two
> versions.  The first one I made simply used file() to load up the file
> into an array,
Personally I think you should use file_get_contents() instead.

> str_replace() to replace variables, then it printed it
> back.
Unless you're doing only very basic substitution, you may need to
consider regex, and preg_replace().

> I made a second one, which reads the file into an array,
> changes the variables the same way, but instead compiles the finished
> product into a compile directory and then reads the compiled file back
> to the page.  the benefit to this being that I can easily create a
> simple cache system now.

All I'd change here, is that instead of reading the file into an
array, I'd load it into a string.

> 1st question)  I need a professionaly opinion on to which solution is
> better, considering speed, security, and expandability.
Depends on how it's implemented. When you 'compile' the script into
native php, you are having a highly optimised parser do the variabe
insertion. Your main problem here would be register_globals, so you
need to ensure that you initialise any variables used.

> 2nd question)  Like I said before, I've mastered the art of variable
> replacement, but how would one go about adding support for if {}
> statements as well as loops.  I'm a little bit lost when it comes to
> this.
You could use a full featured tokeniser/parser(and you'd probably IIRC
find one in Pear), but it may perhaps be simpler, to simply use preg
to replace something like {foreach:var:list}, or whatever your
perfered syntax.

> Thank-you guys very very much.
> --
> jamwil.com
> 
> --
> 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] Re: A couple questions about templating

2005-05-10 Thread Rory Browne
> This has all been done before, and in a number of ways. If you really
> *must* build your own templating class, go and thoroughly review the
> code of those that already exist: Smarty, Savant, paTemplate,
> FastTemplate, etc. Figure out how each solved the problems. Then
> determine if you can improve upon their solutions.

This has all been done before, and I'm assuming that the James knows,
and has seen that before, since he used the same common method names,
as is in many php templating systems. $class->assign has been used in
any templating system I've ever seen(although to be honest I haven't
seen that many).

I don't think the fact that it has been done before should inhibit him
from doing it again. Carrying out the process, is one of the most
educational ways, and perhaps one of the most enlightening ways to see
how a process works.

I'm not sure how many lines of code are in Savant, paTemplate, or
FastTemplate, etc, but smarty has way too many to be used as a
learning tool, and there are times, when you want raw speed, that can
only be delivered via minimal, specialist code. Smarty is also too
complicated to be used by someone without good knowledge of
templating, and one of the best ways to understand it is to write your
own IMHO.

I think this question, whilst centred around templating, offers
opportunities for topics that aren't directly related to templating,
and perhaps PHP Programming in General. One particular area of
potential interest is dynamic code generation.

> 
> --
> Matthew Weier O'Phinney   | WEBSITES:
> Webmaster and IT Specialist   | http://www.garden.org
> National Gardening Association| http://www.kidsgardening.com
> 802-863-5251 x156 | http://nationalgardenmonth.org
> mailto:[EMAIL PROTECTED] | http://vermontbotanical.org
> 
> --
> 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] Re: A couple questions about templating

2005-05-11 Thread Rory Browne
> Anyways, I restructered my code, and as far as I can see there is
> nothing wrong with the code, except for that it simply doesn't work :)
That's usually considered a fairly serious problem.

>  I'm probably missing something blatently obvious but I'll post it and
> maybe someone can spot why this isn't working.  Here be the code:
I've had a fairly brief look through, and would recommend the following:

Add error checking routines
Don't do this:$fp = fopen($file, $mode);
Do this instead: $fp = fopen($file, $mode) or die("can't open file
$file with mode $mode");

You might also want to have a look at www.php.net/asssert

Recheck your strings/arrays, and your uses of them:
> function assign($var,$value) {
> if (isset($var) && isset($value)) {
> $this->_var[] = $var;
> $this->_value[] = $value;
// $this->_var, and $this->_value are arrays

> $this->_file = str_replace('{' . 
> $this->_var . '}',$this->_value,$this->_file);
Here you're trying to concatenate a string ('{') with an array ($this->_var)

Probably the easiest solution would be to do a $this->_var[] = '{' .
$var . '}'; in the assign() function.

For Clarity sake, instead of using fopen/fread/fwrite/filesize/etc,
I'd replace them with file_get_contents(), and if available
file_put_contents()

> 
>  class mm {
> //
> // PRIVATE CLASS VARIABLES
> //
> var $_file;
> var $_template;
> var $_var;
> var $_value;
> 
> //
> // CLASS CONSTRUCTOR
> //
> function mm() {
> $this->_var = array();
> $this->_value = array();
> }
> 
> //
> // ASSIGN A VARIABLE
> //
> function assign($var,$value) {
> if (isset($var) && isset($value)) {
> $this->_var[] = $var;
> $this->_value[] = $value;
> }
> }
> 
> //
> // RUN THE WEBPAGE
> //
> function run($template) {
> if (isset($template)) {
> $this->_template = 'tpl/' . $template . 
> '.tpl';
> if (file_exists($this->_template)) {
> $file = fopen($this->_template,'r');
> $this->_file = 
> fread($file,filesize($this->_template));
> fclose($file);
> $this->_file = str_replace('{' . 
> $this->_var .
> '}',$this->_value,$this->_file);
> print($this->_file);
> } else {
> print('Template File Does Not 
> Exists');
> }
> } else {
> print('Template is not sent');
> exit;
> }
> }
> }
> ?>
> 
> The page that run's the script simply looks like this:
> 
>  //
> // LOAD THE TEMPLATING CLASS
> //
> require_once('tpl.php');
> $mm = new mm();
> 
> //
> // SET CONTENT
> //
> $sitename = 'Calgary Outdoor Paintball League » Under Heavy
> Developement';
> $header = 'Welcome to the Calgary Outdoor Paintball League\'s
> Official Website';
> 
> //
> // RUN THE PAGE
> //
> $mm->assign('sitename',$sitename);
> $mm->assign('header',$header);
> $mm->run('index');
> ?>
> 
> --
> 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



[PHP] protect your CSS files, and possibly other extenstions as well...

2005-05-11 Thread Rory Browne
Sorry Richard if you received this twice.

Okay let me get this straight:

You protect your includes by making sure that they have a protected
string defined?

You pass JS and CSS through PHP, and output a 404 unless they've got a
HTTP_REFERER variable set to whatever you want it to be?

I guess it may have some merit, but personally it seems like you're
going from Hong Kong to Shanghi through Paris.

Your first suggestion (protecting php includes) has merit if you're
designing a package that people are going to download, and you have
minimal control over how they install it. If you're trying to stop
people from reading your PHP code however you're misguided if you
think there is any solid method other than placing it outside your
webtree.

The Browser needs access to your .js files and .css files. It's not
going to take long to figure out that the server checks the
HTTP_REFERER, and once you've done that, all you have to do is
something put something like the following into the address bar:

javascript:void(document.write("ss"))

Right-click and "Save Link As"(Firefox), or "Save Target As"(MSIE),
and they get a dialog box asking them where they want to save your
css/js file to.

At least with your first suggestion(protecting php scripts) you
actually get to Shanghi. With your second one, you go from Hong Kong,
to Paris, and back to Hong Kong.

And before you ask, no I'm not Chineese.

On 5/11/05, Richard Lynch <[EMAIL PROTECTED]> wrote:
> You could do all this...
>
> Or you could just move the files outside your web tree and change your
> include path.  [shrug]
>
> On Tue, May 10, 2005 9:03 pm, Kit DeKat said:
> > $const = get_defined_constants();
> > if( !isset($const["SOME_CONSTANT"]) ||
> > ($const["SOME_CONSTANT"] != 'secret_string') )
>
> http://php.net/defined
> would be more clear...
>
> > You will take a performance hit for adding the parser to more pages, but
>
> You'd have to benchmark on your own system to be certain, but others have
> reported in the distant past that it's a 5-10% performance hit to pass all
> .htm files through PHP.
>
> Presumably that would apply for .css and .js as well.
>
> I use .htm and pass through PHP, because I find it frees me up to build a
> better site with more cool PHP snippets/features without having to
> maintain old URLs in a change from .htm to .php  YMMV.
>
> > if( !isset( $_SERVER["HTTP_REFERER"]) ||
> > !strpos($_SERVER["HTTP_REFERER"],$_SERVER["SERVER_NAME"]) )
>
> I don't think you can count on HTTP_REFERER to be set by browsers.
>
> It's not required by the HTTP spec, as I understand it.
>
> Plus, it seems to me like you are asking for trouble between
> www.example.com and example.com if they surf to www. but your
> developer/designer only uses 'example.com'
>
> I also would wonder if this will scale up to server farms?  Maybe the
> REFERER/SERVER_NAME stuff is all hunky-dory consistent there...
>
> If an end user wants to read your CSS or JS bad enough, they can get it.
>
> Nor is this really a problem.
>
> You definitely do *NOT* want them able to surf to non-entry (ie,
> 'include'd) files!
>
> Your developers (you) almost certainly spent zero time wondering "what if"
> the user did that, and them executing your .php/.inc/.inc.php file out of
> context could wreak havoc.
>
> There are many "solutions" for this -- But to me, moving the files out of
> the web tree and setting include_path makes the most sense as the safest.
>
> There's *NO* *WAY* you're gonna screw up your httpd.conf or .htaccess
> files and make the files not in the web tree suddenly accessible.
>
> It's not like setting include_path is rocket science once you figure out
> that this is EXACTLY what that is for.
>
> Just my opinion.
>
> --
> 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
>
>

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



[PHP] Generating a php file

2005-05-11 Thread Rory Browne
You can start by clarifying. I had to read your message three times
before I got a vague understanding.

What I'm hearing is that you want to put something like
 into a string? You are having
difficulty doing this because you are finding that your string
contains the value of $msg, instead of a doller sign, followed by
'msg'?

If so, then you can:

Use Single Quotes:
$code = ''

or Escape your $-signs, by placing a backslash(\) in front of the $-sign
$code = "";


On 5/11/05, Dan Rossi <[EMAIL PROTECTED]> wrote:
>
> Hi there I am trying to generate a php file, which has variables that i
> need to have in it ie $_SERVER but not actually be parsed as they need
> to be in the actual script. I also need to send some variables to
> assign values to other variables in the script. How is this possible ?
> I have tried placing the contents of the script within a string, but
> all the variables gets parsed, and the super globals cause an error.
> Let me know .
>
> --
> 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



[PHP] Generating a php file

2005-05-11 Thread Rory Browne
Sorry forgot to cc to the list - again

I'm still not sure I understand, although I'm getting there.

This might be useful.
$dynamicly_generated_script = "somevalue}';
?>";

As might this:
$dyn_gen_script = sprintf(
''
, $this->somevar );


On 5/11/05, Dan Rossi <[EMAIL PROTECTED]> wrote:
>
> On 12/05/2005, at 6:03 AM, Rory Browne wrote:
>
> > You can start by clarifying. I had to read your message three times
> > before I got a vague understanding.
> >
> > What I'm hearing is that you want to put something like
> >  into a string? You are having
> > difficulty doing this because you are finding that your string
> > contains the value of $msg, instead of a doller sign, followed by
> > 'msg'?
> >
> > If so, then you can:
> >
> > Use Single Quotes:
> > $code = ''
> >
> > or Escape your $-signs, by placing a backslash(\) in front of the
> > $-sign
> > $code = "";
> >
> >
>
> I've had a habit of this of late ! Let me clarify for you then ;)
>
> I have a php file say
>
>  $query = $_SERVER['QUERY_STRING'];
> $somevar = 'somevalue';
> ?>
>
> i need to dynamically generate some values in the script and output a
> new file to download from it ie
>
>  $query = $_SERVER['QUERY_STRING'];
> $somevar = $this->somevalue;
> ?>
>
> becomes
>
>  $query = $_SERVER['QUERY_STRING'];
> $somevar = 'somevalue';
> ?>
>
> where $this->somevalue is from my generator class ;)
>
> However if I do
>
> $buffer = " $query = $_SERVER['QUERY_STRING'];
> $somevar = 'somevalue';
> ?>";
>
> I get all sorts of errors around $_SERVER.
>
>

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



Re: [PHP] Form handling

2005-05-12 Thread Rory Browne
Personally I'm lazy, but I'd probably go with something along the lines of 

$filename = sprintf("step%d.php", (int)($_SESSION['step']) );
require ( file_exists($filename) ? $filename : "step1.php" );

same results in two lines of code - was one line, but I split it into
two lines to make it more readable, although tbh in production code,
I'd add an array_key_exists, to make sure that $_SESSION['step'],
actually exists. It also scales up to as many steps as you like, so
long as they're all in the stepNUMBER.php format. I don't think there
is any need for both a %d formatter and (int) typecasting, but it's
generally best to take every reasonable precaution when you're
including/requireing files.

On 5/12/05, dan <[EMAIL PROTECTED]> wrote:
> Hello, all -
> 
> I've been researching how to handle forms properly, and I think I
> figured out a way that might be beneficial for me to use.  It is as follows:
> 
> (index.php)
> 
> session_start();
> if (isset($_SESSION['step'])) {
> switch $_SESSION['step'] {
> case "1":
> require('step1.php');
> break;
> case "2":
> require('step2.php');
> break;
> case "3":
> require('step3.php');
> break;
> // add more case statements here if I need to
> default:
> require('step1.php');
> break;
> }
> } else {
> $_SESSION['step'] = '1';
> require('step1.php');
> }
> 
> Each stepX.php file would look something similar to this:
> 
> (step1.php)
> 
> // if submitted, check data for completeness
> // if complete, set 'step' to 2, to be used as argument to index.php
> $_SESSION['step'] = '2'
> // redirect back to index.php, use new value of 'step' to direct
> header('Location: http://somesite.com/index.php');
> // else display form data
> 
> Now, this is, really, one of my first experiences with doing forms.  I
> just want to know if I can/should/would anticipate any problems down the
> road while doing this.  I think it would work quite well, but I've only
> been doing this for a short while.
> 
> Thanks!
> -dant
> 
> --
> 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] Hello, I'm new...

2005-05-13 Thread Rory Browne
A community website. Explain. Decide what features you want this
community site to have. Once you've figured out(or explained) what
type of services you want to offer to your community, and then check
out hotscripts.com, or google.

Three scripts that come to mind, are phpgroupware, phpbb, and
phpnuke(or postnuke)

> I have only recently started to look at php, I hope this list dose not
> mind 'noob' questions.
>
Personally I don't like the term noob, but there are very few people
on this list that I've come across who object to beginners questions.
We were all beginners at some stage. On the other hand, quite a few of
us(myself included), object to stupid questions. An example of a
stupid question would be

"I would like to create a 'community' website and was wondering if
there was a framework available to get me started?".

A better question would be:
"I want to create a community website, where community members can
send each other messages, post to a publicly viewable bulletin board,
and share files. What frameworks are available for this.".

Ok that wasn't that bad of a question(hey, I needed an example), but
once you've read ESR's guide to asking smart questions(
http://www.catb.org/~esr/faqs/smart-questions.html ), and/or the guide
for new members, that is regularly posted to this list. You can find
it here: 
http://apache2triad.net/forums/archive/o_t__t_3613__newbie-guide-for-the-benefit-of-new-posters.html

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



Re: [PHP] Hello, I'm new...

2005-05-13 Thread Rory Browne
> 
> Well now I don't even know what a framework is. I was expecting
> someone to say "Oh, you should use model view controller" or
> something.
> 
> All the answers seem to be applications.
>
> Are applications frameworks?

I never checked the dict def of a framework, but I always considered
them to be pieces of sw that you can develop on top of. The only piece
of code(for php) that I can think of that advertises itself as a
framework, would be the horde framework. checkout www.horde.org



> 
> J
> 
> --
> 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



Fwd: [PHP] Pfpro PHP

2005-05-13 Thread Rory Browne
Forgot to cc to list

I'm assuming you're running ./configure, which should be a shell script.

I can't remember whether is's a /bin/sh or /bin/bash script, but if
it's /bin/sh try modding the first line, which should #!/bin/sh to
#!/bin/sh -x, similarly a /bin/bash script would be modded to show
#!/bin/bash -x. That will give you more error messages. Run the script
again with these mods, and report the error message back to us(unless
someone else answers in the mean time).

On 5/13/05, Rezk Mekhael <[EMAIL PROTECTED]> wrote:
>  Hi,
>
> I am getting  this error when I try to run configure pfpro with PHP, any
> idea?
>
> mkdir: too few arguments
> Try `mkdir --help' for more information.
> configure: creating ./config.status
> config.status: creating config.h
> config.status: config.h is unchanged
>
> 
> Sincerely,
> Rezk Mekhael
>
> Incoming / Outgoing Mail scanned for known Viruses by CLUnet(R)
>
> --
> 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] Pfpro PHP

2005-05-13 Thread Rory Browne
There is nothing there about mkdir. The error message you mentioned
isn't in output.txt

you may have to do a: ./configure 2>stderr.txt > output.txt, and send
us stderr.txt, instead as well as stdout.txt

On 5/13/05, Rezk Mekhael <[EMAIL PROTECTED]> wrote:
> 
> I change the /bin/sh to /bin/sh -x and I dump the out put to a file
> "output.txt"
> 
> Can you please see the file and tell me what is the problem?
> 
> --
> Sincerely,
> Rezk Mekhael
> 
> -Original Message-
> From: Rory Browne [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 13, 2005 12:04 PM
> To: Rezk Mekhael
> Subject: Re: [PHP] Pfpro PHP
> 
> I'm assuming you're running ./configure, which should be a shell script.
> 
> I can't remember whether is's a /bin/sh or /bin/bash script, but if it's
> /bin/sh try modding the first line, which should #!/bin/sh to #!/bin/sh -x,
> similarly a /bin/bash script would be modded to show #!/bin/bash -x. That
> will give you more error messages. Run the script again with these mods, and
> report the error message back to us(unless someone else answers in the mean
> time).
> 
> On 5/13/05, Rezk Mekhael <[EMAIL PROTECTED]> wrote:
> >  Hi,
> >
> > I am getting  this error when I try to run configure pfpro with PHP,
> > any idea?
> >
> > mkdir: too few arguments
> > Try `mkdir --help' for more information.
> > configure: creating ./config.status
> > config.status: creating config.h
> > config.status: config.h is unchanged
> >
> > 
> > Sincerely,
> > Rezk Mekhael
> >
> > Incoming / Outgoing Mail scanned for known Viruses by CLUnet(R)
> >
> > --
> > PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
> > http://www.php.net/unsub.php
> >
> >
> Incoming / Outgoing Mail scanned for known Viruses by CLUnet(R)
> 
>

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



Re: [PHP] Form handling

2005-05-13 Thread Rory Browne
>  What other methods would be good to use?  Using a giant if statement?
Did you read my code for this? It consisted of two lines, which
basicly did the same thing as your massive ugly switch statment. It
also does a limited amount of error-checking, in that it checks to
make sure that the file actually exists.


> However, since I'm anal, I want the entire page to be named index.php,
> which is why I am stuck on the idea of making each page's "target" set
> to index.php WITH $_SESSION['step'] being set to 1, 2, 3, whichever is
> the next step in the process.  If this is bad, what are my alternatives now?

If you ask for alternatives, and then turn them down on the basis that
you're anal, well, I give up.

You could also place the step in form hidden values.

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



Re: [PHP] php works in IE not Firefox?

2005-05-14 Thread Rory Browne
it seems more likely that the server is having issues.

On 5/14/05, Simon Allison <[EMAIL PROTECTED]> wrote:
> By the time a properly executed script(executed on the remote server) gets
> to your computer, regardless of the fact it was done in php(or any other
> server side language for that matter) it will just be plain html. Once it
> makes you computer the file/html will be the same as the same page written
> in ASP or even written with just plain html.
> 
> Your focus needs to be on the HTML itself and any CSS(what the browser DOES
> receive). Looking at the emails it seems both browsers are having issues.
> 
> > > -Original Message-
> > > From: Dustin Wish [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, May 13, 2005 2:12 PM
> > > To: php-general@lists.php.net
> > > Subject: [PHP] php works in IE not Firefox?
> > >
> > >
> > > Anyone run across an issue where a php script works in IE and
> > > not Firefox?
> > > Christianboards.org is a PHP nuke site running on a Enism
> > > linux box that is
> > > having this issue.
> > >
> > >
> > > ---
> > > Outgoing mail is certified Virus Free.
> > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > Version: 6.0.859 / Virus Database: 585 - Release Date: 2/14/2005
> > >
> > >
> >
> > --
> > 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
> 
> --
> 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] Hello, I'm new...

2005-05-14 Thread Rory Browne
> I only really put in the bit about the community site as a sort of statement
> about where I would like to go in my php quest.  When I recently looked at
> asp.net, Microsoft had a Community starter kit/framework which included all
> the basic modules/applications needed to get such a site up and running and
> detailed documentation about it's design and implementation.

If you're looking for a php equivlent of the ASP.NET framework, then
the php interpreter has a lot of the ASP.NET framework functionality
built in. For the remainder, of the ASP.NET framework functionality,
in PHP you should take it on a case by case basis. For example if you
need database abstraction(a similar set of functions for accessing
different types of database) you can use PEAR::DB or ADODB.

Most of what you need however is built into the php interpretor.
 
The php documentation is Excellent. I used it to learn php from
scratch, and I've yet to come across better, or easier to understand
docs.

> I have found most of the suggestions/comments to be useful, some a little to
> personal and insulting than was warranted.

I don't think any post on the list was meant to be personal, or
insulting, and it would be a pity if you took it in that way. Perhaps
you received some private replys, that we didn't see, but I think
perhaps the post that could be most easly interpreted as a personal
insult would have been my own, where I pointed out the Guide for new
members, and ESR's smart questions guide.

The new members guide is, as far as I know, sent to the list
regularly(albeit not frequently), and ESR's guide is usually sent to
anyone who posts to the list saying they're new, or asks for advice on
how best to use the list. I assure you that none of my points were
intended to insult, and apologise if you took them out of their
intended scope.
 
> Anyway thank you for your time and suggestions, I will try to make my
> questions more focused and clear in the future.
>

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



Re: [PHP] Hello, I'm new...

2005-05-14 Thread Rory Browne
> AFAIK, PHP doesn't offer that kind of packaged approach. Perhaps
> there's a major difference between the way MS approaches things and
> the way PHP/open source does.
Traditional ASP, and PHP, were fairly similar. ASP.NET and PHP are two
very different solutions, to what is possibly the same problem.

With microsofts changing direction to a Java design(which is basicly
what dotNET is), ASP.NET is taking a lot of ideas from JSP. JSP is
based on the ideas of packages that it inherited from Java.

You'll see a lot of arguments as to whether ASP is better than PHP, or
visa-vearsa, containing ASP.NET arguments. The fact of the matter is
that PHP is better than ASP, and different from ASP.NET.


> PS. there it is again, hit reply and the 'to' address is the email
> sender, not the list. How so?
Is there a 'reply to all' button on your mail client. Some mailing
lists add a 'Reply-to' header asking all clients to redirect replys to
the list. PHP-general doesn't have such a feature.

I know it gets annoying at times.  

> 
> --
> 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-GTK, or something else, for desktop app development?

2005-05-16 Thread Rory Browne
I don't think php-gtk is currently suitable. As of 22 April Andrei was
considering a very early alpha release. Taking that into consideration
I'd doubt if it's stable enough yet for production. Gtk 1 is afaik
obsolete.

If you're going to jump to a different language, then I'd seriously
consider another P-Language(ie python or Perl). Personally(I'm saying
personally to avoid a flame war), I'd lean towards Python. AFAIK it's
pygtk, wxPython, and pyQT modules are fairly stable, although I could
be wrong on that.

Perl AFAIK also has farly stable GUI modules, but writing
bad(unreadable) code is far too easy in Perl.

On 5/16/05, Murray @ PlanetThoughtful <[EMAIL PROTECTED]> wrote:
> Hi All,
> 
> I'd like to do some desktop app development and I'm looking for others'
> thoughts on whether PHP-GTK is a suitable environment in which to work?
> 
> Years ago I developed desktop apps in Access / VB6, but it's been long
> enough now, and VB in particular has changed so much in the intervening
> time, that I'd have to relearn these anyway, so it seems like a good time to
> either consolidate my PHP coding or to pick up some other language. Not to
> mention that Access is entirely despicable for any purpose, desktop app
> development included [1].
> 
> I'm wondering if PHP-GTK is mature / featured enough to handle a relatively
> complex desktop app project, using features like table grids for displaying
> / editing data stored in a MySQL backend and so on.
> 
> My other alternative is to bite the bullet and learn something like Java,
> though I assume my learning curve would be steeper and more time-consuming.
> I pick Java because a) Everyone Seems To Love Java, and b) there appear
> to be at least a couple of decent free Java IDEs available in NetBeans and
> Eclipse (and maybe others that I don't know about).
> 
> In essence, I'm looking for a desktop app development environment that is
> featured, connects well to MySQL, and is relatively painless to learn. Java
> may not suit the last of those criteria, but I don't know enough about it at
> this point to be scared of it if it is painful to learn.
> 
> Anyone have any thoughts to share about PHP-GTK and / or other desktop app
> development environments that might be more suitable? Freeness of
> development tools is a big plus to me in this, if that needs to be
> explicitly said.
> 
> Much warmth,
> 
> Murray
> 
> [1] Just my opinion. I know I'd get a healthy argument from several
> developers that I know.
> 
> --
> 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] WINBINDER! WOOT! Re: PHP-GTK, or something else, for desktop app development?

2005-05-16 Thread Rory Browne
On 5/16/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I missed the original post, but if you're looking at doing Windows desktop 
> development and want a GREAT alternative to GTK, definitely check out 
> Winbinder!  Rubem and crew have done an awesome job (even though he modestly 
> calls it an "alpha" release.. it's very function).

Wheather something is an Alpha, Beta, or Final release isn't related
to the functionality of the library, but rather a reference to how
well tested it is. Calling software Alpha isn't being modest, unless
it's far better tested than the author is taking credit for.


> 
> It's a native Windows API wrapper for PHP.. so you have access to all the 
> familiar Windows.
> 
> http://www.hypervisual.com/winbinder/index.php
> 
> = = = Original message = = =
> 
> [pardon me for my poor english]
> What you want to do?
> If you just want to be a desktop applications programmer, i dont think
> learning PHP-GTK be a good way to produce them (learning a language like
> PHP that is specialized in web environment for desktop programming colud
> not be a good idea) but if you want to be a web programmer too, it's
> here you could use PHP-GTK with the most TRUST!
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> ___
> Sent by ePrompter, the premier email notification software.
> Free download at http://www.ePrompter.com.
> 
> --
> 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] Firefox COM object

2005-05-16 Thread Rory Browne
XPCOM is similar to COM, except that it is Cross Platform, and doesn't
support DCOM.

On 5/16/05, Dang Nguyen <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I would like to write some PHP scripts to automate web testing.  I already
> have a framework that uses the COM class to automate the tests in IE.  Now,
> I'd like to port that code so that I can test the same web pages in FireFox
> or Mozilla browsers.  I haven't been able to locate any documentation or
> otherwise regarding this matter.  Does Firefox have any COM interface like
> IE does?
> 
> Cheers,
> Dang Nguyen
> 
> --
> 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] Cache

2005-05-16 Thread Rory Browne
Interesting idea. Using three identifiers, as a key.
md5() returns a 32 hex-digit value. That means that there are can only
be a maximum of 3.4 * 10^38 possible outcomes for the md5(). This
means that there there is a 1 in
340 chance of a collision between
filenames.

You could reduce those odds by a factor of three, by md5()ing each id
seperately, and concat'ing the resultant md5files. Alternatively
depending on your filesystem and the length of identifiers, you could
simply concat, and urlencode the  identifier. You could have a heck of
a long filename though.

I'd suggest taking a look at at the DB abstraction functions. They
were designed for what you're doing.

On 5/16/05, Evert | Rooftop <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I'm developing a cache system. Which works in pseude code, like this:
> 
> class Cache {
> 
>   function Fetchdata($id1,$id2,$id3) {
> 
> $id = md5($id1 . $id2 . $id3);
> if ($this->DataIsExpired($id)) return false;
>else return unserialize(file_get_contents($id));
> 
>  }
> 
>  function storeData($data,$id1,$id2,$id3) {
> 
>$id = md5($id1 . $id2 . $id3);
>OpenTheFileAndWriteTheDataSerialized($data);
>  }
> 
> }
> 
> $id1 $id2 and $id3 are when they are combined unique
> 
> * Is there a chance of collision when MD5 is used on the id's and the
> ids are long strings
> * Is file_get_contents the fastest way to open the file?
> * Is serialize the fastest way to serialize ;) ?
> * Are there any other things I should consider? (I'm aware of
> file-locking issues, and have taken care of that)
> 
> regards,
> Evert
> 
> --
> 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] Components

2005-05-16 Thread Rory Browne
> Thank you I will look into it ;) but right now I'm also looking for the
> php-developers' opinions.
> So, what are your ideas about this?
AFAIK Prado recently won a fairly well respected PHP Contest. I think
the results speak for themselves.


On 5/17/05, Evert | Rooftop <[EMAIL PROTECTED]> wrote:
> Jason Wong wrote:
> 
> >On Tuesday 17 May 2005 03:24, Evert | Rooftop wrote:
> >
> >
> >
> >>I'm working on a component system and started with a component class.
> >>
> >>
> >
> >[...]
> >
> >
> >
> >>I want to give PHP to have a natural application-programming feel,
> >>along with events and all (which is implemented by the PseudeModule
> >>class). And after that, start off with a web-based PHP RAD tool. (which
> >>I plan to do with either document.designMode or XUL)
> >>
> >>
> >
> >You might want to take a look at Prado http://www.xisc.com/ it seems to be
> >exactly what you're trying to do and I believe it also has a RAD plugin
> >for Dreamweaver.
> >
> >
> >
> Thank you I will look into it ;) but right now I'm also looking for the
> php-developers' opinions.
> So, what are your ideas about this?
> 
> grt,
> Evert
> 
> --
> 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] Cache

2005-05-17 Thread Rory Browne
> Probably, but not serializing at all, and stuffing the data directly into
> shared memory would perhaps be faster, at least as I vaguely understood
> the results of a thread on serialization on this very forum from a month
> or two ago.  (Check archives for "serialize" "shared memory" and "Rasmus
> Lerdorf" who weighed in with a succinct explanation of how to avoid
> serialization if that performance hit was really a problem (unlikely as
> that was))

You're looking for this topic:

From: Josh Whiting <[EMAIL PROTECTED]>
To: php-general@lists.php.net
Date: Jan 3, 2005 5:28 PM
Subject: [PHP] Persistent PHP web application?

and this response by Rasmus:

From: Rasmus Lerdorf <[EMAIL PROTECTED]>
To: Josh Whiting <[EMAIL PROTECTED]>
Cc: php-general@lists.php.net
Date: Jan 4, 2005 6:40 PM
Subject: Re: [PHP] Persistent PHP web application?

The important functions were apc_fetch(), and apc_store() IIRC.
> 
> --
> 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
> 
>

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



Re: [PHP] hey dip shit

2005-05-18 Thread Rory Browne
> 
> This list could really use an active moderator.

Um no. You can't moderate what's already in peoples mailboxes, and if
you're going to have all posts manually approved before delivery, then
you're going to seriously affect the responsiveness of the list.

Besides that post was harmless, was apologised for, and in the grand
scheme of things isn't that big of a deal. Definatly not something to
screw up the list with moderation over.

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



Re: [PHP] hey dip shit

2005-05-18 Thread Rory Browne
> I didn't say anything about approval before delivery, and I really can't
> see how an active moderator would screw up the list.  You mean having
> someone around who can remove email addresses subscribed to the list
> that generate bounces would be a bad thing?  
Fair enough. That just wasn't my idea of moderation. My idea of
moderation would have been the prevention of something like this from
coming on to the list, which would have meant pre-approval.


> Someone that can remove
> email addresses that do nothing but generate auto responders?  Someone
> who can remove addresses which send out those stupid, 'verify you are
> not spam' emails?  Someone who can block spam?  

Are you volunteering?

> Sure, this post was
> harmless, but it's far from the only crap coming onto this list.
> 
> --
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> [EMAIL PROTECTED]
> 
> --
> 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] hey dip shit

2005-05-18 Thread Rory Browne
> > Hell, I'll do it...if there are no objections from the established list
> > members (like that will happen ;)
> 
> John has my vote for what it's worth :)

Ah why not? The man has a vision. 
/me seconds Jochams vote for John.

> 
> >
> 
> --
> 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] Jakarta Tomcat and PHP

2005-05-18 Thread Rory Browne
I don't know if you checked out www.php.net/java but it seems to be
what you're looking for.

On 5/18/05, Evert | Rooftop <[EMAIL PROTECTED]> wrote:
> My guess would be looking for how to use PHP as a CGI in tomcat. So
> check out the manual for CGI stuff.
> 
> grt,
> Evert
> 
> Chris Holden wrote:
> 
> >Hi, I hope this is the right place to ask...
> >
> >I am running Tomcat 5.5.7 (jdk 1.5) on Windows XP quite happily. I have
> >MySQL set up and that all works fine too. But I would also like to be able
> >to run PHP under Tomcat rather than having to install Apache to handle PHP
> >file and forward JSP requests to Tomcat... I'll only be doing some small
> >test pages in PHP but I really dont want to have to install another server.
> >
> >I read on the Tomcat Wiki site that it *is* possible to connect PHP and
> >Tomcat, and I tried but got nowhere, I dont even get errors when opening
> >..php files!
> >
> >I'd really appreciate it if someone could give me or point me in the
> >direction of an idiots guide to getting PHP working with Tomcat. I've gone
> >through every result from google to no avail :(
> >
> >
> >Cheers,
> >
> >
> >Chris.
> >
> >
> >
> 
> --
> 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] Sending a string with $_POST/$_GET

2005-05-18 Thread Rory Browne
You don't set $_GET variables, like $_GET['name'] = whaever and expect
to do something along the lines of echo $_GET['name'] in another page.

To assign a value as a GET variable on another page, then you make the
url of the other page whatever.php?name=value

Then in whatever.php you can do something like 


On 5/17/05, Ross <[EMAIL PROTECTED]> wrote:
> I want to write a string to a variable and use $_POST or $_GET to retrieve
> it on another page.
> 
> I keep gettting an undefined index errror. Can someone show me how this is
> done?
> 
> Do I have to use session_start() ?
> 
> Have checked the documentation, can't find a really basic example.
> 
> R.
> 
> --
> 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] Responses in my email.

2005-05-18 Thread Rory Browne
This is primarly a mailing list. Not a news group. The whole idea of a
mailing list is that you get every message mailed to you.

If you don't want this then unsubscribe. 

You could always filter out any email sent to php-general, or
containing the term [PHP] in the subject.

On 5/18/05, Robert Meyer <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> When I post a question here, I get an email for every response posted.  I
> only want the response posted, not emailed to me.  The other newsgroups I
> belong to don't send me an email.  What are my options if any and how do I
> implement them?
> 
> Regards,
> 
> Robert
> 
> --
> 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] Image Verification - Problems in Safari, Mac OS X

2005-05-19 Thread Rory Browne
if you have an image generated by
http://www.example.com/createimage.php , you could always refer to it
as http://www.example.com/createimage.php/{no_of_seconds_since_unix_epoch}.png

On 5/19/05, Rahul S. Johari <[EMAIL PROTECTED]> wrote:
> 
> On 5/19/05 10:59 AM, "Murray @ PlanetThoughtful"
> <[EMAIL PROTECTED]> wrote:
> 
> 
> > Try forcing the browser to bypass the cache by adding the lines at the
> > following link to your page:
> >
> > http://www.faqts.com/knowledge_base/view.phtml/aid/21068/fid/51
> 
> I thought this would definitely work because it looks like exactly what I
> need. IE is picking up the image from the cache no matter what.. And it
> seemed this piece of code is exactly for that, so that IE doesn't pick up
> images/data from the cache. But it's still not working! IE is still indeed
> picking up the image from the cache.
> 
> This is how the beginning of my php page looks like:
> 
>  session_start();
> header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
> header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
> header ("Cache-Control: no-cache, must-revalidate"); // for HTTP/1.1
> header ("Pragma: no-cache"); // for HTTP/1.0
> ?>
> 
> Stll... IE is displaying the image that has already been displayed on first
> login attempt... It won't display new Image untill you actually physically
> hit the "REFRESH" button on the browser.
> 
> Any suggestions?
> 
> Rahul S. Johari
> Coordinator, Internet & Administration
> Informed Marketing Services Inc.
> 251 River Street
> Troy, NY 12180
> 
> Tel: (518) 266-0909 x154
> Fax: (518) 266-0909
> Email: [EMAIL PROTECTED]
> http://www.informed-sources.com
> 
> --
> 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] How to confirm subscriptions by e-mail on a PHP site ?

2005-05-20 Thread Rory Browne
You can either email them an URL containing an activation code, which
would have them activate in their browser.

If you don't understand the terms .forwared, or MTA, you should
probably either learn more about them or skip to the third paragraph.
If you want them to activate using their email client, the question
isn't quite(although almost) so simple. You can either use the
.forward mechanism, to parse the response mail, and deal with it
accordingly(assuming you're using a .forward capable MTA).

Alternatively you can have them reply to an account, and set up a cron
job(assuming you're on unix) to have PHP check the account using it's
imap functions every minute. The first way would be preferable.



On 5/20/05, Mário Gamito <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I'm making this middle-range site (i. e., not so little, bit not so big,
> either), and i want users that subscribe to my site to have their
> confirmation made by email.
> 
> Does anyone sugests a simple, yet effective way to do this ?
> 
> Please, don't misunderstand me.
> The PHP part i know.
> The sugestions i'm asking for are about the mechanism.
> 
> Thanking you in advance.
> 
> Warm Regards,
> Mário Gamito
> 
> --
> 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] ZEND Certification

2005-05-20 Thread Rory Browne
On 5/20/05, Martin Zvarik <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> anyone has taken ZEND PHP Certification Exam???
Yes. Loads of people here have taken it. Loads of other people here
set the questions.


> Please can you give me some information about it?
I'm sure you'll get lots of useful and encourageing information about
it. In the meantime you might want to search the archives.

> 
> Thank you,
> 
> Martin
> 
> --
> 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] Can I prevent Server variables from being spoofed ?

2005-05-20 Thread Rory Browne
Not only can the user agent string be easly spoofed, but as a result
of its abuse by certain webmasters(mostly Banks) Browsers such as
Opera, and I believe Konqueror, have a setting that allows you to
change the user agent string as a configuration option.

The UserAgent is a hint. It is most definatly not a gurantee. 

On 5/20/05, Graham Anderson <[EMAIL PROTECTED]> wrote:
> Can the server variable 'user agent'  be modified/spoofed  by the user?
> 
>   I have a bunch movies that I want to only open if the user agent
> contains Quicktime Player...
> In my case, if the user agent string contains Quicktime Player, a movie
> url is written for Quicktime to open
> If the user agent contains  a browser, I want php to deny accessnot
> write the url for Quicktime to read
> 
> is is possible for a script kiddie to spoof user agent server variables
> to fool the server ?
> 
> 
> many thanks :)
> 
> g
> 
> --
> 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] SMarty and commercial php (a little 0t)

2005-05-21 Thread Rory Browne
> I was wondering if its a good idea to template via smarty and include smarty
> with my code?
> also instructions to setup smarty when setting up the application i made?

Good idea compared to what? Compared to a different templating
library, compared to writing your own templating library, or compared
to having them download/install smarty themselves as a dependency?


> Searching google I found this very nice place discussing PHP templating (you
> might also want to read up on how many there are!)
> http://www.sitepoint.com/forums/showthread.php?t=123769&page=1&pp=25
> but no discussion of including any of these with commercial software for the
> client to setup and their results.

Smarty is licensed under the LGPL. I've never read the LGPL, but
TTBOMK that means you can use it in commercial/propriatory software,
which I'm assuming is what you're refering to.

> 
> Thanks,
> Ryan
> 
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.322 / Virus Database: 266.11.14 - Release Date: 5/20/2005
> 
> --
> 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] SMarty and commercial php (a little 0t)

2005-05-21 Thread Rory Browne
> Yep, left myself quite open there...should have been more specific.
> I will not write a templating library myself because there are so many
> out there,
> it would be a learning experience of course but other than that I think it
> would be
> rarely needed.
> I meant bundling it along with the rest of the scripts, (which would add
> around 500kb to the
> size) and then giving instructions on how to do a basic configuration for
> smarty.
I've never done it personally, but if this is for one specific client,
isn't 500k pretty much insignificant? If it's a problem though,
perhaps you could use a smaller template system, that maybe required
less configuration. Having that said, I've never used Smarty so I
don't know what configuration is involved. Perhaps an auto-config
script could be made?

> 
> 
> 
> > > Searching google I found this very nice place discussing PHP templating
> > (you
> > > might also want to read up on how many there are!)
> > > http://www.sitepoint.com/forums/showthread.php?t=123769&page=1&pp=25
> > > but no discussion of including any of these with commercial software for
> > the
> > > client to setup and their results.
> >
> > Smarty is licensed under the LGPL.
> > I've never read the LGPL, but
> > TTBOMK that means you can use it in commercial/propriatory software,
> > which I'm
> > assuming is what you're refering to.
> 
> Nope, sorry, I should have been more specific here too.
> I meant what I said above...nobody has discussed what experience they have
> had if they
> bundled smarty along with their scripts and then told the client how to
> configure smarty
> or if the clients had any problem configuring smarty etc.
> 
> Cheers,
> Ryan
> 
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.322 / Virus Database: 266.11.14 - Release Date: 5/20/2005
> 
>

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



Re: [PHP] ZEND Certification

2005-05-21 Thread Rory Browne
On 5/21/05, Martin Zvarik <[EMAIL PROTECTED]> wrote:
> Ok, what should I expect from the certification then?
> Was there any question you didn't expect or anything you didn't know?? If
> yes, what was it?
> 
> It seems like not many people took it as I am reading some emails here...
> like "How to get variable after the form is sent" etc...
There are new users on this list, but there are also some very
experienced programmers here. You'll note that questions such as "How
to get variable after the form is sent", as well as much more
complicated questions are usually answered here.

All quoting the above sentence indicates is that not everyone here is
experienced. Everyone has to start somewhere, and this list encourages
learning, as well as black-voodoo-magic-trick swapping.

> 
> I have looked at yellow pages, seems like you're not there either, Rory
> Browne...
That might have something to do with the fact that I've never done the
exam. However I'm well capable of dealing with forms and variables, as
well as pretty much almost anything else PHP related. I've also read
many threads here over time in which people outlined their opinions,
and offered help on the matter. Forgive me if this seems a bit
defensive, but I don't know what you're getting at.

> If many people here have taken it, can someone please answer my questions
> above? Thank you!
Your questions are very broad, so nobody can give more than generic
answers. Check out
http://marc.theaimsgroup.com/?l=php-general&w=2&r=1&s=zend+certification&q=b
for some answers in the archives.

> 
> Martin
> 
> 
> -Original Message-
> From: Rory Browne [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 20, 2005 1:31 PM
> To: Martin Zvarik
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] ZEND Certification
> 
> On 5/20/05, Martin Zvarik <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > anyone has taken ZEND PHP Certification Exam???
> Yes. Loads of people here have taken it. Loads of other people here
> set the questions.
> 
> 
> > Please can you give me some information about it?
> I'm sure you'll get lots of useful and encourageing information about
> it. In the meantime you might want to search the archives.
> 
> >
> > Thank you,
> >
> > Martin
> >
> > --
> > 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] Search problem

2005-05-21 Thread Rory Browne
On 5/21/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I need to build up a search module for a shop. If I make a basic search 
> (product title for example) it is ok.
> 
> $query = "SELECT product_id FROM products WHERE title LIKE '%$title%'";
> 
> But i need an advance search for more than one field (title, description, 
> price, weight)
> The problem is that i don't know which field is filled in by the user (title, 
> description, price or weight)

Without error checking, or security code(ie supplied code contains SQL
injection vulnerability):
$sql  = "SELECT product_id FROM products WHERE ";
if($_GET['title']){ 
$sql_ext[] = "title like '%{$_GET['title']}%' "; 
}
if($_GET['description']){ 
$sql_ext[] = "description like '%{$_GET['description']}%' "; 
}

$sql .= implode(" OR ", $sql_ext );


> I mean, the user can fill in all fields, or only price field, or title and 
> weight etc
> 
> How can i do the search?
> 
> Thanks
> 
>

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



Re: [PHP] PHP 5...

2006-07-11 Thread Rory Browne

Unless there is some specific reason that you need this code to run on both
php4 and php5, then inform your boss/admin that the idea of developing on
php5, to deploy on php4 is nuts. If they disagree inform them that they are
personally nuts( tell them some guy on the internet said so ).

It may be possible to develop php5 code in a php5 env, if you are intimately
familiar with the differences between php4 and php5, but if you're that
familiar with PHP, then you're worth more than a half-ass software creation
enviornment.

Basicly it's a catch22 if you're good enough to be able to cope with this
enviornment, you shouldn't have to.






Re: [PHP] Basic PHP knowledge test

2006-07-19 Thread Rory Browne

On 7/19/06, KermodeBear <[EMAIL PROTECTED]> wrote:


> Does anyone have any links/resources for a
> basic php knowledge test?  If not, I'll have to
> write one from scratch myself, and mess up the
> rest of my day of goofing off/sleeping.

It wouldn't hurt to pick up one of those Zend PHP Certification study
guides
and pull some things from there. Or, browse the PHP manual for commonly
used
functions and ask questions from there.



Assuming that doing so was either "Fair use" or authorised by Zend, and that
you aren't going to get your ass sued for copyright violation - then again
maybe on a small enough scale.



What might work better though would be to pull some questions from this

mailing list and ask them how they would answer them. It will give you
some
insight into their knowledge of PHP as well as how well they can solve
problems using the language.




To an extent. I personally think the best way is to outline a set of
situations and have them write scripts to solve that problem. You need to
know that they have both the knowledge and language to solve a problem. It
doesn't really matter if they know the syntax of strpos, if they know other
methods of solving their potential problems.

Perhaps a CSV to MySQL converter - although not exactly that, because I've
mentioned it on the list :p


That, in my (not so) humble opinion, is better than just knowledge of the

language. You need to know how to apply it to be a decent programmer.

HTH. I would be very interested in seeing what you come up with, actually.
(o:



After the person sitting the exam has passed their test.


-K. Bear


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




Re: [PHP] Efficiency question

2006-07-26 Thread Rory Browne

For something like that that, unless you are doing it inside a loop, I
wouldn't really worry about efficiency as much as I would about security

On 7/26/06, Paul Scott <[EMAIL PROTECTED]> wrote:



I have googled around a bit, but not really found anything useful...

Which is more efficient? A case switch or a $$method style method?

An example:

switch($action) {
case 'edit':
  //do some stuff
  ...
  return "edit_tpl.php";

case 'whatever':
  //blah
  ..
  ..
}

OR:

$method=$this->convertToMethod($action);
unset($action);
return $this->$method();

Hope this is reasonably clear... Note the return on the latter code.

If anyone has any ideas around this, please let me know! Are there
underlying security risks in doing it this way?

--Paul



All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm



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




[PHP] HTTP_WebDAV_Server problems

2006-07-30 Thread Rory Browne

Hello All

I'm trying to get a WebDAV server set up using PEAR::HTTP_WebDAV_Server, but
so far I'm having little success.

All I could get from the 11 Slides was that the Class had to be subclassed,
and the methods overloaded, to provide the functionality.

I gathered from the source-code, that I had to instigate the object, and
call the ServeRequest method - This works OK for GET requests via the
Browser, but when I try it in MSWord or OOo, it opens whatever it marked
read only, as opposed to read/write.

I've written the following so far in an attempt to help me understand the
procedure. Any suggestions?

#!/usr/local/php51/bin/php
ServeRequest();


Re: [PHP] Re: Is this really a pdf?

2006-08-07 Thread Rory Browne

On 8/7/06, Colin Guthrie <[EMAIL PROTECTED]> wrote:


Sjef wrote:
> Is it possible to recognize if a file for upload really is a pdf (like
the
> function getimagesize retuns the file type of the image)?

If you have a suitible mime.magic file, and your PHP has the
functionality built into it, you could try the mime_content_type()
function.
http://uk.php.net/manual/en/function.mime-content-type.php



Is this to protect against somebody trying to pass an mp3 off as a PDF, or
to stop people mistakenly uploading PDF's. If it's the latter, then mime
functions are probably okay. If the former, then you may want something a
little more through.



Or if not available, read the first few bytes of the file and verify

that it begins with:
%PDF-1.3
(or other versions - perhaps just verify the first 4 chars.

You can do this with a simple

$fp = fopen($filename, 'rb'));
if ('%PDF' == fread($fp, 4))
   // PDF
else
   // Not PDF

This is very simple.



And very insecure. All it takes is a cat and echo to disguise a file as a
PDF, and a quick 'dd skip' to Undisguise it.


You could also use the "file" commandline utility if the server is a

*nix machine and parse it's output.

e.g. on my machine:
[EMAIL PROTECTED] www]$ file ~/Desktop/svn-book.pdf
/home/colin/Desktop/svn-book.pdf: PDF document, version 1.3

or easier:

[EMAIL PROTECTED] www]$ file -i ~/Desktop/svn-book.pdf
/home/colin/Desktop/svn-book.pdf: application/pdf


Col.

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




[PHP] Espanol en esto lista

2006-08-16 Thread Rory Browne

No tengo bastante espanol para decir lo que quiero decir aqui correctimente,
pero hay lista php-general-es para los mesajes espanol.
( I don't have enough spanish to say what I want to say here correctly, but
there is a php-general-es list for spanish messages. )

Eso lista es para los mesajes en Ingles, por que muchos personas aqui, no
hablamos bastante espanol para entiendar que quieres decir cuando hablas
espanol.
( This list is for messages in English, because most of the people here
don't speak enough spanish to understand what you mean when  you speak
Spanish)

Yo ( y vivo circa de Espana ) solo hablo bastante para comprar cerveza.
( I (and I live near Spain) only speak enough to buy beer. )


In short, speaking a language other than English on this list( especially
considering that there is a php.general.es -
http://news.php.net/php.general.es ), is similar to whispering in company.
Most of us don't understand what you're saying.

Rory


Re: [PHP] Espanol en esto lista

2006-08-16 Thread Rory Browne

I have a clue what he's saying - just not much of a one:

Hablo espanol, pero lo que Rory dice es verdad, hay otra lista en espanol.

Pero, si quieres, you tratare entender tu palabra.


 ( I speak spanish, but what Rory says is true, there is another list in
spanish, But, if you want you **something** understand your word. )

I don't speak enough Spanish to understand it all, but tratare according to
altavista is "to treat" - not really sure I get it.


On 8/16/06, Peter Lauri <[EMAIL PROTECTED]> wrote:


I have no clue what he is saying, but I believe he is asking if there is
any
list in Spanish he can join. But I might be wrong :)

-Original Message-
From: Dave Goodchild [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 16, 2006 5:20 PM
To: Rory Browne
Cc: php-general@lists.php.net
Subject: Re: [PHP] Espanol en esto lista

>
> Hablo espanol, pero lo que Rory dice es verdad, hay otra lista en
espanol.
> Pero, si quieres, you tratare entender tu palabra.
>
>
> In short, speaking a language other than English on this list(
especially
> considering that there is a php.general.es -
> http://news.php.net/php.general.es ), is similar to whispering in
company.
> Most of us don't understand what you're saying.
>
> Rory
>
>


--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk




Re: [PHP] Espanol en esto lista

2006-08-16 Thread Rory Browne

On 8/16/06, Mario de Frutos <[EMAIL PROTECTED]> wrote:


Hi everyone!

I'm spanish and i don't have any problem to answer his questions.



And I don't have any problem with you answering his questions, provided
they're either

(a) posted in English, or (b) posted on the Spanish list, or (c) Posted with
a Translation in English.


Cheers


Peter Lauri escribió:
> I have no clue what he is saying, but I believe he is asking if there is
any
> list in Spanish he can join. But I might be wrong :)
>
> -Original Message-
> From: Dave Goodchild [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 16, 2006 5:20 PM
> To: Rory Browne
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Espanol en esto lista
>
>> Hablo espanol, pero lo que Rory dice es verdad, hay otra lista en
espanol.
>> Pero, si quieres, you tratare entender tu palabra.
>>
>>
>> In short, speaking a language other than English on this list(
especially
>> considering that there is a php.general.es -
>> http://news.php.net/php.general.es ), is similar to whispering in
company.
>> Most of us don't understand what you're saying.
>>
>> Rory
>>
>>
>
>


--
**
FUNDACIÓN CARTIF

  MARIO DE FRUTOS DIEGUEZ - Email: [EMAIL PROTECTED]
División de Ingeniería del Software y Comunicaciones

   Parque Tecnológico de Boecillo, Parcela 205
   47151 - Boecillo (Valladolid) España
  Tel.   (34) 983.54.88.21 Fax(34) 983.54.65.21
**
Este mensaje se dirige exclusivamente a su destinatario y puede contener
información CONFIDENCIAL sometida a secreto profesional o cuya
divulgación esté prohibida en virtud de la legislación vigente. Si ha
recibido este mensaje por error, le rogamos que nos lo comunique
inmediatamente por esta misma vía y proceda a su destrucción.

Nótese que el correo electrónico via Internet no permite asegurar ni la
confidencialidad de los mensajes que se transmiten ni la correcta
recepción de los mismos. En el caso de que el destinatario de este
mensaje no consintiera la utilización del correo electrónico vía
Internet, rogamos lo ponga en nuestro conocimiento de manera inmediata.
***
This message is intended exclusively for its addressee and may contain
information that is CONFIDENTIAL and protected by a professional
privilege or whose disclosure is prohibited by law. If this message has
been received in error, please immediately notify us via e-mail and
delete it.

Please note that Internet e-mail neither guarantees the confidentiality
nor the proper receipt of the messages sent. If the addressee of this
message does not consent to the use of Internet e-mail, please
communicate it to us immediately.


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




Re: [PHP] php-general mailing list active?

2006-08-22 Thread Rory Browne

Check out lists.php.net

On 8/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:



> Would someone kindly let me know if there is activity on
> [EMAIL PROTECTED] I have not gotten posts for a few days now,
> and I'm having no luck connecting to the help, owner or admin addresses.

Thanks Jochem, Thomas, and Jay.

Anybody know Wez Furlong's email address? I had this problem once before,
and I recall he was the guy who finally figured out what went awry.

David

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




Re: [PHP] OT - PHP Hosting Service in UK?

2006-09-05 Thread Rory Browne

>
> Why?  If they're not hosting it in-house, why does it matter where on
> the globe it is?

Request latency due to distance and intermediate hops. The shorter the
distance and fewer hops the faster those little images, stylesheets, and
various other embedded media will load. This won't be very noticeable on
the first page load due to the download times, but other requests that
check timestamps against cache will appear more sluggish than necessary.




It's also more fault tolerent. I don't imagine this ever happening, but if
the UK was somehow cut off from all other countries internet system, then
the UK customers would still be able to access sites in the UK, but not
sites outside of the UK. It's one less thing that can go wrong.


Re: [PHP] Accessing .mdb Ms Access file from Linux without ODBC

2006-09-07 Thread Rory Browne



what does this have to do with PHP?



I would assume that he's trying to do it on Linux through PHP.

http://mdbtools.sourceforge.net/
http://pecl.php.net/package/mdbtools


Re: [PHP] Help converting C to PHP

2006-09-22 Thread Rory Browne

On 9/22/06, Kevin Waterson <[EMAIL PROTECTED]> wrote:


This one time, at band camp, "Curt Zirzow" <[EMAIL PROTECTED]> wrote:

> what about using:
>   php.net/pi
>
> note the precision description.
>
> or are we talking about a different pi.

The goal of the codegolf.com challenge is to print pi to 1000 places.
The programmer to do it in the least keystrokes is the winner.



I personally don't think this is a very healthy contest. It discourages
comments, and use of whitespace to make code readable.

I'd perfer a contest that rewarded code readability, and maintainability as
well as minimal keystrokes. After all you only enter the aforementioned
keystrokes once. Perhaps one like codegolf, with an enforced coding style (
eg KR Style, or GNU Style)


  1   2   3   4   >