What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-10-23 19:05:14
Save image to custom meta box
function save_joe_details($post_id){ global $post; if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return $post_id; update_post_meta($post->ID, "custom_field_image", $_POST["custom_field_image"] ); } add_action('s... Add solution -
PHP 2021-10-22 03:51:11
HTML form, add the data into it and submit it to the database by connecting it to MySQL database using PHP.
<?php // database connection code // $con = mysqli_connect('localhost', 'database_user', 'database_password','database'); $con = mysqli_connect('localhost', 'root', '','db_connect'); // get the post records $txtName = $_POST['txtName']; $txtEmail = $... Add solution -
PHP 2021-10-21 08:10:15
how to clear post array on referesh + not refill when return
if (!isset($_SESSION)) { session_start(); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { $_SESSION['postdata'] = $_POST; unset($_POST); header("Location: ".$_SERVER[REQUEST_URI]); exit; } if (@$_SESSION['postdata']){ $_POST=$_SESSION['postdata'... Add solution -
PHP 2021-10-19 17:14:09
pdo php search table
$search_keyword = ''; if(!empty($_POST['search']['keyword'])) { $search_keyword = $_POST['search']['keyword']; } $sql = 'SELECT * FROM posts WHERE post_title LIKE :keyword OR description LIKE :keyword OR post_at LIKE :keyword ORDER BY id DESC '; ... ... ... Add solution -
PHP 2021-10-19 08:08:35
json_decode(file_get_contents('php //input') true) null
if($_SERVER["REQUEST_METHOD"] == "POST" && $_SERVER["CONTENT_TYPE"] == "application/json") { $data = file_get_contents("php://input", false, stream_context_get_default(), 0, $_SERVER["CONTEN... Add solution -
Other 2021-10-18 22:05:05
image upload in php
<?php error_reporting(0); $msg = ""; if ( isset( $_POST['upload']) ) { $filename = $_FILES["uploadfile"]["name"]; $tempname = $_FILES["uploadfile"]["tmp_name"]; $folder = $filename; if (... Add solution -
PHP 2021-10-17 18:29:11
post request php
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"> Name: <input type="text" name="fname"> <input type="submit"> </form> <?php if ($_SERVER["REQUEST_M... Add solution -
Other 2021-10-17 03:44:06
mailpoet 3 rgpd
function mgris_subscription_checkbox() { // changer cette variable en fonction de l'id de votre liste $nl_list_id = 4; if(!is_user_logged_in()) { echo '<p>'; _e('<span>Recevez toute l\'année les offres promotionnelles en vous ins... Add solution