Url value after execution

Hello,
I am using js to href to another page within my php script. On successful execution on that page, 100 is displayed on the browser. I need to get the value into a variable to test and give the user meaningful feedback but am yet to figure out a way to go about it. Can some one please point me in the right direction?
Here is the code:
echo “<script language=javascript>window.location.href='http://www.50kobo.com/tools/geturl/Sms.php?username=".urlencode(‘mymail@yahoo.com’)."&password=mypassword&sender=me&message=”.urlencode(‘This is the message’)."&flash=1&recipients=123’</script>";