Pages

Show message in TextBox


JavaScript can be used to display some information to the users.When user click on the textbox,
message will be hidden.very simple one but can be used in HTML forms without using labels.it will
increase the look and feel of the web page.


<script language=JavaScript>

function clear_username()
{
if (document.text_form.u_input.value == "username")
document.text_form.u_input.value = "";

if (document.text_form.input.value =="")
document.text_form.input.value ="password";
}

function clear_password()
{
if (document.text_form.input.value == "password")
document.text_form.input.value = "";

if (document.text_form.u_input.value == "")
document.text_form.u_input.value = "username";
}

</script>


This a simple HTML form to and when user click the text-box on-focus event will
call my JavaScript function.

<form name="text_form" action="#" method=post>
<input name=u_input onFocus=clear_username() value="username">
<input name=input onFocus=clear_password() value="password">
<input type=submit value=Submit>
<input type=reset>
</form>

Simple PHP Pagine

This is a simple php pagine file and You can change this according to your needs.I published this because when I need a pagine file I couldn't find.
line no 03 set the number of result rows. ex-number of product in the page
line no 04 and 05 set the start result row and end row.

0)
{
$eu=$start;
}
else
{
$eu =0;
}
?>

The query will retrieve the specific portion of data that limit by the start and end values.


$query=" SELECT * FROM student_adv limit $eu,$page_end";
$result=mysql_query($query);
echo mysql_error();


while($noticia = mysql_fetch_array($result))
{
if($bgcolor=='#f1f1f1'){$bgcolor='#ffffff';}
else{$bgcolor='#f1f1f1';}

echo "";
echo " $noticia[id]";
echo " $noticia[name]";
echo " $noticia[class]";
echo " $noticia[mark]";

echo "";
}


Retrieve all the data and count the number of rows in the result.line no 06 count the number of pages.line no 12 print the page numbers and pass the start and end row for the next page.


$query2=" SELECT * FROM student_adv ";
$result2=mysql_query($query2);
echo mysql_error();
$nume=mysql_num_rows($result2);
//setting pages
$pages_count=$nume/$limit;
print "";

for($i=0;$i<$pages_count;$i++) { $limitp=$limit; $end_limit=$i*$limit; print " ".$i.""; }

I will appreciate your comments.Let me know any errors or improvements.

jQuery Template

Simple J Query template.Used basic JQuery functions.Anyone can download this template free
















just considered JQuery functions and layout of the web site.so colors and text may be boring.

LIVE DEMO DOWNLOAD

file uploading PHP

If you need a upload a file using PHP. This is a easiest and nice way to do that. Only one line I used. You can add validation part according to your need.

Html part

<form action="upload_file.php" method="post" enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>


The enctype attribute of the <form> tag specifies which content-type to use when submitting the form. "multipart/form-data" is used when a form requires binary data.

The type="file" attribute of the <input> tag specifies that the input should be processed as a file. For example, when viewed in a browser, there will be a browse-button next to the input field


one line php script

<?php
$path="E:\tharu\";
move_uploaded_file($_FILES["file"]["tmp_name"],$path.$_FILES["file"]["name"]);
?>


[file][tmp_name] - temporary storage of file .now we save this file any place we want
path = specific path
[file][name] - name of the file

JQuery Toggle example

This is a very simple toggle example.After done toggle effect I used it different ways. I'm not considering look and feel anyone can change the CSS file very easily.




when click the Login button login box will appear below the button.

screen shot of login box









Jquery code for this example

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">

$(document).ready(function()
{
$(".flip1").hide();
$(".box").hide();
$(".flip").click(function ()
{
$(".box").slideToggle(1000);
$(".flip1").show();
$(".flip").hide();
});

$(".flip1").click(function ()
{
$(".box").slideToggle(1000);
$(".flip1").hide();
$(".flip").show();
});

});

</script>


html login form
<body>

<p class="flip">Login</p>
<p class="flip1">Login</p>

<div class="box">

Username<input type="text" name="user"> <br/><br/>
Password <input type="password" name="password"><br/>
<input type="submit" value="Submit"/>
</div>


</body>


simple CSS style sheet



<style type="text/css">
div.box
{
margin:0px;
padding:15px;
text-align:center;
background:#e5eecc;

}
div.box
{
height:100px;
width:300px;
display:none;
}

p.flip ,p.flip1
{
height:20px;
width:100px;
margin:0px;
padding:5px;
text-align:center;
background:#e5eecc;

}

</style>


Html / Css simple template free




This free website template has been coded in CSS. This is a very simple one and anyone can change it.
Header banner - image or flash banner
Logo - space to add logo
Navigation bar - Top navigation bar
Two columns
Load content to the left panel


Above I uploaded screen shots for get idea.You can download this template using this link.