Does this CSS styling affect my PHP code?
Upon using the following CSS styling for my log in form, My POST variables register as NULL variables upon form submission. Why?
Here is the CSS:
#wrapper #Box input[type=text], textarea, input[type=password] {
border: 1px solid #929292;
color: #929292;
padding: 10px;
vertical-align: text-top;
width: 200px;
-webkit-box-shadow: #e3e3e3 0.1em 0.1em 0.2em;
box-shadow: #e3e3e3 0.1em 0.1em 0.2em;
-moz-box-shadow: #e3e3e3 0开发者_如何学Go.1em 0.1em 0.2em;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-border-radius: 5px;
-khtml-border-radius: 5px;
background: -webkit-gradient(linear, left top, left 25, from(#FFFFFF), color-stop(4%, #EEEEEE), to(#FFFFFF));
background: -moz-linear-gradient(top, #FFFFFF, #EEEEEE 1px, #FFFFFF 25px);
bottom: 0;
left: 10px;
}
#wrapper #hottestBox button, input[type=submit] {
border: 1px solid #929292;
color: #505050;
-webkit-box-shadow: #e3e3e3 0.1em 0.1em 0.2em;
box-shadow: #e3e3e3 0.1em 0.1em 0.2em;
-moz-box-shadow: #e3e3e3 0.1em 0.1em 0.2em;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-border-radius: 5px;
-khtml-border-radius: 5px;
background: -webkit-gradient(linear, left top, left 25, from(#FFFFFF), color-stop(4%, #EEEEEE), to(#FFFFFF));
background: -moz-linear-gradient(top, #FFFFFF, #EEEEEE 1px, #FFFFFF 25px);
padding: 10px;
}
for this HTML
<div id ='wrapper'>
<div id ='Box'>
<form action="login.php" method="post">
Username:
<input name="username:" type="text"/><br/>
Password:
<input name="password:" type="password" /><br/>
<input name="submit" type="submit" value="Sign In" />
</form>
</div>
</div>
why do your name attributes have a : at the end? That is probably part of your problem. This is definitely not CSS related
Post variables being null has nothing to do with CSS styling.
When trying your snippet, Firebug tells me that both username and password are properly set, so your problem lies elsewhere.
Edit
Seeing other answers: the colon doesn't seem to have an effect of setting post vars to NULL when viewing the request in Firefox. On my server the POST vars are still properly set.
It's impossible that CSS affect php. How do you access your post variables? I've noticed that you name your fields with colon (username: and password:) try to remove the colon from the names and print_r the POST array in your login.php
This has indeed nothing to do with the CSS, remove the ':' from the name-property of your controls.
try
print_r($_POST);
it should help you to solve the problem.
精彩评论