Perad Posted September 18, 2007 Share Posted September 18, 2007 For some reason the if statement keeps coming up as true. This is even if "Call+Out+Fee+for+" isn't in the string being tested. Could someone help me correct this please if (preg_match("Call+Out+Fee+for+", $req)) { preg_match('/item_name1[^&]+/', $req, $out); $vowels = array("item_name1=", "Call+Out+Fee+for+", "%3A00", "%23"); $a = str_replace($vowels, "", $out[0]); $b = str_replace("%23", "*", $a); $c = str_replace("+on+", "*", $b); $d = str_replace("+", "*", $c); $pieces = explode("*", $d); preg_match('/payer_email[^&]+/', $req, $out2); $a = str_replace("payer_email=", "", $out2[0]); $email = str_replace("%40", "@", $a); include 'RCMConnect.php'; echo $sql; $sql = "UPDATE bookings SET confirm='1' WHERE bookingtime='".$pieces[1]."' AND bookingdate='".$pieces[2]."' AND conf='".$pieces[0]."'"; $result = mysql_query($sql); } else { preg_match('/item_name1[^&]+/', $req, $out); $a = str_replace("+for+", "*", $out[0]); $b = str_replace("+", " ", $a); $pieces = explode("*", $b); include 'RCMConnect.php'; $sql = "UPDATE bookings SET confirm='1' WHERE user='".$pieces[1]."' AND type='".$pieces[0]."'"; $result = mysql_query($sql); } Link to comment https://forums.phpfreaks.com/topic/69752-if-substring-exists-not-working/ Share on other sites More sharing options...
sasa Posted September 18, 2007 Share Posted September 18, 2007 you don't have delimiter in 1st preg_match Link to comment https://forums.phpfreaks.com/topic/69752-if-substring-exists-not-working/#findComment-350470 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.