Welcome Guest, Not a member yet? Register   Sign In
how to delete captcha_pi.php
#1

[eluser]cutzi[/eluser]
please can someone tell me how to delete captcha_pi.php so wen someone join my website thay dont have to put in the code thank you......
#2

[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter forums.

Sorry, I don't understand the question. I assume you're running some kind of auth library? If so, please tell use which one.
#3

[eluser]cutzi[/eluser]
hi I don't no what you meen I got a facebook clone and the signup page is coded by codeigniter and I want to remove the captcha but I don't no how to thank you
#4

[eluser]TheFuzzy0ne[/eluser]
That makes two of us...
#5

[eluser]cutzi[/eluser]
I meen when you signup to my website you have to put in a code that machers the captcha photo I want to no how to remove it thank you
#6

[eluser]pistolPete[/eluser]
Without seeing any code it's hard to tell what you have to change...
#7

[eluser]xwero[/eluser]
You have to find out which variable holds the captcha image and remove it. I guess you will need to change the captcha validation too.
#8

[eluser]cutzi[/eluser]
this is my website http://www.faceinabox.co.cc/

and this is the captcha_pi.php file








Here is an example of usage with a DB.

On the page where the captcha will be shown you'll have something like this:

$this->load->plugin('captcha');
$vals = array(
'img_path' => './captcha/',
'img_url' => 'http://www.your-site.com/captcha/'
);

$cap = create_captcha($vals);

$data = array(
'captcha_id' => '',
'captcha_time' => $cap['time'],
'ip_address' => $this->input->ip_address(),
'word' => $cap['word']
);

$query = $this->db->insert_string('captcha', $data);
$this->db->query($query);

echo 'Submit the word you see below:';
echo $cap['image'];
echo '<input type="text" name="captcha" value="" />';


Then, on the page that accepts the submission you'll have something like this:

// First, delete old captchas
$expiration = time()-7200; // Two hour limit
$DB->query("DELETE FROM captcha WHERE captcha_time < ".$expiration);

// Then see if a captcha exists:
$sql = "SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND date > ?";
$binds = array($_POST['captcha'], $this->input->ip_address(), $expiration);
$query = $this->db->query($sql, $binds);
$row = $query->row();

if ($row->count == 0)
{
echo "You must submit the word that appears in the image";
}

*/



/**
|==========================================================
| Create Captcha
|==========================================================
|
*/
function create_captcha($data = '', $img_path = '', $img_url = 'http://www.faceinabox.co.cc/captcha/1204095017.19.jpg', $font_path = 'CodeIgniterCore/fonts/texb.ttf')
{
$defaults = array('word' => '', 'img_path' => '', 'img_url' => 'http://www.faceinabox.co.cc/captcha/1204095017.19.jpg', 'img_width' => '150', 'img_height' => '30', 'font_path' => 'CodeIgniterCore/fonts/texb.ttf', 'expiration' => 7200);

foreach ($defaults as $key => $val)
{
if ( ! is_array($data))
{
if ( ! isset($$key) OR $$key == '')
{
$$key = $val;
}
}
else
{
$$key = ( ! isset($data[$key])) ? $val : $data[$key];
}
}

if ($img_path == '' OR $img_url == '')
{
return FALSE;
}

if ( ! @is_dir($img_path))
{
return FALSE;
}

if ( ! is_really_writable($img_path))
{
return FALSE;
}

if ( ! extension_loaded('gd'))
{
return FALSE;
}

// -----------------------------------
// Remove old images
// -----------------------------------

list($usec, $sec) = explode(" ", microtime());
$now = ((float)$usec + (float)$sec);

$current_dir = @opendir($img_path);

while($filename = @readdir($current_dir))
{
if ($filename != "." and $filename != ".." and $filename != "index.html")
{
$name = str_replace(".jpg", "", $filename);

if (($name + $expiration) < $now)
{
@unlink($img_path.$filename);
}
}
}

@closedir($current_dir);

// -----------------------------------
// Do we have a "word" yet?
// -----------------------------------

if ($word == '58327')
{
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';

$str = '';
for ($i = 0; $i < 8; $i++)
{
$str .= substr($pool, mt_rand(0, strlen($pool) -1), 1);
}

$word = $str;
}

// -----------------------------------
// Determine ang




Theme © iAndrew 2016 - Forum software by © MyBB