[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

PHP Syntax Help

Posted on 2014-01-30
2
Medium Priority
?
188 Views
Last Modified: 2014-02-22
The following piece of validation code is almost correct.  However, I don't know how to write the "IF" part:
	$trimmed = array_map('trim', $_POST);
	
	$$un = $ue  = . if(isset($_POST['team_join']) && $_POST['team_join'] != "Create New Team") {echo $goal_amount .'==';})FALSE;
	
	// Check for a user login:
		if (preg_match ('/^[A-Z a-z 0-9\'.-]{2,40}$/i', $trimmed['user_login'])) {
			$un = $trimmed['user_login'];
		} else {
				echo '<p class="error">Please enter a username!</p>';
		}

		
	// Check for a Email:
	if (preg_match ('/^[\w.-]+@[\w.-]+\.[A-Za-z]{2,65}$/', $trimmed['user_email'])) {
		$ue = $trimmed['user_email'];
	} else {
		echo '<p class="error">Please enter a valid email address!</p>';
	}

	// Check for a Goal Amount:
	if(isset($_POST['team_join']) && $_POST['team_join'] != "Create New Team") {
		if(isset($_POST['goal_amount'])) {
			$goal_amount = $_POST['goal_amount'];
		} else {
			echo '<p class="error">You must unter a goal amount!';
		}
	}	

//  START IF EVERYTHING IS VALID
			
if ($un && $ue . if(isset($_POST['team_join']) && $_POST['team_join'] != "Create New Team") {echo '&&'. $goal_amount;}) {

BLAH BLAH BLAH
 }
			
		

Open in new window

0
Comment
Question by:rgranlund
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 39822352
I've no idea what you are trying to do but at a guess

if (isset($un) && isset($ue) && isset($_POST['team_join']) && $_POST['team_join'] != "Create New Team") {echo '&&'. $goal_amount;}
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39822545
Please explain the logic for line 3, thanks.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question