Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 175 results for
ifelse
- Page 1
Ifelse?
Programming
Web Development
17 Years Ago
by whoisit
I am building on a previous thread which got the user name by now asking for password as well. But for some reason it doesn't work, it jumps right to the default. Thanks for looking Here is the code [code] <?php $usern1 = Joe; $pass1 = abc; $usern2 = Jim; $pass2 = lmn; $usern3 = Jack; $pass3 = xyz; if ($_POST[$user] == $usern1 …
Re: Ifelse?
Programming
Web Development
17 Years Ago
by richie513
Try putting single or double quotes around your values like this: $usern1 = "Joe"; $pass1 = "abc"; $usern2 = "Jim"; $pass2 = "lmn"; $usern3 = "Jack"; $pass3 = "xyz"; The form you are using, is it contained on this file, or another file? Can you also paste the code for that form, this …
Re: Ifelse?
Programming
Web Development
17 Years Ago
by whoisit
Hi Riche thanks for the suggetion, still not working so here is the form that calls the php page. [code] <form method="post" action="login.php" name="userID" > <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR"> <div align="center"> …
Re: Ifelse?
Programming
Web Development
17 Years Ago
by Auzzie
try replacing your php with this: [CODE] <?php $usern1 = "Joe"; $pass1 = "abc"; $usern2 = "Jim"; $pass2 = "lmn"; $usern3 = "Jack"; $pass3 = "xyz"; if ($_POST[$user] == $usern1 && $_POST[$password] == $pass1) { echo("Joe you are now logged in"); } elseif …
Re: Ifelse?
Programming
Web Development
17 Years Ago
by whoisit
Hi Aussie Thanks for the advice but still no luck?
Re: Ifelse?
Programming
Web Development
17 Years Ago
by Auzzie
change $_POST[$user] and $_POST[$password] to $_POST[user] and $_POST[password] in other words drop the $
Re: Ifelse?
Programming
Web Development
17 Years Ago
by Auzzie
slight typo of mine it should be $_POST['user'] and $_POST['password']
Re: Ifelse?
Programming
Web Development
17 Years Ago
by whoisit
Hi Aussie, Success!! I've posted the code below so that other members just starting out with php can look at it. I have another question please, so that I can build on this script, in fact I have two. 1) Can this be placed in a switch statement, instead of elseif? 2) How can I place the info into a log file *.txt. I do appreciate the …
Re: Ifelse?
Programming
Web Development
17 Years Ago
by Auzzie
well for question 2: [CODE] $myFile = "testFile.txt"; $filehandle = fopen($myFile, 'w') or die("can't open file"); $stringData = "Bobby Bopper\n"; fwrite($filehandle, $stringData); $stringData = "Tracy Tanner\n"; fwrite($filehandle, $stringData); fclose($filehandle); [/CODE] fwrite writes a …
Re: Ifelse?
Programming
Web Development
17 Years Ago
by whoisit
Morning Aussie, ROFLOL Thanks for a detailed description, I will go and play around with it for a while. While I'm writing can you recommend any good books for newbies?
Re: Ifelse?
Programming
Web Development
17 Years Ago
by Auzzie
I wouldn't call it detailed :P as for a nice book for newbies hmm... try phpsolutions or php & mysql programming for beginners, both available on Amazon at a nice and cheap price ;) Let us know if you need anything else But i'm sure if i can find it i will pm you a link to a copy of the php & mysql book off my server
Re: Ifelse?
Programming
Web Development
17 Years Ago
by richie513
This here is a good book for beginners, I used it when I started, and still refer back to it every now and then. It is online and free, you can find it here [URL="http://hudzilla.org/phpwiki/index.php?title=Main_Page"]Practical PHP[/URL] richie513:)
Re: Ifelse?
Programming
Web Development
17 Years Ago
by whoisit
Thanks for the link Richie, It's bookmarked!
Re: Ifelse?
Programming
Web Development
17 Years Ago
by richie513
Your welcome whoisit:)
Conditional Structures
Programming
Software Development
14 Years Ago
by raym.mart
Can someone help me solve this! thx Conditional structure , include also the console result. 1. Using switch case design and write a java application that takes as input a single letter and displays the corresponding digit on a telephone. The letters and digits on a telephone are grouped this way: 2=ABC 3=DEF 4=GHI 5=JKL 6=MNO 7=PQRS…
Exception in thread "main" java.lang.NumberFormatException: For input string:
Programming
Software Development
14 Years Ago
by kazumahits
…. here's my code [CODE]import java.io.*; public class
ifelse
{ public static void main(String[] args) throws IOException{ BufferedReader in…) at java.lang.Integer.parseInt(Integer.java:499) at
ifelse
.main(
ifelse
.java:19) this code will come out when i enter…
Radio Button If Statement
Programming
Web Development
18 Years Ago
by pbrookee
… all...I am having a little trouble with using an
ifelse
statement to print information from one page to another. I… 'confirmed' on the next page. How can I do an
ifelse
statement stating if 'this radio button is selected' echo this…
Re: Exception in thread "main" java.lang.NumberFormatException: For input string:
Programming
Software Development
14 Years Ago
by extemer
[B]try this one[/B] [code] import java.io.*; class
ifelse
{ public static void main(String[] args) throws IOException{ BufferedReader in = …
Re: Exception in thread "main" java.lang.NumberFormatException: For input string:
Programming
Software Development
14 Years Ago
by Dupron
… will solve your problem.. [code] import java.io.*; public class
ifelse
{ public static void main(String[] args) throws IOException{ BufferedReader in…
Re: Exception in thread "main" java.lang.NumberFormatException: For input string:
Programming
Software Development
14 Years Ago
by extemer
… the way study it first... [code]import javax.swing.*; class
IfElse
{ public static void main(String[] args){ String Dplay= "\nInvalid…
Re: Exception in thread "main" java.lang.NumberFormatException: For input string:
Programming
Software Development
14 Years Ago
by mitchneys
import java.io.*; public class
ifelse
{ public class InputStreamReader reader=new InputStreamReader (System.in); public class …
Re: Exception in thread "main" java.lang.NumberFormatException: For input string:
Programming
Software Development
14 Years Ago
by jon.kiparsky
[QUOTE=mitchneys;1324796]import java.io.*; public class
ifelse
{ ... int a; System.out.println("Enter your Level"); …
help my code is wrong
Programming
Software Development
4 Years Ago
by Khen Louegie
…6: gender(); break; } } public void
ifelse
() { System.out.println("[10] Legal … case 1: ifex(); break; case 2:
ifelse
(); break; } } public static void main (String…
Re: Help with sed command please.
Programming
Software Development
17 Years Ago
by radoulov
… dict dup /Priority [0 1 2 3] put\ put setpagedevice\ }
ifelse
' currentpagedevice /InputAttributes get 0 get dup null eq { pop } { dup… dict dup /Priority [0 1 2 3] put put setpagedevice }
ifelse
Page 1 1 [/code]
Help with sed command please.
Programming
Software Development
17 Years Ago
by asciiletters
… dict dup /Priority [0 1 2 3] put put setpagedevice }
ifelse
And I want it right before the line containing the…
Re: Help with sed command please.
Programming
Software Development
17 Years Ago
by asciiletters
… dict dup /Priority [0 1 2 3] put\ put setpagedevice\ }
ifelse
Then I ran the script with: sed -f sedscript.sed…
Problems retrieving from database
Programming
Software Development
16 Years Ago
by MadAxel
… retrieve the records from the first selectedindex=0 of the
ifelse
statement and not from the others. That means if i…
A Curious Thing...
Programming
Software Development
16 Years Ago
by archiphile
… code; [ICODE]// This is a program about loops, switch statements,
ifelse
statements //and applying them to another faily simple programme. #include…
Using PHP variables on multiple pages using a MySQL db
Programming
Databases
15 Years Ago
by Bliss C
… the bookstall will be held - it's a simple if/
ifelse
list that displays the dates when the bookstall will be…
Dynamic title errors
Programming
Web Development
15 Years Ago
by whitestream6
… switch statement, but can't get it to work. Tried
ifelse
using code gleaned from Google but it didn't work…
1
2
3
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
Backlink Auditor
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC