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?

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Stephen [ Mo, 06 August 2007 17:18 ] [ ID #1788195 ]

Re: Help with if

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;
>
> </php
> 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
Stut [ Mo, 06 August 2007 17:24 ] [ ID #1788196 ]

Re: 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" <stuttle [at] gmail.com> wrote in message
news:46B73D4B.9070109 [at] 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;
>>
>> </php
>> 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
Stephen [ Mo, 06 August 2007 17:30 ] [ ID #1788197 ]

Re: Help with if

Hi Stephen,

It looks like there are a few problems:

</php should change to <?php (your script shouldn't be parsing at all right now)

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" <therealzerocool [at] gmail.com>
To: php-windows [at] 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;

</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?

--
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
carlton.whitehead [ Mo, 06 August 2007 17:31 ] [ ID #1788198 ]

RE: Help with if

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 [at] gmail.com]
Sent: segunda-feira, 6 de Agosto de 2007 16:31
To: php-windows [at] 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" <stuttle [at] gmail.com> wrote in message
news:46B73D4B.9070109 [at] 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;
>>
>> </php
>> 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
luis.moreira [ Mo, 06 August 2007 17:37 ] [ ID #1788199 ]

Re: Help with if

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" <stuttle [at] gmail.com> wrote in message
> news:46B73D4B.9070109 [at] 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;
>>>
>>> </php
>>> 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
Tom Hearn [ Mo, 06 August 2007 17:37 ] [ ID #1788200 ]

Re: Help with if

$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)"" <luis.moreira [at] esi.pt> wrote in message
news:000601c7d83f$af942790$0ebc76b0$%moreira [at] 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 [at] gmail.com]
> Sent: segunda-feira, 6 de Agosto de 2007 16:31
> To: php-windows [at] 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" <stuttle [at] gmail.com> wrote in message
> news:46B73D4B.9070109 [at] 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;
>>>
>>> </php
>>> 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
Stephen [ Mo, 06 August 2007 17:42 ] [ ID #1788201 ]

Re: Help with if

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" <stuttle [at] gmail.com> wrote in message
> news:46B73D4B.9070109 [at] 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;
>>>
>>> </php
>>> 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
Stut [ Mo, 06 August 2007 18:15 ] [ ID #1788202 ]

RE: Help with if

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 '<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 pro=
blem)

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

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

=09echo "true";

else {

=09echo "false";

}


Best regards
/Gustav Wiberg


-----Original Message-----
From: Stephen [mailto:therealzerocool [at] gmail.com]
Sent: Monday, August 06, 2007 5:18 PM
To: php-windows [at] 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=3Dtherealzerocool%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?

--
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 =
16:16


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Gustav Wiberg [ Di, 07 August 2007 08:07 ] [ ID #1789043 ]

Re: Help with if

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 [at] gmail.com]
> Sent: Monday, August 06, 2007 5:18 PM
> To: php-windows [at] 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?
>
>

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Aleksandar Vojnovic [ Di, 07 August 2007 08:51 ] [ ID #1789044 ]

RE: Help with if

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...


Best regards
/Gustav Wiberg


-----Original Message-----
From: Stephen Deacon [mailto:therealzerocool [at] gmail.com]
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
doing wrong then?
----- Original Message -----
From: "Gustav Wiberg" <gustav [at] hmn.se>
To: "'Stephen'" <therealzerocool [at] gmail.com>; <php-windows [at] 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
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
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:therealzerocool [at] gmail.com]
Sent: Monday, August 06, 2007 5:18 PM
To: php-windows [at] 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=3Dtherealzerocool%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?

--
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=

16:16




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


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Gustav Wiberg [ Mi, 08 August 2007 08:07 ] [ ID #1789860 ]
PHP » gmane.comp.php.windows » Help with if

Vorheriges Thema: php isapi filter 5.2 problem
Nächstes Thema: PHP, MYSQL and Apache