Web Hosting Talk







View Full Version : Sessions help


-Edward-
04-09-2006, 09:10 AM
If I use the following query:


if(substr($msg) == "/color ") {
$font = str_replace("/color ", "", $msg);
$_SESSION['color'] = strtolower($font);
}

My session color changes to whatever I append to the end of /color for example /color green but only does this once - I was wondering why? I've ried using unset to remove the existing colour so it sets a new one but no joy.

Oras
04-09-2006, 05:14 PM
This IF statement will return false always :) because you missed a parameter in substr function

string substr ( string string, int start [, int length])