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

Multiple attribute passing in querySelectorAll

Multiple attribute passing in querySelectorAll     Here I am demonstrating code to how to pass multiple attributes in querySelectorAll. <...

Ads Inside Post

Powered by Blogger.

Arsip