Posts

Showing posts from 2009

XSS vulnerability

Cross-site scripting (XSS) is a type of computer security vulnerability typically found in web applications which enable malicious attackers to inject client-side script into web pages viewed by other users. An exploited cross-site scripting vulnerability can be used by attackers to bypass access controls such as the same origin policy. One common way to solve is: Ensure that parameters and user input are sanitized by doing the following: # Remove < input and replace with < # Remove > input and replace with > # Remove ' input and replace with ' # Remove " input and replace with " # Remove ) input and replace with ) # Remove ( input and replace with (

How to send JSON object using JQUERY to PHP?

After struggling for hours and googling more, finally i succeeded in commincating over Json object. I will share the code: JS side: var datastring=JSON.stringify(obj); $.post('getmessage.php',{data:datastring},function(res){ alert("HIIII"+res); },"text"); }); php side: $data=json_decode(stripslashes($_REQUEST['data']),true); echo $data['page']; ?>

Problems with mysql.sock

Sometimes while working on Linux, mysql.sock may get deleted by mistake due to some softwares.. in such cases any access to mysql wont be possible as the sock file defines the socket connection for mysql. It will give an error of the following type: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) In such cases follow these steps to reconfigure mysql: Delete the log files with the names: ib_logfile0, ib_logfile1 and ibdata1 in the /var/lib/mysql directory Then type: "mysqld_safe --user=mysql &" This will automatically create mysql.sock file and even the new logs files. This is a very simple solution which I used recently and decided to share with you people.

How to creata a form using javascript and submit it..

Image
var myForm = document.createElement("form"); myForm.method="post" ; myForm.action = "./Actionpath"; var myInput = document.createElement("input") ; myInput.setAttribute("type","hidden"); myInput.setAttribute("name", "imput name") ; myInput.setAttribute("value", input value); myForm.appendChild(myInput) ; document.body.appendChild(myForm) ; myForm.submit() ; document.body.removeChild(myForm) ; o ok, I’ve run into this problem in the past where I’m using an onclick event to submit a form from a button control. When you click the button you get a nice little Javascript error stating: “this.form.submit is not a function” Bugger…wtf? This only seems to happen when you have a form element named “submit” already on your page, so the browser treats that “submit” element as an object which is of course NOT a function. I seem to run into this when I want 2 ways of submitting the fo

How ro use show extended permission on page other then fb connect login button.

FB.Bootstrap.requireFeatures(["Connect"], function() { FB.Facebook.init(" ", " "); FB.Connect.showPermissionDialog("email"); }); --------------------------------------------------------------------------------------- Correct way to use to get permission only if user have not grantd a parmission... Code is: var is_initialized = false; // Ensure Facebook app is initialized and call callback afterward function ensure_init(callback) { if(window.is_initialized) { callback(); } else { FB_RequireFeatures(["XFBML"], function() { //FB.FBDebug.logLevel = 4; //FB.FBDebug.isEnabled = true; FB.Facebook.init( , ); window.is_initialized = true; callback(); }); } } function facebook_prompt_permission(permission, callbackFunc) { ensure_init(function() { //check is user already granted for this permission or not FB.Fa

Facebook connect invitaion request:how to

The code to display extended permission is as given below. Call popupFacebookInvite() function to display the extended permission dialog box. Its pretty simple, So try out today... function popupRequestForm(){ FB.IFrameUtil.CanvasUtilServer.run(true); var _e1=document.createElement("div"); _e1.setAttribute("iframeHeight","560px"); _e1.setAttribute("iframeWidth","630px"); var _e2=new FB.UI.PopupDialog("Your message here",_e1,false,false); _e2.setContentWidth(630); _e2.setContentHeight(560); _e2.set_placement(FB.UI.PopupPlacement.center); _e1.setAttribute("fbml"," "+" \">"+" "+" "+" "); _e2.show(); FB_RequireFeatures(["XFBML"],function(){ var _e3=new FB.XFBML.ServerFbml(_e1); FB.XFBML.Host.addElement(_e3); }); } function popupFacebookInvite(){ FB.Facebook.get_sessionState().waitUntilReady(Delegate.create(null,function(_e4){ FB.Facebook.apiClient.connec

Nokia phone connected to AVR microcontroller.

Image
A Introduction to Nokia F-Bus Disclaimer: The author takes no responsibility for the use of this information. Some commands can be very hazardous to your phone and can make your phone useless! Use at your own risk, but have fun! Please Note: No Nokia fones were injured or kill in the production of this page!! How to connect microcontrollers to your Nokia 3310 Most Nokia phones have F-Bus and M-Bus connections that can be used to connect a phone to a PC or in our case a microcontroller. The connection can be used for controlling just about all functions of the phone, as well as uploading new firmware etc. This bus will allow us to send and receive SMS messages. Want to turn your air-conditioner on remotely? The very popular Nokia 3310/3315 has the F/M Bus connection under the battery holder. This is a bit of a pain to get to and requires a special cable to make the connection. The left picture above shows the 4 gold pads used for the F and M Bus. The right picture shows

Pak hackers planning to attack Indian cyber networks

New Delhi: After the Mumbai terror strikes, anti-India elements in Pakistan are now planning an attack on Indian computer networks, intelligence agencies have warned. Already Pakistani hackers are trying out a dry run against Indian networks through popular websites registered there after the Mumbai terror strikes, Home Ministry sources told PTI here today. "Every time the relations between the two countries dampen, Pakistanis start attacking Indian computer networks and this has increased after the Mumbai terror attacks," a Home Ministry source said. Pakistani hackers have created websites such as the www.Songs.Pk , which are infested with software to hack data from the targeted computers, it said. "The website www.Songs.Pk has over 12 lakh Indian users who are downloading stuff from these websites daily," said a cyber expert in the Ministry. With these websites being highly popular, it will take only a few minutes for the hackers to take command of over 12 lakh c

Key for Counter Strike:Condition Zero.

Many of us play Counter Strike(CZ). The universal Key for the game is 5Z62E MTXQZ Z32IY NW2ZL A3C4Q So use the above key and enjoy..

How to add watermark to an image in GIMP?

Image
I have just started using GIMP and its awesome. this is one cool tip which i found and would like to share it with you people. How to watermark an image using GIMP You’ve taken a bunch of pictures with your digital camera and you want to post them on the web. Of course, you don’t want other people stealing your work so you decide to add a watermark to your images. In this tutorial I will show you how to add a watermark to an image using GIMP, and open source image editing package. The screenshots in this tutorial show GIMP running on Ubuntu Linux, however the steps are exactly the same if you’re running GIMP on Windows. Windows users can download the Windows version for free here . Here are the before and after images: Before After First, open your image in GIMP. click to enlarge Now click on the Text Tool . It’s the button with the letter A . click to enlarge Click on the little arrow to the top right of the foreground/background colours tool to make white the foreground colo