php - What is wrong with my function? (new to user defined functions) -


i trying post previous page form on it, , rather typing out code on , on again tried making function it, didnt work. in advance

function postorempty($field){ isset($_post[$field]) ? $_post[$field] : ""; }  $szfname= postorempty('fname'); 

you not return value. try add return keyword.

function postorempty($field) {     return (isset($_post[$field]) ? $_post[$field] : ""); }  $szfname= postorempty('fname'); 

Comments

Popular posts from this blog

SAP Web Service from .NET via WCF -

Optimized Line drawing in QT -

datetime - str to time in python -