<div style='background-color: none transparent;'></div>

Pages

The fight is not over!! MS is now moving .net to compile native, acknowledging the short comings in the .net framework. We need to demand a new vb6 that compiles our projects as they run today. Call, write, email, do what you can to put pressure on MS to bring back VB6!!! The new move by MS means they also acknowledge what we want is legitimate!!! Tell all your friends and colleagues to join in and help! Read more
Think Analytically, Verbalized what you have Thought, and Actualized what you had Verbalized... Read more
1 2 3 4 5 6 7
More Article »
More Article »
Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Apache for Beginners

Saturday, August 29, 2015

Way back when, in the wilds of 1995, there were a great many people who were disgruntled with the state of Web servers. The commercial ones, like Microsoft’s IIS (Internet Information Server) and Netscape’s family of servers, hadn’t been born yet, and the ones put out by college students – well, they sucked.
But lo! What did the early code jockeys do? They made their own damn Web server. They called it Apache (as in a patchy server, because it had a lot of patches). A patch is just what it sounds like – something to plug holes in your code with. This small group of hackers started a project that would eventually create the most popular Web server software in the world.
Not to give ourselves too much credit, but one of the founders of the Apache project was an engineer at HotWired. Don’t you just love us? If you really want to know more about Apache’s history, there’s a nice narrative on its site.
The brilliance of the Apache group’s scheme lay not just in the fine programming, but in the development model it used. Now it is fashionably called open source.
(A small side note:There are several different flavors of open-source development. Apache’s lets anyone create a commercial product based on its code and doesn’t make them share the results if they don’t want to. If I say this model is “better” than the other schemes, hostile email will no doubt follow this article’s publication. But it may well be.)
So … back to the present.
Why should you care? There’s two reasons:
It’s free. It rocks.
If you want to set up a Web site, there are lots of advantages to having the source code.
Another big advantage to the open-source approach is that Apache has attracted lots of developers around the world. They have made blocks of code known in Apache-land as modules. Many of these modules do things you want. And if you can’t find one you like, you can always write your own. (You’ll need to write them in C, or you could use mod_perl to extend the server in Perl … but I’m drifting.)

Downloading Apache

If you’ve landed on this page, you probably will want to know how to install and configure Apache for yourself. You may need a compiler, but don’t let that scare you; there are lots of precompiled versions of Apache now too. You just need to know where to get them (www.apache.org/dist/).
Continue Reading | comments

PHP Tutorial for Beginners

PHP is a powerful scripting language that fits gracefully into HTML and puts the tools for creating dynamic websites in the hands of the people — even people like me who were too lazy to learn Perl scripting and other complicated backend hoodoo.
This lecture is for the person who understands HTML but doesn’t know much about PHP. One of PHP’s greatest attributes is that it’s a freely distributed open-source language, so there’s all kinds of excellent reference material about it out there, which means that once you understand the basics, it’s easy to find the materials that you need to push your skills.


What Is PHP?

So, what is this whole PHP business all about?
PHP is a program that gets installed on top of your web server software. It works with versions of Apache (Tutorial:Apache for Beginners), Microsoft IIS and other server software packages.
You use PHP by inserting PHP code inside the HTML that makes up your website. When a client (anybody on the web) visits a web page that contains this code, your server executes it. That’s why you need to install your own server in order to test PHP locally — the server is the brain here, not your browser. Users don’t need any special plug-ins or anything to see your PHP in action — it gets to the end user as regular old-fashioned HTML.
PHP is a scripting language, like HTML. That means that code does not need to be compiled before it gets used — it gets processed on the fly as necessary.
Before we dig in, you should know about a site called PHP.net. PHP is an open-source language, and PHP.net is its control center, with extensive reference material about the language and tips sent in by users across the globe. PHP.net has exceptional, deep information about the language, but it can be a little cryptic for the newcomer. We’ll look more closely at how to use PHP.net at the end of this tutorial.
So, what kinds of things can PHP do? Welllll … it can:
  • take info from web-based forms and use it in a million ways (store it in a database, create conditional pages depending on what the forms said, set cookies for later, send e-mail, write your mom on her birthday);
  • authenticate and track users;
  • run threaded discussions on your site;
  • serve different pages to people using different browsers or devices;
  • publish an entire website using just a single layout template (server-side includes-style);
  • serve XML pages.
But before we can get to the specific uses of PHP, we need to start with a quick preview of the building blocks of PHP, beginning with a sample script. This example script is titled “chickenman.php.” When called by a web browser, it would simply read, “I am the CHICKEN MAN!”
1<?php
2
3
4
5 print ("I am the CHICKEN MAN");
6
7
8
9 ?>
The  ?php and ?¢ tags start and end a PHP script, and your meat goes in the middle. Got that? Good! Now let’s walk through the basic rules you need to know to before you can write your first PHP script.
Continue Reading | comments

php activities ( tagalog video's)

1 Introduction, Variables, Comments  >>Watch Me (Whip / Nae Nae)
2 String, Functions  >>You already know who it is
3 Numbers, Math Functions  >>Gonna do it for me
4 Arrays  >>watch me nene here
5 Associative Arrays >>Now watch me whip (Kill it!)
6 Array Function >>Now watch me nae nae (Okay!)
7 Constants >>Now watch me whip whip
8 Boolean, Null and Empty Values  >>Watch me nae nae (Want me do it?)
9 Type Juggling and Casting  >>Now watch me whip (Kill it!)
10 Conditional Expressions  >>Watch me nae nae (Okay!)
11 Logical and Comparison Operators  >>Now watch me whip whip
12 Switch Case  >>Watch me nae nae (Can you do it?)
13 While Loop  >>Now watch me
14 For Loop  >>Ooh watch me, watch me
15 Foreach Loop  >>Ooh watch me, watch me
16 Continue and Break  >>Ooh watch me, watch me
17 Functions  >>Ooh watch me, watch me
18 Functions with Arguments  >>Ooh watch me, watch me
19 Returning Value from a Function  >>Ooh watch me, watch me
20 Returning Multiple Values from a Function  >>Ooh watch me, watch me
21 Scope and Global Variables  >>Ooh watch me, watch me
22 Common Problems and Errors  >>Do the stanky leg (stank)
23 Request Response Cycle  >>Do the stanky leg (stank stank)
24 Encoding URL, Reserved Words  >>Do the stanky leg (stank)
25 Encoding HTML  >>Do the stanky leg (stank stank)
26 Include and Require Function  >>Now break your legs (break 'em, break 'em)
27 Post Method  >>Break your legs (break 'em dog)
28 Connecting to MySQL Database  >>Tell 'em "break your legs" (break 'em, break 'em)
29 Adding Data to MySQL Database  >>Break your legs (break 'em dog)
30 Viewing Data from MySQL Database  >>Tell 'em "break your legs" (break 'em, break 'em)
31 Edit Data from MySQL Database  >>Break your legs (break 'em dog)
32 Delete Data from MySQL Database  >>Tell 'em "break your legs" (break 'em, break 'em)

Now watch me
Bop bop bop bop bop bop bop bop bop
Now watch me
Bop bop bop bop bop bop bop bop bop

For recap download this students hands-on checklist here:-)

Continue Reading | comments

Simple Social Networking Site

Friday, February 17, 2012


Simple Social Networking Sites

This is a Sample of A Social Networking Sites That Helps connect People to the one they truly Belong with. This Project Cannot Be Completed Without the Help of our Friends,Classmates,Family,our Teacher and Most of All Our Beloved God...
Continue Reading | comments

Php: Creating Simple Website with MysQl ( for newbe)

Thursday, February 16, 2012

What you Need?

If your server supports PHP you don't need to do anything.
Just create some .php files in your web directory, and the server will parse them for you. Because it is free, most web hosts offer PHP support.
However, if your server does not support PHP, you must install PHP.


Php SERVER -- (xampp) download here ---> xampp1.6.8 

after installation make sure that MySQL and Apache pannel is running  ->






if it is running just click the X button to hide the pannel.


Next you need an Editor to create and edit your PHP codes ( i prefer notepad ++) download here if you want --->  notepad++ 




then a layout to your site(HTML) if you want base from the scratch its ok, i preferably   use template from internet to download (ex. click here to download a sample template --> sample HTML template )
 more html template here---->>>> html template
if you done downloading  the template you need to unzip or to extract the files 
(right click the file and click extract here) and after extracting copy the folder ( CTRL + C)


and paste it to the directory of (XAMPP) in localdisk C and folder xampp---->   . c:/xampp/htdocs (if the xampp install in C:/)

now after that open the folder and rename the index.html file to INDEX.PHP  by using notepad++(editor)[right click and open with notepad++] now save as it to index.php , then open your browser ( ex. mozilla, explorer) and type --> localhost/slickblue/index.php   ,  ( slickblue- is a folder u can rename it if u want like wise with the index).

so thats it you already have now a template you can use for creating simple website .


next we have to create a login form for a registration to our site to engage accessing to any part to our website.

first we need a login form for our user but first we to create a registration for in order to access to the login form of the user .  ( put it anywhere in the lay out as long as its fit to your taste . meaning design it )


the user need to create an account so we need to create a registration form for the user using editor (NOTEPAD++)  

--------------> SAVE IT AS A REGISTRATION.PHP (in editor (notepad++) <---------
 FILENAME: registration.php

<html>
<body>
<div style="border:1px solid;"><center>
<table border="1"><tr><td>
<form action="register.php" method="post">
USERNAME  <input type="text" name="name"><br>
PASSWORD   <input type="password" name="password"><br>
FIRST NAME <input type="text" name="fname"><br>
LAST NAME  <input type="text" name="lname"><br>
AGE        <input type="text" name="age"><br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>   </tr></td></table></center>
</div>
</body>
</html>

 ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------

from the registration.php all the data inputted must be cached by a form to save from a database (MYSQL) so we need a form as a catcher from all the data inputted from registration.php
-----> SAVE the FILE as a register.php <------------------

<?php
mysql_connect("localhost","root","") or die("Cannot connect to server");
mysql_select_db("sample") or die("Cannot connect to the database");

$username= ($_POST['username']);
$password = ($_POST['password']);
$fname = ($_POST['fname']);
$lname = ($_POST['lname']);
$age = ($_POST['age']);


mysql_query("insert akoregister set username='".$username."', password='".$password."'");
   

?>


---------------------------------------------------------------------------------------------------

so all data inputted in the registration form must be saved in dabase (MYSQL) so we need to create a database (mysql) in order to save those data inputted from the user 

 im preferably used CMD prompt, so click RUN in the START menu type CMD , and then locate the mysql directory using -->
( preferably dont use password)

cd c:\
cd xampp\mysql\bin
mysql -u root 


then first you have to create database using the command --> create database sample;
*sample is the database name* if you already have database just type ---> show databases;
and then you have to use the database you create by typing ---> use sample;
* sample  is the database name*
after creating database you need to create table by typing ----> create table akoregister(id int not null auto_increment primary key, username varchar(23), password varchar(24), fname varchar(23), lname varchar(24), age int(23));

so you already done creating your database and the table , in order to see the value from the table type usinng ---> describe akoregister;
*akoregister is a table name*

in order to see all information save from the form manually in the database(MYSQL)
----> select * from the akoregister;
* akoregister is a table name *

click here for all list of mysql server code --> mysql command code
--------------------------------------------------------------------------------------
so you already done adding information from form to database(MYSQL) but mostly we need to see all information itself from database to the website or to the browser likewise not only viewing files but mostly deleting ad updating all information from a certain files . so heres the step by step to do that.


first we need to view all the information from the database in order to see a certain user , let we use the information the we add earlier the registration.php

----> SAVE as FILE as VIEW.PHP,<-------------------

<?php
mysql_connect("localhost","root","") or die("Cannot connect to server");
mysql_select_db("sample") or die("Cannot connect to the database");

$query = mysql_query("select * from akoregister order by id desc");
?>
<table border="1">
<tr>
    <td>Username</td>
    <td>First Name</td>
    <td>Last Name</td>
    <td>Age</td>
    <td>Action</td>
</tr>
<?php

if(mysql_num_rows($query)>0){
    while($row= mysql_fetch_array($query)){ ?>
    <tr>
        <td><?=$row['username']?></td>
        <td><?=$row['fname']?></td>
        <td><?=$row['lname']?></td>
        <td><?=$row['age']?></td>
        <td><a href="update.php?id=<?=$row['id']?>">[Edit]</a>&nbsp;<a href="delete.php?id=<?=$row['id']?>">[Delete]</a></td>
    </tr>
<?php       
       
    }
       
}
else{
   
    echo "no record";
}

?>
<tr><td colspan="3"><a href="index.php" >[Add new record]</a>
</td></tr>
</table>


-----------------------------------------------------------------------

---> DELETE.PHP <-------


<?php
mysql_connect("localhost","root","") or die("Cannot connect to server");
mysql_select_db("sample") or die("Cannot connect to the database");

$id    = $_GET['id'];

    mysql_query("delete from akoregister where id='".$id."'");
    echo "<script>alert('Record successfuly deleted.');window.location.href='view.php';</script>";
?>



-------------------------------------------------------------------
UPDATE.PHP

<?php
mysql_connect("localhost","root","") or die("Cannot connect to server");
mysql_select_db("sample",$konek) or die("Cannot connect to the database");

$query = mysql_query("select * from akoregister where id='".$_GET['id']."'");
$row = mysql_fetch_array($query);
?>
<html>
<body>
<div style="border:1px solid;">

<form action="edit.php" method="post">
<input type='hidden' name="id" value="<?=($_GET['id'])?$_GET['id']:''?>">
username <input type="text" name="username" value="<?=$row['username']?>"><br>
First name <input type="text" name="fname" value="<?=$row['fname']?>"><br>
Lastname <input type="text" name="lname" value="<?=$row['lname']?>"><br>
Age <input type="text" name="age" value="<?=$row['age']?>"><br>
<input type="submit" value="Update">
<input type="reset" value="Reset">
</form>   
<a href="view.php" >[Back to home]</a>
</div>
</body>
</html>

------------------------------------------------------------------

EDIT.php


<?php
$konek = mysql_connect("localhost","root","") or die("Cannot connect to server");
mysql_select_db("sample",$konek) or die("Cannot connect to the database");


$username= ($_POST['username'])?$_POST['username']:'';
$fname= ($_POST['fname'])?$_POST['fname']:'';
$lname= ($_POST['lname'])?$_POST['lname']:'';
$age= ($_POST['age'])?$_POST['age']:'';
$id    = ($_POST['id'])?$_POST['id']:'';

if($name=="" || $age==""){
    echo "<script>alert('Complete all field');history.back();</script>";
   
}else{
    mysql_query("update akoregister set username='".$username."', age='".$age."', fname='".$fname."', lname='".$lname."' where id='".$id."'");
    echo "<script>alert('Record successfuly updated.');window.location.href='view.php';</script>";
}
?>



--------------------------------------------------------------






 
Continue Reading | comments
 
Copyright © 2011. datasavvy . All Rights Reserved
Company Info | Contact Us | Privacy policy | Term of use | Widget | Advertise with Us | Site map
Template Modify by Creating Website . Inpire by Darkmatter Rockettheme Proudly powered by Blogger