Exemple #1
0
			<?php 
echo displayErrors(getValue($errors, 'username', []));
?>
		</div>
		<div <?php 
echo getErrorClass(getValue($errors, 'password1', []));
?>
>
		<label for="password1">Password:</label>
		<input type="password" id="password1" name="password1"/>
			<?php 
echo displayErrors(getValue($errors, 'password1', []));
?>
		</div>
		<div <?php 
echo getErrorClass(getValue($errors, 'password2', []));
?>
>
		<label for="password2">Retype Password:</label>
		<input type="password" id="password2" name="password2"/>
			<?php 
echo displayErrors(getValue($errors, 'password2', []));
?>
		</div>
		<div>
		<input type="submit" />
		</div>
	</form>
	<div id="result">
		<?php 
echo "<p>Username: {$username}</p>";
		<form action="" method="POST">
			<div class="<?php 
echo getErrorClass($errors, 'username');
?>
">
				<label for="username">Username: </label>
				<input type="text" name="username" id="username" value="<?php 
echo htmlentities($username);
?>
">
				<?php 
echo getFieldErrors($errors, 'username');
?>
			</div>
			<div class="<?php 
echo getErrorClass($errors, 'password');
?>
">
				<div>
					<label for="password">Password: </label>
					<input type="password" name="password" id="password">
				</div>
				<div>
					<label for="verifying-password">Repeat password: </label>
					<input type="password" name="verifyPassword" id="verifying-password">
				</div>
				<?php 
echo getFieldErrors($errors, 'password');
?>
			</div>
			<div>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Task 3</title>
	<style>
		.error {
			color: red;
			border-color:red;
		}
	</style>
</head>
<body>
	<div id="root">
		<form action="" method="POST">
			<input type="text" name="degreesInput" class="<?php 
echo getErrorClass($errors);
?>
" value="<?php 
echo htmlentities($input);
?>
">
			<select name="degreesSystem" id="degreesSystem">
				<option value="FtoC">F to C</option>
				<option value="CtoF">C to F</option>
			</select>
			<input type="submit">
		</form>
		<?php 
echo getFieldErrors($errors, 'input');
?>
		<?php 
Exemple #4
0
			}
			
			.error {
				color: red;
			}
			
			.error input {
				border-color: red;
			}
		</style>
		
	</head>
	<body>
		<form action="" method="post">
			<div class = "<?php 
echo getErrorClass($validationErrors, 'numbers');
?>
">
				<label for="numbers">Enter 10 numbers separated with commas:</label>
					<input type="text" id="numbers" name="numbers" />
				
				<?php 
echo getFieldErrors($validationErrors, 'numbers');
?>
			</div>
			
			
			
			<input type="submit" id="submit" />
			
		</form>
Exemple #5
0
	<body>
		<form action="" method="post">
			<div class = "<?php 
echo getErrorClass($validationErrors, 'firstNum');
?>
">
				<label for="firstNum">Enter first number:</label>
					<input type="text" id="firstNum" name="firstNum" />
				
				<?php 
echo getFieldErrors($validationErrors, 'firstNum');
?>
			</div>
			
			<div class = "<?php 
echo getErrorClass($validationErrors, 'secondNum');
?>
">
				<label for="secondNum">Enter second number:</label>
					<input type="text" id="secondNum" name="secondNum" />
				
				<?php 
echo getFieldErrors($validationErrors, 'secondNum');
?>
			</div>
			
			<div>
				<select name="operation" id="operation">
					<option>--Choose operation--</option>
					<?php 
echo options(['sum' => '+', 'subtraction' => '-', 'multiplication' => '*', 'division' => '/'], $operation);
Exemple #6
0
echo getErrorClass($validationErrors, 'password');
?>
">
				<label for="password">Password:</label>
					<input 
						type="password" 
						name="password" 
						id="password" 
						/>
				
				<?php 
echo getFieldErrors($validationErrors, 'password');
?>
			</div>
			<div class = "<?php 
echo getErrorClass($validationErrors, 'rep_password');
?>
">
				<label for="rep_password">Repeat Password:</label>
					<input 
						type="password" 
						name="rep_password" 
						id="rep_password" 
						/>
				
				<?php 
echo getFieldErrors($validationErrors, 'rep_password');
?>
			</div>
			<br />
			<input type="submit" />
			</div>
			<div class="<?php 
echo getErrorClass($errors, 'lastname');
?>
">
				<label for="lastname">Lastname: </label>
				<input type="text" id="lastname" name="lastname" value="<?php 
echo htmlentities($lastname);
?>
">
				<?php 
echo getFieldErrors($errors, 'lastname');
?>
			</div>
			<div class="<?php 
echo getErrorClass($errors, 'date');
?>
">
				<label for="birthdate">Birthdate: </label>
				<input type="date" id="birthdate" name="date" value="<?php 
echo htmlentities($date);
?>
">
				<?php 
echo getFieldErrors($errors, 'date');
?>
			</div>
			<div>
				<input type="submit">
			</div>
		</form>