Free Web Hosting Forum
Go Back   Free Web Hosting Forum > Website Building > Web Programming
Reload this Page PHP Help: "IF" statments won't work
Reply
 
Thread Tools Display Modes
(#1)
Old
Magnie's Avatar
Magnie Magnie is offline
Member
Magnie is on a distinguished road
 
Posts: 42
Join Date: Nov 2009
Location: Polaris, The Planet
Default PHP Help: "IF" statments won't work - 03-14-2010, 12:53 AM

I have no blazen idea why it won't work:

PHP Code:
if($isloggedin "yes"){

$us $_GET["us"];
$us secure($us);
$content $content.$us."<br><br>";

if(
$us "PG"){
$query "SELECT * FROM ".$prefix."users WHERE username = '$loggedinname'";

$result = @mysql_query($query);

$power=@mysql_result($result,$i,"power");
$cash=@mysql_result($result,$i,"cash");
if(
$cash>20000 or $cash 20000){
$powers $power 30;
$cashs $cash 20000;
$query "UPDATE ".$prefix."users SET power='".$powers."' WHERE username='".$loggedinname."'"

mysql_query($query);
$query "UPDATE ".$prefix."users SET cash='".$cashs."' WHERE username='".$loggedinname."'"

mysql_query($query);
$title "New Upgrade!";
$content $content."<br>The Power Generator has been upgraded.";
}
else{
$title "Not Enough Resources!";
$content $content."Sorry! You don't have enough resources! Please wait another billion seconds before buying this again. (Cost: 20000)";
}
}
else{
$content $content."No such upgrade exists.";
}


It gives no error messages, practically skips the IFs and goes right on through.


List of Common Problems and how to fix them <- Read that before you ask for help with something.
Reply With Quote
(#2)
Old
chanh's Avatar
chanh chanh is offline
Administrator
chanh is on a distinguished road
 
Posts: 2,065
Join Date: Dec 2008
Default 03-14-2010, 01:57 AM

<?php
if ($foo == 3) bar();
?>
Reply With Quote
(#3)
Old
Magnie's Avatar
Magnie Magnie is offline
Member
Magnie is on a distinguished road
 
Posts: 42
Join Date: Nov 2009
Location: Polaris, The Planet
Default 03-14-2010, 04:15 AM

Lol, thanks, never realized I could have made such a mistake. o.O


List of Common Problems and how to fix them <- Read that before you ask for help with something.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com