| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| Multipul IF ELSE's IN PHP | |
|---|---|
| Tweet Topic Started: Jun 10 2005, 12:07 AM (436 Views) | |
| Das | Jun 10 2005, 12:07 AM Post #1 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I know I have another thread, but the other question is gonna take a while to answer I gather, and adding another question there is only gonna confuse things so:
As you can see there are multipul IF statements. Is there a way to use }else{ for all of them at once and then do the thing on the bottom? If it gets caught on an IF statment it means something is wrong, but if it dosn't pass all of them it means the submition was correct and then I want the query to be added. Question2: Is there a way to use a wildcard in php? I want to make sure the user's e-mail is in proper form EX: something@something.something is this possible to do? |
![]() |
|
| FearKiller | Jun 10 2005, 12:24 AM Post #2 |
|
www.drewscripts.com
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
QUESTION 1:
QUESTION 2:
There may be a better way for question number 2, but I believe that does work. You could also use the empty() function or isset() function to check for blank fields.
|
![]() |
|
| Seth | Jun 10 2005, 12:42 AM Post #3 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
And if you hope for your code to be portable, you gotta stop the short-tag stuff. The correct PHP style is
|
![]() |
|
| Das | Jun 10 2005, 12:46 AM Post #4 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
What is 'portable'? |
![]() |
|
| kingy | Jun 10 2005, 04:21 AM Post #5 |
|
1 in 10 people understands binary, the other 1 doesn't
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I think the <? short tags are being removed in the next few versions of php, phased out. If you are going to be running a current version you will be alright unless you upgrade. I think thats what seth means |
![]() |
|
| Total_Resistance | Jun 10 2005, 04:51 AM Post #6 |
![]()
Forum Support // Webmaster
![]() ![]() ![]() ![]() ![]()
|
some browsers dont read <? > Seths way will work for all upcoming browser updates |
![]() |
|
| Stefan | Jun 10 2005, 07:48 AM Post #7 |
![]()
Mew?
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
That has nothing to do with browsers. PHP is not visible for browsers, only the output generated by PHP. It's how PHP is configured at your server. http://docs.php.net/en/ini.html#ini.short-open-tag |
![]() |
|
| Gornakle | Jun 10 2005, 08:09 AM Post #8 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
With 'portable', he means that it will run on different servers. Some servers have the short tags disabled, or don't support them yet (not sure when short tags were introduced). |
![]() |
|
| Dennis | Jun 10 2005, 08:23 AM Post #9 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Instead of using ($pass == ""), try this:
Or
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Technology Chat · Next Topic » |
| Track Topic · E-mail Topic |
11:30 AM Jul 11
|




![]](../../../../0/1/0/p601690/pipright.png)





11:30 AM Jul 11