Thursday, June 23, 2016

Tuesday, June 7, 2016

How to remove symbol � ? PHP Include and accents (They show up as �)

That happens if the browser thinks your using another encoding than you actually use.
try to add the following in your php file before any html is printed:

header ('Content-type: text/html; charset=utf-8');
// or
header ('Content-type: text/html; charset=iso8859-15');

and add

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- or -->
<meta http-equiv="Content-Type" content="text/html; charset=ISO8859-15" />

between the <head></head> tags

UPDATE: just saw your update with the file. you need to add header ('Content-type: text/html; charset=utf-8');

Thursday, November 5, 2015

How to check given array is in which order..

    #include<stdio.h>
    #include<conio.h>
    #include<string.h>
    int main()
    {
    //int a[10]={2,5,1,7,0,10,145,14,15,9};
    int a[10]={1,2,3,4,5,6,7,8,9,10};
    int tem,i=0,j,isTRUE=0;
    for(j=0; j<10; j++)
    {
    if(a[j]<a[j+1])
    {
    isTRUE=1;
    break;
    }
    isTRUE=0;
    }
    if(isTRUE)
    printf("inorder\n");
    else
    printf("ASEorder\n");
    getch();
    return 0;
    }

How to find Length of string without using function?

$count = 0;
for ($i = 0; $i < 1000000; $i++) {
     if(isset($temp[$i]))  
        $count++;
     else
         break;
}
print_r($count);

****************************************************************
Another simplified version

$count = 0;
for ($i = 0; TRUE; $i++) {
     if(isset($temp[$i]))
        $count++;
     else
         break;
}
print_r($count);


Displaying MYSQL database table into PHP table

I have set up a MYSQL database and added a table with some data. I want to display this in a table in PHP that is 3 wide, like this:
<table width="100" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>item1</td>
    <td>item2</td>
    <td>item3</td>
  </tr>
  <tr>
    <td>item4</td>
    <td>item5</td>
    <td>item6</td>
  </tr>
  <tr>
    <td>item7</td>
    <td>item8</td>
    <td>item9</td>
  </tr>
</table>

and so on...
Now, I have been using this PHP:
CODE
<?php
//connect to the server
$link = mysql_connect('localhost', 'root', '');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}

//connect to the database
mysql_select_db(product_index);

//query the database
$query = mysql_query("SELECT * FROM products WHERE type = 'bracelets'");

//fetch the results / convert results into an array

        WHILE($rows = mysql_fetch_array($query)):
       
            $product_name = $rows['product_name'];
            $id = $rows['id'];
            $description = $rows['description'];
            $price = $rows['price'];
            $image_large = $rows['image_large'];
            $image_thumb = $rows['image_thumb'];
            $page_link = $rows['page_link'];
            $purchase_link = $rows['purchase_link'];
       
        echo "$product_name<br>$description<br>$price<br>$image_large<br>$image_thumb<br>$page_link<br>$purchase_link<br><br><br>";
       
        endwhile;
?>

Wednesday, October 28, 2015

how to write css in different browser..Prevent Bootstrap Modal from disappearing when clicking outside or pressing escape?

1.Prevent Bootstrap Modal from disappearing when clicking outside or pressing escape?

If using javascript then:

$('#myModal').modal({
    backdrop: 'static',
    keyboard: false
})
and if HTML:
<a data-controls-modal="your_div_id" data-backdrop="static" data-keyboard="false" href="#">

**************************************************************************************************
2.how to find ip address in php
<?php echo $_SERVER["REMOTE_ADDR"];     ?>
********************************************************
3.how to get base url
<?php echo getcwd(); ?>
********************************************************
4. how to write css in different browser..
.safari { /* Safari only */ }
.mac { /* Mac only */ }
.safari.mac { /* Safari Mac */ }
html:not(.safari) { /* All browsers except for Safari */ }
html:not(.safari.mac) { /* All browsers except for Safari Mac */ }
**************************************************************************

What are the key differences between HTML and HTML5? Which is better?

1. HTML5 Is a Work in Progress

2. Simplified Syntax

3. The New <canvas> Element

4. The <header> and <footer> Elements

5. New <section> and <article> Elements

6. New <menu> and <figure> Elements

8. New <audio> and <video> Elements

8. New Forms

The new <form> and <forminput> elements are looking good. If you do much with forms, you may want to take a look at what these have to offer.

9. Kiss <b> and <font> Goodbye!

CSS, all the time.
All the time, CSS.

10. No More <frame>, <center>, <big>

I bet you’re going to miss these.


Difference in Tags:


• <!DOCTYPE  html> : In  HTML 4.01, there are three different <!DOCTYPE> declarations  but  In HTML 5 there is only one  <! DOCTYPE html>

•  <a >:  In HTML 4.01, the <a> tag could be either a hyperlink or an anchor. In HTML5, the <a> tag is always a hyperlink, but if it has no href attribute, it is only a placeholder for a hyperlink.

• <acronym> : The <acronym> tag is not supported in HTML5. Use the <abbr> tag instead. The <acronym> tag was used to define acronyms in HTML 4.01.

• <applet>: The <applet> tag is not supported in HTML5.  Use the  <object> tag instead.

• <strong>: In HTML 4.01, the <strong> tag defines strong emphasized text, but in HTML5 it defines important text.

• <body> :   In HTML5, all <body> specific attributes are removed, while in HTML 4.01 they were deprecated.

• <hr>: In HTML 4.01, the <hr> tag represented a horizontal rule. In HTML5, the <hr> tag defines a thematic break. The <hr> element is used to separate content (or define a change) in an HTML page.


• <map> : In HTML5, if the id attribute of the <map> tag is also specified, it must have the same value as the name attribute.

• <meta> :  The scheme attribute is not supported in HTML5.


HTML5 has a new attribute, charset, which makes it easier to define charset:


HTML5 has a new attribute, charset, which makes it easier to define charset:

HTML 4.01: <Meta http-equiv="content-type" content="text/html; charset=UTF-8">
            
HTML5 : <meta charset="UTF-8”>

• <script> : The "type" attribute is required in HTML 4, but optional in HTML5.

•<small >  : In HTML 4.01 the small element is displayed as smaller text. In HTML5 the small element defines small text and other side comments, and is displayed as smaller text.

•<table>:  Only the "border" attribute is supported in HTML5, and it only allows the values " " or "1".

New Semantic/Structural Elements :


HTML5 offers new elements for better structure:
      

           
<article>  :  Defines an article

           
<aside>  :  Defines content aside from   the page content

           
<bdi>   :  Isolates a part of text that might be formatted in a   different
direction from other text outside it
           

<command>   :   Defines a command button   that a user can invoke
           

<details>   :   Defines additional details   that the user can view or hide
           

<summary>    :    Defines a visible heading   for a <details> element
           

<figure>   :  Specifies self-contained   content, like illustrations, diagrams, photos, code listings, etc.
           

<figcaption>   : Defines a caption for a   <figure> element
           

<footer>   :  Defines a footer for a   document or section.

      
<header>   :   Defines a header for

Difference in Tags:


• <!DOCTYPE  html> : In  HTML 4.01, there are three different <!DOCTYPE> declarations  but  In HTML 5 there is only one  <! DOCTYPE html>

•  <a >:  In HTML 4.01, the <a> tag could be either a hyperlink or an anchor. In HTML5, the <a> tag is always a hyperlink, but if it has no href attribute, it is only a placeholder for a hyperlink.

• <acronym> : The <acronym> tag is not supported in HTML5. Use the <abbr> tag instead. The <acronym> tag was used to define acronyms in HTML 4.01.

• <applet>: The <applet> tag is not supported in HTML5.  Use the  <object> tag instead.

• <strong>: In HTML 4.01, the <strong> tag defines strong emphasized text, but in HTML5 it defines important text.

• <body> :   In HTML5, all <body> specific attributes are removed, while in HTML 4.01 they were deprecated.

• <hr>: In HTML 4.01, the <hr> tag represented a horizontal rule. In HTML5, the <hr> tag defines a thematic break. The <hr> element is used to separate content (or define a change) in an HTML page.


• <map> : In HTML5, if the id attribute of the <map> tag is also specified, it must have the same value as the name attribute.

• <meta> :  The scheme attribute is not supported in HTML5.


HTML5 has a new attribute, charset, which makes it easier to define charset:


HTML5 has a new attribute, charset, which makes it easier to define charset:

HTML 4.01: <Meta http-equiv="content-type" content="text/html; charset=UTF-8">
            
HTML5 : <meta charset="UTF-8”>

• <script> : The "type" attribute is required in HTML 4, but optional in HTML5.

•<small >  : In HTML 4.01 the small element is displayed as smaller text. In HTML5 the small element defines small text and other side comments, and is displayed as smaller text.

•<table>:  Only the "border" attribute is supported in HTML5, and it only allows the values " " or "1".

New Semantic/Structural Elements :


HTML5 offers new elements for better structure:
      

           
<article>  :  Defines an article

           
<aside>  :  Defines content aside from   the page content

           
<bdi>   :  Isolates a part of text that might be formatted in a   different
direction from other text outside it
           

<command>   :   Defines a command button   that a user can invoke
           

<details>   :   Defines additional details   that the user can view or hide
           

<summary>    :    Defines a visible heading   for a <details> element
           

<figure>   :  Specifies self-contained   content, like illustrations, diagrams, photos, code listings, etc.
           

<figcaption>   : Defines a caption for a   <figure> element
           

<footer>   :  Defines a footer for a   document or section.

      
<header>   :   Defines a header for a   document or section

           
<hgroup>   :   Groups a set of <h1>   to <h6> elements when a heading has multiple levels.

           
<mark>   :   Defines marked/highlighted   text.

           
<meter>  :   Defines a scalar   measurement within a known range (a gauge).

           
<nav>   :    Defines navigation links.

           
<progress>   :   Represents the progress of   a task.

           
<ruby>    :   Defines a ruby annotation   (for East Asian typography).

           
<rt>   :  Defines an   explanation/pronunciation of characters (for East Asian typography).

           
<rp>   :   Defines what to show in browsers that do not support ruby   annotations
    

        
<section>   :  Defines a section in a   document
    

        
<time>  :  Defines a date/time
    

<wbr>  :  Defines a possible line-break .

New Media Elements :


HTML5 offers new elements for media content:
      

           
<audio>  :  Defines sound content.
           
<video>  :  Defines a video or movie.
           
<source>  :  Defines multiple media   resources for <video> and <audio>.
           
<embed>  :  Defines a container for an external application or   interactive content (a plug-in).
           
<track>  :   Defines text tracks for   <video> and <audio>.


Examples :


<video> :


<!DOCTYPE html>
<html>
<body>
<DIV id='abc' style="z-index:2; position:relative; right:0px; top:10px; background-color:#cccc33; width:400px; height:80px; padding:10px; color:White; border:#ffffcc 1px dashed; font-size:xx-large;">
LogicPace Technologies Pvt.Ltd,Jaipur</DIV><br>
<VIDEO src="atheora.ogv" width="320" height="240"  controls autoplay>
</VIDEO>
</body>
</html> a   document or section

           
<hgroup>   :   Groups a set of <h1>   to <h6> elements when a heading has multiple levels.

           
<mark>   :   Defines marked/highlighted   text.

           
<meter>  :   Defines a scalar   measurement within a known range (a gauge).

           
<nav>   :    Defines navigation links.

           
<progress>   :   Represents the progress of   a task.

           
<ruby>    :   Defines a ruby annotation   (for East Asian typography).

           
<rt>   :  Defines an   explanation/pronunciation of characters (for East Asian typography).

           
<rp>   :   Defines what to show in browsers that do not support ruby   annotations
    

        
<section>   :  Defines a section in a   document
    

        
<time>  :  Defines a date/time
    

<wbr>  :  Defines a possible line-break .

New Media Elements :


HTML5 offers new elements for media content:
      

           
<audio>  :  Defines sound content.
           
<video>  :  Defines a video or movie.
           
<source>  :  Defines multiple media   resources for <video> and <audio>.
           
<embed>  :  Defines a container for an external application or   interactive content (a plug-in).
           
<track>  :   Defines text tracks for   <video> and <audio>.


Examples :


<video> :


<!DOCTYPE html>
<html>
<body>
<DIV id='abc' style="z-index:2; position:relative; right:0px; top:10px; background-color:#cccc33; width:400px; height:80px; padding:10px; color:White; border:#ffffcc 1px dashed; font-size:xx-large;">
LogicPace Technologies Pvt.Ltd,Jaipur</DIV><br>
<VIDEO src="atheora.ogv" width="320" height="240"  controls autoplay>
</VIDEO>
</body>
</html>