php-general Digest 21 Oct 2008 18:32:56 -0000 Issue 5748

Topics (messages 282173 through 282209):

Re: Mass email
        282173 by: Richard Heyes

Re: Remote Developer Wanted
        282174 by: Brennon Bortz
        282183 by: Daniel Brown
        282184 by: Jay Moore
        282186 by: Daniel Brown
        282188 by: Rene Veerman
        282191 by: Robert Cummings
        282192 by: Daniel Brown
        282193 by: Jay Moore
        282194 by: Jay Moore
        282196 by: Jochem Maas
        282197 by: Jochem Maas
        282199 by: Daniel Brown
        282201 by: Jochem Maas
        282208 by: Nitsan Bin-Nun

Re: Securing AJAX requests with PHP?
        282175 by: Yeti
        282200 by: Eric Butera

Re: Accessibility problem with delegates
        282176 by: Jochem Maas

Re: what's the difference in the following code?
        282177 by: Yeti
        282180 by: Jochem Maas
        282181 by: tedd

Politics
        282178 by: Amy
        282179 by: Chrome
        282189 by: Jim Lucas
        282190 by: Robert Cummings
        282195 by: Nathan Rixham
        282198 by: Wolf
        282202 by: Jochem Maas

Re: How to Execute Exe File from PHP
        282182 by: Alice Wei
        282203 by: Paulo Sousa

table and class
        282185 by: Alain Roger
        282187 by: Nathan Rixham

display_errors in DEV
        282204 by: ceo.l-i-e.com
        282206 by: Robert Cummings
        282207 by: Eric Butera
        282209 by: Boyd, Todd M.

ZendOptimizer + APC
        282205 by: Jochem Maas

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
> I have a client who wants to send out mass emails to 37,000+ opt-in members
> (i.e., not spam).
>
> Any suggestions as to the best way to do this?

Outsource it.

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

--- End Message ---
--- Begin Message ---
Actually, speaking as someone now living in the UK, your low end is LESS
than minimum wage here.  Rather insulting, if you ask me...

Brennon Bortz

-----Original Message-----
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 21, 2008 2:32 AM
To: Andy Dyble
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Remote Developer Wanted

Andy Dyble schreef:
> Hi
> 
> I am looking for a remote developer for small add hoc jobs.  Usually
> only a few hours at a time. Basic stuff, listing data from SQL and text
> files. Mainly work on existing systems.

personally I'd run in the other direction based on that description,
I mean who decides what's simple, how long something should take, etc.

my experience of working on 'existing systems' is usually akin to wading
neckdeep through crap you wouldn't wish on your worst enemy. really well
thought out, well written code usually has competent people working on it
already ... code that stinks generally gets no attention because nobody
wants to work on/with it which is people end up scouring the net looking
for someone desperate enough to take a shot at it.

> $10-$15 per hour depending on location.

Im sure there is an indian outsourcing solution to fit your needs, your from
the UK and quoting dollars ... your low-end is just over 5 pound sterling an
hour,
I can flip burgers at Macdonalds for more.

there are plenty of market places on the net where tenders can be placed for
this
kind of thing.

just so you know ... at lot of the regular people doling out free advice on
this
list command somewhere in the region of 8 to 10 times what your willing to
pay ...
if not more.

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



--- End Message ---
--- Begin Message ---
On Tue, Oct 21, 2008 at 4:26 AM, Brennon Bortz <[EMAIL PROTECTED]> wrote:
> Actually, speaking as someone now living in the UK, your low end is LESS
> than minimum wage here.  Rather insulting, if you ask me...

    Simple advice then: delete the message and don't reply.

-- 
</Daniel P. Brown>
http://www.parasane.net/ [New Look]
[EMAIL PROTECTED] || [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Daniel Brown wrote:
On Tue, Oct 21, 2008 at 4:26 AM, Brennon Bortz <[EMAIL PROTECTED]> wrote:
Actually, speaking as someone now living in the UK, your low end is LESS
than minimum wage here.  Rather insulting, if you ask me...

    Simple advice then: delete the message and don't reply.


<Striker>
Surely you can't be serious.
</Striker>

--- End Message ---
--- Begin Message ---
On Tue, Oct 21, 2008 at 10:20 AM, Jay Moore <[EMAIL PROTECTED]> wrote:
>
> <Striker>
> Surely you can't be serious.
> </Striker>

    I am serious.  And don't call me Shirley.

-- 
</Daniel P. Brown>
http://www.parasane.net/ [New Look]
[EMAIL PROTECTED] || [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Daniel Brown wrote:
On Tue, Oct 21, 2008 at 4:26 AM, Brennon Bortz <[EMAIL PROTECTED]> wrote:
Actually, speaking as someone now living in the UK, your low end is LESS
than minimum wage here.  Rather insulting, if you ask me...

    Simple advice then: delete the message and don't reply.

Andy deserves to know his current offer is kinda insulting :D

Consider plz that if a job is easy, i'd be done sooner. So i'd make even less..
The offer really only is fair to a noob php-er ;-)

So you might get a 15 year old to do it, if its an easy of a job with a technical director giving him coding guidelines..
They might be happy with the $15/h.
A talented 17 year old would want $20 at least, or he aint talented :)

If you plan to do many of these type of tasks, and will do them for years to come, it might be cheaper to have a $50/h programmer take a look at building something re-usable, with an interface for non-techies to describe your forms and databases. With something re-usable, if properly written and self-documented, you have a more solid base for your business operations, and can distribute improvements to all your clients when they become available. I've gotta add that there might be many hours involved depending on the complexity of the data and ways of displaying it. I guess you could start with the types of operations that happen a lot, grouped by similarity. Give us a few examples and i can tell you if it's possible to create something re-usable in a short time..


--- End Message ---
--- Begin Message ---
On Tue, 2008-10-21 at 10:23 -0400, Daniel Brown wrote:
> On Tue, Oct 21, 2008 at 10:20 AM, Jay Moore <[EMAIL PROTECTED]> wrote:
> >
> > <Striker>
> > Surely you can't be serious.
> > </Striker>
> 
>     I am serious.  And don't call me Shirley.

You must be new around here... Shirley!

:D

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


--- End Message ---
--- Begin Message ---
On Tue, Oct 21, 2008 at 11:31 AM, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
> You must be new around here... Shirley!

    Yes, brand new.  This is only my second post --- and only the
third email I've ever sent in my life.  How do you PHP?







    ;-P

-- 
</Daniel P. Brown>
http://www.parasane.net/ [New Look]
[EMAIL PROTECTED] || [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Daniel Brown wrote:
On Tue, Oct 21, 2008 at 11:31 AM, Robert Cummings <[EMAIL PROTECTED]> wrote:
You must be new around here... Shirley!

    Yes, brand new.  This is only my second post --- and only the
third email I've ever sent in my life.  How do you PHP?







    ;-P


Standing up.

*stang*

(look it up)

--- End Message ---
--- Begin Message ---
Jay Moore wrote:
Daniel Brown wrote:
On Tue, Oct 21, 2008 at 11:31 AM, Robert Cummings <[EMAIL PROTECTED]> wrote:
You must be new around here... Shirley!

    Yes, brand new.  This is only my second post --- and only the
third email I've ever sent in my life.  How do you PHP?







    ;-P


Standing up.

*stang*

(look it up)

Actually, moron, it's called a "sting"; not a "stang".

http://www.nationmaster.com/encyclopedia/Sting-%28percussion%29

--- End Message ---
--- Begin Message ---
Daniel Brown schreef:
> On Tue, Oct 21, 2008 at 4:26 AM, Brennon Bortz <[EMAIL PROTECTED]> wrote:
>> Actually, speaking as someone now living in the UK, your low end is LESS
>> than minimum wage here.  Rather insulting, if you ask me...
> 
>     Simple advice then: delete the message and don't reply.

and rob myself of the sport? your no fun since your married Shirley ;-)

> 


--- End Message ---
--- Begin Message ---
Jay Moore schreef:
> Jay Moore wrote:
>> Daniel Brown wrote:
>>> On Tue, Oct 21, 2008 at 11:31 AM, Robert Cummings
>>> <[EMAIL PROTECTED]> wrote:
>>>> You must be new around here... Shirley!
>>>
>>>     Yes, brand new.  This is only my second post --- and only the
>>> third email I've ever sent in my life.  How do you PHP?
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>     ;-P
>>>
>>
>> Standing up.
>>
>> *stang*
>>
>> (look it up)
> 
> Actually, moron, it's called a "sting"; not a "stang".
> 
> http://www.nationmaster.com/encyclopedia/Sting-%28percussion%29

I love the way you talk down to yourself :-P

you want one of these (more fun with the sound on):

http://instantrimshot.com/

> 


--- End Message ---
--- Begin Message ---
On Tue, Oct 21, 2008 at 12:03 PM, Jochem Maas <[EMAIL PROTECTED]> wrote:
>
> and rob myself of the sport? your no fun since your married Shirley ;-)

    Coincidentally, that's exactly what my wife says.

-- 
</Daniel P. Brown>
http://www.parasane.net/ [New Look]
[EMAIL PROTECTED] || [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Daniel Brown schreef:
> On Tue, Oct 21, 2008 at 12:03 PM, Jochem Maas <[EMAIL PROTECTED]> wrote:
>> and rob myself of the sport? your no fun since your married Shirley ;-)
> 
>     Coincidentally, that's exactly what my wife says.

your wife calls you Shirley? your definitely doing *something* wrong ... maybe 
take off the
dress. :-P

> 


--- End Message ---
--- Begin Message ---
I'm 16 years old and have a steady income for the last 3 month as PHP
developer company in Israel which pays me almost doubled then your high rate
(if you convert it from Israeli Shequl to $). I wouldn't work for less than
20$ per hour - that's for sure.

I don't think your will find a good programmer outside India in those rates.
Although on the other hand I know teenagers in Israel who would like to take
this project ;)

Wishing you luck in the journey after your desired 15$ programmer,
Nitsan

On Tue, Oct 21, 2008 at 4:46 PM, Rene Veerman <[EMAIL PROTECTED]> wrote:

> Daniel Brown wrote:
>
>> On Tue, Oct 21, 2008 at 4:26 AM, Brennon Bortz <[EMAIL PROTECTED]>
>> wrote:
>>
>>
>>> Actually, speaking as someone now living in the UK, your low end is LESS
>>> than minimum wage here.  Rather insulting, if you ask me...
>>>
>>>
>>
>>    Simple advice then: delete the message and don't reply.
>>
>>
>>
> Andy deserves to know his current offer is kinda insulting :D
>
> Consider plz that if a job is easy, i'd be done sooner. So i'd make even
> less..
> The offer really only is fair to a noob php-er ;-)
>
> So you might get a 15 year old to do it, if its an easy of a job with a
> technical director giving him coding guidelines..
> They might be happy with the $15/h.
> A talented 17 year old would want $20 at least, or he aint talented :)
>
> If you plan to do many of these type of tasks, and will do them for years
> to come, it might be cheaper to have a $50/h programmer take a look at
> building something re-usable, with an interface for non-techies to describe
> your forms and databases.
> With something re-usable, if properly written and self-documented, you have
> a more solid base for your business operations, and can distribute
> improvements to all your clients when they become available.
> I've gotta add that there might be many hours involved depending on the
> complexity of the data and ways of displaying it. I guess you could start
> with the types of operations that happen a lot, grouped by similarity.
> Give us a few examples and i can tell you if it's possible to create
> something re-usable in a short time..
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
> True, but then my permission / auth / workflow schema defines all that. the
> user won't like have that permission, the request will be logged and nothing
> is ever deleted from the app in any case since I only allow soft (record
> level flag ) deletes to ensure data integrity

I agree with Bastien here. If you can't trust your authorized users
then don't authorize them to delete entries. I would also recommend
some kind of access control to lower the risk of a complete data loss.
Use HTTPS to prevent man in the middle attacks.

--- End Message ---
--- Begin Message ---
On Tue, Oct 21, 2008 at 5:12 AM, Yeti <[EMAIL PROTECTED]> wrote:
>> True, but then my permission / auth / workflow schema defines all that. the
>> user won't like have that permission, the request will be logged and nothing
>> is ever deleted from the app in any case since I only allow soft (record
>> level flag ) deletes to ensure data integrity
>
> I agree with Bastien here. If you can't trust your authorized users
> then don't authorize them to delete entries. I would also recommend
> some kind of access control to lower the risk of a complete data loss.
> Use HTTPS to prevent man in the middle attacks.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

That is a bit overkill going https for everything.  If you just make
ajax requests behave the same way as a normal direct hit, you'll be
fine.  One of the problems with ajax stuff is that sometimes we forget
to validate each request validating the user making the request and
the action they're performing.  It's quite easy to just assume the
request hasn't been changed at all since it is buried behind code.
Everyone's guilty of this at one point or another.  Just look at this
google docs example. [1]

I'd recommend reading up on the concepts of authentication and
authorization.  Authentication just makes sure you're logged in.
Authorization makes sure you can perform a specific action.  Once you
have that you'll be able to answer the original question.

Of course you can also go into other types of things like creating
signatures for each request and tokens (which should be done), but
start at the beginning and work at it.  I'd also recommend installing
something like httplive headers or firebug just to get an idea of what
is going over the wire.  It might make things more obvious.

[1] http://xs-sniper.com/blog/2007/09/28/all-your-google-docs-are-belong-to-us/

--- End Message ---
--- Begin Message ---
Dave Kok schreef:
> Hi Everyone,
> 
> I have a class with some callback functions and a class that should call
> them. The class with the callback functions initializes the array with
> the callbacks and hands it down to the other class that should call
> them. PHP however forces the callback functions to be public, so the
> other class can call them. This seems rather strange as the callback
> functions have no meaning when invoked arbitrarily. So I was wondering
> whether I am doing something wrong. Could someone comment?

callbacks run from the global scope so whatever is called must be available
i.e. public in the case of methods. so your not doing anything wrong.

if the methods are not static you might consider making the ctor of the
'callback class' private so that only the class itself can create an instance
of itself ... which it then does when creating the callback definitions that
it passes to the class using the callbacks ... so the second class then has
an object on which it can call the relevant functions but no other code
is able to create an instance of the callback class and thereby screw with the
functions designed only to be used in the callback situation.

but that's all probably overkill ... make them public, document their usage, 
done.

> 
> Regards,
> Dave
> 


--- End Message ---
--- Begin Message ---
OP = original poster (in this case I guess)
http://acronyms.thefreedictionary.com/OP

So it's all about making code readable and probably easier to maintain
(even people unfamiliar with the script).
Doesn't that render the ternary operator IF-statement unnecessary?
Have I been totally wrong using it in countless scripts of mine
(always thought it's a neat way to do if )?
Somebody please tell me that I do not have to rewrite my code base
now, since I care about security.

Btw. PHP's ternary inconsistency here ..
http://en.wikipedia.org/wiki/%3F:#Inconsistency_of_implementations

And how about this ..
switch(isset($_GET['search'])) {
        case true:
        $search = $_GET['search'];
        break 1;

        default:
        $search = '';
}

--- End Message ---
--- Begin Message ---
tedd schreef:
> At 6:37 AM -0700 10/20/08, Lamp Lists wrote:
>> ----- Original Message ----
>>
>> From: tedd <[EMAIL PROTECTED]>
>> To: Lamp Lists <[EMAIL PROTECTED]>; [EMAIL PROTECTED]
>> Sent: Monday, October 20, 2008 8:25:50 AM
>> Subject: Re: [PHP] what's the difference in the following code?
>>
>> At 10:58 AM -0700 10/17/08, Lamp Lists wrote:
>>  >I'm reading "Essential PHP Security" by Chris Shiflett.
>>>
>>  >on the very beginning, page 5 & 6, if I got it correct, he said this
>>  >is not good:
> 
> NO, you did not get it correct.
> 
> 
>> how it's so obvious? I can't see it either?
>>
>> -ll
> 
> 
> Re-read those paragraphs.
> 
> He was not telling you that one way was better than the other. He WAS
> saying that one way showed the tainted variable more obvious than the
> other -- that's all.
> 
> I hate it when people take things out of context and misquote others.
> Chris did not say that one way was better, or different, than the other.
> But rather he used two sets of code to illustrate a point.

seems to me the point being illustrates is not at all objective in it's
premise. I find the the ternary syntax easier to read/grok than the 3 liner.

in both cases you need to understand the 'if' context to see when the
variable is tainted.

all that can be said is that one way is more obvious that the other to *Chris*,
which doesn't do anybody but Chris much good ... obviously it's a rather silly
point ... the useful parts of Chris' work revolve around where he explains
*how* to validate/cleanse the tainted value ... extracting the goodness is a
matter of evaluating and possibly disregarding statements/information which are
secondary and/or irrelevant.

> 
> Again, re-read those paragraphs.
> 
> Cheers,
> 
> tedd
> 


--- End Message ---
--- Begin Message ---
At 2:44 AM -0700 10/21/08, Yeti wrote:
Somebody please tell me that I do not have to rewrite my code base
now, since I care about security.

You do not have to rewrite your code because you use ternary operators! Nobody said that.

Again, Chris was not saying that it was the use of the operator that was a security issue, but rather its use could obscure the fact that the operator, as in the case he provided, could produce a tainted variable.

Perhaps I've confused what Chris tried to say -- so, I suggest that everyone who is interested in arguing this point further buy Chris' book and read it for themselves.

Cheers,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
representations emphasizing leksr matching thirds painfully wakesleep 
ekswiezeezeewie accompanied

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Amy [mailto:[EMAIL PROTECTED]
> Sent: 21 October 2008 11:58
> To: [EMAIL PROTECTED]
> Subject: [PHP] Politics
> 
> 
> representations emphasizing leksr matching thirds painfully wakesleep
> ekswiezeezeewie accompanied

Have you tried restarting Apache? :)

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


--- End Message ---
--- Begin Message ---
Chrome wrote:
>> -----Original Message-----
>> From: Amy [mailto:[EMAIL PROTECTED]
>> Sent: 21 October 2008 11:58
>> To: [EMAIL PROTECTED]
>> Subject: [PHP] Politics
>>
>>
>> representations emphasizing leksr matching thirds painfully wakesleep
>> ekswiezeezeewie accompanied
> 
> Have you tried restarting Apache? :)

no, no, no, she said "painfully", she must be using IIS... :)

Try upgrading all your drivers and then restarting...

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

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare


--- End Message ---
--- Begin Message ---
On Tue, 2008-10-21 at 08:01 -0700, Jim Lucas wrote:
> Chrome wrote:
> >> -----Original Message-----
> >> From: Amy [mailto:[EMAIL PROTECTED]
> >> Sent: 21 October 2008 11:58
> >> To: [EMAIL PROTECTED]
> >> Subject: [PHP] Politics
> >>
> >>
> >> representations emphasizing leksr matching thirds painfully wakesleep
> >> ekswiezeezeewie accompanied
> > 
> > Have you tried restarting Apache? :)
> 
> no, no, no, she said "painfully", she must be using IIS... :)
> 
> Try upgrading all your drivers and then restarting...

Hmmm, I'm not so sure. I think it's a php.ini problem where
register_globals=on is required to make the code work.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


--- End Message ---
--- Begin Message ---
Robert Cummings wrote:
On Tue, 2008-10-21 at 08:01 -0700, Jim Lucas wrote:
Chrome wrote:
-----Original Message-----
From: Amy [mailto:[EMAIL PROTECTED]
Sent: 21 October 2008 11:58
To: [EMAIL PROTECTED]
Subject: [PHP] Politics


representations emphasizing leksr matching thirds painfully wakesleep
ekswiezeezeewie accompanied
Have you tried restarting Apache? :)
no, no, no, she said "painfully", she must be using IIS... :)

Try upgrading all your drivers and then restarting...

Hmmm, I'm not so sure. I think it's a php.ini problem where
register_globals=on is required to make the code work.

Cheers,
Rob.

I think they need a new dictionary / word list or at least some form of lexicographic analysis.

Oh yeah and a point.

--
nathan ( [EMAIL PROTECTED] )
{
  Senior Web Developer
  php + java + flex + xmpp + xml + ecmascript
  web development edinburgh | http://kraya.co.uk/
}

--- End Message ---
--- Begin Message ---
---- Nathan Rixham <[EMAIL PROTECTED]> wrote: 
> Robert Cummings wrote:
> > On Tue, 2008-10-21 at 08:01 -0700, Jim Lucas wrote:
> >> Chrome wrote:
> >>>> -----Original Message-----
> >>>> From: Amy [mailto:[EMAIL PROTECTED]
> >>>> Sent: 21 October 2008 11:58
> >>>> To: [EMAIL PROTECTED]
> >>>> Subject: [PHP] Politics
> >>>>
> >>>>
> >>>> representations emphasizing leksr matching thirds painfully wakesleep
> >>>> ekswiezeezeewie accompanied
> >>> Have you tried restarting Apache? :)
> >> no, no, no, she said "painfully", she must be using IIS... :)
> >>
> >> Try upgrading all your drivers and then restarting...
> > 
> > Hmmm, I'm not so sure. I think it's a php.ini problem where
> > register_globals=on is required to make the code work.
> > 
> I think they need a new dictionary / word list or at least some form of 
> lexicographic analysis.
> 
> Oh yeah and a point.
> 

http://www.youtube.com/watch?v=IF2RYhNhBdw&feature=related

And...

http://www.youtube.com/watch?v=B_kvgD_Mv-M

:)


--- End Message ---
--- Begin Message ---
Amy schreef:
> representations emphasizing leksr matching thirds painfully wakesleep 
> ekswiezeezeewie accompanied
> 

incidently. the word politics ... seemingly a combination of 'poli' (aka many)
and 'tics' (aka 'bloodsucking wotsits') ... all too apt.


--- End Message ---
--- Begin Message ---


Hi, Guys:  Sorry about bothering everyone about this problem.  It seems strange 
that now I try to create some arguments after what I tried to execute, it does 
not give me a thing. 
  I get no error messages. No output file, and only a blank screen when I put 
the following snippet into the PHP file. 
 $a= shell_exec("./test.exe -m$market -d$length");
  echo $a;
 What is odd is, I tired doing this by using a dos command prompt, it works 
entirely. Could anyone please give me a hint on what problem I am having now? 
Thanks for the heads up. 

Alice
> CC: [EMAIL PROTECTED]
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Date: Mon, 20 Oct 2008 21:51:23 +0100
> Subject: Re: [PHP] How to Execute Exe File from PHP
> 
> On 20 Oct 2008, at 21:47, Alice Wei wrote:
> >  Has anyone tried to execute an .exe file from PHP? I am
> > currently stuck in a situation where I cannot execute the script, and
> > all I am getting is a blank screen.
> >
> > This is my code snippet used to execute the file:
> >
> >  //execute program
> > $a = @shell_exec("C:\Inetpub\wwwroot\test/test.exe");
> > echo $a;
> >
> > The
> > program above is supposed to generate a file, so I can read from it. I
> > have previously set up a file, and I have no problems with reading the
> > file.
> > Can anyone please help me with the possible command to
> > execute the script? I tried CURL too, but it does not seem to be
> > working either.
> 
> 1) Remove the @ before the function call, it's hiding the error message!
> 
> 2) \ needs to be escaped within double quotes, try replacing each one  
> with \\
> 
> 3) Why are you mixing \'s and /'s? Dunno whether it matters, but it's  
> definitely better to stick to one or the other.
> 
> 4) There is no 4!
> 
> -Stut
> 
> -- 
> http://stut.net/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

_________________________________________________________________
Use Messenger to talk to your IM friends, even those on Yahoo!
http://ideas.live.com/programpage.aspx?versionId=7adb59de-a857-45ba-81cc-685ee3e858fe

--- End Message ---
--- Begin Message ---
Hi Alice

First, make sure about the value on $market and $length. Yeah, it's simple.

 echo $market;
 echo $length;
 $a= shell_exec("./test.exe -m$market -d$length");
 echo $a;

Second: "http://www.chipmunkninja.com/Program-Execution-in-PHP:-exec-m@@";
A good explanation to use external commands (thanks chip!)

Third: give us more information: PHP version, OS. Maybe this time can be
useless, but important for future questions.

(sorry about my poor english)




2008/10/21 Alice Wei <[EMAIL PROTECTED]>

>
>
>
> Hi, Guys:  Sorry about bothering everyone about this problem.  It seems
> strange that now I try to create some arguments after what I tried to
> execute, it does not give me a thing.
>  I get no error messages. No output file, and only a blank screen when I
> put the following snippet into the PHP file.
>  $a= shell_exec("./test.exe -m$market -d$length");
>  echo $a;
>  What is odd is, I tired doing this by using a dos command prompt, it works
> entirely. Could anyone please give me a hint on what problem I am having
> now?
> Thanks for the heads up.
>
> Alice
> > CC: [EMAIL PROTECTED]
> > From: [EMAIL PROTECTED]
> > To: [EMAIL PROTECTED]
> > Date: Mon, 20 Oct 2008 21:51:23 +0100
> > Subject: Re: [PHP] How to Execute Exe File from PHP
> >
> > On 20 Oct 2008, at 21:47, Alice Wei wrote:
> > >  Has anyone tried to execute an .exe file from PHP? I am
> > > currently stuck in a situation where I cannot execute the script, and
> > > all I am getting is a blank screen.
> > >
> > > This is my code snippet used to execute the file:
> > >
> > >  //execute program
> > > $a = @shell_exec("C:\Inetpub\wwwroot\test/test.exe");
> > > echo $a;
> > >
> > > The
> > > program above is supposed to generate a file, so I can read from it. I
> > > have previously set up a file, and I have no problems with reading the
> > > file.
> > > Can anyone please help me with the possible command to
> > > execute the script? I tried CURL too, but it does not seem to be
> > > working either.
> >
> > 1) Remove the @ before the function call, it's hiding the error message!
> >
> > 2) \ needs to be escaped within double quotes, try replacing each one
> > with \\
> >
> > 3) Why are you mixing \'s and /'s? Dunno whether it matters, but it's
> > definitely better to stick to one or the other.
> >
> > 4) There is no 4!
> >
> > -Stut
> >
> > --
> > http://stut.net/
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> _________________________________________________________________
> Use Messenger to talk to your IM friends, even those on Yahoo!
>
> http://ideas.live.com/programpage.aspx?versionId=7adb59de-a857-45ba-81cc-685ee3e858fe

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

in my web application (as quite all web applications) i have a lot of
tables. I mean by table the <table> tag with for sure some data displayed in
it from SQL requests.
To not have to write the whole code every time i was thinking to make a
class that :
- will manage the whole design (color, images, width, height of cells,...)
- will manage the paging (to limit the data transfer from DB server to
client browser)
- will manage the sorting and search (classic and advanced) of data based on
some online built query (user should be able to do something like field1 =
value 1 OR field 1 = value2 AND field4 = "a")

therefore i would like to know if to encapsulate everything in PHP classes
(integrating javascript and css) will be the best approach or not ?
because i would like to keep it as simple as possible in order to
redistribute later this package.

or should i mix javascript "classes" and PHP classes ?

thx.

-- 
Alain
------------------------------------
Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

--- End Message ---
--- Begin Message ---
Alain Roger wrote:
Hi,

in my web application (as quite all web applications) i have a lot of
tables. I mean by table the <table> tag with for sure some data displayed in
it from SQL requests.
To not have to write the whole code every time i was thinking to make a
class that :
- will manage the whole design (color, images, width, height of cells,...)
- will manage the paging (to limit the data transfer from DB server to
client browser)
- will manage the sorting and search (classic and advanced) of data based on
some online built query (user should be able to do something like field1 =
value 1 OR field 1 = value2 AND field4 = "a")

therefore i would like to know if to encapsulate everything in PHP classes
(integrating javascript and css) will be the best approach or not ?
because i would like to keep it as simple as possible in order to
redistribute later this package.

or should i mix javascript "classes" and PHP classes ?

thx.


I'd suggest two classes; one(php) which controls the data and outputting it as a table, the other (clientside) which controls the display of the table. Everything directly relating to CSS should be in CSS with an optional 3rd php class/app for generating or controlling the css.

Maybe something like YUI Tables would help you in your quest.

(dare I say it (as always) - Flex 3 is great for this kind of thing..)

Regards

--
nathan ( [EMAIL PROTECTED] )
{
  Senior Web Developer
  php + java + flex + xmpp + xml + ecmascript
  web development edinburgh | http://kraya.co.uk/
}

--- End Message ---
--- Begin Message ---
Until recently, I've thought that display_errors in DEV was "good"



But as soon as you move into Ajax Web 2.0 world, it really doesn't cut it.



You'll never see the E_NOTICE and E_WARNING errors for Ajax, probably, and the 
whole thing might "just work" but you'll have plenty of buggy code.



I think it's time for the PHP team to recommend log_errors across the board.



What do you think?



--- End Message ---
--- Begin Message ---
On Tue, 2008-10-21 at 16:33 +0000, [EMAIL PROTECTED] wrote:
> Until recently, I've thought that display_errors in DEV was "good"
> 
> But as soon as you move into Ajax Web 2.0 world, it really doesn't cut it.
> 
> You'll never see the E_NOTICE and E_WARNING errors for Ajax, probably, and 
> the whole thing might "just work" but you'll have plenty of buggy code.
> 
> I think it's time for the PHP team to recommend log_errors across the board.
> 
> What do you think?

Have a simple switch for ajax requests so errors to go into a file... or
send the errors along as part of the ajax request and have the ajax code
popup a warning that is readable. Or whatever :)

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


--- End Message ---
--- Begin Message ---
On Tue, Oct 21, 2008 at 12:33 PM,  <[EMAIL PROTECTED]> wrote:
>
> Until recently, I've thought that display_errors in DEV was "good"
>
> But as soon as you move into Ajax Web 2.0 world, it really doesn't cut it.
>
> You'll never see the E_NOTICE and E_WARNING errors for Ajax, probably, and 
> the whole thing might "just work" but you'll have plenty of buggy code.
>
> I think it's time for the PHP team to recommend log_errors across the board.
>
> What do you think?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

This has bit me in the bum several times.  What I do though is put a
try catch around my json response parsing and if something goes wrong
then I show some error to the user.  Then with firebug I can see the
raw php error.  So I guess I don't care either way since I'm covered.

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 21, 2008 11:33 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] display_errors in DEV
> 
> 
> Until recently, I've thought that display_errors in DEV was "good"
> 
> But as soon as you move into Ajax Web 2.0 world, it really doesn't cut
> it.
> 
> You'll never see the E_NOTICE and E_WARNING errors for Ajax, probably,
> and the whole thing might "just work" but you'll have plenty of buggy
> code.
> 
> I think it's time for the PHP team to recommend log_errors across the
> board.
> 
> What do you think?

Report via Javascript exceptions. If you're debugging with your browser
(i.e., Web Developer plug-in for Firefox, or even the plain, built-in
debuggers will do) you should be able to view the exception's message
and maybe even a stack trace if you set it up right.

Todd Boyd
Web Programmer

--- End Message ---
--- Begin Message ---
anyone know whether running ZendOptimizer + APC simultaneously still causes 
allsorts
of problems ... I know it did in the past but I can't find any very recent 
stuff about the
issues online.

--- End Message ---

Reply via email to