Archive for the ‘Programming’ Category

If you are getting started with ASP.NET, one of the first things you’ll want to install on Windows 7 or Vista is IIS (internet information server). Keep in mind that your version of Windows may not come with IIS.

First, go to Control Panel, and then click on Programs.

 

You’ll see a link for “Turn Windows features on or off”

 

If you expand the Internet Information Services tree node, you can see that there are a lot of options beneath it. You will probably want to explore these options, because even if you click on IIS, some of the necessary options for doing development aren’t checked.

 

Once you’ve gone ahead and checked the items you want, and clicked OK, you’ll see this dialog for a while….

 

 

Original Article by HowToGeek: Here

 

Advertisements

Although blogspot (blogger) has changed a lot through the years (especially since I last used it) I never thought it was possible to change the layout of the blog this easily as I found out to be.

You just need to follow the next few steps

Step 1 –  Find the theme you prefer for your blog

Step 2 – Download it topically to your hard drive dis, using the “download” link. If it is a .zip file unzip it and use the .txt (or .xml file)

Step 3 – Log on to your Blogger account if you haven’t already done so. Now you’re at your Dashboard. Click on the “layout” link to your blog.

Step 4 – Click on the “Edit HTML” link under the “Template” tab.

Step 5 – Open the .txt (or .xml) file with a text editor

Step 6 – Click on the “Expand Widget Template” box. Delete everything in the template box and replace it with all the text in the “.txt” file that you just opened.

Save your changes and Voila! You just changed your template.

Note: Before you use the template preview your changes so as to be sure you are satisfied.

Some sites to visit for some free templates are the followings:

http://blogspotbloggertemplates.blogspot.com/

http://freeskins.blogspot.com/

http://mashable.com/2007/09/13/blogger-templates/

How to create a simple form in PHP

Posted: January 13, 2011 in PHP, Programming

Forms are the basic stuff in every website, either that is a part of a poll or of a sign up form.

So how easy it is to create one? It’s quite easy!

In the following example, i will create a form that includes input fields, text areas, check boxes, radio buttons, drop down lists, and a input button.

So firstly, i have to create my form. As I will send all the data of my fields into the same page, i will use the following block of code to create it.

 

<html>
<head>
<title> Form example </title>
</head>

</body>
<!– creating a form –>
<form method=”post” action=”<?php echo $PHP_SELF;?>”>

</form><br />

</body>
</html>

 

As a posting action I have used $PHP_SELF that will send all the form’s data to the same page the form is.

Then I will add 2 input areas by this

<!–input fields–>
First name: <input type=”text” size=”12″ maxlength=”12″ name=”Fname”><br>
Last name: <input type=”text” size=”12″ maxlength=”12″ name=”Lname”><br><Br>

 

Some radio buttons (they have the same name value so as to keep one of their values)

<!–radio buttons –>
Gender: <br>
Male <input type=”radio” value=”Male” name=”gender”><br>
Female <input type=”radio” value=”Female” name=”gender”><br><Br>

 

Then, some check boxes (in the name attribute the value is an array so as to keep, if necessary, more than one of their values)

<!– checkboxes –>
Favourite Food: <BR>
Pizza: <input type=”checkbox” value=”Pizza” name=”food[]”><br>
Chicken: <input type=”checkbox” value=”Chicken” name=”food[]”><Br>
Chinese Food: <input type=”checkbox” value=”Chinese food” name=”food[]”><Br><br>

 

Maybe,  a drop down list (use select to define the list, and option to define each of the list’s items)

<!– dropdown list –>
Select a Level of Education:<br />
<select name=”education”>
<option value=”Jr.High”>Jr.High</option>
<option value=”HighSchool”>HighSchool</option>
<option value=”College”>College</option>
</select><br />

 

Even, a text area

<!– textarea –>

<br>
<textarea name=”quote” rows=”4″ cols=”20″ wrap=”physical”>Insert your favorite quote! </textarea>
<br><Br>

 

And finally an input button

<!– inpute button –>
<input type=”submit” value=”submit” name=”submit”><br />

 

So… what’s after creating the form?? Well now we have to write the php code that will create the two views of this page (the form to be filled and the results page)

To get all the data that were posted in the form and were submited you can use this:

<?php
$Fname = $_POST[“Fname”];
$Lname = $_POST[“Lname”];
$gender = $_POST[“gender”];
$food = $_POST[“food”];
$quote = $_POST[“quote”];
$education = $_POST[“education”];

?>

$_POST[“Anything”] will get the value included in Anything object after the submit button is pressed.

To create the two views of this page, we use the isset() function. If not true then the page must show the first form. If it returns true it must show the results.

The final block of code that will get the job done is the following:

 

<?php
$Fname = $_POST[“Fname”];
$Lname = $_POST[“Lname”];
$gender = $_POST[“gender”];
$food = $_POST[“food”];
$quote = $_POST[“quote”];
$education = $_POST[“education”];

if(!isset ($_POST[“submit”]))
{
?>

<html>
<head>
<title> Form example </title>
</head>

</body>
<!– creating a form –>
<form method=”post” action=”<?php echo $PHP_SELF;?>”>
<!–input fields–>
First name: <input type=”text” size=”12″ maxlength=”12″ name=”Fname”><br>
Last name: <input type=”text” size=”12″ maxlength=”12″ name=”Lname”><br><Br>

<!–radio buttons –>
Gender: <br>
Male <input type=”radio” value=”Male” name=”gender”><br>
Female <input type=”radio” value=”Female” name=”gender”><br><Br>

<!– checkboxes –>
Favourite Food: <BR>
Pizza: <input type=”checkbox” value=”Pizza” name=”food[]”><br>
Chicken: <input type=”checkbox” value=”Chicken” name=”food[]”><Br>
Chinese Food: <input type=”checkbox” value=”Chinese food” name=”food[]”><Br><br>

<!– dropdown list –>
Select a Level of Education:<br />
<select name=”education”>
<option value=”Jr.High”>Jr.High</option>
<option value=”HighSchool”>HighSchool</option>
<option value=”College”>College</option>
</select><br />

<!– textarea –>

<br>
<textarea name=”quote” rows=”4″ cols=”20″ wrap=”physical”>Insert your favorite quote! </textarea>
<br><Br>

<!– inpute button –>
<input type=”submit” value=”submit” name=”submit”><br />
</form><br />

</body>
</html>

<?php
}
else {
echo “Thanks for adding your information <br>”;
echo “Your name is “.$Fname.”<br>” ;
echo “Your Lastname is “.$Lname.”<br>”;
echo “Your Gender is “.$gender.”<br>” ;
echo “Your favorite food is “;

foreach ($food as $f) {
echo “<br />”.$f;
}

echo “<br>”.”Your favorite quote is <i> “.$quote.”</i><br>” ;
echo “And your level of education is “.$education.”<br>”;
}
?>

 

All websites include  various meta tags, such as for description, keywords etc.

An easy way to values of this meta tags is by using the following command:

get_meta_tags (‘website-url’);

So a simple example of getting meta tags from a certain site is the following:

<html>
<head>
<meta http-equiv=”content-type” content=”text/html; charset=utf-8″ />

</head>

</body>

<?php
$tags = get_meta_tags(‘ website-url ‘);

echo $tags[‘description’].”<br><br>”;
echo $tags[‘keywords’].”<br><br>”;
echo $tags[‘generator’].”<br><br>”;

?>

</body>
</html>

The above block of code would retrieve the meta tags with names “description” , “keywords” and “generator” from the site given in website-url, and print their values on screen.

The meta tag given in the code for the content type is used for UTF-8 character set. If you want to use a different one or the results of your code are unreadable, then try some other from this list which includes most of them.

Some of the most common ones are the following 3:

<meta http-equiv=”content-type” content=”text/html; charset=utf-8″ />

<meta http-equiv=”Content-Type” content=”text/html; charset=Windows-1253″>

<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>?

Array invertion in PHP

Posted: January 12, 2011 in PHP, Programming

In the following example i will try to explain how to invert an array in php. Obviously there is an easier way using the array_reverse command

$result = array_reverse($array_name);

The above line will return the reversed array of $array_name into $result.

Another way would be to do this from scratch. The following block of code will first create an array and print it on screen, and then reverse the array and print it again.

<html>
<head>
</head>

<body >
<!– this is a simple example to show how to invert an array in php –>
<p>
<?php
//creating the array and filling it with strings
$array = array(“fox”, “dog”, “cat”, “mouse”);
print_r ($array);

//inverting the array and then printing again
//count command returns the size of the array
for($i=0 ; $i < count($array)/2; $i++)
{
$temp = $array[$i];
$array[$i] = $array[count($array) – $i – 1];
$array[count($array) – $i – 1] = $temp;

}
echo “<br><br>”;
print_r($array);
?>
</p>
</body>

After saving and running the above block of code, the result is the following:

Array ( [0] => fox [1] => dog [2] => cat [3] => mouse )

Array ( [0] => mouse [1] => cat [2] => dog [3] => fox )

Free Flash Website Builder

Posted: December 21, 2010 in Flash, Programming

The percentage of Internet users and website creations might be daily going up, but the knowledge of creating flashy, fully functional and attractive sites is a privilege that, seemingly, only a few possess.

A simply solution for this, would be the use of CMS (Content Management Systems). But an even easier way – for me at least – is the use of online site builders as Wix.

Wix offers:

  • Free hosting
  • Hundreds of free Flash website Designs
  • Simple few-step builder
  • No necessity of download or programming
  • Search engine friendliness
  • Upload of any kind of media (video, pictures etc)
  • Easy drag and drop editor
  • Excellent flash components etc

Wix also contains a video helper for the new users, explaining how to build a site from scratch and very helpful menus.

Here is a list of great flash sites built by users with the wix online builder.