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
1 | 2 
3bit.com
5876 posts

Uber Geek
+1 received by user: 189

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.






282 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.

605 posts

Ultimate Geek
+1 received by user: 1

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 ... 

1 | 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 tech item prices are listed in our price comparison site:




News »

Trending now »
Hot discussions in our forums right now:

Moment of Truth?
Created by BarTender, last reply by Glassboy on 19-Sep-2014 01:32 (367 replies)
Pages... 23 24 25


IOS8 - Network Load
Created by FireEngine, last reply by joker97 on 18-Sep-2014 19:43 (36 replies)
Pages... 2 3


10 Iphone 128gb 6+ iphones this weekend at auckland airport
Created by frysie, last reply by TimA on 17-Sep-2014 22:02 (36 replies)
Pages... 2 3


Mr. Key to extradite Kim Dotcom?
Created by TimA, last reply by SaltyNZ on 18-Sep-2014 09:20 (126 replies)
Pages... 7 8 9


Spark DNS Issues - Amazing - Broadband Service Alert
Created by PeteS, last reply by Demeter on 15-Sep-2014 14:13 (307 replies)
Pages... 19 20 21


2014 Holden SS (V8) or Ford XR6-T (in-line 6 turbo)
Created by joker97, last reply by ilovemusic on 16-Sep-2014 14:34 (71 replies)
Pages... 3 4 5


Is there anyone who would not upgrade to iphone 6 bcos it only has 1gb ram?
Created by joker97, last reply by joker97 on 18-Sep-2014 23:18 (16 replies)
Pages... 2


Maybe some politicians should go back to school?
Created by jarledb, last reply by DarthKermit on 18-Sep-2014 18:27 (31 replies)
Pages... 2 3



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.