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
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
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
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
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,
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
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
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
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
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:
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
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/;
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
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
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
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 =
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
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
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,
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:
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
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
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
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
24 matches
Mail list logo