<input type="file" onchange="onFileSelected(event)">
<br>
<textarea id="result" rows="10" cols="50"></textarea>
<script type="text/javascript">
function onFileSelected(event) {
var selectedFile = event.target.files[0];
var reader = new FileReader();
var result = document.getElementById("result");
reader.onload = function(event) {
result.innerHTML = event.target.result;
};
reader.readAsText(selectedFile);
}
</script>
simply just copy the above code and put it on your root directory. hope this post will helps you, if you still facing some bugs or error to than feel free to contact.
thanks for reading the post and please share this code with your developer buddy.
so first of all we should take an overview of our working scenario. in the below code we are created a form with having email, subject,message and attachment fields.
once the form is submitted our script is check that the file’s format is valid or not. if the file format is valid than the attachment is concatenate with our message field and with the help of MIME (Multipurpose Internet Mail Extensions) version and its content type and boundary.
we will send the attachment. once the mail is send successfully our script will display the success message and if the mail isn’t sent than it will display failure message as well.
before start this tutorial first of all we should understand the overall scenario of this post. now first of all we need to create a database connection , so in this example my database name is testdb .
after creating a database connection we fetch all the records from our user table and designed it in a tabular format with checkbox field, and also create a java script function that will help us to select all check boxes at a time. so just follow the below code.
copy the above code and save it on htdocs directory of your xampp server. there is a www folder if you are using WAMP or Appserv local server.
share this code with your developer buddies and if you have another way to make it simple ,please feel free to contact we will update your method also in this post.
Now in this post today we will learn how to create a pagination using PHP and MySQL.
so most of the time we see when we are developing any kind of software and when we fetch records from our MySQL database it probably returns us thousand or millions records. so it is not a good idea to show all records on a single page, so we split all those records into multiple pages.
so before start this tutorial we just take an overview how we split records into multiple pages. first of all we are establish a database connection , in this tutorial my database name is library. so i am going to fetch all the books name and their title which are stored in the table name called bookstore.
so in this post today we will learn how to extract all links of any web page with the help of PHP and will store all the links into MySQL database. also make a URL extractor platform which will help us to analysis the website.
if some one is using WordPress website we can extract the URLs and check which kind of themes and plugins that website developers are used. so just follow the below code an develop your own URL extractor.
so in the above code we are just creating a PHP function that takes website URL as a parameter and fetch /extract all the links. so in the below code we are just passing website URL as a parameter to our function.