How to disable “Enter Key” to submit?

javascript Ноябрь 26th, 2008

<form action=”foo”>
<input type=”text” onkeypress=”return bar(event)”>
<input type=”submit”>
</form>

<script type=”text/javascript”>
function bar(evt){
var k=evt.keyCode||evt.which;
return k!=13;
}
</script>

Note however that this “enter” key behavior isn’t standard (and actually behaves differently across user agents); moreover this won’t prevent you from full server-side checking, as a client can have javascript deactivated (or even trick your javascript at runtime).

Tags: ,

PHP function for make JSON

javascript, php Ноябрь 7th, 2008

PHP function for make JSON from array

Read the rest of this entry »

Tags: , , , , , ,

test credit card numbers

ПРОГРАММИРОВАНИЕ Сентябрь 14th, 2008

These credit card numbers can be used to test a transaction at ECHO. They are numbers that banks will reject as invalid without problem and are intended for system testing.

Test Credit Card Numbers:
Visa: 4111-1111-1111-1111
MasterCard: 5431-1111-1111-1111
Amex: 341-1111-1111-1111
Discover: 6011-6011-6011-6611

Credit Card Prefix Numbers:
Visa: 13 or 16 numbers starting with 4
MasterCard: 16 numbers starting with 5
Discover: 16 numbers starting with 6011
AMEX: 15 numbers starting with 34 or 37 Read the rest of this entry »

Удобный сервис глобальных аватар

WEB, WordPress Август 28th, 2008

За день, многие из вас прочитывают несколько блогов, часть из которых комментируют. Порой хочется как-то эти комментарии индивидуализировать авторскими аватарми, тем более что они есть почти у всех.

Именно этим вопросом занимается сервис - Gravatar! Для того чтобы начать использовать свои аватарки, достаточно зарегистрировать в сервисе то мыло, которое вы обычно используете при комментировании блогов. Кстати говоря, зарегистрировать можно несколько адресов, в случае если вы ведёте не один блог, а так же загрузить сколько угодно аватарок, которые внутри системы делятся на 4 типа:

G - на аватарке нет ничего пошлого, ее можно использовать на всех публичных сайтах;
PG - на аватарке могут быть неприличные жесты, или что-нибудь провокационное;
R - аватарка содержит элементы жестокости, обнаженных тел или картины принятия тяжелых наркотиков;
X - на аватарке изображены сцены порнографического характера.

Те, кто ещё не зарегистрированы в Gravatar, могут наблюдать рядом со своими никами автоматически сгенерированную картинку. Пример можно увидеть на нашем блоге, в комментариях некоторых пользователей.

В новой версии Wordpress уже встроена поддержка граватар, поэтому особо мобильные пользователи Интернет уже смогут оживлять ветвь дисскусии своими аватарками!

easy sort table with javascript

javascript Август 20th, 2008

Скрипт сортировки данных в таблице с помощью JavaScript.

Read the rest of this entry »

Tags: , , , , ,

JavaScript Check Email Address

javascript, ПРОГРАММИРОВАНИЕ Август 5th, 2008

A while ago I put up a Password Strength Checker using JavaScript and Regular Expressions. On that same note, you can also check the structure of an email address utilizing the same methodology:

If your form element has the id=emailaddress and you add a form onSubmit=”return checkEmail();”, this is a Javascript function that you can utilize to return an alert if the email address has a valid structure or not:

function checkEmail() {
var email = document.getElementById(’emailaddress’);
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (!filter.test(email.value)) {
alert(’Please provide a valid email address’);
email.focus
return false;
}else{
alert(’Email address is valid’);
email.focus
return true;
}
}

Try use this function:
Read the rest of this entry »

распознавание капчи. php решения.

WEB, php, xakep Июль 23rd, 2008

php решения распознавания каптч трёх видов

captcha1

captcha1

Read the rest of this entry »

Tags: , , , , , , , , , , , , ,

Getting real IP address in PHP

php, ПРОГРАММИРОВАНИЕ Июль 17th, 2008

Are you using $_SERVER['REMOTE_ADDR'] to find the the client’s IP address in PHP? Well dude, you might be amazed to know that it may not return the true IP address of the client at all time. If your client is connected to the Internet through Proxy Server then $_SERVER['REMOTE_ADDR'] in PHP just returns the the IP address of the proxy server not of the client’s machine.  So here is a simple function in PHP to find the real IP address of the client’s machine. Read the rest of this entry »

Tags:

foreach in JavaScript

javascript, ПРОГРАММИРОВАНИЕ Июль 8th, 2008

Actually that’s not true at all.
As all javascript objects are really just associative arrays, there is a foreach like syntax for the ‘for’ construct.
Without it it would be very hard to work with many common javascript objects.
It’s actually very simple to use and incredibly useful if you like associative arrays.

You just have to make sure to use it on an associative array and not an object.
Example below

Read the rest of this entry »

Tags: , , ,

WEB Optimizator

WEB, ПРОГРАММИРОВАНИЕ Июнь 19th, 2008

http://webo.in - Онлайн сервис проверки скорости загрузки сайтов. Советы по ускорению загрузки сайтов и оптимизации времени загрузки.

Tags: , , ,