Help with if

Help with if

am 06.08.2007 17:18:22 von Stephen

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;

if ($rank) !== Unregistered) {
echo '


method="post">



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

height="1">

} else {
echo '

BORDER="0">
';
}
?>

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?

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

Re: Help with if

am 06.08.2007 17:24:59 von Stut

Stephen wrote:
> 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;
>
> > if ($rank) !== Unregistered) {

Curious PHP tag, you don't want the ) after $rank and Unregistered I'm
guessing should be in quotes. I suggest you copy/paste your code instead
of re-typing it (assuming you re-typed it).

-Stut

--
http://stut.net/

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

Re: Help with if

am 06.08.2007 17:30:43 von Stephen

i did take out the ) after them both and it still is not working. I have
copy and pasted it, I just removed the huge blog of info that was given from
PayPal that is not important.
"Stut" wrote in message
news:46B73D4B.9070109@gmail.com...
> Stephen wrote:
>> 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;
>>
>> >> if ($rank) !== Unregistered) {
>
> Curious PHP tag, you don't want the ) after $rank and Unregistered I'm
> guessing should be in quotes. I suggest you copy/paste your code instead
> of re-typing it (assuming you re-typed it).
>
> -Stut
>
> --
> http://stut.net/

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

Re: Help with if

am 06.08.2007 17:31:45 von carlton.whitehead

Hi Stephen,

It looks like there are a few problems:


In your second line, do you have a constant named Unregistered, or are you trying to check if $rank is a string containing "Unregistered"? I'm guessing that line should change to:

if ($rank !== 'Unregistered') {

Regards,
Carlton Whitehead

----- Original Message -----
From: "Stephen"
To: php-windows@lists.php.net
Sent: Monday, August 6, 2007 11:18:22 AM (GMT-0500) America/New_York
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;

if ($rank) !== Unregistered) {
echo '
method="post">



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

height="1">

} else {
echo '

BORDER="0">
';
}
?>

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?

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

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

RE: Help with if

am 06.08.2007 17:37:23 von luis.moreira

I believe the syntax is not correct.

First, you should have

if ($rank !== Unregistered) {

or

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

Otherwise, the count for "open parenthesis" and "close parenthesis" do not
match.

Also, is Unregistered a defined type?
If not, how do you compare a variable ($rank) against it ?


Luis


-----Original Message-----
From: Stephen [mailto:therealzerocool@gmail.com]
Sent: segunda-feira, 6 de Agosto de 2007 16:31
To: php-windows@lists.php.net
Subject: Re: [PHP-WIN] Help with if

i did take out the ) after them both and it still is not working. I have
copy and pasted it, I just removed the huge blog of info that was given from

PayPal that is not important.
"Stut" wrote in message
news:46B73D4B.9070109@gmail.com...
> Stephen wrote:
>> 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;
>>
>> >> if ($rank) !== Unregistered) {
>
> Curious PHP tag, you don't want the ) after $rank and Unregistered I'm
> guessing should be in quotes. I suggest you copy/paste your code instead
> of re-typing it (assuming you re-typed it).
>
> -Stut
>
> --
> http://stut.net/

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

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

Re: Help with if

am 06.08.2007 17:37:43 von Tom Hearn

Stephen,
Should be if ($rank != Unregistered)

However, what is Unregistered? Is it a variable, constant?

There is a possibility that it should be ($rank != $Unregistered)

If you are comparing $rank to an actual text value then it should be
($rank != "Unregistered")

Hopefully that helps.

Tom

Stephen wrote:
> i did take out the ) after them both and it still is not working. I have
> copy and pasted it, I just removed the huge blog of info that was given from
> PayPal that is not important.
> "Stut" wrote in message
> news:46B73D4B.9070109@gmail.com...
>
>> Stephen wrote:
>>
>>> 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;
>>>
>>> >>> if ($rank) !== Unregistered) {
>>>
>> Curious PHP tag, you don't want the ) after $rank and Unregistered I'm
>> guessing should be in quotes. I suggest you copy/paste your code instead
>> of re-typing it (assuming you re-typed it).
>>
>> -Stut
>>
>> --
>> http://stut.net/
>>
>
>

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

Re: Help with if

am 06.08.2007 17:42:54 von Stephen

$rank would be called from the users file and then if their rank was set at
Unregistered i want it to display the subscription button and if it was any
other rank then it shows the Cancle Subscription button

""Luis Moreira (ESI-GSQP)"" wrote in message
news:000601c7d83f$af942790$0ebc76b0$%moreira@esi.pt...
>I believe the syntax is not correct.
>
> First, you should have
>
> if ($rank !== Unregistered) {
>
> or
>
> if (($rank) !== Unregistered) {
>
> Otherwise, the count for "open parenthesis" and "close parenthesis" do not
> match.
>
> Also, is Unregistered a defined type?
> If not, how do you compare a variable ($rank) against it ?
>
>
> Luis
>
>
> -----Original Message-----
> From: Stephen [mailto:therealzerocool@gmail.com]
> Sent: segunda-feira, 6 de Agosto de 2007 16:31
> To: php-windows@lists.php.net
> Subject: Re: [PHP-WIN] Help with if
>
> i did take out the ) after them both and it still is not working. I have
> copy and pasted it, I just removed the huge blog of info that was given
> from
>
> PayPal that is not important.
> "Stut" wrote in message
> news:46B73D4B.9070109@gmail.com...
>> Stephen wrote:
>>> 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;
>>>
>>> >>> if ($rank) !== Unregistered) {
>>
>> Curious PHP tag, you don't want the ) after $rank and Unregistered I'm
>> guessing should be in quotes. I suggest you copy/paste your code instead
>> of re-typing it (assuming you re-typed it).
>>
>> -Stut
>>
>> --
>> http://stut.net/
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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

Re: Help with if

am 06.08.2007 18:15:49 von Stut

Stephen wrote:
> i did take out the ) after them both and it still is not working. I have
> copy and pasted it, I just removed the huge blog of info that was given from
> PayPal that is not important.

Make sure you have display_errors on and error_reporting is set to E_ALL
in your php.ini. Without those you're not getting the full picture.

Also try viewing the source of the page that is output. Are you seeing
any PHP code in it?

-Stut

--
http://stut.net/

> "Stut" wrote in message
> news:46B73D4B.9070109@gmail.com...
>> Stephen wrote:
>>> 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;
>>>
>>> >>> if ($rank) !== Unregistered) {
>> Curious PHP tag, you don't want the ) after $rank and Unregistered I'm
>> guessing should be in quotes. I suggest you copy/paste your code instead
>> of re-typing it (assuming you re-typed it).
>>
>> -Stut
>>
>> --
>> http://stut.net/

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

RE: Help with if

am 07.08.2007 08:07:00 von Gustav Wiberg

Hi!

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

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


echo '
method=3D"post">


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

it's fast, free and secure!">
3D""
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) !== 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) {




You can try to do this and see what happens. (and figure out what's the pro=
blem)

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

if ($rank) !== Unregistered) {

=09echo "true";

else {

=09echo "false";

}


Best regards
/Gustav Wiberg


-----Original Message-----
From: Stephen [mailto:therealzerocool@gmail.com]=20
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=20
buttons to show for registering if a certain user is at the first rank.

The current code that I have is as follows;

if ($rank) !== Unregistered) {
echo '
method=3D"post">


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

it's fast, free and secure!">
3D""
src=3D"https://www.paypal.com/en_US/i/scr/pixel.gif" width=3D"1"

height=3D"1">

} else {
echo '
cmd=3D_subscr-find&alias=3Dtherealzerocool%40gmail%2ecom">

BORDER=3D"0">
';
}
?>

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

--=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.=20
Version: 7.5.476 / Virus Database: 269.11.6/938 - Release Date: 2007-08-05 =
16:16
=20

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

Re: Help with if

am 07.08.2007 08:51:47 von Aleksandar Vojnovic

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 ' >
> method="post">
>
>
> >
> 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) {
>
>
> >
>
> 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;
>
> > if ($rank) !== Unregistered) {
> echo ' >
> method="post">
>
>
> >
> src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1"
>
> height="1">
>
> } else {
> echo '
> >
> BORDER="0">
>
';
> }
> ?>
>
> 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?
>
>

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

RE: Help with if

am 08.08.2007 08:07:00 von Gustav Wiberg

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:

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

if ($rank !== 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:therealzerocool@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) !== 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"
To: "'Stephen'" ;
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 '
method=3D"post">


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

it's fast, free and secure!">
3D""
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) !== 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) {




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) !== 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;

if ($rank) !== Unregistered) {
echo '
method=3D"post">


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

it's fast, free and secure!">
3D""
src=3D"https://www.paypal.com/en_US/i/scr/pixel.gif" width=3D"1"

height=3D"1">

} else {
echo '
cmd=3D_subscr-find&alias=3Dtherealzerocool%40gmail%2ecom">

BORDER=3D"0">
';
}
?>

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

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