For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Tuesday, June 28, 2016

How to use $_POST in better way

How to use $_POST in better way.

Suppose there are 10 fields in a PHP webpage that's data are saving into database.
In that 10 fields 2 fields are empty and when in values are empty you want store "N/A" values are saving into database. 

Use below one line of code:
$myval = isset( $_POST['myvar'] ) ? $_POST['myvar'] : 'N/A'; 


You can use this logic in any website programming language.



Share:

0 comments:

Post a Comment

Add Dependent Scripts

   here is the code that allow to add dependent script :         <script>         const addDependentScripts = async function( scriptsT...

Ads Inside Post

Powered by Blogger.

Arsip