Welcome Guest, Not a member yet? Register   Sign In
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



Theme © iAndrew 2016 - Forum software by © MyBB