Jump to content

Recommended Posts

<?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

//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!

}

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.