Jump to content

blacknight

Members
  • Posts

    271
  • Joined

  • Last visited

Posts posted by blacknight

  1. this is the function i use to combine images

    function combineImage( $image,$filename,$x_loc,$y_loc )
    {
    	$info = getimagesize($filename);
    
    	switch( $info['mime'] )
    	{
    		case 'image/jpeg' :
    			$im_temp = @imagecreatefromjpeg($filename);
    			break;
    
    		case 'image/png' :
    			$im_temp = @imagecreatefrompng($filename);
    			break;
    
    		case 'image/gif' :
    			$im_temp = @imagecreatefromgif($filename);
    			break;
    
    		default:
    			debugMode( $line,'Unhandled image type: ' . $info['mime'] );
    	}
    
    	// Get the image dimentions
    	$im_temp_width = imageSX( $im_temp );
    	$im_temp_height = imageSY( $im_temp );
    
    	// Copy created image into main image
    	@imagecopy( $image,$im_temp,$x_loc,$y_loc,0,0,$im_temp_width,$im_temp_height );
    
    	// Destroy the temp image
    	if( isset($im_temp) )
    	{
    		@imageDestroy( $im_temp );
    	}
    }
    

  2. try adding mysql_real_escape_string() around every car that is in the sql queries thsi shoudl saolve this issue

    best way is to use a function

    function escape( $string )
    {
    	if( version_compare( phpversion(), '4.3.0', '>' ) )
    	{
    		return mysql_real_escape_string( $string );
    	}
    	else
    	{
    		return mysql_escape_string( $string );
    	}
    }
    

     

    then its just escape($value) and its cleaned for sql

  3. RewriteEngine On

     

    should turn it on for your site to test create a html file on your site called bob.html

    add

    RewriteRule  ^bob\.html$  john.html

     

    after turning the engion on then go to yoursite.com/bob.html the address should change to yoursuite.com/john.html

     

     

  4. this may help gen you addresses guessing you have given each symble a numerical value

     

    function generateUniqueRandoms($min, $max, $count)  
    {
    	if($count > $max)  
    	{  // this prevents an infinite loop
    		echo "ERROR: The array count is greater than the random number maximum.<br>\n";
    		echo "Therefore, it is impossible to build an array of unique random numbers.<br>\n";
    		break;
    	}    
    	$numArray = array();
    	for($i = 0; $i < $count; $i++)
    	{        
    		$numArray[$i] = mt_rand($min,$max);         // set random number
    
    		for($j = 0; $j < $count; $j++)                 // for each number, check for duplicates
    		  if($j != $i)                                 // except for the one you are checking of course
    			if($numArray[$i] == $numArray[$j])
    			{
    				$numArray[$i] = mt_rand(1,39);         // if duplicate, generate new random
    				$j = 0;                                // go back through and check new number
    			} 
    	}
    	return $numArray;
    }
    

     

    then

    $x = generateUniqueRandoms(1, 39, 6);

    $r = implode('-',$x);

     

    $r would return ex 12-25-16-24-9-6

    your 7th is allways your origin :)

  5. $htmlx =  str_replace('---replaceid---', nl2br($rows[0]), $html);

    $htmlx =  str_replace('---replacetime---', nl2br($rows[1]), $htmlx);

    $htmlx =  str_replace('---replacefrom---', nl2br($rows[2]), $htmlx);

    $htmlx =  str_replace('---replacemail---', nl2br($rows[3]), $htmlx);

    $htmlx =  str_replace('---replacehomepage---', nl2br($rows[4]), $htmlx);

    $htmlx =  str_replace('---replacecomment---', nl2br($rows[5]), $htmlx);

    echo $htmlx;

     

    but why..... do it this way it would cause the page to load to slow.....

     

  6. gotta watch the name of your var's

     

    $pass_conf = $_REQUEST['newpass'];

    $email = $_REQUEST['passconf'];

    should be

    $pass_new = $_REQUEST['newpass'];

    $pass_conf = $_REQUEST['passconf'];

     

    or add in

    if (isset($pass_conf) && $pass_conf !='' && isset($pass_new) && $pass_new !='')
    {
    if ($pass_conf == $pass_new)
    {
    $newpass = md5($pass_conf)
    }
    else
    {
    echo 'your passwords no not match';
    }
    }
    else
    {
    echo ' one or more of your passwords are blank';
    }
    

     

    this is long code but it make sure the passwords are set lol

  7. $query = "SELECT COUNT(id)  FROM `teamrosters` WHERE TEAM = '$team'  ";   

    should be

    $query = "SELECT COUNT(id) as idcount  FROM `teamrosters` WHERE TEAM = '$team'  ";   

     

    then you would use $row['idcount']

     

    COUNT(id) just counts but assignes it no name

     

    then echo 'ROSTER COUNT: '. $row  [$COUNT];

    would be

     

    echo 'ROSTER COUNT: '. $row['idcount'];

  8. us ither ... you are getting no sql or php errors?

    have you tryed not using stmt

    tryed making the changes in the database using myadmin and changing them back on the webpage?

    have you tryed putting

    error_reporting(E_ALL);

    ini_set("display_errors", 1);

     

    at the start of the page directly after the <?php ?

  9. thats sorrect bruteforce attacks can still occure

     

    if you use a salt for hashing once you allways have to use the same salt every where that user logging in or the password will not match

     

    making useres use casps and numbers in passwords helps alot

     

    example bruting "apple" has 5 letters with 26 possabilitys for each letter 52 if upper case the more time it takes to crack a password the better but passwords can all ways be cracked or bruteforced

     

    http://www.usewisdom.com/computer/passwords.html explanes this well...

     

    most sites just use simple md5 no salt this is acceptiable but if you want more strength you can use salts...

  10. i think this is what your trying to do ......

     

    each menu item has a class asigned by its row "line striping" so each line is nto the same collor but it alternated between 2 classes

    if im correct this is what you need...

     

    $liclass = array('','ac_menu-item', 'menu-item-last');

    $liclass[(((++$r)%2)+1)]

     

    this will return position1 and position 2 in the array by each row looped i hope this helps...

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.