ID badge - Find jobs - Sport news - Rome hotels - Wordpress Themes

PDA

View Full Version : ## Quick Fixing need, PHP experts Please help :)


me4you
Jun 3rd 2008, 6:13 am
Hi DP's

I brought a site there is some error Please help me to fix it.

http://tinyurl.com/4575lq

Warning: checkdnsrr() [function.checkdnsrr]: Host and type cannot be empty in /home/sendkiss/public_html/Include/mail.inc on line 8


and


http://tinyurl.com/3ll2lw

whats are the Warning: on top also the chaptha code is not working :mad:


Please help me OUT !

xlcho
Jun 3rd 2008, 6:32 am
Warning: checkdnsrr() [function.checkdnsrr]: Host and type cannot be empty in /home/sendkiss/public_html/Include/mail.inc on line 8
Apparently, you use checkdnsrr(), but do not pass any arguments to it (or the variables that you pass are undefined).

The warnings you get are from division by zero. Somewhere in the code divide a number by 0, which is not possible. Take a good look trough all the divisions you make in the code and you should find it. This could also be caused by a undefined variable.

Hope that helps :)

krakjoe
Jun 3rd 2008, 8:22 am
My guess would be register_globals is off, and you're running php5 and the code was written on php4 which had register_globals on by default ...

Before any code is executed or variables referenced ... you might try ...


extract( $_POST );
extract( $_GET );


This will allow _POST and _GET members to be used in the global scope and may be enough to fix it ...

me4you
Jun 4th 2008, 6:22 am
now using php4 1 done done !!!


what about the warning

Warning: Division by zero in /home/sendkiss/public_html/Include/crypt.inc on line 9

File crypt.inc

<?php
$key = '1nand0nor';
function encrypt($string)
{
$result = '';
for($i=0; $i<strlen($string); $i++)
{
$char = substr($string, $i, 1);
$keychar = substr($key, ($i % strlen($key))-1, 1);
$char = chr(ord($char)+ord($keychar));
$result.=$char;
}
return base64_encode($result);
}

function decrypt($string)
{
$result = '';
$string = base64_decode($string);

for($i=0; $i<strlen($string); $i++)
{
$char = substr($string, $i, 1);
$keychar = substr($key, ($i % strlen($key))-1, 1);
$char = chr(ord($char)-ord($keychar));
$result.=$char;
}
return $result;
}
?>

krakjoe
Jun 4th 2008, 8:51 am
<?php
$key = '1nand0nor';
function encrypt($string)
{
global $key ;
$result = '';
for($i=0; $i<strlen($string); $i++)
{
$char = substr($string, $i, 1);
$keychar = substr($key, ($i % strlen($key))-1, 1);
$char = chr(ord($char)+ord($keychar));
$result.=$char;
}
return base64_encode($result);
}

function decrypt($string)
{
global $key ;
$result = '';
$string = base64_decode($string);

for($i=0; $i<strlen($string); $i++)
{
$char = substr($string, $i, 1);
$keychar = substr($key, ($i % strlen($key))-1, 1);
$char = chr(ord($char)-ord($keychar));
$result.=$char;
}
return $result;
}
?>

me4you
Jun 4th 2008, 3:59 pm
<?php
$key = '1nand0nor'; what should i type there :D
function encrypt($string)

....

also the chaptha code why not working, the code is bellow, also why they use crypt.inc on that file :) I wish time time done ! :)


Happy kissing!
</p>';
?>
<?
$ercTime = time();
include('./Include/system.inc');
include('./Include/crypt.inc');
include('./Include/mail.inc');
if(isset($_GET[reply]))
{
$id = decrypt($_GET[reply]);
$result = mysql_query("SELECT * FROM kisses WHERE id = '$id' LIMIT 1");
if($kiss = mysql_fetch_assoc($result))
{
$sender_name_pre = $kiss[receiver_name];
$sender_mail_pre = $kiss[receiver_mail];
$receiver_name_pre = $kiss[sender_name];
$receiver_mail_pre = $kiss[sender_mail];
}
}
if(isset($_GET[confirm]) && isset($_GET[id]))
{
$sender_mail = decrypt($_GET[confirm]);
$id = decrypt($_GET[id]);
if(checkemail($sender_mail))
{
$result = mysql_query("SELECT * FROM kisses WHERE id = '$id' AND sender_mail = '$sender_mail'");
mysql_query("UPDATE kisses SET confirmed = 'y', send_date = CURDATE() WHERE id = '$id'");
include('./Include/kissmail




Chapcha

<br><br>
Enter the Verification Code<br>
<input type="text" size=6 class="input" name="verify"></input>
<? if(strcmp($_POST[form], "yes") == 0 && $randerror) echo "<span style=\"font-size: 9px; color: red\"> * incorrect verification code</span>" ?>
<br><img src="<? echo PATH_CLIENT_MAIN . "/randomimage.php?rand=" . $rand; ?>" border="0" height="22" width="60">
<br><br>
<input type="hidden" name="rand" value="<?=$rand?>">
<input type="hidden" name="form" value="yes">