Jump to content

samanj

Members
  • Content Count

    17
  • Joined

  • Last visited

Community Reputation

0 Neutral

About samanj

  • Rank
    Member
  1. Ok thank you, I will check the number of rows. I think that will do the trick.
  2. Hi everyone, My code is meant to give a certain response if the hospital number & PIN together do or do not match. However, whatever I input, whether it is correct information or random numbers, I still get the output that the data has been submitted successfully. Any thoughts? <?php $connect = mysqli_connect($hostname, $username, $password, $databaseName); $query = "UPDATE card SET comments = '$comments' , seniorsent = '$seniorsent' WHERE hospitalnumber = '$hospitalnumber' and PIN = '$PIN'"; @mysqli_query($connect, $query); $result = mysqli_quer
  3. Turned out that there were duplicate (sometimes triplicate) data entries and hence the repeated messages & emails. Mystery solved. πŸ™‚
  4. I am inclined to think that the script is running twice as I receive two emails. From what it sounds like, no one is able to spot a simple error. Hence it’s back to me again.
  5. Hi, So the full code is below: <html> <head> <style> * { text-align: center; font-size: medium; font-family: Arial, Helvetica, sans-serif; color: black; margin: 1em; /* set font */ } </style> </head> <body bgcolor="#B2D3C2"> <br> <a href="homepage.html">Return to Home screen</a><br> <p><span id="datetime"></span></p> <script> var dt = new Date(); document.getElementById("datetime").innerHTML = dt.toLoc
  6. Hi, A html form that I have made connects to a php file that contains code to send an acknowledgement email. For some reason the code at the end of the file sends the same email twice to the recipient. Anyone spot my (likely very obvious) error(s) anywhere? <?php //phpmailer while ($row = mysqli_fetch_array ($result)) { //connect to phpmailer require_once('PHPMailer/class.phpmailer.php'); //set email $mail = new PHPMailer(true); $mail->IsSMTP(); try { $mail->SMTPDebug = 1; $mail->SMTPAuth = TRUE; $mail->SMTPSecure = "tls"; $mail->Port
  7. Thanks all, I will try it out and will reply once successful.
  8. Hi, I have made a database linked with php that I use a html form for. The HTML form requests a particular date to retrieve, and the php form it is linked to then retrieves data from the MySQL database from that date. My question is: I want there to be a restriction so that the retrieval can only be for dates before the present date (and certainly not any date in the future). e.g. if it is 6th July 2020, then the database can only retrieve from the 5th July 2020 and before. (7th July 2020 onwards also is not allowed.) Is there a way I can do it? An
  9. Thank you everyone for your guidance and support. I do have a long way to go before getting to grips with this programming language so all input is gladly taken.
  10. Hi, I have a php form that submits updated 'comments' onto specific records. I have now added a timestamp feature to record the time of submission automatically. I have only added the lines and sections containing 'sent' (which is the column that for the timestamp) but there is an error when I do this and the php file shows an error as a result. $hospitalnumber = $_POST['hospitalnumber']; $PIN = $_POST['PIN']; $comments = $_POST['comments']; $sent = date("Y-m-d H:i:s"); // mysql query to Update data $query = "UPDATE `greencard` SET `comments`= '$comments', 's
  11. Final update, I have made what I wanted to work, work. One page for everything. Case closed. If anyone is interested in the code (albeit a very simple one), then feel free to get in touch
  12. Ok thank you for the replies, it got the mental circuits in the brain working! This is what I have been able to find and tweak based on both of your guidances (work in progress for all of the rows needed): <!DOCTYPE html> <html> <head> <title>Specialty Referral Form</title> <style> table { width: 100%; color: #000000; font-family: arial; font-size: 10px; text-align: center; } th { background-color: #588c7e; color: white; } tr:nth-child(even) {background-color: #f2f2f2} </style> </head> <body> <table> </tr> <?php $l
  13. Hello community, I am working on a database of specialties in the hospital I work. The doctor's referral requests are sent to a mySQL database and I have, with the help of online guidance, produced a working php script that displays the information I need it to. However, I need it a little bit more specific. I intend to make multiple copies of this file for each specialty, so that when they open the file they only have the requests for that particular specialty. My question is, with reference to my code below, can I make echo information so that online, for instance, i
  14. Update on this, I started from scratch and worked bit by bit and finally got it to work πŸ‘ Thanks for the feedback.
  15. Latest update: have seemed to get this far: Does this mean my password is incorrect? (Update: password is correct) Maybe I am almost there...
×
×
  • 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.