[PHP] $_POST vs $_REQUEST

2010-02-22 Thread Slack-Moehrle
Hi All, I have Forms that I submit for processing. I have seen examples of people using either $_POST or $_REQUEST. When would I choose one over the other? Also, I see examples of these being used with and without the single quotes Like: $_POST[j_orderValue] or $_POST['j_orderValue'] Single

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Slack-Moehrle
John, Then if you use a MySQL database you would escape the string like this $tmp = mysql_real_escape_string($_REQUEST['yyy']); mysql_real_escape_string() protect from SQL injection by escaping your string according to what your charset requires. Good point, I should be doing that. But only

[PHP] Close MySQL Result

2010-01-20 Thread Slack-Moehrle
I think I am a dork. How do I close a MySQL result set to free memory? Given something like this: $gsql = Select * from resources where queryName = 'Production';; $myresult = mysql_query($gsql) or die('Cannot execute Query: ' . mysql_error()); $Row = mysql_fetch_assoc($myresult); if

Re: [PHP] Close MySQL Result

2010-01-20 Thread Slack-Moehrle
Daevid, Thanks for the links so I can read up! -ML - Original Message - From: Daevid Vincent dae...@daevid.com To: php-general@lists.php.net Cc: Slack-Moehrle mailingli...@mailnewsrss.com Sent: Wednesday, January 20, 2010 1:24:16 PM Subject: RE: [PHP] Close MySQL Result http

[PHP] PHP has encountered an Access Violation at ***

2010-01-05 Thread Slack-Moehrle
Hi All, Win 2003, PHP 5.2.12 and IIS 6. I have PHP configured as ISSAPI and it is serving PHP pages. When I try a page that requires MySQL I am getting just: PHP has encountered an Access Violation at (and a RANDOM number) What does this mean? I have mysql extension uncommented in php.ini,

[PHP] Calendar/Date

2009-03-17 Thread Jason Todd Slack-Moehrle
Hi All, Does anyone have code and/or advice for how to get get the current week (with a passed current day, say) and what then end date is at Saturday. So take today: Tuesday March 17, 2009 I want to get: Sunday March 15, 2009 Monday March 16, 2009 Tuesday March 17, 2009 Wednesday March

[PHP] password field validation

2009-03-12 Thread Jason Todd Slack-Moehrle
Hi All, I have an input field with type=password. I am trying to do some error checking to see if the user puts a value in after they submit the form (i.e not left it blank) Here is what I have: on form: Password: input id=PASSWORD name=PASSWORD type=password size=15 In PHP error

Re: [PHP] password field validation

2009-03-12 Thread Jason Todd Slack-Moehrle
if (empty($_POST[PASSSWORD])) { $GERROR=TRUE;} If that's a direct copy/paste from your actual code, there is an extra S in PASSWORD. Also, you should enclose the array key in quotes: if (empty($_POST['PASSWORD'])) { $GERROR='TRUE'; } It is official I am a DOPE! Thank you, yes, I did not

[PHP] Daily and Weekly Calendar classes

2009-03-12 Thread Jason Todd Slack-Moehrle
Hi All, Does anyone have classes for creating a nice daily calendar? I can put the data in MySQL and be queried, etc. Something that when I add events to the calendar it puts them in the right time slot, etc, etc. I can do the rest of the coding Free is best! -Jason -- PHP General

[PHP] PHP Content Management

2009-01-29 Thread Jason Todd Slack-Moehrle
Hi All, I am looking for an open-sourced CMS that is PHP/MySQL based. I would like something simple to setup, but also would be good for a storefront as I want to use it for my indie business. Thoughts? -Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] PEAR Help

2008-12-05 Thread Jason Todd Slack-Moehrle
Hi All, I installed PEAR fine. How I need to install OLE and Spreadsheet_Excel_Writer and I dont see how pear install . fails every time with channel errors and not found errors. I have downloaded the .tgz files, but I dont know where to put the contents. Any thoughts? -Jason

[PHP] File Uploads Help!!!

2008-12-05 Thread Jason Todd Slack-Moehrle
Hi All, I am uploading a file and it says it worked, but I dont see it in the directory Here is my code so far: $allowed_ext = array('csv','xls'); $ext = end(explode('.',$_FILES['uploadedfile']['name'])); $ran2 = rand()..; $target = tempUploads/;

Re: [PHP] File Uploads Help!!! --Forgot

2008-12-05 Thread Jason Todd Slack-Moehrle
Here is the output I am printing: 'tempUploads/1425182872.xlsUploaded The File.' What is the issue? -Jason On Dec 5, 2008, at 2:11 PM, Jason Todd Slack-Moehrle wrote: Hi All, I am uploading a file and it says it worked, but I dont see it in the directory Here is my code so far

Re: [PHP] File Uploads Help!!! --Forgot

2008-12-05 Thread Jason Todd Slack-Moehrle
Hi Eric, 'tempUploads/1425182872.xlsUploaded The File.' http://us2.php.net/manual/en/function.is-uploaded-file.php http://us2.php.net/manual/en/features.file-upload.errors.php So do I still use move_uploaded_file? -Jason

Re: [PHP] File Uploads Help!!! --Forgot

2008-12-05 Thread Jason Todd Slack-Moehrle
Hi Eric, So do I still use move_uploaded_file? Absolutely. I just didn't see anywhere in your code where you were checking for an error with the file upload itself or that it did exist on the server before moving it. Got it, thanks!! -Jason -- PHP General Mailing List

[PHP] Parsing Strings

2008-12-05 Thread Jason Todd Slack-Moehrle
OK, making good learning progress today. I have a string that is: Jason Slack and I want it broken at the space so i get Jason and then Slack I am looking at parse_str, but I dont get how to do it with a space. The example is using []=. Then I want to assign like: $fname = Jason; $lname =

Re: [PHP] Parsing Strings

2008-12-05 Thread Jason Todd Slack-Moehrle
How might I also parse and address like: SCOTTSDALE, AZ 85254 It has a comma and a space -Jason On Dec 5, 2008, at 4:02 PM, Jason Todd Slack-Moehrle wrote: OK, making good learning progress today. I have a string that is: Jason Slack and I want it broken at the space so i get Jason

Re: AW: [PHP] Parsing Strings

2008-12-05 Thread Jason Todd Slack-Moehrle
Konrad, On Dec 5, 2008, at 4:22 PM, Konrad Priemer wrote: $array = explode( , Jason Slack); Awesome, thanks, yup that does it. Can you explain how to do an address now into City, State, Zip Like: cortland, ny 13045 It has a comma and a space! -Jason -- PHP General Mailing List

Re: AW: [PHP] Parsing Strings

2008-12-05 Thread Jason Todd Slack-Moehrle
Conny, Can you explain how to do an address now into City, State, Zip Like: cortland, ny 13045 $string = cortland, ny 13045; $search = array(, , ,); $replace = array( , ); $newString = str_replace($search, $replace, $string); $array = explode( , $newString); Ah ha! Nice that makes sense,

[PHP] MkDir Help

2008-10-22 Thread Jason Todd Slack-Moehrle
Hi All, I want to make a directory on my web server programatically when my code to create a new user runs. I am running PHP 5.2.5 on Linux. I am running: $dirToCreate = ...$_SESSION['s_USER_URL']; mkdir($dirToCreate, 0777, TRUE); // create the directory for the user $dirToCreate is:

Re: [PHP] MkDir Help

2008-10-22 Thread Jason Todd Slack-Moehrle
Hi, Well, as your mkdir is saying you can only have 2 parameters, I'm guessing you're not yet running PHP 5. Also, as 0777 is the default mode, you can omit this from your code to leave only one argument. You didn't say the exact error you're getting when you omit the third argument. My guess

[PHP] CSV Files

2008-10-22 Thread Jason Todd Slack-Moehrle
Hi All, I need to take a record in MySQL and have my user get it as a CSV File. I am OK with most everything, except when I create the CSV file, I write out the column headers then I need to write out the data. After I right out the column headers do I have to put a '/n' to have it start

Re: [PHP] CSV Files

2008-10-22 Thread Jason Todd Slack-Moehrle
Hi Stut, Actually i am ending the row headers with a chr(10); // LINE FEED -Jason On Oct 22, 2008, at 5:12 PM, Stut wrote: On 23 Oct 2008, at 00:59, Jason Todd Slack-Moehrle wrote: After I right out the column headers do I have to put a '/n' to have it start a new line in the CSV file? I

Re: [PHP] CSV Files

2008-10-22 Thread Jason Todd Slack-Moehrle
Oh, I am not putting quotes around each field that i get from MySQL. There are no quotes in the data so that is good. Sorry I put /n and I meant to put chr(10). -Jason On Oct 22, 2008, at 6:58 PM, Stut wrote: On 23 Oct 2008, at 02:41, Jason Todd Slack-Moehrle wrote: Actually i am ending