Re: Help with if

From: Date: Tue, 07 Aug 2007 06:51:47 +0000
Subject: Re: Help with if
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-28341@lists.php.net to get a copy of this message
Are you sure you want to check in the IF sentence also for the type? If not, then try using != or == in the if chunk. Is the "Unregistered" a define/constant? -Aleksandar Gustav Wiberg wrote:
Hi! I saw a several things that other people has pointed out, but there is another thing... You are missing '; after height="1" echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click- but24.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> The if-statement is missing a parenthese ) if ($rank) !== Unregistered) { You have two right paranthesis and one left... if ($rank) !== Unregistered) { Could be if ($rank !== Unregistered) { OR if (($rank) !== Unregistered) { Or as someone else has pointed out: if ($rank !== $Unregistered) { </php should be <?php as someone has pointed out also You can try to do this and see what happens. (and figure out what's the problem) echo "rank=" . $rank; echo "unregistered=" . Unregistered; if ($rank) !== Unregistered) { echo "true"; else { echo "false"; } Best regards /Gustav Wiberg -----Original Message----- From: Stephen [mailto:therealzerocool@gmail.com] Sent: Monday, August 06, 2007 5:18 PM To: php-windows@lists.php.net Subject: [PHP-WIN] Help with if i'm tryin to get the if command to work on my site so that I can get the buttons to show for registering if a certain user is at the first rank. The current code that I have is as follows; </php if ($rank) !== Unregistered) { echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click- but24.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> <rest of the code> } else { echo '<A HREF="https://www.paypal.com/cgi-bin/webscr? cmd=_subscr-find&alias=therealzerocool%40gmail%2ecom"> <IMG SRC="https://www.paypal.com/en_US/i/btn/cancel_subscribe_gen.gif" BORDER="0"> </A>'; } ?> On the account i'm testing with it should not be showing both buttons on the lase one, but both of them show. What am I doing wrong?


« previous php.windows (#28341) next »