See the manual at php.net:
addslashes()
stripslashes()
I've found it easier to just turn on magic-quotes in the php.ini file
This is all covered at php.net
Robert
- Original Message -
From: "Nick Patsaros" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Cc: <[EMAIL PR
Why don't you just do the sql insert *after* the file upload function?:
Pseudocode:
if( NOT file upload attack, wrong file type, etc.){
//copy the file to the permanaent location
//call function to insert file details into the database
}
else{
//echo error to user
Ok,
This is driving me nuts. I'm sure its something simple but I can't seem to
find the glitch.
I'm trying to make a simple shopping cart using Session varibles to store
the item => quantity pairs, then I loop thru the cart and query the db to
get the item details, etc.. Most of it works fine bu
t get the $qty to set.
Thanks,
Robert Weeks
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
while (strlen($nps)<$len)
> {
>
> $c = chr(mt_rand (0,255));
>
> if (eregi("^[a-z0-9]$", $c)) $nps = $nps.$c;
>
> }
>
> $nps.=".$ext";
> return ($nps);
>
> }
>
> Of course, depending on what you are doi
If you read to part 2 of the tutorial it has quite a bit on inserting data.
The reason there are tutorials and books are to teach the *concepts* behind
what they are showing you.
This is probably what is tripping you up; you create the table with uid as
an integer, auto increment, not null field
On 2/5/02 9:58 AM, "Todd Williamsen" <[EMAIL PROTECTED]> wrote:
> Now I have two small issues...
>
> 1. How would I automate the file naming otherwise errors will fly (can't
> copy file... blah blah)
You could replace the file name with a randomly generated number. There are
a number of ways to
What exactly is the error message? Did you change config.php to use the name
of your database and your username & password?
I've found the articles at devshed to be helpful in the past. This
particular one has a pretty good explaination of setting up a user
authentication system:
http://www.devs
m' => w_c
);
while (list($val, $key) = each($item_array)){
if ($key == $item){
$item_text = $val;
}
}
echo $item_text;
Thanks again,
Robert
- Original Message -
From: "Matthew Loff" <[EMAIL PROTECTED]>
To: "'Robert Weeks'" <[EMAIL
I'm trying to use a hash to translate a value into something human readable. I know
how to do this with an if-else but that seems like a waste of typing.
I have a bunch of items in the db and their values are abbreciations such as 'm_r'. I
want m_r to show on the page as "Mens Rings". I was try
Yup,
I knew it was something really simple. I should never touch a computer
before the coffee is brewed ;-)
Thanks!
Robert
On Wednesday, December 12, 2001, at 11:09 AM, Steve Cayford wrote:
>
> Do you want $$fname = $val here? Taking the string in $fname as the
> name of a variable to which
Hi,
I'm a little stumped here, maybe I haven't had enough coffee yet...
Anyway, I have a lot of SQL queries that return one row if there is a match
and instead of having to write out something like this:
$firstname = $row["firstname"];
$lastname = $row["lastname"];
$midinitial = $row["midin
12 matches
Mail list logo