I had a search box and scrapped it at one point, in which i had this working at one point but don’t remember where i found it), I want to push this post variable and I want it to stay uppercase all the way through to the final page but it goes to lowercase.
Code
<?php
if (isset($_POST['u'])) {
header ("Location: ./index.php?p=lookup&u=".$_POST['u']);
}
?>
<h2>Driver Search</h2>
<h3>* Are Required Fields</h3>
<div class="content">
<p>
<form id="searchform" method="post" action="">
<div>
*Driver Name: <input type="text" name="u" id="u" size="15" style="text-transform:uppercase;" />
<input type="submit" value="Search" />
</div>
</form>
</p>
</div>
So if i search for the driver “SMOKEU”, the url still prints out index.php?p=lookup&u=smokeu
The CSS style
text-transform: uppercaseonly affects what the text looks like on the page, not what the value actually is.If you need the value to be all-uppercase, you could just call
strtoupperon it in your PHP code.If you’re instead more worried about how it looks in the URL that gets created, you’ll have to use JavaScript to alter the value as it’s typed or just before submission of the form.