• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image handling and upload

#2
[eluser]TheFuzzy0ne[/eluser]
You can't check that the image is a square before uploading it without some kind of Flash or Java applet embedded on the page.

Once the file is uploaded, you can either crop it to a square using the image library, or use getimagesize() to get the image dimensions and see if it's square.

Another observation, it would be wiser to call $this->session->set_userdata() once. If you are storing your sessions in the database, or ever decide to, an update will be fired at the database once for each call to $this->session->set_userdata().

Code:
$this->session->set_userdata(array(
    'name' => $data['name'],
    'username' => $data['username'],
    'address' => $data['address'],
));


Messages In This Thread
Image handling and upload - by El Forum - 03-21-2013, 11:28 AM
Image handling and upload - by El Forum - 03-21-2013, 12:41 PM
Image handling and upload - by El Forum - 03-21-2013, 01:43 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.