Skip to main content

Posts

Showing posts with the label if-statement

App Bypassing the Login-screen, even though it shouldn"t

Whenever I launch my App, even from a new emulator with now files created it still executes the bit of code, that says if the file has been created do this intent, I don't understand, it shouldn't, I have no way of testing, because I have an iPhone not an Android phone, in theory the code should not be called, only on the second time loading the app. Thanks! Code: Public class LogIn extends Activity implements OnClickListener { Button send; EditText user; EditText pass; CheckBox staySignedIn; FileOutputStream Fos; String a; String b; String string = a; String string2 = b; String DANNYISREALLLLYYYGAAYYYYYIMNOTBS; String FILENAME = "userandpass"; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.login); send = (Button) findViewById(R.id.bLogIn); user = (EditText) find

App Bypassing the Login-screen, even though it shouldn"t

Whenever I launch my App, even from a new emulator with now files created it still executes the bit of code, that says if the file has been created do this intent, I don't understand, it shouldn't, I have no way of testing, because I have an iPhone not an Android phone, in theory the code should not be called, only on the second time loading the app. Thanks! Code: Public class LogIn extends Activity implements OnClickListener { Button send; EditText user; EditText pass; CheckBox staySignedIn; FileOutputStream Fos; String a; String b; String string = a; String string2 = b; String DANNYISREALLLLYYYGAAYYYYYIMNOTBS; String FILENAME = "userandpass"; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.login); send = (Button) findViewById(R.id.bLogIn); user = (EditText) find

if & else statements

I'm looking for some help with a little problem I'm having. Basically i have a "if & else" statement in my app but I want to add another "if" statement that checks for a file then for certain line of text in that file. But I am unsure of how to do this. on "if" check if file exists on "if" check if file exists but DOES NOT contain a certain line of text on "else" do something here is what i i have if(file.exists()) { do this } else { do this }

Is it possible to have IF statement in an Echo statement in PHP

Thanks in advance. I did look at the other questions/answers that were similar and didn't find exactly what I was looking for. I'm trying to do this, am I on the right path? echo " <div id='tabs-".$match."'> <textarea id='".$match."' name='".$match."'>". if ($COLUMN_NAME === $match) { echo $FIELD_WITH_COLUMN_NAME; } else { } ."</textarea> <script type='text/javascript'> CKEDITOR.replace( '".$match."' ); </script> </div>"; I am getting the following error message in the browser: Parse error: syntax error, unexpected T_IF Please let me know if this is the right way to go about nesting an IF statement inside an echo. Thank you.

jQuery IF var = value or #id clicked

I have the .live aspect working now so if links are clicked, my function is executed, but I'm trying to figure out how include an option for a direct link to the content as well. Something like this: $(showDiv).is('shipping-timeline') or $("#inm_if_hc_shipping_timeline").live('click', function() { [code to show and hide divs] }); showDiv contains the value that identifies the proper id, extracted from the URL. My Question: How do I construct the IF statement to execute if either case is true? Can anyone help? Thanks! UPDATE: So I took the IF parts from Graydot's answer and applied it to my code and here is a more complete example of what it looks like now: $("#inm_if_hc_faq").bind('click', function(e) { if(showDiv == 'faq') { // prevent default behavior e.preventDefault(); $("#inm_if_hc_content_faq").show("slow"); $("#inm_if

javasript Is there a limit to else if statements

I am getting value from a text field. I have one if and several else if statement. The problem the last else if doesn't execute even if the condition is true. If I change the last else if to if it executes and gives alert. When i change that back to else if the statement doesn't execute. The else if before that is fine as it's firing/executing on a particular condition. function Valcheck() { var txtVal = document.getElementById("sometextField").value; if(txtVal =="%") { alert("% is only allowed with other characters."); return; } else if(txtVal.indexOf("%") != -1) { if((txtVal.indexOf('%')) != (txtVal.length-1)) { alert(" % is only allowed at the end."); return; } } else if(txtVal.indexOf(",") != -1) { alert("Comma or comma separated values are not allowed."); return; }