Defafe

all about extjs, jquery, javascript, php, mysql

This tutorial only improve previous tutorial, because in the previous tutorial there are bugs or errors.

The following are bug or error and now i have fixed it.

1. Login: if you know about sql injection, you can log in, although you do not know the password, but now is clearly. You can use script like below

$username = stripslashes(trim($_POST["username"]));
$password = stripslashes(trim($_POST["password"]));</pre>
$passwordhash = stripslashes(trim(md5($password)));
$query = sprintf("select * from user where username='%s' and password='%s'",
mysql_real_escape_string($username),mysql_real_escape_string($passwordhash));
<pre>

2. Edit: When you selected a check box to edit a data, then a function edit data does not work, it is cause i used a function edit.getSelections(). in extjs 2.0 it is fine but if you execute in extjs 3.1.0 it is does not work. but now is clearly. you must add a function getSelectionModel().

var m = EditorGrid.getSelectionModel().getSelections();

3. Delete: the problem is the same as when you editing a file, when you select a check box to delete file, function does not work, but now is clearly.

function del(btn)
{
if(btn == 'yes')
{
var m = EditorGrid.getSelectionModel().getSelections();
var store = EditorGrid.getStore();

for(var i=0; i&lt; m.length; i++){
var rec = m[i];
if(rec){
SimpleDataStore.load({
params:{del:rec.get("Nota"),start:0,limit:10},
callback: function(){

}
});store.remove(rec);
}
}

}
}

demo | download

hi all, i have trouble which my previous tutorial “registration-form-with-captcha“  when i executed in hosting, but when i executed it in my localhost is it fine.  i deadlocked.  i need your help to get solving. my trouble is always wrong captcha when i execute my extjs apllication in hosting. please check my previous tutorial and try demo and check my source code.

i am very grateful if you could solve my problem.

thanks!

In this tutorial, I just want to give examples of how to use the icon on the button on extjs. I think this is a very simple example, and I’m sure has a lot to know about this. But there is nothing wrong if I write this tutorial, maybe there is not yet known. below is a sample script to create icon on button.

==script in javascript file==

buttons: [{
text:'Submit',
iconCls:'icon-close'

},{
text: 'Close',
iconCls:'icon-close',
handler: function(){
win.hide();
}
}]

“”"iconCls:’icon-close’,” is main of this tutorial. icon-close is name of class icon, and will  load  in html file,

this is a script html file

<STYLE type=”text/css”>
.icon-close
{
background-image:url(database_go.png) !important;
}
</STYLE>

demo

Because of you, I still hold to share knowledge through this blog. These days I am confused what to write on this blog, I have no time to continue my project before. But do not worry, now I want to share knowledge, how to make a completed registration form with a captcha. As we know captcha is necessary to protect the blog or our website from spam.

Registration form is composed of 5 input, ie name, username, passwword, confirm password, email, and spam code. Below are some validation that I use to make this registration form:

  1. Each input can not be empty, sourcecode ==> “allowBlank: false”.
  2. username: user can only create a username at least 3 characters and maximum of 12 characters, source code ==> Minlength: 3, MaxLength: 12.
  3. password: sourcecode ==> inputType: ‘passoword’
  4. email validation : sourcecode ==> vtype: ‘email’.

To create spam on the extjs code I use script like below.

xtype:'box',
 autoEl:{
 tag:'img',
 src:'spam.php'
 }

You can download the sourcecode is in the link below.

download | demo

upload fiile and image

upload fiile and image

I am sorry when I check back my previous tutorial on uploading files and images, there are some mistakes that should be fixed in its database, and there are some parts that I have not explained clearly. Now I will try to explain again some of which I consider important.

  1. On these tutorials you can only upload image files that have extensions gif,  jpeg and png. if you upload a file extension other than the image file, the file will not be able to upload or error.
  2. create a folder image and article to store files uploaded.

    download this sourcecode , demo this application

    theme extjs

    theme extjs

    Below are some new themes that I took from the extjs forum, you can make the display more interesting applications with extjs these themes.

    1. xtheme-indigo this theme created by  elyxr (elyxr is a username in extjs forum).

    2. xp-theme-for-extjs this theme created by coolstar (account id in extjs forum).

    3. TargetProcessSkin_ext_3 this theme created by firefalcon (account id in extjs forum).

    below are example of the use of extjs themes above

    <link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
    <link rel="stylesheet" type="text/css" href="resources/TargetProcessSkin_ext_3/css/xtheme-tp.css" />
    
    « Previous Entries  Next Page »

    Calendar

    February 2010
    T W T F S S M
    « Jan    
     1
    2345678
    9101112131415
    16171819202122
    232425262728