DOING_AJAX php version issues

I am getting this notice with PHP 7.4.12 version : Use of undefined constant DOING_AJAX – assumed ‘DOING_AJAX’ (this will throw an Error in a future version of PHP) in

And with PHP 8 I am getting this error Fatal error: Uncaught Error: Undefined constant “DOING_AJAX” in

It is the second line in this function that is causing it. ( if (!is_admin() || (defined(DOING_AJAX) && DOING_AJAX)) { )

private function init() {
    if (!is_admin() || (defined(DOING_AJAX) && DOING_AJAX)) {
        $this->frontend = new Woo_Custom_CSV_Builder_Frontend();
    }
    if (isset($_GET['file'])) {
        //$this->handle_download();
    }
}

Could someone point to right direction with this issue?

Contact Form 7 submitting issue with mobile

i’m using a contact form 7 in my wordpress site and it’s working fine in the desktop browsers (chrome, Edge ..etc) and the email is received with the data , but the issue is in the mobile (chrome, Safari..etc) when click submit button it shows spinning indicator continuously with no message or refresh!
and i found that when i have removed the file input field it is working fine so the issue with file field but i couldn’t find the reason. please your help.

note:
i’m using ITheme security plugin and i have tried to disable it but nothing, also there is nothing in the log.

the response message in the mobile browser:
enter image description here
enter image description here

the response in desktop browser:
enter image description here
enter image description here

How do I upload an image to a webpage?

I need to take an image as user input on the uploaduser.php page and then display the uploaded image on the home.php page. How can I do that?

Uploaduser.php:


  <body>
    <nav>
     
         <a href='home.php'>Home</a> 
          <a href='/AMU WALL/main/uploaduser.php'>Upload</a>
         <a href='/AMU WALL/logout.php'>Logout</a>
         <div class='animation start-home'>
         </div>      <div class="animation start-home">
      </div>

    </nav>
    
  </body>

</html>

    <section class="form login">
      <header> Upload your Photo </header>
      <form action="home.php" method="POST" enctype='multipart/form-data'>
      
        <div class="error-text"></div>
        <div class="field input">
          <label>Name</label>
          <input type="name" name="name"   placeholder="Enter Your Name" required>
          <small></small>
        </div>
        <div class="field input">
          <label>Your Message</label>
          <input type="text" name="message" placeholder="Enter Message" required>
        </div>
        <div class="field input">
        <label>Your Image</label>
                 <input type='file' name='userimage'  style="border:none;" accept='image/*' required>
        </div>
        <div class="field button">
          <input type="submit" name="submit" value="Upload">
        </div>
      </form>
      
    </section>
    


  </div>

I tried using php code for it but it did not work.

Why modal didnt work and probably the data directly inserted to database [closed]

first when i click the issue of indigency the modal should open and the details of the person is there but probably it inserted directly to database. and the modal didnt open for me to view and print the indigency. before its working i just leave it for a few days. but when i cameback not working anymore i didnt touch any code too.

the image is the one that work before. thats the modal working before

heres the indigency.php

<?php include'header.php' ?>

<div style="padding: 0px;" class="container-fluid" id="banner">

<?php include'sidebar.php' ?>

<div class="col-md-10 right-section">
  <?php include'babaw.php' ?>
  <?php include'code.php' ?>

  <div class="tittle-header">
        <h3 style="text-align: center;font-size: 30px">Indigency Page</h3>
        <div class="text-right adminauth">
            <h2 class='text-admin'>Welcome:&nbsp;<span><a style='font-family: Lucida Fax;color: black;text-decoration: none;' href=""><?php echo $_SESSION['admin_name']; ?></a></span></h2>
        </div>
    </div>
    <div class="staffrecords">
      <div class="flex-parent">
        <div class="flex1">
          <label class="Search-text">Search Resident:</label>
          <input class='search-input' type='text' name='number' id="myInput" onkeyup="myFunction()" placeholder="Enter Resident Name...">
        </div>
    </div>

    <div class="table-scroll" style="margin-top:25px;">
      <div class="table-responsive">
        <table id="myTable" class="table table-stripes">
          <thead>
            <tr>
                <th>ID</th>
                <th>Image</th>
                <th>Full Name</th>
                <th>Age</th>
                <th>Gender</th>
                <th>Purok</th>
                <th>Action</th>
            </tr>
          </thead>
          <tbody>
            <?php
            include("database/db_connection.php");

            $recordperpage = 5;
            if (isset($_GET['page']) && !empty($_GET['page'])) {
              $currentpage = $_GET['page'];
            }else{
              $currentpage = 1;
            }

            $startfrom = ($currentpage * $recordperpage) - $recordperpage;
            $select = mysqli_query($dbcon,"SELECT * FROM tblresident WHERE CivilStatus != ''");
            $totalrecords = mysqli_num_rows($select);
            $firstpage = 1;
            $nextpage = $currentpage + 1;
            $previouspage = $currentpage -1;
            $lastpage = ceil($totalrecords/$recordperpage);

            $select2=mysqli_query($dbcon,"SELECT * FROM `tblresident` WHERE CivilStatus != '' LIMIT $startfrom, $recordperpage");
            while($row=mysqli_fetch_array($select2))
            {

            ?>

           <tr>
              <input type='hidden' name='id' value='<?php echo $row['id']; ?>'>

             <td><?php
              echo $row['id'];
              $_SESSION['id'] = $row['id'];
              ?></td>
             <?php
                $count = strlen($row['Picture']);
                if ($count < 100) {?>
                <td><img class="image" src="image/<?php echo $row['Picture'] ?>"></td>
              <?php
                }else{?>
                <td><img class="image" src="<?php echo $row['Picture'] ?>"></td>
              <?php
                }
              ?>
             <td><?php echo $row['FirstName'] ." ". $row['LastName']; ?></td>
             <td><?php echo $row['Age']; ?></td>
             <td><?php echo $row['Gender']; ?></td>
             <td><?php echo $row['Purok']; ?></td>
             <td><a class='btn btn-primary' data-toggle="modal" data-target="#myModal" residentid="<?php echo $row['id']; ?>" >Issue Certificate of Indigency</a></td>
          </tr>

          <?php } ?>
        </tbody>
      </table>
    <!-- pagination button -->
        <div class="text-right" id="navigate" style='margin-right: 100px;'>
            <nav aria-label="Page navigation">
              <ul class="pagination">
                <?php
                  if ($currentpage != $firstpage) {?>
                    <li class="page-item">
                      <a class='page-link' href="?page=<?php echo $firstpage ?>" tabindex="-1" aria-label="previous">
                        <span aria-hidden="true">First</span>
                      </a>
                    </li>
                <?php
                  }
                ?>
                <?php
                  if ($currentpage >= 2) {?>
                    <li class="page-item">
                      <a class="page-link" href="?page=<?php echo $previouspage; ?>"><?php echo $previouspage; ?></a>
                    </li>
                <?php
                  }
                ?>
                <li class="page-item active">
                  <a class="page-link" href="?page=<?php echo $currentpage; ?>"><?php echo $currentpage; ?></a>
                </li>
                <?php
                  if ($currentpage != $lastpage) {?>
                    <li class="page-item">
                      <a class="page-link" href="?page=<?php echo $nextpage; ?>"><?php echo $nextpage; ?></a>
                    </li>

                    <li class="page-item">
                      <a class='page-link' href="?page=<?php echo $lastpage ?>" aria-label="next">
                        <span aria-hidden="true">Last</span>
                      </a>
                    </li>
                <?php
                  }
                ?>
              </ul>
            </nav>
        </div>
        <script>
        function myFunction() {
          var input, filter, table, tr, td, i, navigate;
          input = document.getElementById("myInput");
          filter = input.value.toUpperCase();
          table = document.getElementById("myTable");
          tr = table.getElementsByTagName("tr");
          navigate = document.getElementById("navigate");
          for (i = 0; i < tr.length; i++) {
            td = tr[i].getElementsByTagName("td")[2];
            if (td) {
              if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
                tr[i].style.display = "";
                navigate.style.display ="block";
              } else {
                tr[i].style.display = "none";
                navigate.style.display ="none";
              }
            }
          }
        }
        </script>
      </div>
    </div>
 <!-- Modal -->
    <div id="myModal" class="modal fade" role="dialog">
      <div class="modal-dialog">
          <!-- Modal content-->
          <div class="modal-content modal-dialog modal-sm">
                <div class="modal-header">
                  <button type="button" class="close" data-dismiss="modal">&times;</button>
                  <h4 class="modal-title">Certification Of Indigency</h4>
                </div>
              <div class="modal-body " id="profileForm">
                <form method='POST' action='code.php'>
                  <?php
                    include 'database/db_connection.php';
                     $select = mysqli_query($dbcon,"SELECT * FROM tblbarangay");
                    while ($row2 = mysqli_fetch_assoc($select)) {?>
                    <input type='hidden' name='admin' value='<?php echo $_SESSION['admin_name']; ?>'>
                    <input type='hidden' name='municipality' value='<?php echo $row2['Municipality'];; ?>'>
                    <input type='hidden' name='barangay' value='<?php echo $row2['Barangay'];; ?>'>
                    <input type='hidden' name='province' value='<?php echo $row2['Province'];; ?>'>
                    <?php
                    }
                  ?>
                    <input type='hidden' name='id'>
                    <h4>Enter OR No.</h4>
                    <input class='form-control' type='number' name='OR' >

                   <div class="buttons text-right" style='margin-top:20px;'>
                      <input class='btn btn-primary' type='submit' name='submit-indigency' value='Proceed'>
                      <a data-dismiss="modal" class='btn btn-danger'>Cancel</a>
                   </div>
                 </form>
              </div>
          </div>
      </div>
    </div>
  </div>
</div>
<?php include 'footer.php' ?>

indigency_print.php

<html>
<head>
    <title>BARANGAY CLEARANCE SYSTEM</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initialscale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link type="text/css" rel="stylesheet" href="css/bootstrap.css">

    <style>
        .print{
            text-align: justify;
        }
        .flex-parent{
            display: flex;
        }
        .flex1{
            flex: 1;
        }
        img{
            width: 130px;
            height: 130px;
        }
        .margin-top-50{
            margin-top: 50px;
        }
        .uppercase{
            text-transform: uppercase;
        }
    </style>
</head>
<body>
    <div class="container-fluid print">
        <div class="flex-parent">

                    <?php 
                        include 'database/db_connection.php';
                        $select = mysqli_query($dbcon,"SELECT * FROM tblbarangay");
                        while ($row = mysqli_fetch_assoc($select)) {?>
                        <div class="flex1 text-left">
                            <div class="img">
                                <img src="image/<?php echo $row['Logo'] ?>">
                            </div>
                        </div>
                        <div class="flex1 text-center">
                            <h5>Republic of the Philippines</h5>
                            <h5>Province of Leyte</h5>
                            <h5>Municipality of <?php echo $row['Municipality']; ?> </h5>
                            <h5>Barangay <?php echo $row['Barangay']; ?> </h5>
                        </div>
                    <?php
                        }
                    ?>
            <div class="flex1">
                <div class="text-right">
                    <?php
                        include 'database/db_connection.php';
                        $select = mysqli_query($dbcon,"SELECT * FROM tblofficials WHERE role = 'Barangay Captain' ");
                        while ($row = mysqli_fetch_assoc($select)) {?>
                             <?php
                                $count = strlen($row['img']);
                                if ($count < 100) {?>
                                <td><img class="image" src="image/<?php echo $row['img'] ?>"></td>
                              <?php
                                }else{?>
                                <td><img class="image" src="<?php echo $row['img'] ?>"></td>
                              <?php
                                }
                              ?>
                    <?php
                        }
                    ?>
                </div>
            </div>
        </div>
        <div class="text-center">
            <h3 style="text-decoration: underline;">OFFICE OF THE PUNONG BARANGAY</h3>
        </div>
        <div class="content margin-top-50">
            <h4>SUBJECT: <b style="text-decoration: underline;">CERTIFICATE OF INDIGENCY</b></h4>
        </div>
        <div class="content margin-top-50">
            <h4>To whom it may concern;</h4>
        </div>
        <?php
            include 'database/db_connection.php';
            $id = $_GET['id'];
            $select = mysqli_query($dbcon,"SELECT * FROM tblresident WHERE id = '$id' ");
            while ($row = mysqli_fetch_assoc($select)) {?>
                <div class="content margin-top-50" style='text-indent: 50px;'>
                    <h4>THIS IS TO CERTIFY that <b class="uppercase"><?php echo $row['FirstName'] . " " . $row['LastName']; ?></b>
                        <?php
                            $status = $row['Gender'];
                            if ($status == 'Female') {?>
                            the Daughter of <b class="uppercase"><?php echo "Mr.".$row['FathersName']; ?></b>
                        <?php
                            }else{?>
                            the Son of <b class="uppercase"><?php echo "Mr.".$row['FathersName']; ?></b>
                        <?php
                            }
                        ?>
                        legal age, a resident of Barangay
                        <?php echo $_GET['barangay'].','.$_GET['municipal'].','.$_GET['province']; ?>.</h4>
                </div>
                <div class="content margin-top-50" style='text-indent: 50px;'>
                    <h4>This is to certify further that <b class="uppercase"><?php echo $row['FirstName'] . " " . $row['LastName']; ?></b> is one of the Indigent members in this Barangay.
                    .</h4>
                </div>
                <div class="content margin-top-50" style='text-indent: 50px;'>
                    <h4>This Certification is issued upon the request of the interested party for whatever legal purpose it may serve her  most.</h4>
                </div>
                <div class="content margin-top-50" style='text-indent: 50px;'>
                    <h4>
                        GIVEN this <b><span id='date'></span> day of <span id='month'></span> <span id='year'></span></b> at <?php echo $_GET['barangay'].','
                    .$_GET['municipal'].','.$_GET['province']; ?> Philippines.
                    </h4>
                </div>
        <?php
            }
        ?>

        <?php
            include 'database/db_connection.php';
            $select = mysqli_query($dbcon,"SELECT * FROM tblbarangay");
            while ($row = mysqli_fetch_assoc($select)) {?>
        <div class=" margin-top-50">
            <div class="margin-top-50">
                    <div class="flex-parent">
                        <div class="flex1"></div>

                        <div class="flex1">
                            <h4 class="text-center">Certified Correct</h4>
                            <h4 class="uppercase text-center">
                                <?php
                                   $select2 = mysqli_query($dbcon,"SELECT * FROM tblofficials WHERE role = 'Barangay Captain'");
                                   $row2 = mysqli_fetch_assoc($select2);
                                   echo $row2['FirstName']." ".$row2['MiddleName'].". ".$row2['LastName'];
                                ?>
                            </h4>
                            <h4 class="text-center">Punong Barangay</h4>
                        </div>
                    </div>

            </div>
        </div>
        <div class=" margin-top-50">
            <h4 style="width: 100xp;">Paid OR No <span style="margin-left: 20px;">:<?php echo $_GET['OR'] ?></span></h4>
            <h4>Issued on <span style="margin-left: 38px;"></span>:<span id="month2"></span> <span id="date2"></span> <span id="year2"></span><h4>
            <h4>Issued at <span  style="margin-left: 43px;"></span>:Barangay <?php echo $row['Barangay'] . " " . $row['Municipality']. ", ". $row['Province'] ; ?></h4>
        </div>
        <?php
            }
        ?>
    </div>
<script>
    var y = new Date();
    var m = new Date();
    var d = new Date();

    var month = ["January","February","March","April","May","June","July","August","September","October","November","December"];
    var day = d.getDate("1-31");

    if (day == 1 && day != 11) {
        document.getElementById("date").innerHTML = d.getDate("1-31") + "st";
    }else if(day == 2 && day != 12){
        document.getElementById("date").innerHTML = d.getDate("1-31") + "nd";
    }else if(day == 3 && day != 13){
        document.getElementById("date").innerHTML = d.getDate("1-31") + "rd";
    }else{
        document.getElementById("date").innerHTML = d.getDate("1-31") + "th";
    }
    document.getElementById("year").innerHTML = y.getFullYear("yyyyy");
    document.getElementById("month").innerHTML = month[m.getMonth("0-11")];

        document.getElementById("date2").innerHTML = d.getDate("1-31") + ",";
    document.getElementById("year2").innerHTML = y.getFullYear("yyyyy");
    document.getElementById("month2").innerHTML = month[m.getMonth("0-11")];
</script>
  <script src="js/jquery.min.js"></script>
  <script src="js/bootstrap.min.js"></script>
<script>
    function myFunction() {
        window.print();
    }
    myFunction();
</script>
</body>
</html>


code.php

//print residency
if (isset($_POST['submit-indigency'])) {
    $admin = $_POST['admin'];
    $municipal = $_POST['municipality'];
    $barangay = $_POST['barangay'];
    $province = $_POST['province'];
    $id = $_POST['id'];
    $OR = $_POST['OR'];
    $transaction = "Barangay Indigency";
    $type = "Indigency";
    $issued = date("Y-m-d");
    $y = Date("Y");
    $m = Date("m");
    $d = Date("d");
    if ($m < 10) {
        $month = "0".$m;
    }else{
        $month = $m;
    }
    $calmonth = $month + 6;

    if ($calmonth > 12) {
        $totalmonth = $calmonth - 12;
        $totalyear = $y + 1;
        $expire = $totalyear."-".$totalmonth."-".$d;
    }else{
        $expire = $y."-".($month + 6)."-". $d;
    }

    $select = mysqli_query($dbcon,"SELECT * FROM tblresident WHERE id = $id");
    if (mysqli_num_rows($select) > 0) {
        $row = mysqli_fetch_assoc($select);
        $fn = $row['FirstName'];
        $ln = $row['LastName'];
        $fullname = $fn." ".$ln;
        $insert = "INSERT INTO tbltransaction VALUES (NULL,'$id','$fullname','$type','$transaction','$issued','$expire','$admin','')";
        if (mysqli_query($dbcon,$insert)) {
            echo"<script>window.open('indigency_print.php?id=$id&OR=$OR&municipal=$municipal&barangay=$barangay&province=$province','_blank','location=yes,height=1200,width=1200,scrollbars=yes,status=yes')</script>";
            echo "<script>window.open('indigency.php','_self')</script>";
        }
    }
}

Adding new user contact fields also in user-new.php in wordpress

I have already found a code the let me add new user contact fields, the problem is that I can just edit these fields, but when I’m creating a new user I dont see these fields immediatly, my desire is having these fields from the start in the page user.new.php, and of course the content should “stick”

//adding contact fields to user profile 

function extra_contact_info($contactmethods) {

$contactmethods['fax'] = 'Fax';
$contactmethods['address'] = 'Indirizzo';
$contactmethods['postalcode'] = 'Codice Postale';
$contactmethods['town'] = 'Comune';
$contactmethods['country'] = 'Paese';
$contactmethods['taxcode'] = 'Codice fiscale';

return $contactmethods;

}
add_filter(‘user_contactmethods’, ‘extra_contact_info’);

web-token/jwt-signature-algorithm-rsa – RS 256 algorithm – slowness

I have a TokenParser class that looks like this:

https://github.com/cgauge/laravel-cognito-provider/blob/master/src/TokenParser.php

My app runs perfectly with L8 (php 7.4) but after upgrading to L9 LTS (php 8.2), the loadAndVerifyWithKeySet() function executes for around 19 seconds. After some digging there’s a signature algorithm verification function that’s causing the slowness:

// file: jwt-signature-algorithm-rsa/RSAPKCS1.php
public function verify(JWK $key, string $input, string $signature): bool
    {
        $this->checkKey($key);
        $pub = RSAKey::createFromJWK($key->toPublic()); // Causes slowness

        return openssl_verify($input, $signature, $pub->toPEM(), $this->getAlgorithm()) === 1;
    }

Can someone help me fix this? What could be causing the slowness in parsing the token?

Extracting specific data via coordinates using php pdfParser

I want to extract specific data from various pdfs that are 3-4 pages each.
I don’t want to parse everything (all the text of each page) and then using for example regular expressions in order to match the data that i want.

So i was looking the documentation, and the php pdfParser has this function $data = $pdf->getPages()[0]->getDataTm(); in which it is returnig you an array and it says that You can extract transformation matrix (indexes 0-3) and x,y position of text objects (indexes 4,5).
(https://github.com/smalot/pdfparser/blob/master/doc/Usage.md)

So i tried it and it is returning an array with all the data that i want, plus each data’s coordinates..

Here an example of you to try it if you want.

require_once __DIR__ . '/vendor/autoload.php';
use SmalotPdfParserParser;

$parser = new Parser();
$pdf = $parser->parseFile('pdfFile.pdf');

$data = $pdf->getPages()[0]->getDataTm();
print_r($data);

Now let’s say i have the coordinates, but i don’t know how to use them in order to find the exact data that i want.
I was looking the documentation for a function that you can apply the coordinates something like this functionXYcoordinates("260", "120") in order to get what i exaclty want from my pdf.. but I couldn’t find anything.

If anyone knows if there is a function like this in pdfParser, please let me know, or also feel free if you believe that extracting data via coordinates is a bad thing, and it is better by parsing all the pages and then using regular expression in order to match the specific data.

Dockerizing a wodpress mutlisite – why am I not redirected to the installation page?

I’m trying to dockerize a multisite wordpress,but I can’t see what I did wrong.

I made a docker-compose file, when I run docker-compose up, volumes and containers are created and everything goes well, when I access the localhost:8085 all what I see is a blank page.

I tired deleting volumes, and tried building from the start but for some I always end up in the same situation.

This is my docker-compose file:

version: '3.3'

services:
  db:
    image: mysql:8
    volumes:
      - db_data:/var/lib/mysql
    networks:
      - wp-multisite
    restart: always
    environment:
      DB_HOST: localhost
      MYSQL_ROOT_HOST: '%'
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
    ports: 
      - 3306:3306

  phpmyadmin:
    depends_on:
      - db
    image: 'phpmyadmin:latest'
    environment:
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD: password
    ports:
        - 8090:80

  wordpress:
    depends_on:
        - db
    image: wordpress:latest
    ports:
      - 8085:80
    restart: always
    volumes: 
      - ./wordpress:/var/www/html
      - ./wordpress/.htaccess:/var/www/html/.htaccess
    networks:
      - wp-multisite
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress
      WORDPRESS_DEBUG: 1
      WORDPRESS_CONFIG_EXTRA:  |
        define('WP_ALLOW_MULTISITE', true );
        define('MULTISITE', true);
        define('SUBDOMAIN_INSTALL', true);
        define('DOMAIN_CURRENT_SITE', 'localhost');
        define('PATH_CURRENT_SITE', '/');
        define('SITE_ID_CURRENT_SITE', 1);
        define('BLOG_ID_CURRENT_SITE', 1);

        define('WP_HOME', 'http://localhost');
        define('WP_SITEURL', 'http://localhost');
        define( 'NOBLOGREDIRECT', '' );    

volumes:
  db_data:
  wordpress:

networks:
  wp-multisite:

The wordpress container logs says this:

Could not reliably determine the server's fully qualified domain name, using xxxxxxx.
Set the 'ServerName' directive globally to suppress this message
WordPress database error Table 'wordpress.wp_blogs' doesn't exist

Thanks for the help!!

How can i manage models when i have multiple languege website laravel

in my Laravel project i have two tables. One for products and another one for translations of products.

1 - products
2 - product_translations

So i want to write my controller for adding a product and it translations.

How can i manage it? should i write two models for my tables or is there another way with design patterns? (like if i can write an adapter to handle it)

And what is the best practice to handle the process of inserting in two tables (first, i have to insert row in products table and then i have to insert a row in my product_translations table.)?

Thanks in advance

Selecting from multiple tables based on the values of columns in one table

I am working on using psql to crete dental charts. I have one table that has a value for each individual. It consists of an id for that person, and 32 additional columns (one for each tooth). These additional columns have numeric values.

In addition, there is a table for each tooth (obviously, 32 columns). Each of these tables has two columns. The first column has a list of numbers equivalent the numbers used in the columns of the first table. The second column has a filename for an image of that particular tooth in a different state (0 –> goodtooth.jpg, 1 –> filling.jpg, etc).

What I am trying to do is generate a query which will take the id from one set of records in the main table, and use the values in each tooth’s column to point to the correct image in each tooth’s table, thereby generating a dental chart. I’ve done inner joins to link records across tables, but that’s always been using the same id for each table. What do I use when I want to match multiple tables based on discrete values in multiple columns of one table?

I can’t get my head around where to start with this one. I’ve done select statements and gotten my output to display correctly, I’ve also worked with views when I’ve been working with many columns across tables. All of those, however, have been with one id that matched the other tables. I’m not sure where to begin where I have to use different ids for different tables.

Add captcha code after the comment field in WordPress

I sent the comment field to the end of the comments form using the code below :

function customize_comment_form_fields( $fields ) {
    $comment_field = $fields['comment'];
    unset( $fields['comment'] );
    $fields['comment'] = $comment_field;
    return $fields;
} add_filter( 'comment_form_fields', 'customize_comment_form_fields' );

Now I want to put the captcha code after the comment field, I checked the comment-template.php file, but I didn’t find any action that I want to hook to.

Laravel doesn’t generate a new key because can’t find APP_KEY

I need to clone an existing project into my new Docker-environment , but running php artisan key:generate always fails due to missing APP_KEY in .env, but it exists there and empty!

I tried php artisan config:clear and php artisan config:cached, but didn’t help as well.

Why could it happen and could it be a problem with my Docker container?

laravel app key error

PHP Server Side Validation failing

Right, so I have some server-side code which compliments my form, with a form file test-contact.php

The form itself works as it should, and the code is separate from the HTML document with which the form is situated. This is actioned simply from the action = "test-contact.php"

I also have required in all the input fields and the textarea field. However, as we all well know, you can type url/test-contact.php into your web browser and it will send the form and bypass the required attributes to your form fields. (Well, unless you’re using my server apparently – which can evidently pick and choose which code it wants to read and ignore the rest)

However, despite integrating the validation code – which checks for empty fields – as sourced from W3Schools, can anyone shed any light as to why my server is choosing to ignore my server-side validation code and is blatantly just sending blank messages anyway?

<?php

require_once 'sendgrid/config.php';
require 'sendgrid/vendor/autoload.php'; 

    $first = $surname = $customeremail = $company = $message = "";
    $nameErr = $surnameErr = $emailErr = $companyErr = $companyErr = $messsageErr = "";

    if ($_SERVER["REQUEST_METHOD"] == "POST") {

        if (empty($_POST["first"])) {

            $nameErr = "Name is required";

        } else {

            $first = test_input($_POST["first"]);

        }
        
        if (empty($_POST["surname"])) {

            $surnameErr = "Name is required";

        } else {

            $surname = test_input($_POST["surname"]);

        }
        
        if (empty($_POST["email"])) {

            $emailErr = "Name is required";

        } else {

            $customeremail = test_input($_POST["email"]);

        }
        
        if (empty($_POST["company"])) {

            $companyErr = "Name is required";

        } else {

            $company = test_input($_POST["company"]);

        }
        
        if (empty($_POST["message"])) {

            $messageErr = "Name is required";

        } else {

            $message = test_input($_POST["message"]);

        }

    }
    
    $email          =   new SendGridMailMail();

    $email->setFrom(FROM_EMAIL, $first." ".$surname);
    $email->setSubject(SUBJECT);
    $email->addTo("<TO EMAIL>", "Helpdesk");
    $email->addContent("text/plain", "Client Name: ".$first." ".$surname."nClient Company: ".$company."nClient Email: ".$customeremail."nClient Message: ".$message."nn");

    $sendgrid = new SendGrid(SENDGRID_API_KEY);

    try {
        $response = $sendgrid->send($email);
        //print $response->statusCode() . "n";
        //print_r($response->headers());
        //print $response->body() . "n";
        header('Location: <thankyou page>');
        
        $email  =   new SendGridMailMail();
        
        $email->setFrom(FROM_EMAIL, "Name");
        $email->setSubject("Service Support");
        $email->addTo($customeremail, $first." ".$surname);
        $email->addContent("text/plain", "Hello ".$first."nnThank you for your message. We will aim to get back to you within five working days. In the meantime, you can read how we collect, process and store your data by visiting our legal section at <redacted url>The message has been send from an unmonitored email address, so please do not reply to this email.nnThank you for contacting Blauwe Stad TechnologieënnnThe Technical Development Team.nn");
        
        $sendgrid = new SendGrid(SENDGRID_API_KEY);
        $response = $sendgrid->send($email);
        
    } catch (Exception $e) {
        echo 'Caught exception: '. $e->getMessage() ."n";
    }
  
  <html>
  
  <form action="test-contact.php" method="POST" enctype="multipart/form-data">
            <input required value="" type="text" name="first"><br/><br/>
            <input required value="" type="text" name="surname"><br/><br/>
            <input required value="" type="email" name="email"><br/><br/>
            <input required value="" type="company" name="company"><br/><br/>
            <textarea required name="message"></textarea><br/><br/>
            <button type="submit" value="Send Message">Send message</button>
    </form>
  
  </html>

mysql not receiving all data

$stmt = $conn->prepare("INSERT INTO orders (orderID, Imie, Nazwisko, Email, UlicaINumer, KodPocztowy, Miasto) VALUES (?, ?, ?, ?, ?, ?, ?)");

$orderID = uniqid();
$Imie = isset($_POST['name']) ? $_POST['name'] : "";
$Nazwisko = isset($_POST['surname']) ? $_POST['surname'] : "";
$Email = isset($_POST['email']) ? $_POST['email'] : "";
$UlicaINumer = isset($_POST['street']) ? $_POST['street'] : "";
$KodPocztowy = isset($_POST['postal_code']) ? $_POST['postal_code'] : "";
$Miasto = isset($_POST['city']) ? $_POST['city'] : "";

$stmt->bind_param("sssssss", $orderID, $Imie, $Nazwisko, $Email, $UlicaINumer, $KodPocztowy, $Miasto);

$stmt->execute();

$stmt->close();

I basically wanted for this to take the input text from forms in other file, form looks like this:

<form action="polaczenie.php" method="POST">

<label for="name">Imię:</label>
<input type="text" id="name" name="name" class="form-input" required>

<label for="surname">Nazwisko:</label>
<input type="text" id="surname" name="surname" class="form-input" required>

<label for="email">E-mail:</label>
<input type="email" id="email" name="email" class="form-input" required>

<label for="street">Ulica i numer:</label>
<input type="text" id="street" name="street" class="form-input" required>

<label for="postal_code">Kod pocztowy:</label>
<input type="text" id="postal_code" name="postal_code" class="form-input" required>

<label for="city">Miasto:</label>
<input type="text" id="city" name="city" class="form-input" required>

For some reason in mysql database I can only see the uniqeID, it doesn,t taka any data from forms, could someone help?