Create and Get Cookie in Javascript/PHP

Creating Cookie in Javascript <script type=”text/javascript”> //create cookie function function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = “expires=”+d.toUTCString(); document.cookie = cname + “=” + cvalue + “; ” + expires + “;…

Getting Filenames From Path

Sometimes you have a situation when you want filename without extension and you don’t know extension then you can use pathinfo(). Example File info: $file=’/www/htdocs/inc/lib.inc.php’; $ext = pathinfo($file, PATHINFO_EXTENSION); // php $filename = pathinfo($file, PATHINFO_FILENAME); // lib.inc $dirname = pathinfo($file,…

Page 2 of 41234