Skip to content

Instantly share code, notes, and snippets.

View alfintechcomputer's full-sized avatar
🎯
Focusing

AlfinTech Computer alfintechcomputer

🎯
Focusing
View GitHub Profile
@alfintechcomputer
alfintechcomputer / functions.php
Last active November 1, 2020 20:17
WordPress Excerpts
/* sets the excerpt length */
function customize_the_excerpt_length() {
return 30;
}
add_filter('excerpt_length','customize_the_excerpt_length');
@alfintechcomputer
alfintechcomputer / built.html
Created November 14, 2020 19:48
HTML Forms using PHP
<html>
<head>
<meta charset="utf-8">
<title>HTML Form Built With Love</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/respond.js"></script>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
@alfintechcomputer
alfintechcomputer / process_form1.php
Created November 15, 2020 15:04
HTML Forms using PHP
<pre>
<?php
print_r($_POST);
?>
@alfintechcomputer
alfintechcomputer / information
Created November 15, 2020 15:30
HTML Forms using PHP
Array
(
[website] => https://www.alfintechcomputer.com/
[category] => Social
[submit] => Submit Website
)
@alfintechcomputer
alfintechcomputer / process_form2.php
Created November 15, 2020 15:35
HTML Forms using PHP
<html>
<head>
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/respond.js"></script>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
@alfintechcomputer
alfintechcomputer / process_form3.php
Created November 15, 2020 15:43
HTML Forms using PHP
<html>
<head>
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/respond.js"></script>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
@alfintechcomputer
alfintechcomputer / process_form4.php
Created November 15, 2020 15:58
HTML Forms using PHP
<html>
<head>
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/respond.js"></script>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
@alfintechcomputer
alfintechcomputer / form.php
Created November 15, 2020 16:07
HTML Forms using PHP
<?php
if(isset($_POST['submit']) and strlen($_POST['website']) > 0) {
$website = htmlspecialchars($_POST['website']);
$category = htmlspecialchars($_POST['category']);
echo "Hi bud, thanks for submitting <b>$website</b> to the <b>$category</b> category.";
} else {
echo 'Enter a Website and Category';
}
@alfintechcomputer
alfintechcomputer / validation_rules.php
Created November 15, 2020 16:17
HTML Forms using PHP
<?php
// presence
$value = '';
if(!isset($value) or empty($value)) {
echo 'fail';
}
// string length
@alfintechcomputer
alfintechcomputer / validation_functions.php
Created November 15, 2020 16:24
HTML Forms using PHP
<?php
function has_presence($value) {
return isset($value) and $value !== '';
}
function max_length($value, $max) {
return strlen($value) <= $max;
}