macosx101 Posted August 23, 2008 Share Posted August 23, 2008 Hi I'm having trouble with a basic php application. (im a beginner) <?php$you=$_POST["name"];if ($you=="james") echo ("<h2>MSG1</h2>"); elseif ($you=="joe") echo ("<h2>MSG2</h2>"); else echo ("<h2>MSG3</h2>"); ?> I want to add more names to the else if statement, so it would be joe, oscar, nick, richard.How would I do that? (ive tried "joe"OR"oscar" in it but then you don't get msg 3 if you enter anything else like asdaThanks for your help Link to comment Share on other sites More sharing options...
Synook Posted August 23, 2008 Share Posted August 23, 2008 elseif ($you == "joe" || $you = "oscar" || $you == "nick" || $you == "richard") Link to comment Share on other sites More sharing options...
macosx101 Posted August 23, 2008 Author Share Posted August 23, 2008 elseif ($you == "joe" || $you = "oscar" || $you == "nick" || $you == "richard") Synook thank you :)Also planning a PHP application, would this be possible?page 1 -> any user (unregistered, no login) queries MYSQL using an html form to input a name already in a MYSQL table to bring up additional info such as comments regarding name.page2-> variables are displayed.page 3 Owner login where owner of application can add to the MYSQL table by using a quick simple html form.Just wondering if this was possible. If it is possible, would it take a long time for a begginer to develop? Oh and could some one point me in the direction of what to learn.Thanks. Link to comment Share on other sites More sharing options...
jeffman Posted August 23, 2008 Share Posted August 23, 2008 You can do all that. The way you describe page 3, your client is logging in AND inputting data at the same time. Certainly possible, and it's done that way, but it's not the most common UI for logging in.Keep practicing your PHP and start learning MYSQL and the PHP interfaces to it. Between the schools here and the PHP manual (http://www.php.net/manual/en/index.php) you can learn what you need. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.