Mancent Posted October 4, 2011 Share Posted October 4, 2011 <?php //ob_start(); include "../connect.php"; Header('Cache-Control: no-cache'); Header('Pragma: no-cache'); $UserId=$_POST['UserId']; $UserId = stripslashes($UserId); $UserId = mysql_real_escape_string($UserId); $UserName=$_POST['UserName']; $UserName = stripslashes($UserName); $UserName = mysql_real_escape_string($UserName); $UserFirstName=$_POST['UserFirstName']; $UserFirstName = stripslashes($UserFirstName); $UserFirstName = mysql_real_escape_string($UserFirstName); $UserLastName=$_POST['UserLastName']; $UserLastName = stripslashes($UserLastName); $UserLastName = mysql_real_escape_string($UserLastName); $UserGender=$_POST['UserGender']; $UserGender = stripslashes($UserGender); $UserGender = mysql_real_escape_string($UserGender); $UserLink=$_POST['UserLink']; $UserLink = stripslashes($UserLink); $UserLink = mysql_real_escape_string($UserLink); $UserPicture=$_POST['UserPicture']; $UserPicture = stripslashes($UserPicture); $UserPicture = mysql_real_escape_string($UserPicture); $sql="SELECT * FROM Fb_Profile WHERE UserId='$UserId' and UserName ='$UserName' and UserFirstName ='$UserFirstName' and UserLastName ='$UserLastName' and UserGender ='$UserGender' and UserLink ='$UserLink' and UserPicture ='$UserPicture'"; $result=mysql_query($sql); $count=mysql_num_rows($result); //Lets add a first time active check 0 or 1 if 1 skip and check for update<br /> if($UserId == 'undefined') { return true; } if($count==1) { echo "&msgText=Facebook MySql Copy Successfully!\n"; return false; } else { echo "&msgText=Invalid Login!\n"; //THIS HERE IS WHAT I AM HAVING A PROBLEM WITH, IF STATEMENT STATING THAT IF $UserId IS EMPTY AND THE OTHER VARIABLES RETURN NOTHING BUT IF IS HAS A VALUE IT INSERTS //IF(!empty $UserId) $FB_Profile_Copy = mysql_query("INSERT INTO Fb_Profile(UserId,UserName,FirstName,LastName,Gender,Link,Picture) VALUES('$UserId','$UserName','$UserFirstName','$UserLastName','$UserGender','$UserLink','$UserPicture')"); $FB_BackGround_Copy = mysql_query("INSERT INTO Fb_BackGround(UserId) VALUES('$UserId')"); return false; } ?> Link to comment https://forums.phpfreaks.com/topic/248441-so-simple-but-i-do-not-know-help-please/ Share on other sites More sharing options...
Adam Posted October 4, 2011 Share Posted October 4, 2011 Really..? Link to comment https://forums.phpfreaks.com/topic/248441-so-simple-but-i-do-not-know-help-please/#findComment-1275793 Share on other sites More sharing options...
Mancent Posted October 4, 2011 Author Share Posted October 4, 2011 Sorry thought php bbcode was what i should use.. HA HA my bad fixed Link to comment https://forums.phpfreaks.com/topic/248441-so-simple-but-i-do-not-know-help-please/#findComment-1275800 Share on other sites More sharing options...
Mancent Posted October 4, 2011 Author Share Posted October 4, 2011 //THIS HERE IS WHAT I AM HAVING A PROBLEM WITH, IF STATEMENT STATING THAT IF $UserId IS EMPTY AND THE OTHER VARIABLES RETURN NOTHING BUT IF IS HAS A VALUE IT INSERTS //IF(!empty $UserId) { //something to do here! } Link to comment https://forums.phpfreaks.com/topic/248441-so-simple-but-i-do-not-know-help-please/#findComment-1275802 Share on other sites More sharing options...
KevinM1 Posted October 4, 2011 Share Posted October 4, 2011 The PHP manual is your friend: empty. Note how the correct syntax is different than what you have. Keep a bookmark to the manual. Link to comment https://forums.phpfreaks.com/topic/248441-so-simple-but-i-do-not-know-help-please/#findComment-1275803 Share on other sites More sharing options...
Mancent Posted October 4, 2011 Author Share Posted October 4, 2011 so this is correct If(!empty() $UserId) { //so this says that if the variable is empty it will run this condition? } Link to comment https://forums.phpfreaks.com/topic/248441-so-simple-but-i-do-not-know-help-please/#findComment-1275806 Share on other sites More sharing options...
gizmola Posted October 4, 2011 Share Posted October 4, 2011 No, it's a function that takes a parameter. But the entire condition needs to be put inside parens: if (!empty($UserId)) { // do whatever } Link to comment https://forums.phpfreaks.com/topic/248441-so-simple-but-i-do-not-know-help-please/#findComment-1275813 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.