I send a query to another server via curl, and when I view the page source of the response I get this:
<!---Begin debug --->
<!---Begin Includes--->
<!---Begin Javascripts--->
<script language="JavaScript" type="text/JavaScript">
function Mini_Window(theURL,winName,features) { //v2.0 location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes
window.open(theURL,winName,features);
}
</script>
<SCRIPT LANGUAGE="JavaScript">
var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
function checkmail(e){
var returnval=emailfilter.test(e.value)
if (returnval==false){
alert("Please enter a valid email address.")
e.select()
}
return returnval
}
</SCRIPT>
<!---End JavaScripts--->
failed<br /><br /><br />
I have an if statement saying if the word "failed" shows up on this page, then we go to another page.
But the if statement is not exactly working, and I wonder if it's because of all the other gobbledygook code.
I've tried strip_tags() to take out all other tags, but to no avail. Here is what I've got now:
if($response == 'Success'){
header('Location: ../success.php'); exit;
}elseif($response == 'failed'){
header('Location: ../unsuccessful.php'); exit;
}
$response is what I print to the page, and as you can see, it's more than just "failed" or "Success".
How do I strip extraneous tags and scripts?