Just as an addition to lozloz's comment -- when you go from register globals on to off, it affects variables used in the $_GET scope as well (if you have any of those).
Main Topics
Browse All TopicsRight now my register_globals are ON, I heard this was a security risk because people could make fake passing vars in the URL and have the script think they auth'ed or something like that.
If I were to turn OFF register_globals, in my mysql_query() statements, where I use the forms names such as
INSERT INTO table (field) VALUES ($formfieldname)
would have to be
INSET INTO table (field) VALUES ($_POST[formfieldname])
?
And also,
$filetype = $_POST['filetype'];
$_SESSION['search_filetype
$filetype = $_SESSION['search_filetype
Like there, I'm trying to set the $filetype variable they want to search for as a session variable so they can go back and forth between the forms (like back and next buttons).
I'd like to know the most efficient ways of doing this, I'm fimilar with PHP now, just not with coding standards.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Well I didn't use any GET methods at all, all POST's if any...
For loz, you said that I would have to do
$query = "INSERT INTO table (field) VALUES ('" . $_POST["formfieldname"] . "')";
That value string is really ugly, is there a way around this? Or do I have to do it like this with the concatnating and all...
well $_FILES["filename1"] will hold an array of the information about the file
tmp_name is the temporary name of it, name is the actual name, type is the mime type, size is its size in bytes, error is the assocatied error code
so these are accessed through $_FILES["filename1"]["tmp_
so you probably want something like:
copy($_FILES["filename1"][
you'll probably want to change the directory information for the 2nd half of the function
loz
Also, I had this before:
$img2_name = str_replace(" ","",$img2_name);
$img2_name = str_replace("'","",$img2_n
$img2_name = str_replace("(","",$img2_n
$img2_name = str_replace(")","",$img2_n
$img2_name = str_replace("\\","",$img2_
That was done basically to elimate nasty characters in the filename before uploading...
How would this change? Can I define the $_FILES[img2][name] array element?
Business Accounts
Answer for Membership
by: lozlozPosted on 2003-11-05 at 12:41:18ID: 9689898
correct about the query and security risk except you need some concatenation:
"] = $filetype;
$query = "INSERT INTO table (field) VALUES ('" . $_POST["formfieldname"] . "')";
to set the session variables all you need is $_SESSION["search_filetype
are you wondering if a session is the best way to do this or just how to set a session variable?
loz