Jump to content

strip special characters from $_SESSION var


nine72

Recommended Posts

ok, so I have this form(s)...saving the input to the session. I need to take what is saved in the session strip special characters and then have it return back the var that I state it equals.

 

exp.

 

$_SESSION['agentId'] = $agentId - need to strip special characters at this point

 

then enter the stripped var into a new string

 

$xmlString .= "<agent>" . $agentId . "</agent>";

 

I need to do this some 400+ times...

 

Thanks in advance....

thanks for the susguestions they are both intresting possiblities...

 

would it work if I did something along this line...

 

$_SESSION['agentId'] = $agentId

$agentId = preg_replace("/[^a-zA-Z0-9s]/", "", $agentId);

 

or somthing like

 

if (!isset($_SESSION['agentId']), ereg("[0-9!@#$%^&*()]", $agentId)) {

$xmlString .= "<agent>" . $agnetId . "</agent>";

}

 

or am I just WAYYY off....

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.