tutorial1000
Friday, 11 November 2016
Wednesday, 5 October 2016
Sunday, 17 February 2013
Php uploader
First of all we have to create a from from where we will upload files from client server to remote server. Below is the from
<html>
<body>
<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>
</body>
</html>
At the above code you find a attribute "enctype " this 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, like the contents of a file, to be uploaded
Now we have to build the php code to upload files you can see at the from we set aname of a php page in action attribute "upload_file.php". This is main file to upload the selected file from client server to remote server.
<html>
<body>
<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>
</body>
</html>
At the above code you find a attribute "enctype " this 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, like the contents of a file, to be uploaded
Now we have to build the php code to upload files you can see at the from we set aname of a php page in action attribute "upload_file.php". This is main file to upload the selected file from client server to remote server.
upload_file.php
<?php
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
?>
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
?>
Saturday, 26 May 2012
About the new html5 slider tag.
One thing to say that in a word it is amazing. The slider tag will allow you to set a range of value and allow you to set a initial value. You can do it just by a one line code.
The most left side of the bar is the minimum value, the right most is the maximum. users can slide the bar to the left or right to choose the value they like..Look below to see it in action and then we will go for the releated code
This is a slider to insert it just use one line code in your html code
<input type="range">
This one line will set the slider in your page now we will go step by step with example of this html5 slider. Now we will set the values for this html5 slider. To set the value for minimum and maximum we will add some more words with the existing codeThis is a slider to insert it just use one line code in your html code
<input type="range">
In this slider I have set min and max values and to do this I just add few words
<input type="range" min="0" max="100">
But still we can not see any output of the min/max value it's behavior is same as a slider without setting min/max value. Don't worry we will do everything but before this I like to show you another tricks of html5 slider.
Now we set a initial value for the slider as you can see the slider set himself a t middle as default but we have to customize it so we apply another attribute that is value
See this slider is set himself almost at the top right , how is it possible ?
See below
<input type="range" min="0" max="100" value="90">
Now we will go fto set the step value that means you can move the slider with a fix value. See the example below to understand
Move the slider and you can understand what is the difference.How will you do this ? Just add a more attribute "step"
<input type="range" min="0" max="100" value="90" step="10">
And lstly we are going to show the value for slider so that user can know what value they are choosing
To do this I wrote a simple javascript code that will show the value of the slider as you slide it..Here is the code. Now go and try this if you facing any problem please contact me
<span id="range">0</span>
<script type="text/javascript">
function showValue(newValue)
{
document.getElementById("range").innerHTML=newValue;
}
</script>
Hope this tutorial will help you.. Just get in touch I will provide more tutorial on html5 ,php, flash, photoshop and on web designing in web 2.0 style.
Sidd
Sidd
Hi
Now a days the html5 become very much usefill and become more and more strong tool for web site design and development we post several tutorial for HTML5 . Specialy on jquary using in HTML5. Jquary is now a very powerful animation tool for web technologies. Not only a design tool it is a programming tool also. I like to talk about it later. Please keep watching I try my best to give you some good tutorial
Sidd
Now a days the html5 become very much usefill and become more and more strong tool for web site design and development we post several tutorial for HTML5 . Specialy on jquary using in HTML5. Jquary is now a very powerful animation tool for web technologies. Not only a design tool it is a programming tool also. I like to talk about it later. Please keep watching I try my best to give you some good tutorial
Sidd
Subscribe to:
Posts (Atom)