jerry4all
08-22-2011, 05:33 PM
Hi,
this is a part of a script I'm using to send url to an sms gateway.
$param["username"] = "test@yahoo.com";
$param["password"] = "12345";
$param["msg"] = "This is sample message.";
$param["to"] = "2348023555555";
$param["from"] = "MyCompany";
foreach($param as $key=>$val){
//this is to urlencode the values
$request.= $key."=".urlencode($val);
//append the ampersand (&) sign after each paramter/value pair
$request.= "&";
}
//remove the final ampersand sign from the request
$request = substr($request, 0, strlen($request)-1);
my problem is with the username which is an email address, after the encoding the username appears as "%40" in the url that is sent. Is there a way I can prevent this so that it retains the "@" symbol in the resulting $request
this is a part of a script I'm using to send url to an sms gateway.
$param["username"] = "test@yahoo.com";
$param["password"] = "12345";
$param["msg"] = "This is sample message.";
$param["to"] = "2348023555555";
$param["from"] = "MyCompany";
foreach($param as $key=>$val){
//this is to urlencode the values
$request.= $key."=".urlencode($val);
//append the ampersand (&) sign after each paramter/value pair
$request.= "&";
}
//remove the final ampersand sign from the request
$request = substr($request, 0, strlen($request)-1);
my problem is with the username which is an email address, after the encoding the username appears as "%40" in the url that is sent. Is there a way I can prevent this so that it retains the "@" symbol in the resulting $request