Rizwan Abbasi’s Blog











{اپریل 2, 2009}   Restarting Apache server

How to restart Apache server in CentOS?

It’s simple just right click on desktop, click on Open terminal

and type

service httpd restart

Rizwan Abbasi



{اپریل 2, 2009}   Opening/Editing a text file

How to open/edit a text file in CentOS?

it’s simple

gedit filepath

e,g,

gedit /etc/php.ini

An editor will be opened and you can edit your php.ini file.

Rizwan Abbasi



{اپریل 2, 2009}   Installing bin(*.bin) files

How to install binary files in Linux? It’s simple dude,

I have downloaded a file GoogleEarthLinux.bin, now

rightclick on  GoogleEarthLinux.bin and click on properties,

click on permissions and in the Execute there will e a checkbox

“Allow executing file as program” just tick it.

Double click on GoogleEarthLinux.bin , a popup will appear and just select

Run in Terminal.

Follow the instruction and you are done.

Rizwan Abbasi



{اپریل 2, 2009}   Magic with youtube

Do you want to see the magic with http://www.youtube.com?

open your favourit browser and enter http://www.youtube.com/

click on your favourite video now, I liked the Heroes video, i have the following address from the address bar.

http://www.youtube.com/watch?v=M4dQ1DTOtb4&feature=PlayList&p=8026B24C41B07EC0&playnext=1&playnext_from=PL&index=3

just add &flip=1 at the end. i.e,

http://www.youtube.com/watch?v=M4dQ1DTOtb4&feature=PlayList&p=8026B24C41B07EC0&playnext=1&playnext_from=PL&index=3&flip=1

and  text and video  will be flipped.

It’s great naa, you must try it.

Rizwan Abbasi



{ستمبر 11, 2006}   HTML Vs XHTML

Untitled Document

You can prepare yourself for XHTML by starting to write strict HTML.


How To Get Ready For XHTML

XHTML is the next generation of HTML, but it will of course take some time before browsers and other software products are ready for it.
In the meantime there are some important things you can do to prepare yourself for it. As you will learn from this tutorial, XHTML is not very different from HTML 4.01, so bringing your code up to 4.01 standards is a very good start. Our complete HTML 4.01 reference can help you with that.
In addition, you should start NOW to write your HTML code in lowercase letters, and NEVER make the bad habit of skipping end tags like the </p>.
Happy coding!


The Most Important Differences:

  • XHTML elements must be properly nested
  • XHTML documents must be well-formed
  • Tag names must be in lowercase
  • All XHTML elements must be closed

Elements Must Be Properly Nested

In HTML some elements can be improperly nested within each other like this:

<b><i>This text is bold and italic</b></i>

In XHTML all elements must be properly nested within each other like this:

<b><i>This text is bold and italic</i></b>

Note: A common mistake in nested lists, is to forget that the inside list must be within a li element, like this:

<ul>
  <li>Coffee</li>
  <li>Tea
    <ul>
      <li>Black tea</li>
      <li>Green tea</li>
    </ul>
  <li>Milk</li>
</ul>

This is correct:

<ul>
  <li>Coffee</li>
  <li>Tea
    <ul>
      <li>Black tea</li>
      <li>Green tea</li>
    </ul>
  </li>
  <li>Milk</li>
</ul>

Notice that we have inserted a </li> tag after the </ul> tag in the "correct" code example.


Documents Must Be Well-formed

All XHTML elements must be nested within the <html> root element. All other elements can have sub (children) elements. Sub elements must be in pairs and correctly nested within their parent element. The basic document structure is:

<html>
<head> ... </head>
<body> ... </body>
</html>

 


Tag Names Must Be In Lower Case

This is because XHTML documents are XML applications. XML is case-sensitive. Tags like <br> and <BR> are interpreted as different tags.
This is wrong:

<BODY>
<P>This is a paragraph</P>
</BODY>

This is correct:

<body>
<p>This is a paragraph</p>
</body>

 


All XHTML Elements Must Be Closed

Non-empty elements must have an end tag.
This is wrong:

<p>This is a paragraph
<p>This is another paragraph

This is correct:

<p>This is a paragraph</p>
<p>This is another paragraph</p>

 


Empty Elements Must Also Be Closed

Empty elements must either have an end tag or the start tag must end with />.
This is wrong:

This is a break<br>
Here comes a horizontal rule:<hr>
Here's an image <img src="happy.gif" alt="Happy face">

This is correct:

This is a break<br />
 
Here comes a horizontal rule:<hr />
Here's an image <img src="happy.gif" alt="Happy face" />

IMPORTANT Compatibility Note:
To make your XHTML compatible with today’s browsers, you should add an extra space before the "/" symbol like this: <br  />, and this: <hr  />. 



{ستمبر 10, 2006}   XHTML Vs HTML

You can prepare yourself for XHTML by starting to write strict HTML.

How To Get Ready For XHTML
XHTML is the next generation of HTML, but it will of course take some time before browsers and other software products are ready for it.
In the meantime there are some important things you can do to prepare yourself for it. As you will learn from this tutorial, XHTML is not very different from HTML 4.01, so bringing your code up to 4.01 standards is a very good start. Our complete HTML 4.01 reference can help you with that.
In addition, you should start NOW to write your HTML code in lowercase letters, and NEVER make the bad habit of skipping end tags like the

.
Happy coding!

The Most Important Differences:
• XHTML elements must be properly nested
• XHTML documents must be well-formed
• Tag names must be in lowercase
• All XHTML elements must be closed

Elements Must Be Properly Nested
In HTML some elements can be improperly nested within each other like this:
This text is bold and italic
In XHTML all elements must be properly nested within each other like this:
This text is bold and italic

Note: A common mistake in nested lists, is to forget that the inside list must be within a li element, like this:

  • Coffee
  • Tea
    • Black tea
    • Green tea
  • Milk

This is correct:

  • Coffee
  • Tea
    • Black tea
    • Green tea
  • Milk

Notice that we have inserted a

tag after the

tag in the "correct” code example.

Documents Must Be Well-formed
All XHTML elements must be nested within the root element. All other elements can have sub (children) elements. Sub elements must be in pairs and correctly nested within their parent element. The basic document structure is:


Tag Names Must Be In Lower Case
This is because XHTML documents are XML applications. XML is case-sensitive. Tags like
and
are interpreted as different tags.
This is wrong:

This is a paragraph

This is correct:

This is a paragraph

All XHTML Elements Must Be Closed
Non-empty elements must have an end tag.
This is wrong:

This is a paragraph

This is another paragraph
This is correct:

This is a paragraph

This is another paragraph

Empty Elements Must Also Be Closed
Empty elements must either have an end tag or the start tag must end with />.
This is wrong:
This is a break
Here comes a horizontal rule:


Here’s an image Happy face
This is correct:
This is a break

Here comes a horizontal rule:


Here’s an image Happy face

IMPORTANT Compatibility Note:
To make your XHTML compatible with today’s browsers, you should add an extra space before the "/” symbol like this:
, and this:


.



{ستمبر 10, 2006}   About Mansehra

i am sharing the site of my native town with u.

          http://www.mansehravalley.com



{مارچ 12, 2006}   Beginning ASP

Beginning ASP is pretty easy. ASP is a kool language for creating dynamic webpages.



{مارچ 10, 2006}   3rd Lecture.

You cannot view the PHP source code by selecting "View source” in the browser – you will only see the output from the PHP file, which is plain HTML. This is because the scripts are executed on the server before the result is sent back to the browser.


Basic PHP Syntax

A PHP file normally contains HTML tags, just like an HTML file, and some PHP scripting code.
Below, we have an example of a simple PHP script which sends the text "Hello World” to the browser:

 
 
 
 
 

A PHP scripting block always starts with and ends with ?>. A PHP scripting block can be placed anywhere in the document.
Each code line in PHP must end with a semicolon. The semicolon is a separator and is used to distinguish one set of instructions from another.
There are two basic statements to output text with PHP: echo and print. In the example above we have used the echo statement to output the text "Hello World”.


Variables in PHP

All variables in PHP start with a $ sign symbol. Variables may contain strings, numbers, or arrays.
Below, the PHP script assigns the string "Hello World” to a variable called $txt:

 
 

$txt="Hello World"; 
echo $txt; 
?> 
 
 

To concatenate two or more variables together, use the dot (.) operator:

 
 

$txt1="Hello World"; 
$txt2="1234"; 
echo $txt1 . " " . $txt2 ; 
?> 
 
 

The output of the script above will be: "Hello World 1234”.


Comments in PHP

In PHP, we use // to make a single-line comment or /* and */ to make a large comment block.

 
 

//This is a comment 
/* 
This is 
a comment 
block 
*/ 
?> 
 
 



{مارچ 10, 2006}   2nd Lecture

What do You Need?  

This tutorial will not explain how to install PHP, MySQL, or Apache Server. 

If your server supports PHP – you don’t need to do anything! You do not need to compile anything or install any extra tools  – just create some .php files in your web directory – and the server will parse them for you. Most web hosts offer PHP support. 

However, if your server does not support PHP, you must install PHP. Below is a link to a good tutorial from Webmonkey on how to install PHP4: 

http://hotwired.lycos.com/webmonkey/00/44/index4a.html?tw=programming 

Download PHP  

Download PHP for free here: http://www.php.net/downloads.php 

Download MySQL Database  

Download MySQL for free here: http://www.mysql.com/downloads/index.html 

Download Apache Server  

Download Apache for free here: http://httpd.apache.org/download.cgi



et cetera