On 5/23/07, Jim Lucas <lists@xxxxxxxxx> wrote:
Dan Shirah wrote: > Okay, I think I'm doing everything right, but for whatever reason my > include > isn't working. > > <?php > echo $_POST['status_code']; > if ($_POST['status_code'] = "C") { > include ('complete_save.php'); > } > ?> > > The echo of my status_code retruns the correct value so the if should > trigger. > > This is my include page: > > <?php > > echo "test"; > > ?> > > VERY simple, but for some reason is not working???? > I think to this point most have missed the actual problem. imho, it has nothing to do with the following line. if ( $_POST['status_code'] = "C") my reason for saying this is this. The preceding condition will always return true. <?php $a = 'a'; if ( $a = "C" ) { echo '$a test success'; } $c = 'C'; if ( $c == "C" ) { echo '$c test success'; } ?> This snippet should prove my point. so, I would have to say that the problem is not with the condition, but rather the include file itself. -- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Unknown -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
That's true as well, Jim.... but the OP included the include file code at the foot of the message, and it's valid (a simple echo statement). Dan, try adding this to the top of your code: ini_set('error_reporting',E_ALL); If it outputs any errors for you, then you'll know what's up. Also, you don't need a space in your include command. Just type it out as if it were a function: include('complete_save.php'); -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107