<script>
$(function(){
$('#submitinfo').on('submit', function(e){
e.preventDefault();
$.ajax({
url: "https://localhost/submit.php",
type: 'POST', //or POST
data: $('#submitinfo').serialize(),
success: function(data){
alert('successfully submitted');
$('#submitinfo').hide();
}
});
});
});
</script>
<form id="submitinfo">
<table>
<thead>
<h4 id="review-title">Customer information</h4>
</thead>
<tr>
<label class="control-label" for="input-name">Complete Name</label>
<input type="text" name="name" value="" id="input-name" class="form-control" required>
</tr>
<tr>
<label class="control-label" for="input-name">Phone Number</label>
<input type="text" name="guest_
</tr>
<tr>
<label class="control-label" for="input-name">Email Address</label>
<input type="text" name="email" value="" id="input-name" class="form-control" required>
</tr>
</table>
<div class="modal-footer" STYLE="margin-top:30%;" >
<button name="btn_submit" id="btn_submit" type="submit" class="btn btn-success">Submit</button>
</div>
</form>
Monday, October 24, 2016
Sunday, May 29, 2016
Exporting & Importing App Pools and Websites configuration between multiple IIS instances
Using IIS server in a Cluster, Server Farm or other Load Balanced Environment will take a lot of work to setup, transferring a site from old IIS server to a new IIS server can encounter different issue in the .net framework and etc. When upgrading IIS7 (Windows Server 2008) TO IIS 8 (Windows Server 2012 R2).
appcmd is a commandline utility who can export the entire IIS Website and App. pools configuration in XML format and also import the xml into another IIS instance.
Export the Application Pools Using appcmd Command line
%windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\apppools.xml
This command line will export all your application pools including the default in your webserver. Therefore you need to edit your appools.xml and remove the following contents that you do'nt need to import.
· DefaultAppPool
· Classic .NET AppPool
· SecurityTokenServiceApplicationPool
· .NET v2.0
· .NET v2.0 Classic
· .NET v4.5
· .NET v4.5 Classic
Import the Application Pools Using appcmd Command line
Copy the appools.xml file to your webserver and run this following command line. after that All the AppPools in the xml will be created on your second IIS server.
%windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\apppools.xml
Export All Website Using appcmd Command line
%windir%\system32\inetsrv\appcmd list site /config /xml > c:\websites.xml
This command line will export all website on you IIS Server, after exporting you need to edit the websites.xml and remove the Default Website as well as any other website you don't want to export to you new IIS Server or already exist on the target IIS instance, otherwise the import command line won't work
Import All Website Using appcmd Command line
Just like you did with the App Pools file, copy the websites.xml file to your webserver and run this following command line. after that All the website in the xml file will be created on your target IIS server.
%windir%\system32\inetsrv\appcmd add site /in < c:\websites.xml
Monday, May 23, 2016
Zip File Upploader and Extracting using PHP Script
<?php
if($_FILES["fileToUpload"]["name"]) {
$file = $_FILES["fileToUpload"];
$filename = $file["name"];
$tmp_name = $file["tmp_name"];
$type = $file["type"];
$name = explode(".", $filename);
$accepted_types = array('application/zip', 'application/x-zip-compressed', 'multipart/x-zip', 'application/x-compressed');
if(in_array($type,$accepted_types)) {
$okay = true;
}
$continue = strtolower($name[1]) == 'zip' ? true : false;
if(!$continue) {
$message = "The file is not .zip file. Please try again.";
}
$ran = $name[0]."-".time()."-".rand(1,time());
$targetdir = "files/".$ran;
$targetzip = "files/".$ran.".zip";
if(move_uploaded_file($tmp_name, $targetzip)) {
$zip = new ZipArchive();
$x = $zip->open($targetzip);
if ($x === true) {
$zip->extractTo($targetdir);
$zip->close();
unlink($targetzip);
}
$message = " <strong>{$ran}.zip</strong> file was uploaded and extracted.";
} else {
$message = "Error!Uploaded file. Please try again.";
}
}
echo $message;
?>
if($_FILES["fileToUpload"]["name"]) {
$file = $_FILES["fileToUpload"];
$filename = $file["name"];
$tmp_name = $file["tmp_name"];
$type = $file["type"];
$name = explode(".", $filename);
$accepted_types = array('application/zip', 'application/x-zip-compressed', 'multipart/x-zip', 'application/x-compressed');
if(in_array($type,$accepted_types)) {
$okay = true;
}
$continue = strtolower($name[1]) == 'zip' ? true : false;
if(!$continue) {
$message = "The file is not .zip file. Please try again.";
}
$ran = $name[0]."-".time()."-".rand(1,time());
$targetdir = "files/".$ran;
$targetzip = "files/".$ran.".zip";
if(move_uploaded_file($tmp_name, $targetzip)) {
$zip = new ZipArchive();
$x = $zip->open($targetzip);
if ($x === true) {
$zip->extractTo($targetdir);
$zip->close();
unlink($targetzip);
}
$message = " <strong>{$ran}.zip</strong> file was uploaded and extracted.";
} else {
$message = "Error!Uploaded file. Please try again.";
}
}
echo $message;
?>
Subscribe to:
Posts (Atom)