Archive for 2009

Welcome 2nd SemEster 2009-2010

Friday, November 06, 2009 · Posted in

This is another semester for another learning. Last semester I really learn a lot from my different subjects and also from my different teachers. I never expected that I can learn so much from them, especially in the the subject WEB Development in which it really taught me a lot on how to create a website and also on how to implement it using the php mysql.

This semester I am going to do my best in order for me to learn another knowledge in which could help me to become a better person and man in the future.

How to use Form Select Statement in PHP

Wednesday, October 14, 2009 · Posted in ,

Using a select statement in one page is commonly use by web programmers in building web applications and websites. The sample codes below illustrates on how to use and on how to simply code Form select statement.

HTML CODE:
<html>
<head>
<title>Title goes heretitle>
head>
<body>
<form action="" method="post">
<select name="day">
<option value="Monday" selected="selected">Mondayoption>
<option value="Tuesday">Tuesdayoption>
<option value="Wednesday">Wednesdayoption>
<option value="Thursday">Thursdayoption>
<option value="Friday">Fridayoption>
<option value="Saturday">Saturdayoption>
<option value="Sunday">Sundayoption>
select>
<br/>
<br/>
<input type="submit" name="btn_submit" value="submit" />
form>
body>
html>

As you can observe from the codes above that we did not specify the form action. So this means that if we will going to run the codes above the return would only on its self because of the reason that we did not specify the action in which the form will going to pass the value after the user submit the form. Also as you can observe inside the select statement we have and option which has a value of the complete days from Monday to Sunday, as you notice I put an attribute in the first option which is selected="selected" this shows that every time that the page is being refresh or open the first option will be the select item to be seen by the user.


PHP CODE:

<html>
<head>
<title>Title goes heretitle>
head>
<body>
<form action="" method="post">
<select name="day">
<option value="Monday" selected="selected">Mondayoption>
<option value="Tuesday">Tuesdayoption>
<option value="Wednesday">Wednesdayoption>
<option value="Thursday">Thursdayoption>
<option value="Friday">Fridayoption>
<option value="Saturday">Saturdayoption>
<option value="Sunday">Sundayoption>
select>
<br/>
<br/>
<input type="submit" name="btn_submit" value="submit" />
form>

if(isset($_POST['btn_submit']))
{
echo "Today is: ".$_POST['day'];
}
?>body>
html>
OUTPUT:


Lets assume that the user select the Wednesday, so that is why, the given sample output above shown the return value as Wednesday. Because after the use select the value Wednesday and submit the form, the PHP script will now be executed and display the value the being submitted by the form. You can also try this with your own. If there are some comments or questions about this article just CLICK THIS LINK to be redirected to the forum page.

How to use HTML Form in PHP

Monday, August 17, 2009 · Posted in ,

Form is one of the most important tool in making and designing a website or web application. Through the use of form you can send any values to another page. try to observe the given sample code below.



HTML Code:




<html>

<head>

<title>Title goes heretitle>

head>

<body>



<form action="welcome.php" method="post">



<label>Name:label><input type="text" name="name"><br/>

<label>Age:label><input type="text" name="age"><br/>

<input type="submit" name="btn_submit">



form>



body>

html>



The page contains two input fields and a submit button in which it has a type of text and a name of name and age.



Sample Output 1:


and if we were going to run the code above and then this would be the output of the code that we have made above in which it has a two input fields in which this field will be use in getting the value that comes from the user and also the submit button.



HTML with PHP Code:

<html>

<head>

<title>Title goes heretitle>

head>

<body>



Welcome echo $_POST['name']; ?>.<br/>

You are echo $_POST['age']; ?> years old.



body>

html>

and this would be our another page in which it has a filename of welcome.php. As you notice that its filename is being put at the from action so that when the user click the submit button and then it pass the value the being input by the user through the use of the form and then the form will past the value the the welcome.php and will directly display the value in the page. As you notice in the code we embed the php code in the HTML code. In this code we have the opening and the closing PHP tag. The variable array $_post["name"]; and $_post["age"]; are the two variables that holds the value that came from the form and this variable also uses to display the value that being input in the form.


Sample Output 2:








Goodbye and Thank You Tita Cory

Tuesday, August 04, 2009 · Posted in

Last Saturday morning, I was really shock when I first heard the news that our dearest former President Corazon Aquino died, because of the colon cancer. I can’t really imagine how it comes. My 9 years old cousin asked me of who Cory Aquino is? And I thought her that she was the mother of the first EDSA revolution and the mother of the democracy, and I asked her. “Why Filipino did called her as the mother of EDSA and democracy?” and she said “YES”. I told her that Cory Aquino called as the Mother of EDSA and the mother of democracy it is because she is the one who brought to us the type of government which is the democracy which literary means FREEDOM.

I am only 19 years old boy and a student and even me I didn’t seen and witness the First EDSA Revolution but I know what Cory had done to our country during that time. So people of the Philippines we should not have to waste what our beloved former President done. Let’s remember always of what Cory had made to us and who give us freedom. So Thank you very much Tita Cory and we are lucky and grateful of all you have done for us and to our country. Cory Hindi ka Nagiisa sa Lahat ng Laban mo.

So lets all take care of the legacy of our beloved former President. This Democracy and freedom that we are enjoying now lets take care of it.

How to use While Loop in PHP

Friday, July 03, 2009 · Posted in

This is a tutorial on how to use a while loop in a PHP. The output will be the same if you were going to use a for loop, the only difference is only the code itself and especially the concept of each loop and how this loop performs its action when the programmer run his/her program. Below is a sample illustration on how to code while loop in PHP.

PHP Code:

<?php
$var_x = 1;
while($var_x <= 5)
{
echo "Number: ".$var_x."<br/>";
$var_x++;
}
?>
From the given codes above as you can observe we really put the PHP opening tag and at the end also we put the PHP ending tag, so that every time we execute the program it would not return any error. Because sometimes programmers for got to put the opening and closing tags that might be the cause of some errors sometimes in a application. After the opening tag we initialized our variable with the value of one. So, now the variable $var_x has now a value of 1. Then on the next line is the while loop itself, inside the while loop we put variable again and this time we put an operator to determine of the value is less than or equal with 5 only. Next is to print the value of the variable and after is to increment our variable. The purpose of $var_x++ is to increment the value of the variable each time the loop executes until it reach the desire value which is 5. Regarding with the open and close braces you can omit it but it is mostly required especially if you are following some coding standards but it is recommended that you have to put braces for you to be able to know where does your statement starts and ends. Below is the sample output of the above code.

Sample Output:
You can try this with your own. If there are some comments or questions about this article just CLICK THIS LINK to be redirected to the forum page.

What is PHP?

Tuesday, June 30, 2009 · Posted in

PHP stand for PHP Hypertext Preprocessor. PHP also known as a recursive acronym would you want to ask why recursive? It is because recursive is an acronym in which the first letter of the first word represented but the acronym is the acronym itself.

PHP also known as an open source, server side and a HTML embedded scripting language. When we say embedded scripting language it is a language in which it is a kind of language in where HTML and PHP codes can be combined. It is a server side client, because PHP is being process in the server and not in the browser. E,g A user request a page. As you notice that when you view source the page and then only pure HTML code are you going to see, it is because PHP process first in the server and the server will only send to the user or to the client the HTML form.

How to create a simple HTML Table

Wednesday, May 27, 2009 · Posted in

In this article we will know how to create a simple table in HTML without using any CSS but HTML tag attribute only. Try to observe the given code below and its output and then try it. If you experience some bugs or error in executing the codes, send me message through comments for me to be able to fix the program and sample below. Thank you.

HTML Code:

<html>
<head><title>Your title goes here</title></head>
<body>
<table border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="50" align="center">OTY.</td>
<td width="150" align="center">Description</td>
<td width="100" align="center">Unit Price</td>
<td width="100" align="center">Total</td>
</tr>
<tr>
<td width="50" align="center">3</td>
<td width="150" align="center">Noodles</td>
<td width="100" align="center">15.00</td>
<td width="100" align="center">45.00</td>
</tr>
<tr>
<td width="50" align="center">10</td>
<td width="150" align="center">Ballpen</td>
<td width="100" align="center">8</td>
<td width="100" align="center">80</td>
</tr>
</table>
</body>
</html>

Sample Output:

How to insert images in HTML

· Posted in

In this tutorial we will know on how to put and display an image on your HTML. Simply , first you have to choose an image and let be the width and the height of the image is 100x100 pixels.


HTML Code:


Output:

This is the result of the HTML that we made in the upper part of this tutorial. Just follow the HTML in the upper part of this article and you will surely come up with this result.

What is Cascading Style Sheet (CSS)?

· Posted in

Have you ever thought about what a web page is? Actually there are 3 Layer part of the web page and than are the Content, Presentation and its behavior.

Content Layer is always present in a web page actually. It comprises the information the author wishes to convey to his or her audience or readers and is embedded within the HTML or the Hypertext Mark-up Language or either the XHTML that defines its structure and semantics. As we can see in all the web pages today most of the content of it is text but some of the content can also be images, animations, videos, sound and etc.

Presentation Layer it defines how the content will appear to a human being who access the document in one way or another. The conventional way to view web pages is with a regular web browser.

There are also advantage in using the CSS from the traditional HTML because in CSS we can modify or replace any of the layers without having to change the others an styling can be kept entirely separate from the content also the most important is that the CSS also provides more and far control over presentation than do presentational elements types of HTML.

Powered by Blogger.