Jump to content

Another problem.


JayJabber

Recommended Posts

I dont seem to get this to work.  If gold in the database (on a persons data) is 0 or its just empty i want it to show the message below but if its 1 or more i want it to show a file with content in ( The content shows on the page there on)

<?php

if($gold != 0)

{

echo "<center><p>You DO not have Gold webclient, Purchase at the Upgrades shop!</p></center>";

}

else

{

echo include 'gold.php';

}

?>

 

Link to comment
https://forums.phpfreaks.com/topic/238292-another-problem/
Share on other sites

So what is the actual problem?  Code looks fine.

 

I dont know.

 

I it wont show anything like now i've changed it

<?php

if($gold != 0)

{

echo "<center><p>You DO not have Gold webclient, Purchase at the Upgrades shop!</p></center>";

}

else

if($gold != 1)

{

echo "work?";

}

?>

 

and it still dont work. It wont show the You do not have message if gold is on 0

Link to comment
https://forums.phpfreaks.com/topic/238292-another-problem/#findComment-1224534
Share on other sites

replace the if statement with this and try again:

 

if($gold != '0' && $gold != '') // to account for the fact that it may be empty, and also the fact that the number may be a string and not an integer.

 

hope this helps.

 

it helps but now it shows the include file part for 0 and well any number really

Link to comment
https://forums.phpfreaks.com/topic/238292-another-problem/#findComment-1224537
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.