Skip to content

Instantly share code, notes, and snippets.

@SitesByYogi
SitesByYogi / form.html
Last active June 21, 2023 22:28
basic php form with HTML markup
<!-- HTML form -->
<form method="POST" action="process.php">
<input type="text" name="name" placeholder="Your name">
<input type="submit" value="Submit">
</form>
<?php
function greet($name) {
echo "Hello, " . $name . "!";
}
greet("John"); // Output: Hello, John!
?>
@SitesByYogi
SitesByYogi / loops.php
Created June 21, 2023 14:33
PHP Loops
<?php
// Loop through an array
$fruits = array("apple", "banana", "orange");
foreach ($fruits as $fruit) {
echo $fruit . "<br>";
}
// Perform a specific number of iterations
for ($i = 1; $i <= 10; $i++) {
echo $i . "<br>";
@SitesByYogi
SitesByYogi / conditionals.php
Created June 21, 2023 14:31
PHP Conditional Statements
<?php
$age = 18;
if ($age >= 18) {
echo "You are an adult.";
} elseif ($age >= 13 && $age < 18) {
echo "You are a teenager.";
} else {
echo "You are a child.";
}
@SitesByYogi
SitesByYogi / output.php
Created June 21, 2023 14:29
PHP Outputting Data
<?php
$name = "John Doe";
echo "Hello, " . $name . "!"; // Output: Hello, John Doe!
?>
@SitesByYogi
SitesByYogi / var.php
Created June 21, 2023 14:18
PHP Variables and Data Types
<?php
$name = "John Doe"; // string
$age = 25; // integer
$price = 9.99; // float
$isStudent = true; // boolean
$fruits = array("apple", "banana", "orange"); // array
?>
@SitesByYogi
SitesByYogi / syntax.php
Created June 21, 2023 14:15
PHP Syntax
<?php
// PHP code goes here
?>
@SitesByYogi
SitesByYogi / dismiss.php
Created June 6, 2023 18:11
dismiss total upkeep admin notice
add_action( 'wp_head', 'dismiss_tu_admin_notice' );
function dismiss_tu_admin_notice() {
?><style>
.notice notice-warning .is-dismissible boldgrid-backup-protect-now {
display: none !important;
}
</style><?php
}
@SitesByYogi
SitesByYogi / error.text
Created May 15, 2023 15:37
crio/wp6.2/ErrorLog
#0 /home/dh_uytzv7/hemstitchrentals.com/wp-content/themes/crio/inc/boldgrid-theme-framework/includes/customizer/class-boldgrid-framework-customizer-generic.php(303): Boldgrid_Framework_Customizer_Generic->create_media_prefix(Array)
#1 /home/dh_uytzv7/hemstitchrentals.com/wp-content/themes/crio/inc/boldgrid-theme-framework/includes/customizer/class-boldgrid-framework-customizer-generic.php(128): Boldgrid_Framework_Customizer_Generic->device_visibility_styles(Array)
#2 /home/dh_uytzv7/hemstitchrentals.com/wp-content/themes/crio/inc/boldgrid-theme-framework/includes/customizer/class-boldgrid-framework-customizer-generic.php(90): Boldgrid_Framework_Customizer_Generic->get_default_styles(Array)
#3 /home/dh_uytzv7/hemstitchrentals.com/wp-includes/class-wp-hook.php(308): Boldgrid_Framework_Customizer_Generic->add_styles(”)
#4 /home/dh_uytzv7/hemstitchrentals.com/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
#5 /home/dh_uytzv7/hemstitchrentals.com/wp-includes/plugin.php(517): WP_Hook->do_act
@SitesByYogi
SitesByYogi / errorlog.txt
Created May 9, 2023 19:28
1optionplatform error log
<pre><code>
[2023-05-09 17:09:45 UTC] PHP Version: 7.4.28
[2023-05-09 17:09:45 UTC] WordPress Version: 6.2
[2023-05-09 17:09:45 UTC] Total Upkeep version: 1.15.6
[2023-05-09 17:09:45 UTC] getpgid support: Available
[2023-05-09 17:09:45 UTC] Backup process initialized.
[2023-05-09 17:09:45 UTC] Process id: 8793
[2023-05-09 17:09:45 UTC] --------------------------------------------------------------------------------
[2023-05-09 17:09:45 UTC] Starting dump of database...
[2023-05-09 17:09:45 UTC] Memory usage - limit / current / peak memory usage: 1073741824 / 14664888 (13.99 MB) / 15941928 (15 MB)