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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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