the-botman Posted May 4, 2010 Share Posted May 4, 2010 hi guys.. i need to know how to add a default name if users do not add name to my logo gen i was thinking about using an if statment here session_start(); $_SESSION['number'] = $_POST['number']; $_SESSION['name'] = $_POST['name']; $_SESSION['image'] = $_GET['image']; Quote Link to comment Share on other sites More sharing options...
trq Posted May 4, 2010 Share Posted May 4, 2010 php5.3 session_start(); $_SESSION['number'] = $_POST['number']; $_SESSION['name'] = $_POST['name'] ?: 'some default'; $_SESSION['image'] = $_GET['image']; else session_start(); $_SESSION['number'] = $_POST['number']; $_SESSION['name'] = $_POST['name'] ? $_POST['name'] : 'some default'; $_SESSION['image'] = $_GET['image']; Quote Link to comment Share on other sites More sharing options...
ignace Posted May 4, 2010 Share Posted May 4, 2010 $_SESSION['name'] = $_POST['name'] ?: 'some default'; I think is best not used as it will spread confusion, not many read the manual as thoroughly as we are Quote Link to comment Share on other sites More sharing options...
the-botman Posted May 4, 2010 Author Share Posted May 4, 2010 thanks guys that works great its just 1 issue i have no when a user adds text it puts the text in the center but when the user does not it adds te default text but not in the center any idea what i can do about this? Quote Link to comment Share on other sites More sharing options...
the-botman Posted May 4, 2010 Author Share Posted May 4, 2010 thnks i found the problem and its fixed thanks for all your help Quote Link to comment Share on other sites More sharing options...
trq Posted May 4, 2010 Share Posted May 4, 2010 $_SESSION['name'] = $_POST['name'] ?: 'some default'; I think is best not used as it will spread confusion, not many read the manual as thoroughly as we are Spread confusion? Amongst who? The people who don't know the language well enough to understand it? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.