aebstract Posted January 23, 2008 Share Posted January 23, 2008 -835 This is the output of me entering a phone number in to my 3 field area. It works if I echo each post variable, but when I try to echo my session it displays the above. The form piece: <input type=\"text\" size=\"3\" name=\"phonenumber1\" value=\"$_POST[phonenumber1]\" /> <input type=\"text\" size=\"3\" name=\"phonenumber2\" value=\"$_POST[phonenumber2]\" /> <input type=\"text\" size=\"3\" name=\"phonenumber3\" value=\"$_POST[phonenumber3]\" /> The session being set: $_SESSION['telephone'] = $_POST['phonenumber1'] - $_POST['phonenumber2'] - $_POST['phonenumber3']; Quote Link to comment https://forums.phpfreaks.com/topic/87426-weird-session-setting-problem/ Share on other sites More sharing options...
revraz Posted January 23, 2008 Share Posted January 23, 2008 Because you are subtracting each one with - What do you want to do? Quote Link to comment https://forums.phpfreaks.com/topic/87426-weird-session-setting-problem/#findComment-447145 Share on other sites More sharing options...
aebstract Posted January 23, 2008 Author Share Posted January 23, 2008 Eh that makes sense, put a dash in between each instead of subtract? Quote Link to comment https://forums.phpfreaks.com/topic/87426-weird-session-setting-problem/#findComment-447147 Share on other sites More sharing options...
revraz Posted January 23, 2008 Share Posted January 23, 2008 Try using quotes around the whole thing and make it a string. Quote Link to comment https://forums.phpfreaks.com/topic/87426-weird-session-setting-problem/#findComment-447148 Share on other sites More sharing options...
aebstract Posted January 23, 2008 Author Share Posted January 23, 2008 $_SESSION['telephone'] = "$_POST[phonenumber1]-$_POST[phonenumber2]-$_POST[phonenumber3]"; It is a string, is it not? I tried piecing it together with . ' ' . and didn't get a result. With the above, it isn't outputting anything. Quote Link to comment https://forums.phpfreaks.com/topic/87426-weird-session-setting-problem/#findComment-447159 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.