Kamis, 19 September 2013

Example Project of Condition

this thread contained an Example Project of Condition, before following this
tutorial, if you not knowing about Condition, read my post before about 
Condition, Array and Looping.

1. Create new HTML Document on your Site, Right Click on Site -> New File ->
name it "conditional_form.html" or what ever you want.

2. Insert this in your HTML form:
3. Create new PHP Document on your site, Right Click on Site -> New File -> name it "conditional".php" or what ever you want.
4. we create a variable to store the data sent, then checks whether the data is sent empty or not. If you do not check the selected gender, Add this code inside 'conditional.php.
5. Before test for Run, if you use Dreamweaver, please check 'Follow Links Con- tinously' and 'Use testing server for Document Source' first, this needed when you want appear in Live, that setting at "conditional_form.html".
6. And try to Run it in Live mode :
7. So the output will be seen like this :)

Rabu, 11 September 2013

Condition, Array and Looping at PHP

1. Condition
There's 3 way to make Condition at PHP: if, else, elseif. Every Condition
starting with if :

if(codition) {
//do something
}

if included else:

if(codition) {
//do something
}
else {
//do something else
}

else can be used to add more condition:

if(codition1) {
//do activity1
}
elseif(condition2) {
//do activity2
}
else {
//do other activity
}

*if the condition correct or true values of the existing code in the curly
braces {} will be executed.

2. Array
not seems like string and number only can hold a single value, array can
store/save more than one value. Values ​​can be accommodated, like string,
number, or other arrays. To make arrays in PHP as follows:

$country=array("Indonesia","Japan", "Singapore", "Australia");

or

$country[0]="Indonesia"; 
$country[1]="Japan"; 
$country[2]="Singapore";


-> to create an empty array:

$country=array();

-> to access the value inside array:

$var=$country[1];
echo $var; //the output is Japan
echo $country[0]; //the output is Indonesia

-> sorting array can using with function sort():


sort($country); //array sorted ascending
$var=$country[1]; 
echo $var; //the output is Japan
echo $country[0]; //the output is Indonesia


-> to knowing a lot of elements / or stored values array, using function
   count():

$Amount = count($country);
echo $Amount; //the output is 3


3. Looping
In PHP there are two forms of repetition that is often used, for and while,

-> Looping using for:

for(initial expression; condition; final expression){
//do something
}

Example:
for($i=1; $i<=10; $i++){
echo "Output >,<" ;
}
*this looping will outputing word "Output >,<" ten times.

-> Looping using while:

while(condition){
//do something
}

Example:
$i=1;
while($i<=10){
echo "Output >,,<";
$i++;
}
*this looping will outputing word "Output >,,<" ten times.

"as long as the conditions TRUE, the loop will continue to do"

Rabu, 04 September 2013

Input and Output data Biodata Project ASP.NET

Read my post before about Inputing and Output data, on this Thread, i want to share about
make Biodata using Input and Output, put this method and you can modify with your own style :


and Run it Ctrl + F5, input your data and see the Output :)


NB: this Input and Output Without TryParse()

Selasa, 03 September 2013

Input and Output on ASP.Net

There's 2 kinds of Input and Output on ASP.Net, Without TryParse() and with
TryParse()

1. Without TryParse();

Try to practice it with make a New Project, you can use your old Folder project
with right clicking on 'Solution'

Name it 'InputOutput' and you will focused on Program.cs part of InputOutput
Insert this method, or whatever with your own style
and Run it Ctrl + F5, input your form and look the output
2. With TryParse(); Try to practice it again make a New Project, you can use your old Folder project with right clicking on 'Solution'. Becouse we want use TryParse, make it different than before Name it 'InputOut putTryParse' and you will focused on Program.cs part of InputOutputTryParse
Insert this method, or whatever with your own style
and Run it Ctrl + F5, input your numbers and look the output
float.TryParse(input, out height); is function used to be string values can converted to desired type.

Comment, Variable and Type Data on ASP.NET

1. Comment
1. Function main()
   Include command/statement that will process with computer, example
Function main() on C# languange:

static void Main (string[]args)

2. Command(statement)
   Use for commanding computer to do specific task, example
command inside C# language:

Console.WriteLine("Hello World. . .");

3. Keyword (using)
   If you use function Console.WriteLine(), you must give sign to computer
library file which recorded Console.WriteLine(). to give sign write using
System; on early of program code. command using System; indicates that user
will use all things inside library System.

4. Comment
   for including words without process with computer, you must give a comment
statement. comment usefull when the programming forget about his/her made,

// comment for 1 line

/* comment for more than 1 line*/
5. Parenthesis Brace Parenthesis brace using for start and stop the statement, example class Program { static void Main (string[]args) // this function of main() { Console.WriteLine("Hello World. . ."); } } 2. Variable and Type Data Variable is a place for keep the data. for example, when you want caculate block volume, long, width, height and volume from that will saved inside variable. Declaration of Variable is a command for computer to provide the variable which will be used. for example user commanding computer for provide variable of long, width, height and volume. that Variable will be use for saving data number (integer)/ 3. Rule of naming Variable 1. name of Variable consist of letters, number, and underscore "_". 2. the First character of name, must letter. 3. uppercase and lowercase is different (case Sensitive) 4. can't use Program keywords (ex. using)

Senin, 02 September 2013

Make First Project on ASP.NET [2]

Continued of Make First Project on ASP.NET . . .

2. ok next, add this Code on "Luas_Lingkaran.cs" or whatever method you want
   to use.

3. but dont run it, you wont get the result, add this code first on first class we have made
4. after that you can Run it now with Ctrl + F5 and look the equals of your new class operation.
OK the last of this Thread is Make a Biodata from ASP.NET 1. Make a New Project and name it Biodataku.cs, or whatever you want
2. Input the Script into Program.cs like this, and make your own style
3. Run it with Ctrl + F5 and see the Output :)


Make First Project on ASP.NET

Hello guys, i want to share about make a first project on ASP.NET
Firstly, i want to make "Hello World" with C#

1. Open Visual Studio 2012 Above or older, and Click New Project...

2. and then look at Template tab -> Visual C# -> Windows and then we trying to make first project, so choose "Console Application"
3. you will see the blank project, but there still any standart commands
4. and add Console.WriteLine("Hello World"); inside input tag. but becarefull, it's Chase Sensitive, so look on the letters..
5. and the last thing, Run with Ctrl+F5 and look your first Project :)
And then We will add a new Class, 1. Right Click on your project name, and rename it "Luas_Lingkaran.cs" or whatever you want.
To Be Continued. . . Continued on Page: Make First Project on ASP.NET [2]

Make Biodata Using Array 1 Variable on PHP

On this thread i want to share about make a biodata using array, but now
im only using one variable to difine the variable.

Firstly to remember about array, Array is a structured data type is useful
for storing large amounts of data of the same type.
Section assembles an array called Array Elements.

OK here's about my example, im using the old project of my biodata, if you
having it too, change only the variable,

the Screenshot of Code:

and looks at unprocess words, there's the right variable, on here we try to make it in one variable, and only add an index array for make the system different output with one variable. but the Output still same:
ok i think enought about this tutorial, thanks anyway..

Example Project Writing Style on PHP

Before scrutinizing this thread read first about Writing Style on PHP,

so, now i want to share about the example project using Style on PHP,

here the Screenshot of my Biodata project, on here we'll know about
the different things for using any output command, like echo, print,
printf,

here the Live view of Dreamweaver

here the code, you can do it too with your modify self project
and there's the view of localhost on browser
ok time for you to learning and try it now, and one thing again, don't forget about add Header ('Content-type: text/plain');

Writing Style on PHP

In this thread i want to share about "Writing Style on PHP".

1. Echo
echo : used to print variable or character string without using format.
how to use:
echo "right";
echo ("right");

example:
$flname=Bagoes Rizaldy Setiambodo;
echo ("My Full Name is : %flname");


2. Print and Printf

Print : used to print variable or character string without using format.

example:
$flname=Bagoes Rizaldy Setiambodo;
print ("My Full Name is : %flname");

Printf : used to print variable or character string using format.

-> for String format use  : %s
-> for Integer format use : %d
-> for Decimal format use : %f

example:
$flname=Bagoes Rizaldy Setiambodo;
printf ("My Full Name is : %s",%flname);

echo does not have a return value while print has a return value that is
worth the amount of characters displayed.

3. Define constanta

for defining constanta, we just need tag:

define("name_constants",constants_values);

Arithmetic operators:
$a + $b = Addition (total of $a and $b)
$a - $b = Reduction (reduction of $a and $b)
$a * $b = Multiple (multiple of $a and $b)
$a / $b = Division (quotient of $a and $b)
$a % $b = Modulus (remainder of $a division $b)

Logic operators:
$a and $b = And (TRUE if $a and $b TRUE)
$a or $b  = Or (TRUE if $a or $b TRUE)
$a xor $b = Xor (TRUE if one of $a or $b TRUE)
  !$a     = Not (TRUE if $a not TRUE)
$a && $b  = And (TRUE if $a and $b TRUE)
$a || $b  = Or (TRUE if $a or $b TRUE)

Comparison operators:
$a == $b  = Equal (TRUE if $a = $b)
$a === $b = Identical (TRUE if $a = $b, and have same type)
$a != $b  = Not Equal (TRUE if $a not= $b)
$a <> $b  = Not Equal (TRUE if $a not= $b)
$a !== $b = Not identical (TRUE if $a not= $b, or have different type)
$a < $b   = Less than (TRUE if $a less than $b)
$a > $b   = Greater than (TRUE if $a greater than $b)
$a <= $b  = Less than or Equal to (TRUE if $a less than or same $b)
$a >= $b  = Greater than or Equal to (TRUE if $a greater than or same $b)

On the next Thread i'll share about the example project :)