?
Solved

PHP Syntax Help

Posted on 2014-01-30
2
Medium Priority
?
186 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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

777 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