ukweb Posted June 7, 2006 Share Posted June 7, 2006 Hi In all my time developing php apps have i ever encountered so many problems as I have with this project. It has been some time since I last developed anything like this but it is really winding me up as i cannot see where the problems are. The problem page is here: [a href=\"http://www.servewales.co.uk/members/register.php\" target=\"_blank\"]http://www.servewales.co.uk/members/register.php[/a] and it is not supposed to display "you did not specify your first name" unless there is a get variable called action which is set to confirm. Here is the code for this line of text: <?php if ( $_POST['first_name'] == '' && $_GET['action'] == 'confirm' ) { ?> You did not specify your first name <?php } if ( ! ($_POST['first_name'] == "") ) { $v3 = "1"; } ?> THe last bit of code just sets a value for $v3 which works fine. HELP PLEASE! Quote Link to comment https://forums.phpfreaks.com/topic/11401-statement-not-working-again/ Share on other sites More sharing options...
kenrbnsn Posted June 7, 2006 Share Posted June 7, 2006 Have you put any debugging lines in your code so you can see what you are actually testing against? <?php echo '<pre> $_POST: ' . print_r($_POST,true) . '</pre>'; // debug echo '<pre> $_GET: ' . print_r($_GET,true) . '</pre>'; // debug if ($_POST['first_name'] == '' && $_GET['action'] == 'confirm') echo 'You did not specify your first name'; if ($_POST['first_name'] != '') $v3 = "1"; ?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/11401-statement-not-working-again/#findComment-42752 Share on other sites More sharing options...
.josh Posted June 7, 2006 Share Posted June 7, 2006 well at some point in time the 2 conditions of your if statement are being met, and therefore that message is displaying. but you need to post more code than that. there is no way to find the bug based on that. Quote Link to comment https://forums.phpfreaks.com/topic/11401-statement-not-working-again/#findComment-42783 Share on other sites More sharing options...
craygo Posted June 7, 2006 Share Posted June 7, 2006 Post some of your code so we can help out. you could try this if ($_POST['first_name'] == '' && $_GET['action'] == 'confirm'){ echo 'You did not specify your first name'; } else { echo ' '; } if ($_POST['first_name'] != ''){ $v3 = "1"; } use and not just a space because mose tables will not print a space so you need the code FOR a space to print. Ray Quote Link to comment https://forums.phpfreaks.com/topic/11401-statement-not-working-again/#findComment-42785 Share on other sites More sharing options...
servewales Posted December 8, 2013 Share Posted December 8, 2013 odd question but did ukweb own this domain in 2006 ??? Quote Link to comment https://forums.phpfreaks.com/topic/11401-statement-not-working-again/#findComment-1461696 Share on other sites More sharing options...
hitman6003 Posted December 9, 2013 Share Posted December 9, 2013 http://bit.ly/1buzMMy Quote Link to comment https://forums.phpfreaks.com/topic/11401-statement-not-working-again/#findComment-1461705 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.