Simply put, the apostrophes are not displaying inside my text field. The result is here: www.unidrones.co.za/VRentals
In the search box, try typing something with an apostrophe like 1920's car or something. You will see a new form that appears. The "Model" field is supposed to accept the exact same string the user typed.
I viewed this nearly duplicate question: The apostrophes are not displayed when getting data from MySQL into bootstrap table but in my case I am not getting my value from the database, I'm getting the value directly from the previous form the user submitted.
I've tried escaping the string, I've tried utf8_encode() and utf8_decode(), I've tried prepared statements and I even tried changing all the "POST" methods to "GET" methods to see if that made any difference. Yet still, if I tried searching for something like 1920's Chrysler the apostrophe would turn into a backslash and the rest of the sentence would be gone.
My code:
<form action='inc/request.inc.php' method='POST' class='request-form' id='request-form'>
<label class='bold required'>Model</label>
<input type='text' name='searchvalue' class='searchvalue' value='".mysqli_real_escape_string($conn, $_POST['search'])."' required >
<label class='bold required'>Full Name</label>
...
</form>