Jump to content

Is my PHP Code wrong?


flyersman

Recommended Posts

Hey everyone,

 

I set up a basic code in a file. Basically in MySQL if w9 is = 1 it will say ON FILE! If it isnt, it will say NOT ON FILE!

 

For some reason even though it is 1 for me, it says NOT ON FILE!. So th script thinks it isnt 1. Can anyone spot whats wrong here?

 

Thanks

<?
$_POST=$mysql->doSelectAndGetRow("users","*","email='$session_email'");
if(strlen($_POST['state'])>2)
{
$_POST['state2']=$_POST['state'];
$_POST['state']="";
}
?>
<? $w9status = $_POST['w9']

?>	
<p class="descrip">TRIMMED</p>
<hr><br><br><b><?=$_POST['first_name']?></b>, your W9 (W8 for international users) is currently <? if ( $w9status == 1 ) { echo "ON FILE!"; } else { echo "NOT ON FILE!"; } ?>

Link to comment
Share on other sites

unless your doSelectAndGetRow is taking your post array and selecting info based on it and returning results into the same post array...which I don't really see why it would be (I'm not psychic, but honestly I've never seen anybody do something like that, lol) your post array is being assigned whatever is in that method call.  Maybe nothing at all and it's returning true or false. 

 

In any case, by the time it gets to

 

$w9status = $_POST['w9']

 

it's more than likely not assigning anything at all.  Or at best, a boolean value (true/false).  But again, I'm not psychic.

 

 

Link to comment
Share on other sites

Hey guys, im a noob at php. Someone else wrote this code for me, and I tried to put the w9status thing in there.

 

But <?=$_POST['first_name']?> returns the text in first_name correctly. So I'd imagine $_POST['w9'] returns the integer in w9. Which is 1, 2, or 3. Any idea on how to fix this?

 

Thanks

Link to comment
Share on other sites

Also, I changed the code to this and it still wont work.

 

<?
$_POST=$mysql->doSelectAndGetRow("users","*","email='$session_email'");
if(strlen($_POST['state'])>2)
{
$_POST['state2']=$_POST['state'];
$_POST['state']="";
}
?>

<p class="descrip">trim</p>
<hr><br><br><b><?=$_POST['first_name']?></b>, your W9 (W8 for international users) is currently <? if ( $_POST['w9'] == 1 ) { echo "ON FILE!"; } else { echo "NOT ON FILE!"; } ?>

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.