Ejemplo n.º 1
0
				</form>
			</td>
			<td>
				<form method="GET">
					<p><input type="submit" name="showAll" value="Show All"/></p>
				</form>
			</td>
			<td>
		</tr>
	</table>

	<?php 
if ($_POST["create"]) {
    if ($_POST["name"] && $_POST["username"] && $_POST["password"] && $_POST["permissions"] && $_POST["email"] && $_POST["phone"]) {
        $Database = new Connect();
        echo $Database->Exec($_POST["name"], $_POST["password"], $_POST["username"], $_POST["permissions"], $_POST["email"], $_POST["phone"]);
    } else {
        echo "Fill out the fields";
    }
} else {
    if ($_POST["delete"]) {
        $Database = new Connect();
        echo $Database->remove($_POST["removeName"], $_POST["removePass"]);
    } else {
        if ($_GET["showAll"]) {
            $Database = new Connect();
            echo $Database->showAll();
        }
    }
}
?>
Ejemplo n.º 2
0
					<p><input type="submit" name="showAll" value="Show All"/></p>
				</form>
			</td>
			<td>
		</tr>
	</table>

	<?php 
if ($_POST["login"]) {
    $Database = new Connect();
    echo $Database->Fetch($_POST["loginName"], $_POST["loginPass"]);
} else {
    if ($_POST["create"]) {
        if ($_POST["name"] && $_POST["username"] && $_POST["password"]) {
            $Database = new Connect();
            echo $Database->Exec($_POST["name"], $_POST["password"], $_POST["username"]);
        } else {
            echo "Fill out the fields";
        }
    } else {
        if ($_POST["delete"]) {
            $Database = new Connect();
            echo $Database->remove($_POST["removeName"], $_POST["removePass"]);
        } else {
            if ($_GET["showAll"]) {
                $Database = new Connect();
                echo $Database->showAll();
            }
        }
    }
}