williewonka
Gebruiker
- Lid geworden
- 5 aug 2011
- Berichten
- 21
hallo mensen,
ik heb een heel raar probleem. ik ben een site aan het maken om te oefenen met php. ik heb een gratis layout gepakt (heb ik dus niet zelf gemaakt css zat er ook al bij) en ben die nu aan het invullen. nou ben ik een inlog schermpje aan het maken. het probleem is echter dat het veld waar je je gebruikersnaam moet invullen en het veld waarin je je wachtwoord moet invullen niet standaard leeg is. ik denk persoonlijk dat het probleem in de css zit maar ik heb het nog niet kunnen vinden. google geeft ook niks. Dit is mijn code:
zoals je misschien wel ziet controleert het script alleen nog maar of er iets is ingevuld. Dat werkt allemaal. de css code:
weet iemand hoe ik de invulvelden standaard leeg krijg (dus als je de form voor het eerst te zien krijgt). alvast bedankt.
ik heb een heel raar probleem. ik ben een site aan het maken om te oefenen met php. ik heb een gratis layout gepakt (heb ik dus niet zelf gemaakt css zat er ook al bij) en ben die nu aan het invullen. nou ben ik een inlog schermpje aan het maken. het probleem is echter dat het veld waar je je gebruikersnaam moet invullen en het veld waarin je je wachtwoord moet invullen niet standaard leeg is. ik denk persoonlijk dat het probleem in de css zit maar ik heb het nog niet kunnen vinden. google geeft ook niks. Dit is mijn code:
PHP:
<?php
$invulfout['naam'] = FALSE;
$invulfout['ww'] = FALSE;
if (isset($_POST['naam']) || isset ($_POST['ww'])) {
if (empty($_POST['naam'])) $invulfout['naam'] = TRUE;
if (empty($_POST['ww'])) $invulfout['ww'] = TRUE;
if (!$invulfout['naam'] and !$invulfout['ww']) {
echo "<script>location.href='index.php?page=admin'</script>";
}
}
else {
$niet_verzonden = TRUE;
}
if (isset($niet_verzonden) || $invulfout['naam'] || $invulfout['ww']) {
?>
<table border = 1>
<tr>
<td>
<form action = "index.php?page=login" method = "post">
<?php if ($invulfout['naam']) echo '<font color = "red">vul aub uw naam in</font><br>'; ?>
<b>naam: </b><input type = "text" name = "naam" <?php if (isset($_POST['naam'])) echo 'value = "'.htmlspecialchars($_POST['naam']).'"' ?>/><br>
<?php if ($invulfout['ww']) echo '<font color = "red">vul aub uw wachtwoord in</font><br>'; ?>
<b>wachtwoord: </b><input type = "password" name = "ww" / <?php if (isset($_POST['ww'])) echo 'value = "'.htmlspecialchars($_POST['ww']).'"' ?>><br>
<input type = "submit" value = "inloggen" />
</form>
</td>
</tr>
</table>
<?php
}
?>
zoals je misschien wel ziet controleert het script alleen nog maar of er iets is ingevuld. Dat werkt allemaal. de css code:
Code:
/* standard elements */
html {min-height: 100%;}
* {
margin: 0;
padding: 0;
}
a {color: #963;}
a:hover {color: #C60;}
img {
border: 0;
}
body {
background: #7E984D url(img/bg.jpg) repeat-x left bottom;
color: #444;
font: normal 62.5% Tahoma,sans-serif;
}
p,code,ul {padding-bottom: 1.2em;}
li {list-style: none;}
h1 {
font: normal 1.8em Tahoma,sans-serif;
margin-bottom: 4px;
}
h1,h2,h3 {padding-top: 6px;}
/* misc */
.clearer {clear: both;}
.left {float: left;}
.right {float: right;}
/* structure */
.container {
background-color: #FFF;
font-size: 1.2em;
margin: 0 auto;
padding: 0 10px 10px;
width: 780px;
}
/* header */
.top {
padding: 10px 10px 0;
}
/* title */
.header {
background-color: #fff;
font-size: 1.2em;
height: 105px;
margin: 0 auto;
padding: 10px 10px 5px;
width: 780px;
}
.header .left, .header .right {
background-color: #333;
color: #FFF;
height: 105px;
}
.header .left {
background-color: #77933D;
font: normal 2.8em "Trebuchet MS",sans-serif;
line-height: 105px;
width: 564px;
text-align: left;
}
.header .right {
overflow: auto;
width: 212px;
}
.header .right p,.header .right h2 {padding: 0 16px;}
.header .right h2 {padding-top: 16px; font: normal 1.6em "Trebuchet MS",sans-serif;}
/* navigation */
.navigation {
background: #D9E1E5 url(img/nav.jpg);
border: 1px solid #D8EBD8;
height: 41px;
}
.navigation a {
background: transparent url(img/nav.jpg) left top repeat-x;
border-right: 1px solid #D8EBD8;
color: #333300;
display: block;
float: left;
font: bold 1.1em sans-serif;
line-height: 41px;
padding: 0 18px;
text-decoration: none;
}
.navigation a:hover {
background: transparent url(img/nav.jpg) left bottom;
color: #333300;
}
/* main */
.main {
border-top: 4px solid #FFF;
background: url(img/bgmain.gif) repeat-y;
}
/* sub navigation */
.sidenav {
float: right;
width: 210px;
}
.sidenav h2 {
color: #333300;
font-size: 1em;
line-height: 30px;
margin: 0;
padding-left: 12px;
}
.sidenav ul {
padding: 0;
border-top: 1px solid #D8EBD8;
}
.sidenav li {border-bottom: 1px solid #D8EBD8;}
.sidenav li a {
font-size: 1.1em;
color: #333300;
display: block;
padding: 8px 0 8px 5%;
text-decoration: none;
width: 95%;
}
.sidenav li a:hover {
background-color: #ebebeb;
color: #654;
}
/* content */
.content {
float: left;
margin: 10px 0;
padding: 0 16px;
width: 531px;
}
.content .descr {
color: #664;
font-size: 0.9em;
margin-bottom: 6px;
}
.content li {
list-style: url(img/li.gif);
margin-left: 18px;
}
.content .imgright {
padding: 5px;
border: 1px solid #D8EBD8;
margin-left: 4px;
float: right;
}
.content p
{
color: #969696;
}
/* footer */
.footer {
background: url(img/bgfooter.gif) repeat-x;
color: #FFF;
font: bold 1em sans-serif;
line-height: 39px;
text-align: center;
}
.footer a,.footer a:hover {color: #FFF;}
weet iemand hoe ik de invulvelden standaard leeg krijg (dus als je de form voor het eerst te zien krijgt). alvast bedankt.