For Programmers: Free Programming Magazines  


Home > Archive > PHP on Windows > August 2007 > RE: [PHP-WIN] Help with if









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [PHP-WIN] Help with if
Gustav Wiberg

2007-08-08, 4:02 am

Hi!

Oh, sorry. I seem to have some things ...

Try setting a variable to show PHP-errors (seems like PHP doesn't show erro=
rs on your server)


Try this code instead:

<?php
error_reporting(E_ALL);
echo "rank=3D" . $rank;
echo "unregistered=3D" . Unregistered;

if ($rank !=3D=3D Unregistered) {

echo "true";

}

else {

echo "false";

}

?>

You must get some kind of return-value / errors / notices...=20


Best regards
/Gustav Wiberg
=20

-----Original Message-----
From: Stephen Deacon [mailto:therealzero@gmail.com]=20
Sent: Tuesday, August 07, 2007 6:12 PM
To: Gustav Wiberg
Subject: Re: [PHP-WIN] Help with if

I did try doing

echo "rank=3D" . $rank;
echo "unregistered=3D" . Unregistered;

if ($rank) !=3D=3D Unregistered) {

echo "true";

else {

echo "false";

}

but it showed nothing, neither true or false showed up. What could I be=20
doing wrong then?
----- Original Message -----=20
From: "Gustav Wiberg" <gustav@hmn.se>
To: "'Stephen'" <therealzero@gmail.com>; <php-windows@lists.php.net>
Sent: Tuesday, August 07, 2007 1:07 AM
Subject: RE: [PHP-WIN] Help with if


Hi!

I saw a several things that other people has pointed out, but there is=20
another thing...

You are missing '; after height=3D"1"


echo '<form action=3D"https://www.paypal.com/cgi-bin/webscr"

method=3D"post">
<input type=3D"hidden" name=3D"cmd" value=3D"_s-xclick">
<input type=3D"image" src=3D"https://www.paypal.com/en_US/i/btn/x-click-

but24.gif" border=3D"0" name=3D"submit" alt=3D"Make payments with PayPal -

it's fast, free and secure!">
<img alt=3D"" border=3D"0"

src=3D"https://www.paypal.com/en_US/i/scr/pixel.gif" width=3D"1"

height=3D"1">

The if-statement is missing a parenthese )
if ($rank) !=3D=3D Unregistered) {

You have two right paranthesis and one left...


if ($rank) !=3D=3D Unregistered) {
Could be
if ($rank !=3D=3D Unregistered) {
OR
if (($rank) !=3D=3D Unregistered) {


Or as someone else has pointed out:
if ($rank !=3D=3D $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=20
problem)

echo "rank=3D" . $rank;
echo "unregistered=3D" . Unregistered;

if ($rank) !=3D=3D Unregistered) {

echo "true";

else {

echo "false";

}


Best regards
/Gustav Wiberg


-----Original Message-----
From: Stephen [mailto:therealzero@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) !=3D=3D Unregistered) {
echo '<form action=3D"https://www.paypal.com/cgi-bin/webscr"

method=3D"post">
<input type=3D"hidden" name=3D"cmd" value=3D"_s-xclick">
<input type=3D"image" src=3D"https://www.paypal.com/en_US/i/btn/x-click-

but24.gif" border=3D"0" name=3D"submit" alt=3D"Make payments with PayPal -

it's fast, free and secure!">
<img alt=3D"" border=3D"0"

src=3D"https://www.paypal.com/en_US/i/scr/pixel.gif" width=3D"1"

height=3D"1">
<rest of the code>
} else {
echo '<A HREF=3D"https://www.paypal.com/cgi-bin/webscr?

cmd=3D_subscr-find&alias=3Dtherealzero%40gmail%2ecom">
<IMG SRC=3D"https://www.paypal.com/en_US/i/btn/cancel_subscribe_gen.gif"

BORDER=3D"0">
</A>';
}
?>

On the account i'm testing with it should not be showing both buttons on th=
e
lase one, but both of them show. What am I doing wrong?

--=20
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.11.6/938 - Release Date: 2007-08-05=
=20
16:16




No virus found in this outgoing message.
Checked by AVG Free Edition.=20
Version: 7.5.476 / Virus Database: 269.11.8/940 - Release Date: 2007-08-06 =
16:53
=20
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com