Hi Guys,
Win 7 HP, XAMPP 1.7.4, PHP 5.3 (same as my Remote Server) and I've only been into PHP for the last few months:
I seem to have a strange one here: Text boxes in Input Statements, are all displaying the same size regardless of what I give them for a length or maxlength.
I've created a small file to demonstrate it:
<?php
session_start();
header('Cache-Control: no-cache, no-store, must-revalidate'); //HTTP/1.1
header('Expires: Sun, 01 Jul 2005 00:00:00 GMT');
header('Pragma: no-cache'); //HTTP/1.0
echo "<H2>Twayne's Domain E-mail Contact Form<br /></H2>";
echo " Todays date is ".date(" jS F Y "). "<br />";
// ====================== RESET SESSION VIEWS BACK TO >=3 =====================
// store session data
if(isset($_SESSION['views']))
$_SESSION['views']=$_SESSION['views']+1;
else
$_SESSION['views']=1;
if($_SESSION['views'] >= 99) {
echo "You have reloaded a page or pages too many times. You will have to go back to the website and start over again.";
echo '<br /><a href="http://spamcop.net">Click here and start over</a>';
session_destroy();
die();
}
$views = $_SESSION['views'];
ECHO "Views is : " . $views;
?>
<!-- ======================================== start Input -->
<!DOCTYPE html>
<div align="center">
<head>
</head>
<title> Contact Form </title>
<form action="twa1.php" method="post">
<b>First Name: </b>
<input type="text" name="first" label="first" length="2" maxlength="3" >
<b> LastName: </b>
<input type="text" name="last" label="last" length="20" maxlength="5" >
</form>
</body>
</html>
</div>
The maxlength attribute IS working however, and imposes a restriction on too many characters. It's only the display boxes that are the wrong sizes. So it doesn't "break" anything, but something's not right.
And, the resulting browser display [ATTACH]4947[/ATTACH] shows the text boxes much longer onscreen with IE10 and FF, whatever its current version is, regardless of the length and maxlength settings as hopefully the attachment clarifies.
This is consistent with all of my PHP files for forms, of which I have several, and thus the reason I created this stub.
Just for gp's I also ran it live on my remote server; same thing with the text box sizes.
A textarea, less maxlength & length of course is unaffected.
I've looked through php.ini and a couple of configs for hints or changed settings, but no joy. Besides, I'm not sure what to look for. If it was a local issue, I'd expect it to display the text boxes at the sizes I set. The code above is working code should you wish to check it out on your own server.
I suppose it might not even be a PHP issue, but it sure seems to be! Again just for grins, I removed the PHP code and renamed it to HTML of course; still the same results, and also when opening the file with IE and FF.
ARE there any changes to PHP.ini or any other configuration files that could possibly be responsible for this issue?
Any leads, comments, URLs, etc. would be most appreciated. I've been researching this for over a week now!
TIA, Rivet`
Image1.png