Re: [PHP] $POST and $_SESSION

2012-03-17 Thread sono-io
On Mar 15, 2012, at 11:52 AM, Stuart Dallas wrote: > Change your php.ini settings to log to a file and set display_errors to off. Sometimes when you ask a stupid question you end up getting a brilliant answer. I had no idea about any of this until I received your response, which got me

Re: [PHP] $POST and $_SESSION

2012-03-15 Thread Adam Richardson
On Thu, Mar 15, 2012 at 11:04 AM, Tedd Sperling wrote: > Hi gang: > > What's a better/shorter way to write this? > > $first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] : null; > $first_name = isset($_POST['first_name']) ? $_POST['first_name'] : > $first_name; > $_SESSION['first_name'

Re: [PHP] $POST and $_SESSION

2012-03-15 Thread Ashley Sheridan
On Thu, 2012-03-15 at 18:52 +, Stuart Dallas wrote: > On 15 Mar 2012, at 18:48, sono...@fannullone.us wrote: > > > On Mar 15, 2012, at 11:35 AM, Daniel Brown wrote: > > > >> On Thu, Mar 15, 2012 at 14:31, Stuart Dallas wrote: > >>> > >>> The @ prefix is banned from all code I go anywhere n

Re: [PHP] $POST and $_SESSION

2012-03-15 Thread Stuart Dallas
On 15 Mar 2012, at 18:48, sono...@fannullone.us wrote: > On Mar 15, 2012, at 11:35 AM, Daniel Brown wrote: > >> On Thu, Mar 15, 2012 at 14:31, Stuart Dallas wrote: >>> >>> The @ prefix is banned from all code I go anywhere near - it's evil! >> >> For the most part, I agree with you, > >

Re: [PHP] $POST and $_SESSION

2012-03-15 Thread sono-io
On Mar 15, 2012, at 11:35 AM, Daniel Brown wrote: > On Thu, Mar 15, 2012 at 14:31, Stuart Dallas wrote: >> >> The @ prefix is banned from all code I go anywhere near - it's evil! > >For the most part, I agree with you, Hmm... I use it on my web pages (unless I'm testing) so that i

Re: [PHP] $POST and $_SESSION

2012-03-15 Thread Stuart Dallas
On 15 Mar 2012, at 18:35, Daniel Brown wrote: > On Thu, Mar 15, 2012 at 14:31, Stuart Dallas wrote: >> >> The @ prefix is banned from all code I go anywhere near - it's evil! I've >> used the following 'V' function for a long time, primarily for accessing the >> superglobals but it works for a

Re: [PHP] $POST and $_SESSION

2012-03-15 Thread Daniel Brown
On Thu, Mar 15, 2012 at 14:31, Stuart Dallas wrote: > > The @ prefix is banned from all code I go anywhere near - it's evil! I've > used the following 'V' function for a long time, primarily for accessing the > superglobals but it works for any array. > > session_start(); > $_SESSION['first_nam

Re: [PHP] $POST and $_SESSION

2012-03-15 Thread Stuart Dallas
On 15 Mar 2012, at 18:31, Stuart Dallas wrote: > On 15 Mar 2012, at 15:13, Daniel Brown wrote: > >> On Thu, Mar 15, 2012 at 11:04, Tedd Sperling wrote: >>> Hi gang: >>> >>> What's a better/shorter way to write this? >>> >>> $first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] : null

Re: [PHP] $POST and $_SESSION

2012-03-15 Thread Stuart Dallas
On 15 Mar 2012, at 15:13, Daniel Brown wrote: > On Thu, Mar 15, 2012 at 11:04, Tedd Sperling wrote: >> Hi gang: >> >> What's a better/shorter way to write this? >> >> $first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] : null; >> $first_name = isset($_POST['first_name']) ? $_POST['f

Re: [PHP] $POST and $_SESSION

2012-03-15 Thread Michael Save
How about this? $first_name = @$_POST['first_name'] or $first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] : null; Thanks, Michael On Fri, Mar 16, 2012 at 2:13 AM, Daniel Brown wrote: > On Thu, Mar 15, 2012 at 11:04, Tedd Sperling wrote: >> Hi gang: >> >> What's a better/shorter wa

Re: [PHP] $POST and $_SESSION

2012-03-15 Thread Daniel Brown
On Thu, Mar 15, 2012 at 11:04, Tedd Sperling wrote: > Hi gang: > > What's a better/shorter way to write this? > > $first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] : null; > $first_name = isset($_POST['first_name']) ? $_POST['first_name'] : > $first_name; > $_SESSION['first_name'] =

[PHP] $POST and $_SESSION

2012-03-15 Thread Tedd Sperling
Hi gang: What's a better/shorter way to write this? $first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] : null; $first_name = isset($_POST['first_name']) ? $_POST['first_name'] : $first_name; $_SESSION['first_name'] = $first_name; Cheers, tedd _