xampp berjalan lambat setelah di instal
xampp menjadi lambat setelah di instal , padahal sebelumnya berjalan normal.
Ini disebabkan oleh IPV6. Inilah cara Anda membuat MYSQL tidak menggunakannya. (jadi, tanpa menonaktifkan IPV6)
edit file mysql ‘my.ini’
di bawah [mysqld] tambahkan berikut ini:
bind-address = ::
Simpan file dan mulai ulang layanan mysql
[query mysql] String Functions
sumber:http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
Name |
Description |
ASCII() | Return numeric value of left-most character |
BIN() | Return a string containing binary representation of a number |
BIT_LENGTH() | Return length of argument in bits |
CHAR_LENGTH() | Return number of characters in argument |
CHAR() | Return the character for each integer passed |
CHARACTER_LENGTH() | A synonym for CHAR_LENGTH() |
CONCAT_WS() | Return concatenate with separator |
CONCAT() | Return concatenated string |
ELT() | Return string at index number |
EXPORT_SET() | Return a string such that for every bit set in the value bits, you get an on string and for every unset bit, you get an off string |
FIELD() | Return the index (position) of the first argument in the subsequent arguments |
FIND_IN_SET() | Return the index position of the first argument within the second argument |
FORMAT() | Return a number formatted to specified number of decimal places |
HEX() | Return a hexadecimal representation of a decimal or string value |
INSERT() | Insert a substring at the specified position up to the specified number of characters |
INSTR() | Return the index of the first occurrence of substring |
LCASE() | Synonym for LOWER() |
LEFT() | Return the leftmost number of characters as specified |
LENGTH() | Return the length of a string in bytes |
LIKE | Simple pattern matching |
LOAD_FILE() | Load the named file |
LOCATE() | Return the position of the first occurrence of substring |
LOWER() | Return the argument in lowercase |
LPAD() | Return the string argument, left-padded with the specified string |
LTRIM() | Remove leading spaces |
MAKE_SET() | Return a set of comma-separated strings that have the corresponding bit in bits set |
MATCH | Perform full-text search |
MID() | Return a substring starting from the specified position |
NOT LIKE | Negation of simple pattern matching |
NOT REGEXP | Negation of REGEXP |
OCT() | Return a string containing octal representation of a number |
OCTET_LENGTH() | A synonym for LENGTH() |
ORD() | Return character code for leftmost character of the argument |
POSITION() | A synonym for LOCATE() |
QUOTE() | Escape the argument for use in an SQL statement |
REGEXP | Pattern matching using regular expressions |
REPEAT() | Repeat a string the specified number of times |
REPLACE() | Replace occurrences of a specified string |
REVERSE() | Reverse the characters in a string |
RIGHT() | Return the specified rightmost number of characters |
RLIKE | Synonym for REGEXP |
RPAD() | Append string the specified number of times |
RTRIM() | Remove trailing spaces |
SOUNDEX() | Return a soundex string |
SOUNDS LIKE | Compare sounds |
SPACE() | Return a string of the specified number of spaces |
STRCMP() | Compare two strings |
SUBSTR() | Return the substring as specified |
SUBSTRING_INDEX() | Return a substring from a string before the specified number of occurrences of the delimiter |
SUBSTRING() | Return the substring as specified |
TRIM() | Remove leading and trailing spaces |
UCASE() | Synonym for UPPER() |
UNHEX() | Return a string containing hex representation of a number |
UPPER() | Convert to uppercase |
[srcipt] merefresh iframe only once
tadinya mau ngintip tracking jne, tp klo di direct link si jne nya pelit gk ngasih munculnya not found terus.
(dulu sih bisa, dulu mah cukup pake file get content ato curl aja)
coba tes direct link ke http://www.jne.co.id/index.php?mib=tracking.detail&awb=2255835010009
untuk pertama kali pastti not found tpi klo sudah refresh baru deh data di tampilkan.
berikut contoh potongan scriptnya
<noframes> <body> Your browser does not support frames. </body> </noframe> < i frame id="homepage" src="http://www.jne.co.id/index.php?mib=tracking.detail&awb=<?=$resi?>" width="98%" height="100%" frameborder="0"> </iframe> <script> setTimeout(function(e){ var frame=$("#homepage") frame.attr('src',frame.attr('src')); },1000); setTimeout(function(e){ var frame=document.getElementById('homepage') frame.src=frame.src; },2000); </script>
contoh penggunaan:
http://www.bajusupermurah.com/awb.php?r=2255835010009 [ralat sudah gk pake iframe lagi]
[PHP + curl] cara membuat database ayat” Alkitab online ke mysql
siapa yang mau punya web yang bisa menampilkan alkitab online???
atau hanya untuk koleksi 🙂
nah untuk membuat Alkitab online tentunya kita harus punya databasenya terlebih dahulu
langsung aja saya share
yg di butuhkan:browser, xampp, notepad/dreamweaver/dll / blog snowr3x (buat nyontek) hhe
pertama buat databasenya terlebih dahulu bernama wp
kemudian buat table mysqlnya di phpmyadmin xampp kalian
id int 10 set primary set autoincreament
kitab varchar 20
pasal int 5
ayat int 5
firman varchar 20000
*jangan lupa untuk set primary dan auto increament pada id*
nah setelah table terbentuk kita butuh koneksi internet untuk mencomot/membangun database kita
caranya dengan mengambil data” yg sudah ada di internet
kali ini saya kebetulan ambil dari situs http://www.sabda.org/alkitab/tb
saya ambil yg versi tb
bikin page php, berikut ini codingannya
Baca lebih lanjut
belajar buat room chat ajax ~ PHP
masih dalam pengembangan hhhe
klo mau coba kunjungi
atau disini
ajax chat yg saya buat ini
mendetect ip pengunjung sebagai acuan primary-nya
jadi gak perlu login segala,
username bisa diganti bebas di bagian input file “ganti nama”
dan warna text user bisa diganti” juga dengan mengklick button ganti warna.
warna memang sengaja saya hanya pakai button dan kluarnya random
karana ajax saya masih blepotan heheehhe, harap maklum 😛
n saya juga mo tambahiin biar di room chat tersebut bisa upload file
sehinga antar user bisa shared file.
slamat mencoba 🙂
blajar bikin capcay sendiri
lagi coba” bikin capcay sendiri, daripada pake capcay google 😛
<? session_start(); define('capcay_numchar',6); define('capcay_lebar',100); define('capcay_tinggi',20); $pass_phrase=""; for($i=0;$i<capcay_numchar;$i++) { $pass_phrase.=chr(rand(97,122)); } $_SESSION['pass_phrase']=sha1($pass_phrase); //create image $img = imagecreatetruecolor(capcay_lebar,capcay_tinggi); //set background $bg_color = imagecolorallocate($img, 255, 255, 255); // white $text_color = imagecolorallocate($img,0,0,0); //black $graphic_color = imagecolorallocate($img,64,64,64); //abu" gelap // fill backgroud imagefilledrectangle($img,0,0, capcay_lebar, capcay_tinggi, $bg_color); // draw some random lines for($i=0; $i<3; $i++) { imageline($img,0,rand()%capcay_tinggi, capcay_lebar,rand() %25, $graphic_color); } //sprinkle for($i=0; $i<50; $i++) { imagesetpixel($img,rand()%capcay_lebar, rand()%capcay_tinggi, $graphic_color); } //draw the pass-phrase string imagettftext($img, 18, 0, 5, capcay_tinggi-5, $text_color, "arial.ttf", $pass_phrase); header("Content-type: image/png"); imagepng($img); imagedestroy($img); ?>
**yang perlu diperhatiin tuh font yg kita pake harus disertaiin juga di satu folder bersamaan
jalanin php di cron job~ cpanel
klo ngegoogling kita banyak ketemu cara set timming nya aja
padahal yg mo saya tau tuh gimana caranya jalanin tuh cron job.
maklum saya cuma ngeerti php dasar doank hhhhe
ternyata klo cron job untuk jalanin php, harus menambahakan syntax php di depannya
seperti ini :
php -q /home/punyasno/public_html/script.php
ket:
punyasno itu diganti sama username kalian
-q itu biar kita gak dikirimin message ke email kita
dengan cron job kita bisa backup database, cek database, cek file” yg ada di web kita, dll
ternyata cron job se simple itu 😛
Belajar PHP ( Session )
=======
session
=======
seperti saat mengeset cookies, session pun harus ditaruh di paling atas. session biasanya berguna untuk menandai bahwa user sudah login. sehingga user yang blum loggin takkan bisa masuk page kita dengan cara menembak url.
setcookie & session start harus ditaruh paling atas sebelum headers apapun disent (dicek / dibaca).
contoh yang ini sangat simpel cuma bila seesion kosong maka akan diisi nilai 1 dan nilai ini akan terus bertambah ktika page di refresh, tapi jika nilai sudah diatas 10 maka yang kluar hanya “^^” dan session akan di destroy :
<?
session_start();
if(isset($_SESSION[‘views’])) // cek
$_SESSION[‘views’]=$_SESSION[‘views’]+1; // klo ada nambah 1
else $_SESSION[‘views’]=1;
if($_SESSION[‘views’]>10) // klo lbih dari 10 maka destroy session sama echo “^^”;
{
unset($_SESSION[‘views’]); // untuk menghilangkan session atau bisa pakai session_destroy();
echo “^^”;
}
else
echo “session = ” . $_SESSION[‘views’]; // nampilin nilai session
?>
session jangan lupa di destroy
klo gak nanti akan makan resource pada memory
Belajar PHP ( cookie )
===================
cookies
====================
cookie itu berguna untuk menyimpan data pada client server,
dimana data tersebut biasanya dipakai untuk menandai.
misal: agar bisa masuk tanpa login kembali
Untuk menanam cookie kita harus taruh codenya sebelum tag <HTML>
<?
setcookie(“user” , “snowrex” , time()+5);
// buat nanem cookie, time()+5 artinya dikasih expire 5 detik
// maka akan tertanam cookies yang berisi user = snowrex
// cookie slalu ditanem sebelum tag <html>
// user merupakan nama variabel aja jadi bisa diganti dengan nama az
?>
<html>
<head>
</head>
<body>
<h1>belajar menanam cookies dengan PHP</h1><br>
<?
if(isset($_COOKIE[“user”]))echo “Welcome ” . $_COOKIE[“user”] . “!<br>”;
else echo “welcome guest!<br>”;
?>
</body>
</html>
=================PENJELASAN=============
…baca lage yuk..