Validation Jpeg image, jpg and png in php

Ass ..... I am now going to discuss about how to filter upload image or file. So gini habits like fun in the security of a website so that the website clicking any error or order one through to amanannya the image or file uploads. So in order to upload images or files safely we have to limit the upload image or file like-image can only Type Jpg, Jpeg, Png or file and can only zip and pdf
I will not give an example for image alone can try to file your own by ..
example scriptè



$ tipe_file = $ _FILES ['file name field'] ['type']; / / to find out who uploaded Type apah
$ formatgambar = array ("image / jpg", "image / jpeg", "image / gif", "image / png");/ / to find out who are allowed apah
$ namaimage = $ _FILES ['file name field'] ['name'];/ / to retrieve the name of the uploaded photo
$ alamatimage = $ _FILES ['file name field'] ['tmp_name'];/ / to hold while a photo or image around
$ image = move_uploaded_file ($ alamatimage, 'formphp / News / images /'. $ namaimage); / / to move the photos to a folder that we provide suah
if (! in_array ($ tipe_file, $ formatgambar)) {/ / if $ tipe_file, $ formatgambar not the same
  echo "<script> alert ('image format incorrect') </ script>";/ / mesage
else {}
/ / example script insert
mysql_query ("INSERT INTO` table name `(
`Id`,
`Title`,
`ImageNews`,
)
VALUES (
'', '$ _POST [Title]', '$ namaimage') ");}

echo "<script> alert ('save successfully'); </ script>";

A few of my thank you respectfully
Source MYBLOG Inspiration OF Dreams
READMORE
 

how to delete photos in folder php mysql datbase

Ass .. for this article I will tell baimana delete photos in php and MYSQL database with photos that were deleted in the folder .. This allows the script folder size is not too big and not over load actually does not apply to the images alone but applies to anything like PDF or ZIP. Not much stale stale I will reveal the secret

example Script

if ($ mode == "delete") {

                 $ new = mysql_query ("SELECT * FROM` table `WHERE id_primary name = '$ id'");/ / table to determine which would be in the clear

    $ folder = mysql_fetch_array ($ new);

    $ where = $ folder ['nama_field_foto'];

     $ imagedelet = "try / images / $ spot";/ / address of where the photo

      unlink ($ imagedelet);/ / script delete folders

      $ sqlquery = "DELETE FROM` nama_table `WHERE` id_primary `= '$ id'";

      $ querycek = mysql_query ($ sqlquery);/ / sql script delet

                             

echo "<script> alert ('Delete successfully'); </ script>";/ / message

echo "<script> document.location.href = 'address in the heading after successfully remove'; </ script>";

}

?>

Sumber MYBLOG Inspiration OF Dreams
READMORE
 

Auto ID IN PHP

Ass ... for this time I will make a php article auto auto id in id useful for databases that do not use the auto increment id in mysqlnya .. auto id can be used also for a single show or sesseorang indetitas goods etc ...

no strings attached I will memebrikan contohya:

coding example ==>

$ resultKode = mysql_query ("SELECT * FROM Table ORDER BY nama_field name DESC");/ / select table based on the selected id from the ground up

$ rowKode = mysql_fetch_array ($ resultKode);

$ nextKode = substr ($ rowKode ['nama_field'], 2,6) + 1;/ / sequence id broke it up to 2.6 ituh you want to make like apah

$ newKode = sprintf ("firstname auto id". "% 05s", $ nextKode); //combined print the name ID and $ nextkode

so many of my best wishes and worship may be useful for me amin

Source MYBLOG Inspiration OF Dreams
READMORE
 

Tool Tool MYSQL and MYSQL introduction

ok ... now I will introduce Dataabse MYSQL .. Friends may be friends already on the blade but I just wanted to introduce the people who do not know wrote ... hehehehe maaaf vicious words

first install XAMPP is up to 1.6 tau 1.7. ok I think already.
The second click brousernya and ktikan LINK "Lokalhost"
normally the image will appear ....

in the picture there is a red circle ituh love number one. Click ok writing in circles
then the image will appear like this

Number 1 for the name of the database
Number 2 button create database
number 3 database anything that you've created
number 4 would create a data import exel, sql tau etc.
number 5 for Exel want to export data, sql tau etc.
if you've clicked the button will appear createnya
that is in this picture databsenya already become

Number 1 for the fancy table name created
Number 2 tnama table that would be made
number 3 dbrapah many fields that need ituh already created table directly go button on the right sebalah
number 4 for deassain database relationships
Click to go already emerging form fields are created as shown in the table below .........

Number 1 for field name

Number 2 types of data fields that need
Number 3 for the number of digits fielsd ituh
Number 4 for select primary or a fild ituh least

Number 5 created automatically but typedatanya id must be an integer


A few of my thank you respectfully
Sumber MYBLOG -> inspirationi of dreams
READMORE
 

PHP Image Upload

ass ................... for my second article I will discuss how to upload photos / images jpg, Jpeg etc.. to upload an image in php ituh very easy it can be said that the basic easy but if you are creative, people can upload pictures so uncommon and is not easy anymore. Ga lot of strings attached again I will start to upload images as well ... we need a database okay to database problems we already ga I think you have whiz table first of all we prepared for upload should calm gamabarnya Copas ko hehehe .... : D

   CREATE TABLE `tb_upload` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `image` TEXT NOT NULL) ENGINE = MYISAM;

For the second one we make for upload form script gambarnya.dan lifeline shelf

<? php
if (isset ($ _POST ['upload'])) {
  $ tipe_file = $ _FILES ['image'] ['type'];
  $ formatgambar = array ("image / jpg", "image / jpeg", "image / gif", "image / png");
$ namaimage = $ _FILES ['image'] ['name'];/ / create ngambil image name
$ alamatimage = $ _FILES ['image'] ['tmp_name'];/ / create the image address
$ image = move_uploaded_file ($ alamatimage, 'upload / images /'. $ namaimage);/ / this script mindahinnya "upload / images /" ituh want to save the image in the folder where you free up
mysql_query ("INSERT INTO` tutorial `.` tb_upload `(
`id`,
`image`
)
VALUES (
'', '$ Namaimage'
) ");
echo "been able to upload";
}
?>
The source code is action="" method="POST" enctype="multipart/form-data" name="form1">
   <table width="200" border="1">
     <tr>
       <td width="58"> Picture </ td>
       <td width="126"> <label for="image"> </ label>
       <input type="file" name="image"> </ td>
     </ tr>
     <tr>
       <td> </ td>
       <td> <input type="submit" name="upload" value="upload"> </ td>
     </ tr>
   </ table>
</ form>

  selsai may be useful for you and for me aminn worship <
wasssalam

Source MYBLOG Inspirasi OF Dreams
READMORE
 

scripts and tips or simple CRUD PHP Trick

Assalamualaikum ................................................. ......... :)Hi readers this first article I am ..... hahaha wow it feels incredible rich gituh ariel .. so bloggers ituh. in my first article I will ngebahas like where .. how create view update delete in the simple ............... not many strings attached for the first time we started to learn php ituh have already mastered HTML Tips transform and easy to learn HTML fast should be memorized Tag, how to link to another page and know how to use Dreamweaver guaranteed to be easy. if you want to learn to use Dreamweaver and create html table please visit the blog Book Information.HTML for us through the matter I consider the reader. :)ok ..... CEkidottttttttttttttCreate your php to CRUD database has touched .. I usually use MYSQL datbase ..Create your first database for easy copy paste ..CREATE TABLE `tb_belajar` (`Id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,`Name` VARCHAR (50) NOT NULL,`Religion` VARCHAR (50) NOT NULL) ENGINE = MYISAM;Both of you make connectionskoneksi.php<? Php$ Host = "loclahost";$ User = "root";$ Pass = "" ;/ / if there is a password please fill in MQYSL$ Dbname = "tutorial";

 
mysql_connect ($ host, $ user, $ pass);mysql_select_db ($ dbname);?>third for form input

 
form.php <? phpinclude "koneksi.php";$ Id = $ _REQUEST ['id'];$ Mode = $ _REQUEST ['mode'];if ($ mode == "edit") {
    
$ Qry = mysql_query ("select * from tb_belajar where id = $ id");
    
$ Show = mysql_fetch_array ($ qry);}?>The source code is id="form1" name="form1" method="POST" action="save.php">
  
<table width="200" border="1">
    
<tr>
      
<td width="51"> name </ td>
      
<td width="133"> <label for="textfield"> </ label>
      
<Input type = "text" name = "name" id = "textfield" value = "<? Php echo $ show [1]?>"> </ Td>
    
</ Tr>
    
<tr>
      
<td> religion </ td>
      
<td> <label for="select"> </ label>
        
<select name="agama" id="select">
          
<option value="islam"> islam </ option>
          
<option value="kristen"> kristen </ option>
          
<option value="budha"> budha </ option>
          
<option value="hindu"> hindu </ option>
      
</ Select> </ td>
    
</ Tr>
    
<tr>
      
<td> </ td>
      
<td> <input type="submit" name="save" id="save" value="Submit"> </ td>
    
</ Tr>
  
</ Table></ Form>save for the fourth syntaksave.ph<? Phpinclude "koneksi.php";$ Id = $ _REQUEST ['id'];$ Mode = $ _REQUEST ['mode'];if ($ mode == "edit") {mysql_query ("UPDATE` tb_belajar `SET` name `= '$ _POST [name]',`Religion` = '$ _POST [religion]' WHERE `id` = $ id ");Else {}
   
mysql_query ("INSERT INTO.` tb_belajar `(`Id`,`Name`,`Religion`)VALUES ('', '$ _POST [Name]', '$ _POST [religion]') ") ;/ / the contents of $ _POST [ituh text and list name in the form before}echo "<script> alert ('Data behasi in save') </ script>";echo "<script> documet.location.href = 'index.php' </ script>";?>Fifth create index for view and deleteindex.php<? Phpinclude "koneksi.php";$ Id = $ _REQUEST ['id'];$ Mode = $ _REQUEST ['mode'];if ($ mode == "delete") {
        
$ Sqlquery = "DELETE FROM` tb_belajar `WHERE` id `= '$ id'";
        
$ Querycek = mysql_query ($ sqlquery);echo "<script> alert ('Delete successfully'); </ script>";}?>The source code is name="form1" method="POST" action="">
  
<table width="200" border="1">
    
<tr>
    
<td colspan="4"> <a href="form.php"> <input type="button" name="button" id="button" value="add"> </ a> </ td>
    
</ Tr>
  
<tr>
    
<td> id </ td>
    
<td> name </ td>
    
<td> religion </ td>
    
<td> action </ td>
  
</ Tr>
  
<? Php
  
$ Sql ​​= mysql_query ("select * from tb_belajar");
  
while ($ data = mysql_fetch_array ($ sql)) {
  
?>
  
<tr>
    
<td> <? php echo $ data [0]?> </ td>
    
<td> <? php echo $ data [1]?> </ td>
    
<td> <? php echo $ data [2]?> </ td>
    
<td> <a href = "form.php & id = <? php echo $ data [0]?> & mode = edit"> <input type = "button" name = "button2" id = "button2" value = " edit "> </ a>
      
<A href = "? Mode = delete & id = <? Php echo $ data [0]?>"> <input Type="button" name="hapus" id="hapus" value="Submit"> </ a> </ td>
  
</ Tr>
  
<? Php
  
}?></ Table></ Form>

 
Hopefully Helpful for us 
allSource MYBLOG Inspirasi OF Dreams
READMORE
 

how to install cakephp


Bahasa Indonesia
Inggris
Arab
to install cakephp in windows or linux it's pretty easy as long as there is a willingness from you, there are also some Cakephp 1.3 version there is also a 2.0 and there's more you can just choose which version you want to wear but in the versions also there are different ways of writing or the other but you choose the suggestion of my cakephp 2.0 because I prefer that and I wear it and I also will not tell you how to install cakephp how because it's easy but if you really want to know how to install starter cakephp how you just find a guide on youtube, facebook or official websites cakephp.
I'm sorry if my words were wrong there, and hopefully more in the know cakephp semamgat 

READMORE