Friday, December 9, 2011

How to check session setting

<?php
    error_reporting (E_ALL ^ E_NOTICE); // just an error finder.. no need to use it
    include("config.php");
    session_start();
    if (!isset($_SESSION['user']))
        {
            header("Location:index.php");
        }
?>

Basic Login Page

  <form name="form" method="post" action="" >
  <input type="text" name="username" />
  <input type="password" name="password" />
  <input type="submit" name="Submit" value="LOGIN" />
          <?php
                if($message !="")
               {   
                echo $message;
                }
            ?>
  </form>

<?php   
    include("config.php");
    session_start();
   
//     if(isset($_POST["username"])){
//         $username1 = $_POST["username"];
//         $_SESSION["username"] = $username1;


if ($_SERVER['REQUEST_METHOD'] == "POST") {
   
    $username = $_POST["username"];
    $password = $_POST["password"];
   
    $querySelect = "select * from login where name = '$username' and password = '$password' and status ='1'";
    $resultSelect = mysql_query($querySelect);
    //echo $querySelect;
    $count = mysql_num_rows($resultSelect);
    //echo $count;
    //IF COUNT >0 RETRIEVE DATA FROM QUERY .ELSE GO BACK TO LOGIN
   
    if($count>0){
        $row=mysql_fetch_row($resultSelect);
        $loginid = $row[0];
        $role = $row[3];
        $username = $row[1];
        $_SESSION['id'] = $loginid;
        $_SESSION['user'] = $username;
       
    header("Location:home.php");
    }
     else
   
    //echo("Please Enter Correct Username and Password ...");
    header("Location:index.php?flagReg=1");
       
    }
    $message = "";
    if(isset($_GET["flagReg"])){
        $flagReg = $_GET["flagReg"];
        if($flagReg == '1'){
            $message = "Please Enter Correct Username and Password";
       
        }
    }
   
?>

Delete a Field From DataBase

  <a href="delete.php?delid=<?php echo $id; ?>">delete</a>

<?php
         if($_GET["delid"]!="")
        {
            $delid=$_GET["delid"];
            $querySelect="delete from project where id=$delid";
            $resultSelect=mysql_query($querySelect);
            require  "projectlist.php";
   
        }
?>

view a value from DB

 <?php
                  $querySelect="select * from project ";
                $resultSelect=mysql_query($querySelect);
                $countSelect=mysql_num_rows($resultSelect);
                for($i=0;$i<$countSelect;$i++)
                {
                $row=mysql_fetch_row($resultSelect);
                $id=$row[0];
                $name=$row[1];
                $lname=$row[2];
                $image=$row[4];           



                echo $name;
                echo $lname;
                }
?>

Simple Database insertion

<form action="" method="post" enctype="multipart/form-data">
<input type="text" name="name" value="" />
<input type="text" name="lname" value="" />
<input type="file" name="imageupload" value="" />
 </form>

<?php
if($_SERVER['REQUEST_METHOD']=="POST")
        {
            $name=$_POST["name"];
            $name=$_POST["lname"];
            if($_FILES['imageupload']['name'])
                        {
                         $filename = $_FILES["imageupload"]["name"];
                         $fileType = $_FILES["imageupload"]["type"];
                         $fileSize = $_FILES["imageupload"]["size"];
                         $fileTemp = $_FILES["imageupload"]["tmp_name"];
                         $error = $_FILES["imageupload"]["error"];
                         $image = time().$filename;
                         }
              $queryInsert = "insert into  projects(id,name,lname,image)values('','$name','$lname','$image')";
                    $resultSelect = mysql_query($queryInsert);
                    if($_FILES['imageupload']['name'])
                        {
                            move_uploaded_file($fileTemp,'uploads/'.$image);
                            chmod('uploads/'.$image,0777);
                        }
               header("Location:view.php");
}

Config

$db_host="localhost";      //HOST
$db_name="arun";           // DB-NAME
$db_user="arun-user";     // USER-NAME
$db_password="pass";   // PASSWORD

$link=mysql_connect($db_host,$db_user,$db_password) or die(mysql_error());
@mysql_select_db($db_name,$link);

Wednesday, September 28, 2011

Basic - HTML

HTML is easy to learn.
Here you can see the list of all HTML tags. HTML tags and their respective attributes are used to create HTML documents so that you can view the web page in browsers.

<!--...--> Defines a comment  
<!DOCTYPE>  Defines the document type  
<a> Defines an anchor  
<abbr> Defines an abbreviation  
<acronym> Defines an acronym  
<address> Defines contact information for the author/owner of a document  
<applet> Deprecated. Defines an embedded applet  
<area /> Defines an area inside an image-map  
<b> Defines bold text  
<base /> Defines a default address or a default target for all links on a page  
<basefont /> Deprecated. Defines a default font, color, or size for the text in a page  
<bdo> Defines the text direction  
<big> Defines big text  
<blockquote> Defines a long quotation  
<body> Defines the document's body  
<br /> Defines a single line break  
<button> Defines a push button  
<caption> Defines a table caption  
<center> Deprecated. Defines centered text  
<cite> Defines a citation  
<code> Defines computer code text  
<col /> Defines attribute values for one or more columns in a table   
<colgroup> Defines a group of columns in a table for formatting  
<dd> Defines a description of a term in a definition list  
<del> Defines deleted text  
<dfn> Defines a definition term  
<dir> Deprecated. Defines a directory list  
<div> Defines a section in a document  
<dl> Defines a definition list  
<dt> Defines a term (an item) in a definition list  
<em> Defines emphasized text   
<fieldset> Defines a border around elements in a form  
<font> Deprecated. Defines font, color, and size for text  
<form> Defines an HTML form for user input  
<frame /> Defines a window (a frame) in a frameset  
<frameset> Defines a set of frames  
<h1> to <h6> Defines HTML headings  
<head> Defines information about the document  
<hr /> Defines a horizontal line  
<html> Defines an HTML document  
<i> Defines italic text  
<iframe> Defines an inline frame  
<img /> Defines an image  
<input /> Defines an input control  
<ins> Defines inserted text  
<isindex> Deprecated. Defines a searchable index related to a document  
<kbd> Defines keyboard text  
<label> Defines a label for an input element  
<legend> Defines a caption for a fieldset element  
<li> Defines a list item  
<link /> Defines the relationship between a document and an external resource  
<map> Defines an image-map   
<menu> Deprecated. Defines a menu list  
<meta /> Defines metadata about an HTML document  
<noframes> Defines an alternate content for users that do not support frames  
<noscript> Defines an alternate content for users that do not support client-side scripts  
<object> Defines an embedded object  
<ol> Defines an ordered list  
<optgroup> Defines a group of related options in a select list  
<option> Defines an option in a select list  
<p> Defines a paragraph  
<param /> Defines a parameter for an object  
<pre> Defines preformatted text  
<q> Defines a short quotation  
<s> Deprecated. Defines strikethrough text  
<samp> Defines sample computer code  
<script> Defines a client-side script  
<select> Defines a select list (drop-down list)  
<small> Defines small text  
<span> Defines a section in a document  
<strike> Deprecated. Defines strikethrough text  
<strong> Defines strong text  
<style> Defines style information for a document  
<sub> Defines subscripted text  
<sup> Defines superscripted text  
<table> Defines a table  
<tbody> Groups the body content in a table  
<td> Defines a cell in a table  
<textarea> Defines a multi-line text input control  
<tfoot> Groups the footer content in a table  
<th> Defines a header cell in a table  
<thead> Groups the header content in a table  
<title> Defines the title of a document  
<tr> Defines a row in a table  
<tt> Defines teletype text  
<u> Deprecated. Defines underlined text  
<ul> Defines an unordered list  
<var> Defines a variable part of a text  
<xmp> Deprecated. Defines preformatted text           

Web Developing

Here we will learn how to develop a website.

For developing a website we need to know atleast,

HTML
XML
JavaScript
CSS
PHP
MySQL


Please go through my blog to study how to develop a website.

Monday, March 7, 2011

Myself Arun George Seethakunnel

Hi All...............

Its me Arun George. Here i would like to introduce myself as a web developer. This blog is a small portfolio of mine. 

I am very much thankful to Oranjdot E-Concepts, I started my career as a Web Developer from 'Oranjdot' under the Guidance of Mr. Binu M.R. I did my Academic project under his guidance and later on got the opportunity to work in Oranjdot.

I can handle HTML, Css, PHP, Dream weaver 8, WordPress, Filezila FTP, Photoshop 7.0, and control pannel, Mysql Workbench.

Now I am working in  PHPFOX which is a social network software that gives  the ability to create a unique community that includes many of the features found on sites like Facebook and MySpace.