Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.

View this topic in a long page with up to 500 replies per page Create new topic
Prev1 | 2 
3bit.com
5402 posts

Uber Geek

Moderator
Trusted
Subscriber

  Reply # 402272 9-Nov-2010 17:57 Send private message

hamisht: The file needs to re-named while being uploaded, or after uploading, because someone might upload 'photo1.jpg' and overwrite someone elses 'photo1.jpg'.


I would put all the images in a folder (such as /images) then put each user's images in a subfolder (such as images/15/ or images/10/) then there's no worries with overwriting.






274 posts

Ultimate Geek


  Reply # 402589 10-Nov-2010 10:32 Send private message

Thanks for that suggestion nate, but I don't want to complicate things any further ;)

Good news though, the renaming is working! yay!




245 posts

Master Geek


  Reply # 402599 10-Nov-2010 10:35 Send private message

hamisht: Thanks for that suggestion nate, but I don't want to complicate things any further ;)

Good news though, the renaming is working! yay!


Awesome Sauce :)




Load & Performance Tester/PHP/JSP/C/PERL/MYSQL/LoadRunner8->11/HTML/CSS/XML/XSLT/2B|!2B/Cervelo Soloist/EMC Equip4/ Samsung Galaxy S /Darkys 10.2 Extreme

Do androids dream of electric sheep?
use strict;
my $sheepCount;

Yes, they can.

603 posts

Ultimate Geek

Trusted

  Reply # 414336 7-Dec-2010 22:35 Send private message

Very snip-happy:

hamisht: this is my page 'uploadimages.php':

  
    $newcatagory = $_POST['newcatagory'];
       
    // RECORD INPUT
    $emailupload = $_POST['emailupload'];
    $description = $_POST['description'];
    $date = $_POST['date'];



Don't forget to mistrust ALL data that comes from the browser - put in some checking / validation / cleansing on the input to ensure that some clown doesn't set the $_POST['newcatagory'] to something like "; drop table catagory; --"

(Hint - mysql_escape_string())

Another option may be to use either an abstraction layer (ADODB) or mysqli commands.

Did I also mention that you should never trust the data from the browser ... 

Prev1 | 2 
View this topic in a long page with up to 500 replies per page Create new topic



Twitter »
Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when new jobs are posted to our jobs board:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:




News »

Trending now »
Hot discussions in our forums right now:

A reason not to shop at dick smith
Created by dsnz1, last reply by AKLWestie on 17-May-2013 22:45 (82 replies)
Pages... 4 5 6


A new project coming to Geekzone
Created by freitasm, last reply by plambrechtsen on 19-May-2013 21:49 (199 replies)
Pages... 12 13 14


HTC One (2013) owners' discussion
Created by Dingbatt, last reply by Finch on 19-May-2013 22:02 (1441 replies)
Pages... 95 96 97


Track my Phone, Car, how to best do it in .nz?
Created by DonGould, last reply by sonyxperiageek on 19-May-2013 22:24 (15 replies)

Sitting on a boring conference call
Created by SaltyNZ, last reply by SepticSceptic on 17-May-2013 16:52 (14 replies)

Samsung Galaxy SIII Discussion and Owners Thread
Created by networkn, last reply by Johnk on 19-May-2013 16:32 (5523 replies)
Pages... 367 368 369


Chorus is cutting the cost of VDSL to service providers from June 7
Created by maxzzz, last reply by Zeon on 19-May-2013 19:40 (46 replies)
Pages... 2 3 4


Office 365 service outage 2013-05-18
Created by freitasm, last reply by nitrotech on 19-May-2013 18:58 (18 replies)
Pages... 2



Geekzone Jobs »
Most recent NZ jobs in technology:

Exciting Intern Opportunity
Posted 19-May-2013 20:27

Business Analyst
Posted 19-May-2013 18:27

Senior Business Analyst
Posted 19-May-2013 18:27

Senior Business Analyst
Posted 19-May-2013 18:27

Project Coordinator, Reputable Company, Career Pro
Posted 19-May-2013 18:27

Change Manager - Large Financial Services Organiza
Posted 19-May-2013 18:27

Software Developer - Join a market leading company
Posted 19-May-2013 18:27


Geekzone Live »
Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.

Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.