sábado, 4 de octubre de 2014
PHP Javascript Alert Box
<?
echo '<script language="javascript">';
echo 'alert("Incomming call from 1111111111\n Jose")';
echo '</script>';
?>
How to make text blink with JavaScript and CSS3
There used to be CSS property called “text-decoration” and HTML tag “blink” that allowed you to do that easily, but modern browsers these days doesn’t support them anymore. so only option left is to use jQuery for that. Here in this tutorial I’m going to show you a very simple trick you can use to make text blink with JavaScript and CSS3.
jQuery
|
1
2
3
4
5
6
7
8
9
|
// we are blinking text using simple setInterval function
<script type="text/javascript">
$(function(){
window.setInterval(function(){
// 'blink' class is toggled into 'P' tag between the interval of 500 ms
$('P').toggleClass('blink');
}, 500);
});
</script>
|
CSS used for Blinking text
CSS
|
1
2
3
4
5
6
7
|
<style ="text/css">
/* We are using CSS3 Property "transition" for the animating blinking text effect */
P {transition: color 200ms ease;}
/* The class "Blink" is set to be transparent*/
P.blink {color:transparent;}
</style>
|
HTML
|
1
|
<p>This is a demo text that blinks.</p>
|
By default we have set the “P” element to have CSS3 transition property which creates the fade in and fade out effect every time a property changes and the class “blink” has the css property of color set to be transparent meaning it makes the text invisible, so every time the “blink” class is added the text becomes invisible and then visible again when the “blink” class is removed.
This is a really simple way to do this and might be useful sometimes.
http://www.andwecode.com/blink-text-using-simple-javascript-css3/#tab-4820-demo
POPUP WINDOW
<br><center><b>
<a href="" onclick="window.open('google.com','name','width=400,height=500')">Voices list</a></b></center>
<a href="" onclick="window.open('google.com','name','width=400,height=500')">Voices list</a></b></center>
Add edit delete rows dynamically using jquery and php
http://www.amitpatil.me/add-edit-delete-rows-dynamically-using-jquery-php/
http://www.jqueryrain.com/example/jquery-ajax-example/page/4/
Here is the live demo http://www.amitpatil.me/demos/add-edit-delete-rows-dynamically-using-jquery-and-php/with-drop-down/ and download it from here http://www.amitpatil.me/demos/add-edit-delete-rows-dynamically-using-jquery-and-php/Ajax-table-with-drop-down.zip - See more at: http://www.amitpatil.me/add-edit-delete-rows-dynamically-using-jquery-php/#sthash.44BTTzMs.dpuf
http://www.jqueryrain.com/example/jquery-ajax-example/page/4/
Here is the live demo http://www.amitpatil.me/demos/add-edit-delete-rows-dynamically-using-jquery-and-php/with-drop-down/ and download it from here http://www.amitpatil.me/demos/add-edit-delete-rows-dynamically-using-jquery-and-php/Ajax-table-with-drop-down.zip - See more at: http://www.amitpatil.me/add-edit-delete-rows-dynamically-using-jquery-php/#sthash.44BTTzMs.dpuf
Here is the live demo http://www.amitpatil.me/demos/add-edit-delete-rows-dynamically-using-jquery-and-php/with-drop-down/ and download it from here http://www.amitpatil.me/demos/add-edit-delete-rows-dynamically-using-jquery-and-php/Ajax-table-with-drop-down.zip - See more at: http://www.amitpatil.me/add-edit-delete-rows-dynamically-using-jquery-php/#sthash.44BTTzMs.dpuf
Here is the live demo http://www.amitpatil.me/demos/add-edit-delete-rows-dynamically-using-jquery-and-php/with-drop-down/ and download it from here http://www.amitpatil.me/demos/add-edit-delete-rows-dynamically-using-jquery-and-php/Ajax-table-with-drop-down.zip - See more at: http://www.amitpatil.me/add-edit-delete-rows-dynamically-using-jquery-php/#sthash.44BTTzMs.dpuf
(Ubuntu - Lamp) Why exist in Ubuntu lamp 2 PHP.ini files?
PHP can be executed from the command line or from a webserver.
http://superuser.com/questions/147743/ubuntu-lamp-why-exist-in-ubuntu-lamp-2-php-ini-files
/etc/php5/apache2/php.ini is used for the webserver execution, /etc/php5/cli/php.ini is used for the command line execution.http://superuser.com/questions/147743/ubuntu-lamp-why-exist-in-ubuntu-lamp-2-php-ini-files
martes, 30 de septiembre de 2014
Generate Random 10 Digit Number in PHP
Generate Random 10 Digit Number in PHP
PHP, Quick Tips 40 Comments
The application I’m developing requires a random 10 digit number as a bar code on season pass. A simple way to create a unique number is to use the following code:
?
1
$random = substr(number_format(time() * mt_rand(),0,'',''),0,10);
Here’s whats happening with the code:
The outer portion “substr” is used to chop down the random number we create to 10 characters. You will notice the number 10 at the end of the snippet, which can be changed to any number you want.
The “number_format” function helps get rid of the scientific notation that will arise from generating the random number. In the middle, “time()” and “mt_rand()” are multiplied. Time() is the number of seconds from January 1 1970, and rand() is a uniquely generated number through PHP.
Always remember that generating unique numbers is not fool proof. If your application requires each number to be unique, perform a collision check in the database before saving.
- See more at: http://elementdesignllc.com/2011/06/generate-random-10-digit-number-in-php/#sthash.WrvYJJBc.dpuf
Here’s whats happening with the code:
The outer portion “substr” is used to chop down the random number we create to 10 characters. You will notice the number 10 at the end of the snippet, which can be changed to any number you want.
The “number_format” function helps get rid of the scientific notation that will arise from generating the random number. In the middle, “time()” and “mt_rand()” are multiplied. Time() is the number of seconds from January 1 1970, and rand() is a uniquely generated number through PHP.
Always remember that generating unique numbers is not fool proof. If your application requires each number to be unique, perform a collision check in the database before saving.
- See more at: http://elementdesignllc.com/2011/06/generate-random-10-digit-number-in-php/#sthash.WrvYJJBc.dpuf
Here’s whats happening with the code:
The outer portion “substr” is used to chop down the random number we create to 10 characters. You will notice the number 10 at the end of the snippet, which can be changed to any number you want.
The “number_format” function helps get rid of the scientific notation that will arise from generating the random number. In the middle, “time()” and “mt_rand()” are multiplied. Time() is the number of seconds from January 1 1970, and rand() is a uniquely generated number through PHP.
Always remember that generating unique numbers is not fool proof. If your application requires each number to be unique, perform a collision check in the database before saving.
- See more at: http://elementdesignllc.com/2011/06/generate-random-10-digit-number-in-php/#sthash.WrvYJJBc.dpuf
Here’s whats happening with the code:
The outer portion “substr” is used to chop down the random number we create to 10 characters. You will notice the number 10 at the end of the snippet, which can be changed to any number you want.
The “number_format” function helps get rid of the scientific notation that will arise from generating the random number. In the middle, “time()” and “mt_rand()” are multiplied. Time() is the number of seconds from January 1 1970, and rand() is a uniquely generated number through PHP.
Always remember that generating unique numbers is not fool proof. If your application requires each number to be unique, perform a collision check in the database before saving.
- See more at: http://elementdesignllc.com/2011/06/generate-random-10-digit-number-in-php/#sthash.WrvYJJBc.dpuf
Here’s whats happening with the code:
The outer portion “substr” is used to chop down the random number we create to 10 characters. You will notice the number 10 at the end of the snippet, which can be changed to any number you want.
The “number_format” function helps get rid of the scientific notation that will arise from generating the random number. In the middle, “time()” and “mt_rand()” are multiplied. Time() is the number of seconds from January 1 1970, and rand() is a uniquely generated number through PHP.
Always remember that generating unique numbers is not fool proof. If your application requires each number to be unique, perform a collision check in the database before saving.
- See more at: http://elementdesignllc.com/2011/06/generate-random-10-digit-number-in-php/#sthash.WrvYJJBc.dpuf
Here’s whats happening with the code:
The outer portion “substr” is used to chop down the random number we create to 10 characters. You will notice the number 10 at the end of the snippet, which can be changed to any number you want.
The “number_format” function helps get rid of the scientific notation that will arise from generating the random number. In the middle, “time()” and “mt_rand()” are multiplied. Time() is the number of seconds from January 1 1970, and rand() is a uniquely generated number through PHP.
Always remember that generating unique numbers is not fool proof. If your application requires each number to be unique, perform a collision check in the database before saving.
- See more at: http://elementdesignllc.com/2011/06/generate-random-10-digit-number-in-php/#sthash.WrvYJJBc.dpuf
Here’s whats happening with the code:
The outer portion “substr” is used to chop down the random number we create to 10 characters. You will notice the number 10 at the end of the snippet, which can be changed to any number you want.
The “number_format” function helps get rid of the scientific notation that will arise from generating the random number. In the middle, “time()” and “mt_rand()” are multiplied. Time() is the number of seconds from January 1 1970, and rand() is a uniquely generated number through PHP.
Always remember that generating unique numbers is not fool proof. If your application requires each number to be unique, perform a collision check in the database before saving.
- See more at: http://elementdesignllc.com/2011/06/generate-random-10-digit-number-in-php/#sthash.WrvYJJBc.dpuf
PHP, Quick Tips 40 Comments
The application I’m developing requires a random 10 digit number as a bar code on season pass. A simple way to create a unique number is to use the following code:
?
1
$random = substr(number_format(time() * mt_rand(),0,'',''),0,10);
Here’s whats happening with the code:
The outer portion “substr” is used to chop down the random number we create to 10 characters. You will notice the number 10 at the end of the snippet, which can be changed to any number you want.
The “number_format” function helps get rid of the scientific notation that will arise from generating the random number. In the middle, “time()” and “mt_rand()” are multiplied. Time() is the number of seconds from January 1 1970, and rand() is a uniquely generated number through PHP.
Always remember that generating unique numbers is not fool proof. If your application requires each number to be unique, perform a collision check in the database before saving.
- See more at: http://elementdesignllc.com/2011/06/generate-random-10-digit-number-in-php/#sthash.WrvYJJBc.dpuf
Generate Random 10 Digit Number in PHP
The application I’m developing requires a random 10 digit number as a bar code on season pass. A simple way to create a unique number is to use the following code:
1
| $random = substr(number_format(time() * mt_rand(),0,'',''),0,10); |
The outer portion “substr” is used to chop down the random number we create to 10 characters. You will notice the number 10 at the end of the snippet, which can be changed to any number you want.
The “number_format” function helps get rid of the scientific notation that will arise from generating the random number. In the middle, “time()” and “mt_rand()” are multiplied. Time() is the number of seconds from January 1 1970, and rand() is a uniquely generated number through PHP.
Always remember that generating unique numbers is not fool proof. If your application requires each number to be unique, perform a collision check in the database before saving.
- See more at: http://elementdesignllc.com/2011/06/generate-random-10-digit-number-in-php/#sthash.WrvYJJBc.dpuf
Generate Random 10 Digit Number in PHP
The application I’m developing requires a random 10 digit number as a bar code on season pass. A simple way to create a unique number is to use the following code:
1
| $random = substr(number_format(time() * mt_rand(),0,'',''),0,10); |
The outer portion “substr” is used to chop down the random number we create to 10 characters. You will notice the number 10 at the end of the snippet, which can be changed to any number you want.
The “number_format” function helps get rid of the scientific notation that will arise from generating the random number. In the middle, “time()” and “mt_rand()” are multiplied. Time() is the number of seconds from January 1 1970, and rand() is a uniquely generated number through PHP.
Always remember that generating unique numbers is not fool proof. If your application requires each number to be unique, perform a collision check in the database before saving.
- See more at: http://elementdesignllc.com/2011/06/generate-random-10-digit-number-in-php/#sthash.WrvYJJBc.dpuf
Generate Random 10 Digit Number in PHP
The application I’m developing requires a random 10 digit number as a bar code on season pass. A simple way to create a unique number is to use the following code:
1
| $random = substr(number_format(time() * mt_rand(),0,'',''),0,10); |
The outer portion “substr” is used to chop down the random number we create to 10 characters. You will notice the number 10 at the end of the snippet, which can be changed to any number you want.
The “number_format” function helps get rid of the scientific notation that will arise from generating the random number. In the middle, “time()” and “mt_rand()” are multiplied. Time() is the number of seconds from January 1 1970, and rand() is a uniquely generated number through PHP.
Always remember that generating unique numbers is not fool proof. If your application requires each number to be unique, perform a collision check in the database before saving.
- See more at: http://elementdesignllc.com/2011/06/generate-random-10-digit-number-in-php/#sthash.WrvYJJBc.dpuf
Generate Random 10 Digit Number in PHP
The application I’m developing requires a random 10 digit number as a bar code on season pass. A simple way to create a unique number is to use the following code:
1
| $random = substr(number_format(time() * mt_rand(),0,'',''),0,10); |
The outer portion “substr” is used to chop down the random number we create to 10 characters. You will notice the number 10 at the end of the snippet, which can be changed to any number you want.
The “number_format” function helps get rid of the scientific notation that will arise from generating the random number. In the middle, “time()” and “mt_rand()” are multiplied. Time() is the number of seconds from January 1 1970, and rand() is a uniquely generated number through PHP.
Always remember that generating unique numbers is not fool proof. If your application requires each number to be unique, perform a collision check in the database before saving.
- See more at: http://elementdesignllc.com/2011/06/generate-random-10-digit-number-in-php/#sthash.WrvYJJBc.dpuf
Generate Random 10 Digit Number in PHP
The application I’m developing requires a random 10 digit number as a bar code on season pass. A simple way to create a unique number is to use the following code:
1
| $random = substr(number_format(time() * mt_rand(),0,'',''),0,10); |
The outer portion “substr” is used to chop down the random number we create to 10 characters. You will notice the number 10 at the end of the snippet, which can be changed to any number you want.
The “number_format” function helps get rid of the scientific notation that will arise from generating the random number. In the middle, “time()” and “mt_rand()” are multiplied. Time() is the number of seconds from January 1 1970, and rand() is a uniquely generated number through PHP.
Always remember that generating unique numbers is not fool proof. If your application requires each number to be unique, perform a collision check in the database before saving.
- See more at: http://elementdesignllc.com/2011/06/generate-random-10-digit-number-in-php/#sthash.WrvYJJBc.dpuf
Generate Random 10 Digit Number in PHP
The application I’m developing requires a random 10 digit number as a bar code on season pass. A simple way to create a unique number is to use the following code:
1
| $random = substr(number_format(time() * mt_rand(),0,'',''),0,10); |
The outer portion “substr” is used to chop down the random number we create to 10 characters. You will notice the number 10 at the end of the snippet, which can be changed to any number you want.
The “number_format” function helps get rid of the scientific notation that will arise from generating the random number. In the middle, “time()” and “mt_rand()” are multiplied. Time() is the number of seconds from January 1 1970, and rand() is a uniquely generated number through PHP.
Always remember that generating unique numbers is not fool proof. If your application requires each number to be unique, perform a collision check in the database before saving.
- See more at: http://elementdesignllc.com/2011/06/generate-random-10-digit-number-in-php/#sthash.WrvYJJBc.dpuf
Foreign key MYSQL PHPMYADMIN
https://www.youtube.com/watch? v=J3xvwhqYYMQ
CASCADE
Whenever rows in the master (referenced) table are deleted (resp. updated), the respective rows of the child (referencing) table with a matching foreign key column will get deleted (resp. updated) as well. This is called a cascade delete (resp. update[2]).
RESTRICT
A value cannot be updated or deleted when a row exists in a foreign key table that references the value in the referenced table. Similarly, a row cannot be deleted as long as there is a reference to it from a foreign key table.
NO ACTION
NO ACTION and RESTRICT are very much alike. The main difference between NO ACTION and RESTRICT is that with NO ACTION the referential integrity check is done after trying to alter the table. RESTRICT does the check before trying to execute the UPDATE or DELETE statement. Both referential actions act the same if the referential integrity check fails: the UPDATE or DELETE statement will result in an error.
SET NULL
The foreign key values in the referencing row are set to NULL when the referenced row is updated or deleted. This is only possible if the respective columns in the referencing table are nullable. Due to the semantics of NULL, a referencing row with NULLs in the foreign key columns does not require a referenced row.
SET DEFAULT
Similar to SET NULL, the foreign key values in the referencing row are set to the column default when the referenced row is updated or deleted.
CASCADE
Whenever rows in the master (referenced) table are deleted (resp. updated), the respective rows of the child (referencing) table with a matching foreign key column will get deleted (resp. updated) as well. This is called a cascade delete (resp. update[2]).
RESTRICT
A value cannot be updated or deleted when a row exists in a foreign key table that references the value in the referenced table. Similarly, a row cannot be deleted as long as there is a reference to it from a foreign key table.
NO ACTION
NO ACTION and RESTRICT are very much alike. The main difference between NO ACTION and RESTRICT is that with NO ACTION the referential integrity check is done after trying to alter the table. RESTRICT does the check before trying to execute the UPDATE or DELETE statement. Both referential actions act the same if the referential integrity check fails: the UPDATE or DELETE statement will result in an error.
SET NULL
The foreign key values in the referencing row are set to NULL when the referenced row is updated or deleted. This is only possible if the respective columns in the referencing table are nullable. Due to the semantics of NULL, a referencing row with NULLs in the foreign key columns does not require a referenced row.
SET DEFAULT
Similar to SET NULL, the foreign key values in the referencing row are set to the column default when the referenced row is updated or deleted.
Attachments area
Suscribirse a:
Entradas (Atom)