Welcome Guest, Not a member yet? Register   Sign In
upload/captcha problem
#1

[eluser]ebuoe[/eluser]
After development on my local machine i was able to upload pictures and my captcha image was showing,but now after hosting the site on the web,the captcha image isn’t showing and i am unable to upload files.


is this a CI problem,or is the problem from the host provider..
#2

[eluser]Ivar89[/eluser]
Well it's not a CI problem. Mine is working fine on local and hosted so...
probebly your host provider which would be silly to since it's just uploading...
but it's not a CI problem
#3

[eluser]mi6crazyheart[/eluser]
[quote author="da_green" date="1274326620"]After development on my local machine i was able to upload pictures and my captcha image was showing,but now after hosting the site on the web,the captcha image isn’t showing and i am unable to upload files.


is this a CI problem,or is the problem from the host provider..[/quote]

I think you might've problem in u'r PHP codes. It'll be easier for us to detect the error if u show u'r codes with us.......
#4

[eluser]ebuoe[/eluser]
/////this is a section of the code that is suppose to allow you to you to upload images alongside your ad///////

session_start();
$data['cap_value']=$_SESSION["captcha"];
$cap=$_SESSION["captcha"];

$this->load->library('form_validation');

$this->form_validation->set_rules('lname', 'Last name', 'trim|required|alpha_dash');
$this->form_validation->set_rules('fname', 'First name', 'trim|required|alpha_dash');
$this->form_validation->set_rules('group', 'Group', 'trim|required');
$this->form_validation->set_rules('email', 'Email', 'trim|required');
$this->form_validation->set_rules('phone', 'Phone ', 'required');
$this->form_validation->set_rules('detail', 'Detail', 'trim|required');

/////////////this part handles form captcha validation//////////////////////////////////////////////////////////////////////////////


$captcha_image=$this->input->post('captcha_confirm');//this returns the captcha value


if($cap!=$captcha_image)
{
$this->form_validation->set_rules('captcha_confirm', 'correct value for this', 'trim|required|exact_length[6]|matches[captcha_image]');
}
////////////////////////////////////////this ends captcha form validation
if ($this->form_validation->run() == FALSE)
{
$this->load->view('adverts_view',$data);
}
else
{

if($cap==$captcha_image)
{
$lname=$this->input->post('lname');
$fname=$this->input->post('fname');
$group=$this->input->post('group');
$email=$this->input->post('email');
$web=$this->input->post('website');
$phone=$this->input->post('phone');
$detail=$this->input->post('detail');


$config['upload_path'] = './adverts/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '0';
$config['max_width'] = '0';
$config['max_height'] = '0';

//////end of succesful upload//////

$this->load->library('upload', $config);

if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());

}
else
{ $error = array('error' => 'Sucessfully uploaded');
$data = array('upload_data' => $this->upload->data());



$picture=$this->upload->data();

////$this->upload->data contains the array of the file property and it is needed for upload/////////

$image="adverts/".$picture['file_name'];

}

$this->access->advert_user($lname,$fname,$group,$email,$web,$phone,$image,$detail);

}
session_destroy();
header('Location: ' . site_url('/home/adverts'));

}




Theme © iAndrew 2016 - Forum software by © MyBB