Check for URL variable in PHP -


i have php page takes date variable: mypage.php?date=2015-07-14 , displays output.

how check if date= empty , if insert , refresh page current date?

i've tried formulate small script @ top of page using _get date value not sure how handle reload of page?

you can check input not empty using empty function, , create date (it default current, unless pass parameter), , passed parameter in header function same page.

if(empty($_get['date']))     header('location:'.$_server['php_self'].'?date='.date('y-m-d')); 

Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

javascript - Using jquery append to add option values into a select element not working -