Jump to content

DanEthical

Members
  • Content Count

    97
  • Joined

  • Last visited

Everything posted by DanEthical

  1. LOL I know right. I will, I promise. Some day you will be proud. lol I will look into the other stuff. Thanks mate.
  2. Hi guys, Back to annoy you again. Sorry I am getting information from the Database to textbox1 (location_name), which uses an autocomplete. This works lovely. Now, what I want to do is, in textbox2 (location_phone) is have the phone number associated with the value of textbox1 to show in textbox2 automagically. Here is the HTML of both fields: <div class="row form-group"> <div class="col-6"> <div class="form-group"><label for="location" class=" form-control-label">locati
  3. <input type="text" class="searchTerm" placeholder="What are you looking for?"> <button type="submit" class="searchButton"> <i class="fa fa-search"></i> </button> You need Font Awesome. If you have it, try the above. https://fontawesome.com/icons?d=gallery&p=2
  4. Thanks mate. Still wasn't working for me. So, gave in and reverted back to good old text boxes.
  5. Cross-Origin Read Blocking (CORB), an algorithm by which dubious cross-origin resource loads may be identified and blocked by web browsers before they reach the web page..It is designed to prevent the browser from delivering certain cross-origin network responses to a web page.
  6. Hi requinix, Thanks for the reply. When I add location_id to the query I only get the id number in the dropdown. <?php $sql = "SELECT DISTINCT location_id, location_name, location_phone FROM locations"; $result = $con->query($sql); ?> <select name="location" id="location" onchange="myFunction()" class="form-control"> <?php while($r = mysqli_fetch_row($result)) { echo "<option data-location_name='$r[1]' data-location_phone='$r[2]' value='$r[0]' selected> $r[0] </option>"; } ?> Sorry mate. Struggling with this one.
  7. What errors are you getting? By saying it just doesn't work could mean anything. Any errors you get can make it easier for you to get help. Turn on error reporting if you have not done so. ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
  8. Hi guys, Before we go further, yes, I know I should use prepared statements. This is just a project that will probably never go live. If I do decide to go live, I will change to prepared statements. Anyways, I am populating a text box from the selection of an options dropdown and updating MySQL. This all works fine. However, what I want to do is have the newly inserted option display by default in the dropdown. Hope this makes sense. Here is the dropdown code with the select statement... <div class="row form-group"> &l
  9. Thanks both. Sorry it took so long to respond. Been working on the road. This seems to work: // add a page $pdf->AddPage(); $html4 = '<h2>Contacts</h2> <table width="600px" border="1px">'; //data iteration $sql = "SELECT * FROM tours"; $result = $con->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { { $location=$row['location']; // concatenate a string, instead of calling $pdf->writeHTML() $html4 .= '<tr><td>'.$location.'</td></tr>'; } } } $html4 .= '</table>'; // out
  10. Hi all, I am trying to get data from MySQL to display in a html table in TCPDF but it is only displaying the ID. $accom = '<h3>Accommodation:</h3> <table cellpadding="1" cellspacing="1" border="1" style="text-align:center;"> <tr> <th><strong>Organisation</strong></th> <th><strong>Contact</strong></th> <th><strong>Phone</strong></th> </tr> <tbody> <tr>'. $id = $_GET['id']; $location = $row['location']; $sql = "SELECT * FROM tours WHERE id = $id"; $result = $con->query($
  11. Hi requinix, Is that not how it is meant to go? Sorry, it is a new learning curve for me.
  12. Hi guys, I really hope this will make sense. I am creating a dynamic field on a button click for Pickup Location. That works fine and submitting the form to the database works fine. However, instead of one entry, each time I submit the form with multiple Pickup Locations, it creates multiple separate database entries. Here is the PHP for submitting: if(isset($_POST['new']) && $_POST['new']==1){ $pickups = ''; foreach($_POST['pickups'] as $cnt => $pickups) $pickups .= ',' .$pickups; $locations = count($_POST["pickups"]); if ($locations > 0) { for ($
  13. Sorry I was joking with the Bro part. Ok, it seems that there is an issue with the JS this line: var dataResult = JSON.parse(dataResult); The Console keeps pointing to that line. Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>)
  14. Love the Bubble bust lol No that part is PHP bro. I know you know that. I did a little more research and for some reason when it is being submitted it is not checking the ID in the WHERE clause.
  15. Hi all, I am hopeless with Javascript etc but want to do updates, add, delete etc via a Bootstrap Modal. Everything works fine except for Update. No errors etc, just nothing happens. Here is the JS for the Update: $(document).on('click','.update',function(e) { var id=$(this).attr("data-id"); var name=$(this).attr("data-name"); var email=$(this).attr("data-email"); var phone=$(this).attr("data-phone"); var address=$(this).attr("data-address"); $('#id_u').val(id); $('#name_u').val(name); $('#email_u').val(email); $('#phone_u').val(phone); $('#address_u').v
  16. All good. Fixed it. Simple fix was to add data-dismiss="modal" to the Delete button.
  17. Hi all, Bit of a dilema. If I add, update items through the Modal form, all works well. But, if I delete an item, everything works fine, but the window stays greyed out. Even if I check a checkbox and delete that way it works fine. The Delete part of the Ajax: $(document).on("click", ".delete", function() { var id=$(this).attr("data-id"); $('#id_d').val(id); }); $(document).on("click", "#delete", function() { $.ajax({ url: "includes/save.php", type: "POST", cache: false, data:{ type:3, id: $("#id_d").val() }, success: function(dataResu
  18. Hi yans, Not sure if this is what you are looking for. But, have a read. Hope it helps:
  19. DOH!!! Makes sense and works. // image file directory $target = "uploads/".basename($image); if(!empty($_FILES['image']['name'])) { $sql = "UPDATE slide SET slide_text='".$slide_text."', image='".$image."', youtube='".$youtube."', vid_text='".$vid_text."'"; } else{ $sql = "UPDATE slide SET slide_text='".$slide_text."', youtube='".$youtube."', vid_text='".$vid_text."'"; } $result = mysqli_query($con, $sql); Thanks man.
  20. Hi mate, Nothing happens. No errors etc. If I just update some text and click submit, nothing happens. But, if I load a new image into the file input and click update, any changes to text are successful. What I am trying to achieve is for me to be able to change text without having to upload a new image each time.
  21. Hi folks, This has been wrecking my brain. I did do a google a few times to see if I can find a solution but nothing unfortunately. I want to be able to update the details on a page without having to reupload a new image each time. But if I don't open a new image for upload, I cannot update any of the other details. Below is the code and form etc for this particular thing... Please note this is just a project and will not be going live. I know there are vulnerabilities and I will work on those at a later stage. Thanks for any help with this current issue. <?php inclu
  22. Just restart the DNS server in WAMP and it should work for you.
  23. Hi mate, You are spot on. It is a learning curve and I have taken your input on board and decided to go in the direction you suggested. Cheers, Dan
  24. Hi all, Hope to find you all good. I have the following, which creates a php file. This works fine and without error. However, once created, the content of the page, which is got from the Database, is not showing. <?php include_once('includes/header.php'); if(isset($_POST['new']) && $_POST['new']==1){ if(isset($_POST['submit'])){ $trn_date = mysqli_real_escape_string($con, date("Y-m-d H:i:s")); $name = mysqli_real_escape_string($con, $_POST['name']); $description = mysqli_real_escape_string($con, $_POST['description']); $body = mysqli_real_escape_strin
×
×
  • 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.