connecting div css and php page and basic css div


Hay visitor to this time I will make a an example of how to connect a separate css page with HTML or PHP possible for those who have advanced ituh ituh easy but very confusing for beginners. Do not be humble for the beginner ituh also learn proper name must have been getting in trouble. For beginners who learn proggraming there is an tips for you if you get in trouble or there sapai kebingunagan ituh your sign has gone up a level so do not ever give up ... ok

First of all, you make a page in dreamweaver css if you tingal new-> select css code .. and the content you want
but if those of you who do not use dreamweaver you can use notepad and copy code
 below 
@ Charset "utf-8";
/ * CSS Document * /

# Outer {width: 800px;
height: 700px;
background: # FFF;
} / / Width ituh for long if heigth create down or high and I love the color white background
# Header {
height: 200px;
width: 800px;
background: # F00;
} / / For long I still wear high 800 and 200 for the red background color. The background can also be used but with the size of the banner image that has been set
# Left {
width: 400px;
height: 400px;
background: # 00F;
float: left;
}
# Right {
width: 400px;
height: 400px;
background: # 0F0;
float: left;
} / THE LEFT TO RIGHT THIS SAME create html content where I set the same length and height but for a different color backgroun left right blue green and left to float in the first
# Footer {
width: 800px;
height: 100px;
background: # 000

} / / For this footer can be said of a website I set foot for long-footer certainly 800px;
and for the rest of the high of 700 in less than 200 in less than 400 so footer stay 100

note=> for div we must be smart in calculating the height and width of a web that we want to create.
Save with the name style.css

For the second stage I will tell you how you can install last css code to HTML
You just copy the code below and students I To cattan sign # in css had called him in the way HTML is wearing ID as below 
<link rel="stylesheet" href="style.css"/>
<div id="luar">
<div id="header"> this to a banner </ div>
<div id="kiri"> this to a left content </ div>
<div id="kanan"> this to the right content </ div>
<div id="footer"> this to a web foot </ div>
</ Div>


So much from me and thank you ...

 

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