Posts

Showing posts from August, 2012

prevent user from logging back in after logging out by hitting back button

prevent user from logging back in after logging out by hitting back button Disabling browser back button by javascript is a bad idea. Here is an example that logs the user in and logs the user out and also checks if the user is logged in. When you click the logout page you're automatically logged out and redirected. Clicking back won't change anything you still won't be logged in.
in login.php file
session_start();// If they are  logged in, send them to homeeif(isset($_SESSION['isLoggedIn'])) { //   header("Location: start.php");
              echo '<script language="javascript">';
        echo 'top.location.href = "start.php";';
        echo '</script>';


}
also add this after succesful login in login.php file
if(authenticate_user($myusername,$mypassword)){//$_SESSION['login_user']=$myusername;$_SESSION['isLoggedIn'] = true;---}
for all webpages of ur site write this in common.php
sessio…

Simple Login Encryption in javascript and decryption in PHP

Simple Login Encryption in javascript and decryption in PHP
Solution wont show your username in plain text during transit but still It's possible to do man-in-the-middle attacks. for password encryption check http://vinodkotiya.blogspot.in/2012/08/change-or-encrypt-post-data-before.html
can be implemented through XoR.

simple Javascript Encryption code


function encryptUser(str) {

    var encoded = "";
    for (i=0; i
        var a = str.charCodeAt(i);
        var b = a ^ 6;    // bitwise XOR with any number, e.g. 123
        encoded = encoded+String.fromCharCode(b);
    }
    return encoded;
}

simple php Decryption function
function decryptUser($text){ // Our output text $outText = '';
 // Iterate through each character for($i=0;$i {
         $outText .= chr(ord($text{$i}) ^ 6); // bitwise XOR with any number, e.g. 123
 } return $outText;
}
- Vinod Kotiya

Autocomplete Text Box with dropdown from MySQL database webservice vb asp.net

Autocomplete Text Box with dropdown from database webservice vb asp.net

Ajax autocomplete extender with a textbox  using a MySQL database

1. Write webservice.vb in App_code


              Imports System.WebImports System.Web.ServicesImports System.Web.Services.ProtocolsImports MySql.DataImports MySql.Data.MySqlClientImports System.DataImports System.Data.SqlClient
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://vinodkotiya.com/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class WebService
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function HelloWorld() As String
        Return "Hello World"
    End Function
    <WebMethod()> _
    Public Function GetCompletionList(prefixText As St…

How To Fix Android Market Package File Is Invalid, No Download At All, Download Unsuccessful Error ( Play Store )

How To Fix Android Market Package File Is Invalid, No Download At All, Download Unsuccessful Error ( Play Store )

Sometimes when we try to download new apps on Android market we receive "Package File is invalid", "No download at all" or "Download unsuccessful" errors. Sometimes you may receive all of them. After you received this error we can't install and update any apps on the Android market. There are 5 ways to fix this issue. The issue came on my custom ROM Hyvrid v3 for micromax A70 which resolved by method 1. even wiping the cache, wiping the dalvik cache was not resolving problem

1. Clear data and cache of play store


First visit "Menu > Settings > Applications > Manage applications". Now Tap "All" and search Market app, and tap it. Now tap "Clear cache" and "Clear data" and finally click "Uninstall updates". Like following screen shot. If still ur issue not resolved do further (mine was re…

change or encrypt post data before submit

 A user enters their password, and submits the login form. The password is sent to the server, authentication is run, and the hashed password matches the one stored in the database.
The onsubmit event occurs when the submit button in a form is clicked.

    <script src="http://crypto-js.googlecode.com/svn/tags/3.0.2/build/rollups/md5.js"></script>

<script type="text/javascript">
function encryptPWD()
{
//Here do whatever you want to do with the form or it's values.
//can change any elements value.and hidden field

//alert("Welcome " + document.forms["logForm"]["username"].value + "!");
//Getting the two input objects

var pwd=document.forms["logForm"]["password"].value;
//Hashing the values before submitting

document.forms["logForm"]["password"].value =  CryptoJS.MD5(pwd);
}
</script>




<form action="" method="post"  name="logForm" onsubmit=…

Google+ Followers