[PHP] define()

2012-06-15 Thread Karl DeSaulniers
Quick question phprz. Is it ok to put a token inside a define() statement? IE: define('TOKEN', $sometoken); I guess what I am really after is if this can be read by a hacker? I may be misguided as to what define()'s parameters are. Once you define something it becomes a server variable? And se

Re: [PHP] else if vs switch

2012-06-15 Thread James Yerge
On 06/15/2012 06:44 PM, April Mains wrote: > Ah yes that's it. > > Thank you for your help. Have a good weekend. > > April > > On 2012-06-15, at 4:29 PM, Joshua Kehn wrote: > >> Way easier to just use a map. >> >> $mapping = array( >> 'Calgary' => "abc@emailaddress", >> 'Brooks' => "def@

Re: [PHP] else if vs switch

2012-06-15 Thread April Mains
Ah yes that's it. Thank you for your help. Have a good weekend. April On 2012-06-15, at 4:29 PM, Joshua Kehn wrote: > Way easier to just use a map. > > $mapping = array( > 'Calgary' => "abc@emailaddress", > 'Brooks' => "def@emailaddress", > // etc > ); > $toaddress = $mappin

Re: [PHP] else if vs switch

2012-06-15 Thread Joshua Kehn
Way easier to just use a map. $mapping = array( 'Calgary' => "abc@emailaddress", 'Brooks' => "def@emailaddress", // etc ); $toaddress = $mapping[$city]; Regards, –Josh Joshua Kehn | @joshkehn http://joshuakehn.com On Jun 15, 2012, at

[PHP] else if vs switch

2012-06-15 Thread April Mains
I have 25 cities and am currently using the following to set the $toaddress for submitting student pre-registration forms based on the city selected: if ($city == "Calgary") { $toaddress = "abc@emailaddress"; } elseif ($city == "Brooks") { $toaddress = "def@emailaddress"; and so on. Wo

Re: [PHP] Re: php form action breaks script

2012-06-15 Thread Al
It is a small price to pay for large block, especially if the text has any quotes. Personally, I can't keep them straight and delimit them, etc. Heredoc saves all that such stuff. $insert= MY_DEFINED; echo << On 06/15/2012 06:35 AM, Jim Giner wrote: Hear, Hear for heredocs. The only way to c

Re: [PHP] Re: php form action breaks script

2012-06-15 Thread ma...@behnke.biz
Jim Lucas hat am 15. Juni 2012 um 18:39 geschrieben: > On 06/15/2012 06:35 AM, Jim Giner wrote: > > Hear, Hear for heredocs. The only way to code up your html. Took me a few > > months to discover it and haven't looked back since. > > > > > > > > The only problem I have with HEREDOC is I cann

Re: [PHP] Re: php form action breaks script

2012-06-15 Thread Jim Lucas
On 06/15/2012 06:35 AM, Jim Giner wrote: Hear, Hear for heredocs. The only way to code up your html. Took me a few months to discover it and haven't looked back since. The only problem I have with HEREDOC is I cannot use constants within them. -- Jim Lucas http://www.cmsws.com/ http://ww

[PHP] Re: php form action breaks script

2012-06-15 Thread Jim Giner
Hear, Hear for heredocs. The only way to code up your html. Took me a few months to discover it and haven't looked back since. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: php form action breaks script

2012-06-15 Thread ma...@behnke.biz
Al hat am 15. Juni 2012 um 14:29 geschrieben: > > > On 6/14/2012 7:28 PM, Tim Dunphy wrote: > > However if I change the form action to this, it breaks the page > > resulting in a white screen of death: error_reporting(E_ALL); ini_set('display_errors', 'On'); And what is the error message? -

[PHP] Re: php form action breaks script

2012-06-15 Thread Al
On 6/14/2012 7:28 PM, Tim Dunphy wrote: Hello list, I was just wondering if I could get some opinions on a snippet of code which breaks a php web page. First the working code which is basically an html form being echoed by php: if ($output_form) { echo ' Subject of email: B

RE: [PHP] global array

2012-06-15 Thread ma...@behnke.biz
Jeff Burcher hat am 14. Juni 2012 um 14:23 geschrieben: > You're a genius!! Thank you. Uppercase 'R', sheesh. PHP is sooo picky. I > worked for two days trying to figure that one out. Anyway, for future > reference, you can pass the entire array as a variable like that?? and do you > know if th