Advertisement
fazeela

profile.php

Mar 15th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <?php
  2. session_start();
  3. $usernamepm = $_POST['username'];
  4. $passwordpm =$_POST['password'];
  5. $loginpm=array(
  6. 'user_name'=> "$usernamepm" ,
  7. 'password' => "$passwordpm"
  8. );
  9. $url='http://192.168.2.31:8080/Product_Deployment/services/user/login';
  10. $data="$loginpm";
  11. $ch=curl_init();
  12. curl_setopt($ch, CURLOPT_URL, $url);
  13. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  14. curl_setopt($ch, CURLOPT_POST, true);
  15. curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($loginpm));
  16. curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
  17. $response= curl_exec($ch);
  18. curl_close($ch);
  19. $jsondepm = "$response";
  20. $jsonde_o= json_decode($jsondepm);
  21. $jsonde_a=json_decode($jsondepm,true);
  22. $loginstatus=$jsonde_a[firsttimelogin];
  23. if($loginstatus=="yes")
  24. {
  25. header("Location:pipm.php");
  26. }
  27. if($loginstatus=="no")
  28. {
  29. header("Location:pipm.php");
  30. }
  31. if($loginstatus=="")
  32. {
  33. header("Location:login.php");
  34. }
  35.  
  36.  
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement