Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_log("imploding post " . implode(", " , $_POST) . "\n\n");
- // error_log("imploding request " . implode(", " , $_REQUEST));
- if (empty($_POST)) {
- $return['error'] = true;
- $return['msg'] = 'no POST';
- error_log("||||||| post empty");
- }
- else {
- error_log("|||||||| no error |||||||");
- $return['error'] = false;
- $return['msg'] = "";
- foreach ($_POST as $key => $value){
- $return['msg'] .= $return["msg"] .
- "key: " . $key . "\nvalue : " . $value ;
- }
- }
- error_log("|||||||| MADE IT PAST THE BREAK |||||||");
- //$return = "gotcha";
- $username="root";
- $password="PASTEBIN";
- $database="lazyDB";
- if(!($connection = @ mysqli_connect(localhost,$username,$password)))
- die( "||||||||| Unable to connect to database |||||||||");
- error_log("|||||||| connection successful ! ||||||||| " );
- if(!(mysqli_select_db($connection, 'lazyDB')))
- die( "||||||||| Unable to select database");
- error_log("|||||||||| database selected! |||||||||");
- $password = 'asdf';
- $salt = '@#@#$@#%#$%'; // whatever string
- $password_hash = sha1($salt.sha1($password.$salt));
- // ID , username, password, email , profilePicURL, facebookID, googleID
- $ID = "";
- $username = "fotoflo";
- $email = "fotoflo@mailinator.com";
- $profilePicURL = '';
- $facbeookID = '';
- $googleID = '';
- $query = "INSERT INTO contacts VALUES ('','$username','$email','$profilePicURL','$facebookID','$googleID')";
- if(!($result = mysqli_query($query)))
- die("unable to run query");
- error_log("query successful!\nresult: " . $results . "\n");
- mysqli_close();
- echo json_encode($return);
- ?>
Add Comment
Please, Sign In to add comment