one button press save a lot of data stored

For the time I will look at how all the action on the save button in the press a lot of id or data entered into the database is very simple but you have to understand there before looping and place. Ok I think you've been able to with no strings attached
to do this we need an array of looping a text

text script example ==> <input type="text" name="idbarang[]"> / / for the name I gave the name idbarang free and compulsory for the brackets on the back because this array in order to know who wants to infinity in the input text.

henceforth we just plug in the script shelf.

save example script = >>>

$ id = $ _POST ['idbarang']; / / renaming this to a text idbarang
$ result = count ($ id);/ / this to calculate text
for ($ i = 0; $ i <= $ result $ i + +) {/ / $ i starts at 0 and must not be greater than $ results $ i plus one of the
mysql_query ("INSERT INTO` tb_belajar `(
`idbarang`,
`name`
)
VALUES (
'', '$ Id [$ i]', '$ _POST [namebarang]') ");

/ / $ id [$ i] ituh enter whatever value there is in the text

}

thank you so much from me and hopefully useful

Source MYBLOG Inpiration OF Dreams
 

simple Pagging in php

To pagging actually easy kenapah I say easy hold you all that you want to keep learning ... very easy and simple words are pronounced ....

first you need to prepare a table before ......

CREATE TABLE `students` (

`Nis` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,

`Name` VARCHAR (35) NOT NULL,

`Jk` VARCHAR (1) NOT NULL

) ENGINE = MYISAM;


if the table is already installed with students databse you please fill this table dengam 10 records for pagging check whether or not the road.

and you copy the following script =>

siswa.php name

<table>

      <thead>

        <tr>

     

          <th> nis </ th>

          <th> name </ th>

          <th> jk </ th>

        </ Tr>

      </ Thead>

      <tbody>

      <? Php

Mysql_connect ("localhost", "root", ""); / / local name, the user should, if there is a password on the contents

Mysql_select_db ("school") ;/ / name of the database I use the name of the school databse

                  $ Limit = 10 ;/ / create limits on how much data I use until 10 data

                $ Start = $ _GET ['terms'] * $ limit ;/ / this make take some halamanya

$ Sql ​​= "SELECT * FROM` students `limit $ start, $ limit"; / / select which tables will be displayed

                  $ Qry = mysql_query ($ sql);

                  while ($ data = mysql_fetch_array ($ qry)) {

             

                  ?>

        <tr>

          <td> <? php echo $ DataProduct [0]?> </ td>

          <td> <? php echo $ DataProduct [1]?> </ td>

          <td> <? php echo $ DataProduct [2]?> </ td>

         

       

        </ Tr>

        <? Php

                  }

                                ?>

      </ Tbody>

    </ Table>

    <p align="center"> page: <? php

  Let $ = mysql_query ("SELECT * FROM` students `"); / / reselect which tables will be displayed but must be the same as above

  $ Qty = mysql_num_rows ($ let) ;/ / count the number of data

  $ Result = $ Qty / $ limit ;/ / to know the data

  $ No = 0;

  for ($ number = 0; $ number <$ result, $ number + +) {/ / repeat the data and must not be greater than $ results

                  $ No + +;

                  echo "<a href=\"siswa.php?hal=$angka\" class=\"active\"> $ no </ a>";}

                ?> </ P>

so many of my anchovies may be useful for you thank you ..

Sources MYBLOG  Inspiration Of Dreams

 

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
 

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
 

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
 

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
 

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