Archive

Archive for the ‘Programming’ Category

Make Windows welcome you with an audio voice message during logon

I came across a nice tip here on How to Make Windows Welcome you With an Audio Voice Message During Logon.

To use this trick, follow the instructions given below:-

Open Notepad and Copy, Paste below Code. Write any desired text.

Code:
Dim speaks, speech
speaks="Hello Xarabas! Welcome back to your computer. Have a nice day"
Set speech=CreateObject("sapi.spvoice")
speech.Speak speaks

Save it as a .vbs file and place it in the startup folder:

C:\Documents and Settings\<account>\Start Menu\Programs

for example:

C:\Documents and Settings\xarabas\Start Menu\Programs

Advertisements

See source code of a website

We all know that, after visiting any website with browser, you can inspect the source code (HTML and JavaScript)simply by using

  • in Mozilla Firefox: View -> Page Source (or the key combination CTRL U)
  • in Microsoft Internet Explorer:  View -> Source
  • in Google Chrome: Tools -> View Source (or CTRL U).

But if you have doubts about the content of a web page and you want to inspect the source without loading it into the browser?

Firefox and Chrome offer a simple function to invoke.

Typing view-source: followed by the URL of the webpage to visit, the browser will not pass the source code to the rendering engine but it limit to expose the content of a web page in a window.

Try typing in the address bar of Firefox or Chrome

view-source: http://www.google.it

the browser will immediately display the HTML source of the page shown.

The command view-source: can be useful for expert users to analyze the source code  of a website before you visit, especially if you have doubts about its content. This is, we believe, a very nice feature that eliminates the need for more complex procedures (such as downloading the page via wget).

Categories: PHP

PHP – Example 0004

Fourth Example 0004

<html>
<head>
<title>Fourth example</title>
</head>

// Fourth Example (VARIABLES INSIDE A STRINGS)
// ————————

$name = “Xarabas”;
echo “Hi, $name”;
echo ” <br />”;
echo ‘Hi, $name’;
echo ” <br />”;

?>

</body>
</html>

================================================================================

In this example, we see the using of variables inside a string.
In
echo “Hi, $name”;
here the variable $name is evaluated because we use a double quote ( ).

In
echo ‘Hi, $name’;
here the variable $name isn’t evaluated because we use  a single quote ( ).

The output window you will see the following:

Hi, Xarabas
Hi, $name

Categories: PHP

PHP – Example 0003

Third Example 0003

<html>
<head>
<title>Third example</title>
</head>

// Third  Example (STRING)
// ————————
$my_string = ‘first string’;
$another_string = “another string”;

echo $my_string;
echo ” <br />”;
echo $another_string;
echo ” <br />”;
?>

</body>
</html>

================================================================================

In this example, we see the using of string and variable.
In
$my_string = ‘first string’;
$another_string = “another string”;
we see two ways of using a variable with a single quote ( ) and with a double quote ( ).

In
echo $my_string;
echo $another_string;
we see the “echo” function to print the variable value.

The output window you will see the following:

first string
another string

Categories: PHP

PHP – Example 0002

Second Example 0002
==================================================================================

<html>
<head>
<title>Second example</title>
</head>

<body>
<?php
// Second Example
// ————————
echo “Today is ” . showDate();
function showDate(){
$date = getdate();
return ($date[“mday”] . “-” . $date[“mon”] . “-” . $date[“year”] );
}
?>
</body>
</html>

==================================================================================
In this example we see a call to a function (i.e. showDate()).
The output is depending of the day when you execute it.
The variable $date is the date, and the value is obtained thanks to getdate() function;
The following values are
Day = $date[“mday”]
Month = $date[“mon”]
Year = $date[“year”]
and using the return command, you can output the value of Day, Month and Year and then you have to use “.” you concatenate them.

We explain better in the next lessons.

Categories: PHP

PHP – Example 0001

First Example 0001

==================================================================================
<html>
<head>
<title>First Example</title>
</head>

<body>
php
// First Example
// ————————
echo “Hi all, welcome in the first PHP script”;
?>
</body>
</html>

==================================================================================

The row with
php
is the syntax to start the php script.

The rows that start with “//” are in PHP the comments like the following:
// First Example 0001
// —————————-

The row with “echo” sends to Web page the information inserted between the double apices (” … “)

The row with
?>
is the syntax to close the php script.

Categories: PHP
%d bloggers like this: