[eluser]ibnclaudius[/eluser]
[quote author="TheFuzzy0ne" date="1363894881"]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'],
));
[/quote]
Thanks! Another thing, is there any way I can check if there's a file to upload? Something like:
Code:
if (theres_file_to_upload)
{
// run this only if the user selected a file to upload
}