Re: [nyphp-talk] Tamperproof URLs and PHP slides posted

2007-12-13 Thread Rob Marscher
I wrote a couple flash client / php server casino games. I didn't actually do the flash client part (takes me forever to produce nice looking stuff with that app) but I did come up with the api. It used a token and timestamps that were hashed with a secret key - pretty similar to the way

Re: [nyphp-talk] question:upload picture to the server

2007-12-13 Thread Nasir Zubair
Hi, The easiest way I can think of is to upload a PHP document with the following line: Then access that file from a browser. It will tell you the actual path top the file on the server. something like "/home/user/public_html/file.php" You can work out path to your photo directory from there.

[nyphp-talk] question:upload picture to the server

2007-12-13 Thread chad qian
I use "godaddy" as web hosting.I access web files through FTP and I access mysql database through phpMyAdmin(through IE). Now,I want to upload pictures to the server side. My problem is: how to define the picture path when I do php coding?I access the mysql database through phpMyAdmin(IE).Mysql

Re: [nyphp-talk] More questions about working with forms

2007-12-13 Thread John Campbell
> Can you elaborate on this? I use sessions very often and find them to be very > useful. After all, they are there to be used, so why not use them when appli cable? They do have applications, but most people find way too many applications. 1) Sessions often break a lot of things, typically bookm

Re: [nyphp-talk] More questions about working with forms

2007-12-13 Thread David Krings
John Campbell wrote: > In my opinion, sessions should be used very sparingly. Can you elaborate on this? I use sessions very often and find them to be very useful. After all, they are there to be used, so why not use them when applicable? David ___

Re: [nyphp-talk] OOP Books & Resources

2007-12-13 Thread Michael B Allen
On 12/11/07, Ben Sgro <[EMAIL PROTECTED]> wrote: > Hello, > > A while back I asked an OOP related question. Brian D suggested: > > If you're just starting out in the PHP5 OOP world, I highly recommend > Zandstra's "PHP 5 Objects, Patterns, and Practice." I promise you it's > worth the $20. > > Whic

Re: [nyphp-talk] OOP Books & Resources

2007-12-13 Thread Ben Sgro
Michael, http://vig.prenhall.com/catalog/academic/product/0,1144,013205,00.html Is that it? - Ben Michael B Allen wrote: On 12/11/07, Ben Sgro <[EMAIL PROTECTED]> wrote: Hello, A while back I asked an OOP related question. Brian D suggested: If you're just starting out in the PHP5 O

Re: [nyphp-talk] OOP Books & Resources

2007-12-13 Thread Ben Sgro
Hey Michael, Good points. As I said before, I like that book I got from work, "The object oriented thought process". I will take a look at the Java book your recommending. I do like UML though, er, well I at least like the concept of it. I'd like to have the ability to map classes out (but

Re: [nyphp-talk] More questions about working with forms

2007-12-13 Thread Ben Sgro
John, That's easy to say, but unless your building the app as RESTful or something, then the easiest way to accomplish it IS to store it in a session. I am not sure what you are trying to do, but maybe you need hidden form fields to retain state across requests. Sessions sound easier. - Be

Re: [nyphp-talk] More questions about working with forms

2007-12-13 Thread John Campbell
> Is it as simple as stashing away the object in a hidden field? or > maybe in some $_SESSION variable? Don't use sessions. You need to embrace the atomic nature of a web request, and just reconstruct the object on each request. Each request should have all of the information required to recons

Re: [nyphp-talk] More questions about working with forms

2007-12-13 Thread Donald J Organ IV
Yes, just remember to unserialize it when you want to use it. Ben Sgro wrote: Hello, Can you serialize the object and stick it in the $_SESSION? - Ben Tony Furnivall wrote: Thanks to those who replied earlier. I've moved on a little, and now am wondering how to make an object 'persist' betwe

Re: [nyphp-talk] More questions about working with forms

2007-12-13 Thread Ben Sgro
Hello, Can you serialize the object and stick it in the $_SESSION? - Ben Tony Furnivall wrote: Thanks to those who replied earlier. I've moved on a little, and now am wondering how to make an object 'persist' between activations of an action script, associated with a button on the form. The

[nyphp-talk] More questions about working with forms

2007-12-13 Thread Tony Furnivall
Thanks to those who replied earlier. I've moved on a little, and now am wondering how to make an object 'persist' between activations of an action script, associated with a button on the form. The model I have (the common thread of most replies) is something like this (not in php, but in reaso

Re: [nyphp-talk] Callback syntax

2007-12-13 Thread Brian D.
> call_user_func() treats everything as a static method and will not work. While the variable function might work, could you clarify what you mean by 'treats everything as a static method'? I just ran this:schmoo = $var; } function getSchmoo( ) {

Re: [nyphp-talk] OOP Books & Resources

2007-12-13 Thread Brian D.
> Once you get the basics down, I'd recommend looking at design > patterns. I happen to like "Head First Design Patterns". You either > love this series or hate it. This also includes examples in Java. > I second the recommendation for "Head First Design Patterns." I might be a little biased, thou

Re: [nyphp-talk] OOP Books & Resources

2007-12-13 Thread Brian D.
> Once you get the basics down, I'd recommend looking at design > patterns. I happen to like "Head First Design Patterns". You either > love this series or hate it. This also includes examples in Java. > I second the recommendation for "Head First Design Patterns." I might be a little biased, thou

Re: [nyphp-talk] Do you use Pretty URLs

2007-12-13 Thread David Krings
Cliff Hirsch wrote: > You bring up a good point. Perhaps the place to begin is the beginning, which is, "what is the point and benefit." Things I have heard: 3. Security. Hides the file.php and param names. Yeah, but I hope you are not solely relying on security by obscurity Sin't changing

Re: [nyphp-talk] Managing form data with PHP

2007-12-13 Thread David Mintz
Once upon a time someone said it was a security risk to echo back $_POST data unconditionally, even if you escape it, and even though you are only showing them the very thing they just submitted to you. But I forget what that risk was. Maybe I misremember. I suppose if someone were to submit a str

Re: [nyphp-talk] Do you use Pretty URLs

2007-12-13 Thread Gary Mort
Cliff Hirsch wrote: > The next big task is making sure that all of the url links are rewritten properly and that. That can be fairly difficult if your links aren't very centralized. I see this as a big assumption on the part of many router/controllers. If you are working in a framework, thing

Re: [nyphp-talk] Do you use Pretty URLs

2007-12-13 Thread Cliff Hirsch
On 12/13/07 2:34 AM, "John Campbell" <[EMAIL PROTECTED]> wrote: >> It seems to me that a more robust method would be to have something like >> /param1/value1/param2/value2/.../paramn/valuen > > Doesn't that defeat the purpose of pretty urls? I though the whole > point was so the url looks like: