Jump to content

fugix

Members
  • Posts

    1,483
  • Joined

  • Last visited

Posts posted by fugix

  1. im assuming you're on a linux server or this wouldn't be an issue since windows servers do not have an issue with this, unfortuantely, if your url has a upper case letter, there is not way to make it work, i would advise always making your filenames lower case to avoid this issue. However if your urls are all lower case and you want to avoid this issue for other users that type in your url and may mistakingly type an uppercase letter, you can use mod_rewrite to convert user requests to all lowercase.

     

     

    RewriteEngine on

    RewriteBase /

    RewriteMap insensitive tolower:

    RewriteRule ^[\/]*(.*)$ /${insensitive:$1} [R,L]

     

  2. i misread your post, so if you wanted to use my code i will revise to be exactly what you want, the second third and fourth characters after the .com, im assuming that you do not want the forward slash

    preg_match('/\.com\/(.{3})/', $string, $matches);
    echo $matches[1];

     

    Cool.. even easier.  Thanks for the help.  Much appreciated!  Works great.

    no problem at all, glad it worked for you

  3. $query = mysql_query("SELECT * FROM highscore WHERE player = '$CurrentPlayer'") or die(mysql_error());
    while($row = mysql_fetch_assoc($query))
    {
       $score = $row['score'];
       // do whatever you'd like from here
    }

    hope this helps

  4. i misread your post, so if you wanted to use my code i will revise to be exactly what you want, the second third and fourth characters after the .com, im assuming that you do not want the forward slash

    preg_match('/\.com\/(.{3})/', $string, $matches);
    echo $matches[1];

  5. I have one more thing to add onto that though. I'm trying to figure out some logic here if the user gets an account locked then should I keep updating the lockDate column each time and put in a new row into the hacking table of each time an account has gone pasted the 4 chances or how should I approach this?

    this is really up to you, however, if you are storing the date that a user becomes locked from their account, i would not continually update the date if they try to gain access again. I would simply make the user aware of the time that they can gain access into their account again. I also would not keep track of the amount of times that the user has gone over 4 times. You want to make your site as user friendly as possibly.

  6. you need to set a target attribute with a custom name, like so

    <script language="JavaScript1.1">
    <!--
    function openWin(url) {
    self.name = "Popper";
    remote = open(url, "mywindow", "resizable,scrollbars,width=600,height=500,left=10 ,top=10"); //added second param
    }
    //-->
    </script>
    
    <body onload="openWin('http://www.youtube.com/<?php echo $id; ?>');">

  7. almost.

    else {
                            $_SESSION['numberOfAttempts'] = $_SESSION['numberOfAttempts']+1;    
                            $numberOfAttempts = $_SESSION['numberOfAttempts']; //you already added one here
                            
                            if ($numberOfAttempts < 5) {
                                
                                $chancesLeft = 5 - $numberOfAttempts;
                                
                                $output = array('errorsExist' => true, 'message' => 'Invalid Username and Password combination! You have ' .$chancesLeft.' to login succesfully or the account will be locked!'); 
                                
                            } else {
                                
                                
                                $output = array('errorsExist' => true, 'message' => 'Your account is currently locked, we appologize for the inconvienence. This is a security messure implimented by to many failed login\'s!');
                                
                            }
                                
                        }

  8. checked it myself, you are missing a closing bracket at the end of your code

    <?php 
    error_reporting(E_ALL ^ E_NOTICE); 
    $email = $_GET['ipn_email']; 
    $header = ""; 
    $emailtext = ""; 
    // Read the post from PayPal and add 'cmd' 
    $req = 'cmd=_notify-validate'; 
    if(function_exists('get_magic_quotes_gpc')) 
    {  
    $get_magic_quotes_exits = true; 
    } 
    foreach ($_POST as $key => $value) 
    // Handle escape characters, which depends on setting of magic quotes 
    {  
    if($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1){  
    	$value = urlencode(stripslashes($value)); 
    } else { 
    	$value = urlencode($value); 
    } 
    $req .= "&$key=$value"; 
    } 
    // Post back to PayPal to validate 
    $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; 
    $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; 
    $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; 
    $fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30); 
    
    
    // Process validation from PayPal 
    // TODO: This sample does not test the HTTP response code. All 
    // HTTP response codes must be handles or you should use an HTTP 
    // library, such as cUrl 
    
    if (!$fp) { // HTTP ERROR 
    } else { 
    // NO HTTP ERROR 
    fputs ($fp, $header . $req); 
    while (!feof($fp)) { 
    $res = fgets ($fp, 1024); 
    if (strcmp ($res, "VERIFIED") == 0) { 
    	// TODO: 
    	// Check the payment_status is Completed 
    	// Check that txn_id has not been previously processed 
    	// Check that receiver_email is your Primary PayPal email 
    	// Check that payment_amount/payment_currency are correct 
    	// Process payment 
    	// If 'VERIFIED', send an email of IPN variables and values to the 
    	// specified email address 
    	foreach ($_POST as $key => $value){ 
    	$emailtext .= $key . " = " .$value ."\n\n"; 
    	} 
    	mail($email, "Live-VERIFIED IPN", $emailtext . "\n\n" . $req); 
    } else if (strcmp ($res, "INVALID") == 0) { 
    	// If 'INVALID', send an email. TODO: Log for manual investigation. 
    	foreach ($_POST as $key => $value){ 
    	$emailtext .= $key . " = " .$value ."\n\n"; 
    	} 
    	mail($email, "Live-INVALID IPN", $emailtext . "\n\n" . $req); 
    }	 
    } 
    }
    fclose ($fp); 
    
    ?>

  9. because after your script is finished executing, your $_SESSION['numberofattempts'] value remains the same value, which I am assuming is 0, because you have not changed the value of the session, you simply stored it into a variable and added 1 it externally. insed of you else statement you will need to redefine the value of you session, e.g

    $_SESSION['numberOfAttempts'] = $_SESSION['numberOfAttempts']+1

×
×
  • 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.