jeff5656 Posted March 19, 2009 Share Posted March 19, 2009 I have a page with a form. To redirect back to the correct list i set the variable $so to be 'y': case "editdc": $icu='y'; $so = 'y'; break; When I process the form, I use this: $so = $_POST['so']; and at the end I redirect (the point1 point 2 referr to which submit button was pressed): if(isset($_POST['point1'])) { header("Location: editdos.php?action=edit&id=".$pt_id); } if(isset($_POST['point2'])) { if ($so='y') { header("Location: displaysignoff-bill.php"); } else { header("Location: billview.php"); } } if(isset($_POST['point3'])) { header("Location: editdos_cs.php?action=consults&id=".$pt_id); } if(isset($_POST['point4'])) { header("Location: ../../wb/cs/displayactive.php"); } For point2, the problem is even when $so is NOT "y", it STILL goes to Location: displaysignoff-bill.php. It does not go to billview.php. Any ideas? I hope I asked the question in a way that doesn't confuse everyone. Link to comment https://forums.phpfreaks.com/topic/150187-solved-cant-get-the-if-statement-to-do-what-i-want/ Share on other sites More sharing options...
kickstart Posted March 19, 2009 Share Posted March 19, 2009 Hi Try if ($so=='y') All the best Keith Link to comment https://forums.phpfreaks.com/topic/150187-solved-cant-get-the-if-statement-to-do-what-i-want/#findComment-788728 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.