Jump to content

PHPLazy

Members
  • Content Count

    18
  • Joined

  • Last visited

Community Reputation

0 Neutral

About PHPLazy

  • Rank
    Member

Recent Profile Visitors

467 profile views
  1. Hello, I'm developing one website for a real-estate agency. I have a html form that is used to submit property details, There is multiple form inputs and also I need to upload multiple property images using Dropzone JS multiple image upload. Here I'm validating form inputs using jQuery Validation library. Validation works perfect and data Is being to posted to php file called submit_property_data.php. But when I implement the Dropzone JS image upload its not working. JS File (property-submit.js) $('document').ready(function() { $("#notification-property").hide(); /* handling form validation */ $("#property-form").validate({ rules: { prop_title: "required", prop_price: { required: true, digits: true }, prop_area: { required: true, digits: true }, prop_address: "required", prop_message: { required: true, minlength: 10, maxlength: 2000 }, prop_owner_name: "required", prop_owner_email: { required: true, email: true }, prop_owner_phone: { required: true, digits: true }, }, messages: { 'prop_title': { required: "Please enter title for your property" }, prop_price: { required: "Please enter price of your property", digits: "Please enter price in digits (AED)" }, prop_area: "Please enter Sqft of your property", prop_address: "Please enter address of your property", prop_message: { required: "Please enter detailed Information", minlength: "Please enter something about your property in 50 - 20000 characters", maxlength: "Please enter something about your property in 50 - 20000 characters" }, prop_owner_name: "Please enter your name", prop_owner_email: { required: "Please enter your email address", email: "Please enter valid email address" }, prop_owner_phone: { required: "Please enter your phone number", digits: "Please enter valid phone number" }, }, submitHandler: submitPropertyForm }); /* Handling login functionality */ function submitPropertyForm() { var data = $("#property-form").serialize(); $.ajax({ type: 'POST', url: 'submit_property_data.php', data: data, beforeSend: function() { $("#submit-button").html('<span class="glyphicon glyphicon-transfer"></span> &nbsp; Submiting ...'); }, success: function(response) { if (response == "ok") { console.log(1); document.getElementById("property-form").reset(); $("#notification-property").html('<b> ' + response + ' !</b>').show(); //setTimeout(' window.location.href = "dashboard.php"; ',4000); } else { $("#notification-property").fadeIn(1000, function() { $("#notification-property").html('<b>' + response + ' !</b>').fadeOut(); $("#submit-button").html('&nbsp; Send'); }); } }, complete:function(){ $('body, html').animate({scrollTop:$('form').offset().top}, 'slow'); } }); return false; } $("#submit-button").bind('click', function() { if ( $("#property-form").valid() ) { submitPropertyForm(); } else { console.log('form invalid'); } }) Dropzone.autoDiscover = false; $(function () { $("div#myDropzone").dropzone({ url: 'submit_property_data.php', addRemoveLinks: true, maxFiles:11, uploadMultiple: true, autoProcessQueue: false, parallelUploads: 10, init: function () { var myDropzone = this; // Update selector to match your button $("#submit-button").click(function (e) { e.preventDefault(); myDropzone.processQueue(); }); this.on('sending', function(file, xhr, formData) { // Append all form inputs to the formData Dropzone will POST var data = $('#property-form').serializeArray(); $.each(data, function(key, el) { formData.append(el.name, el.value); }); }); this.on("success", function(file, responseText) { alert(responseText); }); }, }); }); }); HTML File (submit-property.php) <html> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> <script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script> !-- Submit Property start --> <div class="content-area-7 submit-property"> <div class="container"> <div class="row"> <div class="col-md-12"> <!-- <div id="error_message" class="notification-box"></div> --> </div> <div id="notification-property" class="notification-box">sd</div> <div class="col-md-12"> <div class="submit-address"> <form name = "property-form" method="post" id="property-form"> <div class="main-title-2"> <h1><span>Tell Me</span> Something About Your Property</h1> </div> <div class="search-contents-sidebar mb-30"> <div class="form-group"> <label>Property Title</label> <input class="input-text" name="prop_title" id="prop_title" placeholder="Property Title"> </div> <div class="row"> <div class="col-md-6 col-sm-6"> <div class="form-group"> <label>Status</label> <select class="selectpicker search-fields" id="prop_status" name="prop_status"> <option value="Sale">For Sale</option> <option value="Rent">For Rent</option> </select> </div> </div> <div class="col-md-6 col-sm-6"> <div class="form-group"> <label>Type</label> <select class="selectpicker search-fields" id="prop_title" name="prop_type"> <option value="Modern">Modern</option> <option value="Traditional">Traditional</option> <option value="Arabic">Arabic</option> </select> </div> </div> </div> <div class="row"> <div class="col-md-3 col-sm-6"> <div class="form-group"> <label>Price (Dirham)</label> <input class="input-text" name="prop_price" id="prop_price" placeholder="AED"> </div> </div> <div class="col-md-3 col-sm-6"> <div class="form-group"> <label>Sqft</label> <input class="input-text" name="prop_area" id="prop_area" placeholder="SqFt"> </div> </div> <div class="col-md-3 col-sm-6"> <div class="form-group"> <label>Bed Rooms</label> <select class="selectpicker search-fields" name="prop_rooms" id="prop_rooms"> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> </div> </div> <!-- <div class="col-md-3 col-sm-6"> <div class="form-group"> <label>Bathroom</label> <select class="selectpicker search-fields" name="1"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> </select> </div> </div> --> </div> </div> <div class="main-title-2"> <h1><span>Location</span></h1> </div> <div class="row mb-30 "> <div class="col-md-6 col-sm-6"> <div class="form-group"> <label>Address</label> <input class="input-text" id="prop_address" name="prop_address" placeholder="Address"> </div> </div> </div> <div class="main-title-2"> <h1><span>Upload</span> Photos Of Villa </h1> </div> <div id="myDropzone" class="dropzone dropzone-design mb-10"> <div class="dz-default dz-message" data=""><span>Drop files here to upload</span></div> </div> <div class="main-title-2"> <h1><span>Detailed</span> Information</h1> </div> <div class="row mb-30"> <div class="col-md-12"> <div class="form-group"> <textarea class="input-text" id="prop_message" name="prop_message" placeholder="Detailed Information"></textarea> </div> </div> </div> <!--<div class="row mb-30"> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Building Age <span>(optional)</span></label> <select class="selectpicker search-fields" name="years"> <option>0-1 Years</option> <option>0-5 Years</option> <option>0-10 Years</option> <option>0-20 Years</option> <option>0-40 Years</option> <option>40+Years</option> </select> </div> </div> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Bedrooms (optional)</label> <select class="selectpicker search-fields" name="1"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> </select> </div> </div> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Bathrooms (optional)</label> <select class="selectpicker search-fields" name="1"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> </select> </div> </div> <div class="col-lg-12"> <label class="margin-t-10">Features (optional)</label> <div class="row"> <div class="col-lg-4 col-sm-4 col-xs-12"> <div class="checkbox checkbox-theme checkbox-circle"> <input id="opt_parking" name="opt_parking" value="1" type="checkbox"> <label for="checkbox1"> Free Parking </label> </div> <div class="checkbox checkbox-theme checkbox-circle"> <input id="opt_air_condition" name="opt_air_condition" value="1" type="checkbox"> <label for="checkbox2"> Air Condition </label> </div> <div class="checkbox checkbox-theme checkbox-circle"> <input id="opt_seat" name="opt_seat" value="1" type="checkbox"> <label for="checkbox3"> Places to seat </label> </div> </div> <div class="col-lg-4 col-sm-4 col-xs-12"> <div class="checkbox checkbox-theme checkbox-circle"> <input id="opt_swimming" name="opt_swimming" value="1" type="checkbox"> <label for="checkbox4"> Swimming Pool </label> </div> <div class="checkbox checkbox-theme checkbox-circle"> <input id="opt_laundary" name="opt_laundary" value="1" type="checkbox"> <label for="checkbox5"> Laundry Room </label> </div> <div class="checkbox checkbox-theme checkbox-circle"> <input id="opt_window_covering" name="opt_window_covering" value="1" type="checkbox"> <label for="checkbox6"> Window Covering </label> </div> </div> <div class="col-lg-4 col-sm-4 col-xs-12"> <div class="checkbox checkbox-theme checkbox-circle"> <input id="opt_parking" name="opt_parking" value="1" type="checkbox"> <label for="checkbox7"> Central Heating </label> </div> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox8" type="checkbox"> <label for="checkbox8"> Alarm </label> </div> </div> </div> </div> </div>--> <div class="main-title-2"> <h1><span>Contact</span> Details</h1> </div> <div class="row"> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Name</label> <input class="input-text" name="prop_owner_name" id="prop_owner_name" placeholder="Name"> </div> </div> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Email</label> <input class="input-text" name="prop_owner_email" id="prop_owner_email" placeholder="Email"> </div> </div> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Contact No</label> <input class="input-text" name="prop_owner_phone" id="prop_owner_phone" placeholder="Phone"> </div> </div> </div> <div class="col-md-12"> <button type="button" name="submit-button" id="submit-button">Submit</button> </div> </div> </form> </div> </div> </div> </div> </div> <script src="property-submit.js"></script> <script src="js/dropzone.js"></script> </html> PHP File (submit_property_data.php) <?php echo "ok"; require_once("functions.php"); $ds = DIRECTORY_SEPARATOR; //1 $storeFolder = 'villas-images'; $encpt_data = rand(1000,5000); if (!empty($_FILES)) { $tempFile = $_FILES['file']['tmp_name']; //3 $targetPath = dirname( __FILE__ ) . $ds. $storeFolder . $ds; //4 $targetFile = $targetPath.$_FILES['file']['name']; //5 if(move_uploaded_file($tempFile,$targetFile)) { echo '<b>Success</b>'; } } ?> What I actually need ? I need to validate the form inputs first & upload the images once the form is valid also I need to post all the inputs to my php file called submit_property_data.php Also I need the image inputs to store into my database.
  2. Hello Guys, I'm developing one website for submitting property and I used DropzoneJS library to drag and drop upload images of properties. I want to upload images on button click and also post the form input values to get all the values along with the images. HTML Code : <?php require_once("functions.php"); require_once("nav_header.php"); ?> <!-- Sub banner start --> <!--<div class="sub-banner overview-bgi"> <div class="overlay"> <div class="container"> <div class="breadcrumb-area"> <h1>Submit Property</h1> </div> </div> </div> </div> <!-- Sub Banner end --> <!-- Submit Property start --> <div class="content-area-7 submit-property"> <div class="container"> <div class="row"> <div class="col-md-12"> <!--<div id="error_message" class="notification-box"> </div>--> </div> <div class="col-md-12"> <div class="submit-address"> <form name = "property_form" id="property_form"> <div class="main-title-2"> <h1><span>Tell Me</span> Something About Your Property</h1> </div> <div class="search-contents-sidebar mb-30"> <div class="form-group"> <label>Property Title</label> <input data-validation="length alphanumeric" data-validation-length="min10" data-validation-error-msg="Propererty title should be minumm 44 characters" class="input-text" name="prop_title" placeholder="Property Title"> <span class="val_prop_title"></span> </div> <div class="row"> <div class="col-md-6 col-sm-6"> <div class="form-group"> <label>Status</label> <select class="selectpicker search-fields" name="prop_status"> <option value="Sale">For Sale</option> <option value="Rent">For Rent</option> </select> <span class="val_prop_status"></span> </div> </div> <div class="col-md-6 col-sm-6"> <div class="form-group"> <label>Type</label> <select class="selectpicker search-fields" name="prop_type"> <option value="Modern">Modern</option> <option value="Traditional">Traditional</option> <option value="Arabic">Arabic</option> </select> <span class="val_prop_type"></span> </div> </div> </div> <div class="row"> <div class="col-md-3 col-sm-6"> <div class="form-group"> <label>Price (Dirham)</label> <input data-validation="number" data-validation-error-msg="Please enter the property price in digits." class="input-text" name="prop_price" placeholder="AED"> <span class="val_prop_price"></span> </div> </div> <div class="col-md-3 col-sm-6"> <div class="form-group"> <label>Sqft</label> <input data-validation="number" data-validation-error-msg="Please enter the Sqft of your property" class="input-text" name="prop_area" placeholder="SqFt"> <span class="val_prop_area"></span> </div> </div> <div class="col-md-3 col-sm-6"> <div class="form-group"> <label>Bed Rooms</label> <select class="selectpicker search-fields" name="prop_rooms"> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> <span class="val_prop_rooms"></span> </div> </div> <!-- <div class="col-md-3 col-sm-6"> <div class="form-group"> <label>Bathroom</label> <select class="selectpicker search-fields" name="1"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> </select> </div> </div> --> </div> </div> <div class="main-title-2"> <h1><span>Location</span></h1> </div> <div class="row mb-30 "> <div class="col-md-6 col-sm-6"> <div class="form-group"> <label>Address</label> <input data-validation="required" class="input-text" name="prop_address" placeholder="Address"> </div> <span class="val_prop_address"></span> </div> </div> <div class="main-title-2"> <h1><span>Upload</span> Photos Of Villa </h1> </div> <div id="myDropZone" class="dropzone dropzone-design mb-10"> <div class="dz-default dz-message" data><span>Drop files here to upload</span></div> </div> <div class="main-title-2"> <h1><span>Detailed</span> Information</h1> </div> <div class="row mb-30"> <div class="col-md-12"> <div class="form-group"> <label>Detailed Information</label> <textarea class="input-text" data-validation="required" data-validation-error-msg="Please tell me something about your property" name="prop_message" placeholder="Detailed Information"></textarea> </div> <span class="val_prop_message"></span> </div> </div> <!--<div class="row mb-30"> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Building Age <span>(optional)</span></label> <select class="selectpicker search-fields" name="years"> <option>0-1 Years</option> <option>0-5 Years</option> <option>0-10 Years</option> <option>0-20 Years</option> <option>0-40 Years</option> <option>40+Years</option> </select> </div> </div> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Bedrooms (optional)</label> <select class="selectpicker search-fields" name="1"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> </select> </div> </div> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Bathrooms (optional)</label> <select class="selectpicker search-fields" name="1"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> </select> </div> </div> <div class="col-lg-12"> <label class="margin-t-10">Features (optional)</label> <div class="row"> <div class="col-lg-4 col-sm-4 col-xs-12"> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox1" type="checkbox"> <label for="checkbox1"> Free Parking </label> </div> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox2" type="checkbox"> <label for="checkbox2"> Air Condition </label> </div> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox3" type="checkbox"> <label for="checkbox3"> Places to seat </label> </div> </div> <div class="col-lg-4 col-sm-4 col-xs-12"> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox4" type="checkbox"> <label for="checkbox4"> Swimming Pool </label> </div> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox5" type="checkbox"> <label for="checkbox5"> Laundry Room </label> </div> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox6" type="checkbox"> <label for="checkbox6"> Window Covering </label> </div> </div> <div class="col-lg-4 col-sm-4 col-xs-12"> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox7" type="checkbox"> <label for="checkbox7"> Central Heating </label> </div> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox8" type="checkbox"> <label for="checkbox8"> Alarm </label> </div> </div> </div> </div> </div>--> <div class="main-title-2"> <h1><span>Contact</span> Details</h1> </div> <div class="row"> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Name</label> <input data-validation="required" data-validation-error-msg="Please enter your name." class="input-text" name="prop_owner_name" placeholder="Name"> <span class="val_prop_owner_name"></span> </div> </div> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Email</label> <input data-validation="email" class="input-text" name="prop_owner_email" placeholder="Email"> <span class="val_prop_owner_email"></span> </div> </div> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Phone</label> <input data-validation="number" data-validation-error-msg="Please enter your contact " class="input-text" name="prop_owner_phone" placeholder="Phone"> <span class="val_prop_owner_phone"></span> </div> </div> <div class="col-md-12"> <button type="submit" name="submit" id="btn-submit"> <span class="btn button-sm button-theme">Submit</span> </button> </div> </div> </form> </div> </div> </div> </div> </div> <script> $.validate({ lang: 'es' }); </script> <!-- Submit Property end --> <?php require_once("nav_footer.php"); ?> Jquery Code : // Dropzone initialization Dropzone.autoDiscover = false; $(function () { $("div#myDropZone").dropzone({ url: 'submit_property_data.php', addRemoveLinks: true, autoProcessQueue: false, addRemoveLinks: true, parallelUploads: 1, maxFilesize: 2, maxFiles:11 }); }); Anybody help me to upload images on button click and also post the input field values with it
  3. How to get javascript console error
  4. Hello Friends, I'm developing one website for real estate company, I'm using jquery validate plugin for that. But its not working. Jquery Code (validate_property.js) : $('document').ready(function() { /* handle form validation */ $("#property-form").validate({ rules: { prop_title: { required: true, minlength: 15 }, prop_status: { required: true }, prop_type: { required: true }, prop_price: { required: true, number: true }, prop_area: { required: true }, prop_rooms: { required: true, number: true }, prop_address: { required: true, minlength: 50, maxlength: 500 }, prop_message: { required: true, minlength: 30, maxlength: 1000 }, prop_owner_name: { required: true, minlength: 3 }, prop_owner_email: { required: true, email: true }, prop_owner_phone: { required: true, digits: true } }, messages: { prop_title:{ required: "Please enter property name", minlength: "Property title must be atleast 15 characters" }, prop_status: "Pleasse select the status of your property", prop_type: "Please select the type of property", prop_price:{ required: "Please enter the price of property", number: "Price should be in digits" }, prop_area: "Please enter the price of property", prop_price:{ required: "Please enter the price of property", number: "Price should be in digits" }, prop_rooms:{ required: "Please enter the number of rooms", number: "Rooms should be in digits" }, prop_address:{ required: "Please enter the address of property", minlength: "Address should be between 50 to 500 characters", maxlength: "Address should be between 50 to 500 characters" }, prop_message:{ required: "Please enter your message", minlength: "Message should be between 30 to 1000 characters", maxlength: "Message should be between 30 to 1000 characters" }, prop_owner_name:{ required: "Please enter your name", minlength: "Name should be atleast 3 characters" }, prop_owner_email:{ required: "Please enter your email address", email: "Please enter a valid email address" }, prop_owner_phone:{ required: "Please enter your contact number", number: "Please enter a valid contact number" } }, submitHandler: submitForm }); /* handle form submit */ function submitForm() { var data = $("#property_form").serialize(); $.ajax({ type : 'POST', url : 'submit_property_data.php', data : data, beforeSend: function() { $("#error").fadeOut(); $("#btn-submit").html('Sending ...'); }, success : function(response) { if(response==1){ $("#error").fadeIn(1000, function(){ $("#error").html('Response 1'); }); } else { $("#error").fadeIn(1000, function(){ $("#error").html('<div class="alert alert-danger"><span class="glyphicon glyphicon-info-sign"></span> '+data+' !</div>'); $("#btn-submit").html('<span class="glyphicon glyphicon-log-in"></span> Create Account'); }); } } }); return false; } }); HTML Form : <?php require_once("functions.php"); require_once("nav_header.php"); ?> <script type="text/javascript" src="https://cdn.jsdelivr.net/jquery.validation/1.15.1/jquery.validate.min.js"> </script> <script src="js/validate_property.js"></script> <!-- Sub banner start --> <div class="sub-banner overview-bgi"> <div class="overlay"> <div class="container"> <div class="breadcrumb-area"> <h1>Submit Property</h1> </div> </div> </div> </div> <!-- Sub Banner end --> <!-- Submit Property start --> <div class="content-area-7 submit-property"> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="notification-box"> <div id="error" class="validate_msg"></div> </div> </div> <div class="col-md-12"> <div class="submit-address"> <form name = "property_submit_form" method="post" id="property_form"> <div class="main-title-2"> <h1><span>Tell Me</span> Something About Your Property</h1> </div> <div class="search-contents-sidebar mb-30"> <div class="form-group"> <label>Property Title</label> <input type="text" class="input-text" name="prop_title" placeholder="Property Title"> <span class="val_prop_title"></span> </div> <div class="row"> <div class="col-md-6 col-sm-6"> <div class="form-group"> <label>Status</label> <select class="selectpicker search-fields" name="prop_status"> <option value="Sale">For Sale</option> <option value="Rent">For Rent</option> </select> <span class="val_prop_status"></span> </div> </div> <div class="col-md-6 col-sm-6"> <div class="form-group"> <label>Type</label> <select class="selectpicker search-fields" name="prop_type"> <option value="Modern">Modern</option> <option value="Traditional">Traditional</option> <option value="Arabic">Arabic</option> </select> <span class="val_prop_type"></span> </div> </div> </div> <div class="row"> <div class="col-md-3 col-sm-6"> <div class="form-group"> <label>Price (Dirham)</label> <input type="text" class="input-text" name="prop_price" placeholder="AED"> <span class="val_prop_price"></span> </div> </div> <div class="col-md-3 col-sm-6"> <div class="form-group"> <label>Area/Location</label> <input type="text" class="input-text" name="prop_area" placeholder="SqFt"> <span class="val_prop_area"></span> </div> </div> <div class="col-md-3 col-sm-6"> <div class="form-group"> <label>Bed Rooms</label> <select class="selectpicker search-fields" name="prop_rooms"> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> <span class="val_prop_rooms"></span> </div> </div> <!-- <div class="col-md-3 col-sm-6"> <div class="form-group"> <label>Bathroom</label> <select class="selectpicker search-fields" name="1"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> </select> </div> </div> --> </div> </div> <div class="main-title-2"> <h1><span>Location</span></h1> </div> <div class="row mb-30 "> <div class="col-md-6 col-sm-6"> <div class="form-group"> <label>Address</label> <input type="text" class="input-text" name="prop_address" placeholder="Address"> </div> <span class="val_prop_address"></span> </div> </div> <div class="main-title-2"> <h1><span>Detailed</span> Information</h1> </div> <div class="row mb-30"> <div class="col-md-12"> <div class="form-group"> <label>Detailed Information</label> <textarea class="input-text" name="prop_message" placeholder="Detailed Information"></textarea> </div> <span class="val_prop_message"></span> </div> </div> <!--<div class="row mb-30"> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Building Age <span>(optional)</span></label> <select class="selectpicker search-fields" name="years"> <option>0-1 Years</option> <option>0-5 Years</option> <option>0-10 Years</option> <option>0-20 Years</option> <option>0-40 Years</option> <option>40+Years</option> </select> </div> </div> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Bedrooms (optional)</label> <select class="selectpicker search-fields" name="1"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> </select> </div> </div> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Bathrooms (optional)</label> <select class="selectpicker search-fields" name="1"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> </select> </div> </div> <div class="col-lg-12"> <label class="margin-t-10">Features (optional)</label> <div class="row"> <div class="col-lg-4 col-sm-4 col-xs-12"> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox1" type="checkbox"> <label for="checkbox1"> Free Parking </label> </div> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox2" type="checkbox"> <label for="checkbox2"> Air Condition </label> </div> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox3" type="checkbox"> <label for="checkbox3"> Places to seat </label> </div> </div> <div class="col-lg-4 col-sm-4 col-xs-12"> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox4" type="checkbox"> <label for="checkbox4"> Swimming Pool </label> </div> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox5" type="checkbox"> <label for="checkbox5"> Laundry Room </label> </div> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox6" type="checkbox"> <label for="checkbox6"> Window Covering </label> </div> </div> <div class="col-lg-4 col-sm-4 col-xs-12"> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox7" type="checkbox"> <label for="checkbox7"> Central Heating </label> </div> <div class="checkbox checkbox-theme checkbox-circle"> <input id="checkbox8" type="checkbox"> <label for="checkbox8"> Alarm </label> </div> </div> </div> </div> </div>--> <div class="main-title-2"> <h1><span>Contact</span> Details</h1> </div> <div class="row"> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Name</label> <input type="text" class="input-text" name="prop_owner_name" placeholder="Name"> <span class="val_prop_owner_name"></span> </div> </div> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Email</label> <input type="email" class="input-text" name="prop_owner_email" placeholder="Email"> <span class="val_prop_owner_email"></span> </div> </div> <div class="col-md-4 col-sm-4"> <div class="form-group"> <label>Phone</label> <input type="text" class="input-text" name="prop_owner_phone" placeholder="Phone"> <span class="val_prop_owner_phone"></span> </div> </div> <div class="col-md-12"> <button type="submit" name="submit" id="btn-submit"> <span class="btn button-sm button-theme">Submit</span> </button> </div> </div> </form> </div> </div> </div> </div> </div> <!-- Submit Property end --> <?php require_once("nav_footer.php"); ?> Output : The form is not validating with the jquery plugin, it just refreshing. Please anybody here to help ?
  5. Hey Python Geeks, I need code to parse one access log file and show the ip address with count. The log file is : https://bureau-ehe.ch/logs/logs/access.log Anybody help me to parse the file in python? I want to track the repeated ips. Thanks
  6. Hey Guys. I want to implement google cloud vision api for recognise the image. Everything installed fine, I'm getting the error Google\Cloud\Core\Exception\ServiceException { "error": { "code": 403, "message": "The request is missing a valid API key.", "status": "PERMISSION_DENIED" } } 1. in C:\xampp\htdocs\vofms\vendor\google\cloud-core\src\RequestWrapper.php at line 336 327328329330331332333334335336337338339340341342343344345 case 504: $exception = Exception\DeadlineExceededException::class; break; default: $exception = Exception\ServiceException::class; break; } return new $exception($this->getExceptionMessage($ex), $ex->getCode(), $ex); } /** * Gets the exception message. * * @param \Exception $ex * @return string */ private function getExceptionMessage(\Exception $ex) 2. in C:\xampp\htdocs\vofms\vendor\google\cloud-core\src\RequestWrapper.php at line 189 – Google\Cloud\Core\RequestWrapper::convertToGoogleException(GuzzleHttp\Exception\ClientException) 183184185186187188189190191192193194195 try { return $backoff->execute($this->httpHandler, [ $this->applyHeaders($request), $this->getRequestOptions($options) ]); } catch (\Exception $ex) { throw $this->convertToGoogleException($ex); } } /** * Deliver the request asynchronously. * 3. in C:\xampp\htdocs\vofms\vendor\google\cloud-core\src\RestTrait.php at line 96 – Google\Cloud\Core\RequestWrapper::send(GuzzleHttp\Psr7\Request, []) 90919293949596979899100101102 try { return json_decode( $this->requestWrapper->send( $this->requestBuilder->build($resource, $method, $options), $requestOptions )->getBody(), true ); } catch (NotFoundException $e) { if ($whitelisted) { throw $this->modifyWhitelistedError($e); } 4. in C:\xampp\htdocs\vofms\vendor\google\cloud-vision\src\Connection\Rest.php at line 59 – Google\Cloud\Vision\Connection\Rest::send('images', 'annotate', ['requests' => [['image' => ['content' => '/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBD...'], 'features' => [['type' => 'FACE_DETECTION']]]]]) 535455565758596061 /** * @param array $args */ public function annotate(array $args) { return $this->send('images', 'annotate', $args); } } 5. in C:\xampp\htdocs\vofms\vendor\google\cloud-vision\src\VisionClient.php at line 272 – Google\Cloud\Vision\Connection\Rest::annotate(['requests' => [['image' => ['content' => '/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBD...'], 'features' => [['type' => 'FACE_DETECTION']]]]]) 266267268269270271272273274275276277278 foreach ($images as $image) { $requests[] = $image->requestObject(); } $res = $this->connection->annotate([ 'requests' => $requests ] + $options); $annotations = []; if (isset($res['responses'])) { foreach ($res['responses'] as $response) { $annotations[] = new Annotation($response); } 6. in C:\xampp\htdocs\vofms\vendor\google\cloud-vision\src\VisionClient.php at line 229 – Google\Cloud\Vision\VisionClient::annotateBatch([Google\Cloud\Vision\Image], []) 223224225226227228229230231232233234235 * @param Image $image The image to annotate * @param array $options Configuration options * @return Annotation */ public function annotate(Image $image, array $options = []) { $res = $this->annotateBatch([$image], $options); return $res[0]; } /** * Annotate a set of images. * 7. in C:\xampp\htdocs\vofms\frontend\themes\admin_lte\site\index.php at line 22 – Google\Cloud\Vision\VisionClient::annotate(Google\Cloud\Vision\Image) 16171819202122232425262728 $image = $vision->image( fopen('C:\xampp\htdocs\vofms\frontend\themes\admin_lte\images\1.jpg', 'r'), ['faces'] ); $annotation = $vision->annotate($image); // Determine if the detected faces have headwear. foreach ($annotation->faces() as $key => $face) { if ($face->hasHeadwear()) { echo "Face $key has headwear.\n"; } 8. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\View.php at line 348 – require('C:\xampp\htdocs\vofms\frontend\t...') 9. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\View.php at line 257 – yii\base\View::renderPhpFile('C:\xampp\htdocs\vofms\frontend\t...', ['dataProvider' => yii\data\ActiveDataProvider]) 10. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\View.php at line 156 – yii\base\View::renderFile('C:\xampp\htdocs\vofms\frontend\v...', ['dataProvider' => yii\data\ActiveDataProvider], frontend\controllers\SiteController) 11. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\Controller.php at line 384 – yii\base\View::render('index', ['dataProvider' => yii\data\ActiveDataProvider], frontend\controllers\SiteController) 12. in C:\xampp\htdocs\vofms\frontend\controllers\SiteController.php at line 89 – yii\base\Controller::render('index', ['dataProvider' => yii\data\ActiveDataProvider]) 83848586878889909192939495 $dataProvider = new ActiveDataProvider([ 'query' => Offenses::find(), ]); return $this->render('index', [ 'dataProvider' => $dataProvider, ]); } /** * Displays a single Offenses model. * @param integer $id * @return mixed 13. frontend\controllers\SiteController::actionIndex() 14. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\InlineAction.php at line 57 – call_user_func_array([frontend\controllers\SiteController, 'actionIndex'], []) 15. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\Controller.php at line 157 – yii\base\InlineAction::runWithParams(['r' => 'site/index']) 16. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\Module.php at line 528 – yii\base\Controller::runAction('index', ['r' => 'site/index']) 17. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\web\Application.php at line 103 – yii\base\Module::runAction('site/index', ['r' => 'site/index']) 18. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\Application.php at line 386 – yii\web\Application::handleRequest(yii\web\Request) 19. in C:\xampp\htdocs\vofms\frontend\web\index.php at line 17 – yii\base\Application::run() 11121314151617 require _DIR_ . '/../../common/config/main.php', require _DIR_ . '/../../common/config/main-local.php', require _DIR_ . '/../config/main.php', require _DIR_ . '/../config/main-local.php' ); (new yii\web\Application($config))->run() Where I can set GOOGLE_APPLICATION_CREDENTIALS environment variable in Yii2 framework.
  7. Hey Guys, I'm currently in a program managed by IT Department of India. My topic is Vehicle Offence Management System. Unfortunately I failed with android finger print scanning. I need to record face of every individual when registering offence and I need to retrieve data when the same face is captured. is there is any Solution in PHP ??? for matching 2 faces ? Thanks
  8. Hi, Anybody can help me to extract data from son using php {"location":{"woeid":2293962,"city":"Kasaragod","region":" KL","country":"India","lat":12.5174,"long":74.990662,"timezone_id":"Asia/Kolkata"},"current_observation":{"wind":{"chill":80,"direction":338,"speed":11.81},"atmosphere":{"humidity":70,"visibility":10.0,"pressure":29.8,"rising":0},"astronomy":{"sunrise":"6:54 am","sunset":"6:35 pm"},"condition":{"text":"Clear","code":31,"temperature":80},"pubDate":1549638000},"forecasts":[{"day":"Fri","date":1549564200,"low":76,"high":85,"text":"Sunny","code":32},{"day":"Sat","date":1549650600,"low":76,"high":85,"text":"Sunny","code":32},{"day":"Sun","date":1549737000,"low":75,"high":85,"text":"Sunny","code":32},{"day":"Mon","date":1549823400,"low":76,"high":87,"text":"Mostly Sunny","code":34},{"day":"Tue","date":1549909800,"low":76,"high":89,"text":"Sunny","code":32},{"day":"Wed","date":1549996200,"low":77,"high":88,"text":"Partly Cloudy","code":30},{"day":"Thu","date":1550082600,"low":76,"high":89,"text":"Mostly Sunny","code":34},{"day":"Fri","date":1550169000,"low":76,"high":86,"text":"Sunny","code":32},{"day":"Sat","date":1550255400,"low":76,"high":85,"text":"Sunny","code":32},{"day":"Sun","date":1550341800,"low":74,"high":85,"text":"Sunny","code":32}]} How to extract data of "current_observation" Thanks
  9. Means. We need to create different directory for different users?
  10. Cool gizmola! Got some points and ideas. Let me ask one thing for building apk we need to set different que? Because users input necessary details to build apk such as Icon, appname, packages name, version code, splash, We store these details into our global database and make a unique global path for every users. Once user build apk, our code write the path into entire configuration file may be gradle.properties for Android. I don't know about Apache Cordova but I will learn. The question is "How we can set building apk task" for different users? Possible to call only exec() command for every user? Need to make anything before? Thanks
  11. Are you sure that these sites are using the same method to run commands from pure codes?
  12. Thank you for the informations. Okay let me say if everything is installed in our server to build the apk. Assume that Someone comes to our website interface to create an hello world app. We accept project name from the interface. In Apache Cordova the command to create project is cordova create hello com.example.hello HelloWorld This is the command to create a hello world project. My question is how we can run the entire command from our php code with the project name which is taken from user input & How we can show the response to user. If project is successfully created. Im really confused to run the command from our code. Please give me some tips for this, so i can continue.. Yii Framework is okay for this? Thanks
  13. I want to build a online "app builder" project that users can create android / iphone applications online without any coding knowledge. These sites are very common in market. They offer onclick app builder. I have skill in development of web applications using php frameworks. My question is How we can generate android apk from our server after getting the necessary information from user? (Appname, icon, packagename etc) PHP can do this entire task?, if yes any framework for that? Can you give me some basic tips to generate apk from our server? Can we genrate both android and iphone app from one single code? What are the requirements needed for the server? Anybody having skills in these areas, please help me. I need basic tips to get started this project. Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.