Jump to content

hackalive

Members
  • Posts

    652
  • Joined

  • Last visited

Everything posted by hackalive

  1. @thorpe, Thanks for the advice ... but how to execute it (as in make it work). PS I am generating a "GUID" for each device, so this would replace the login you would use in a normal IM script. The GUI is set as a PHP cookie and also stored in a DB.
  2. Hi guys, I am after some code (PHP/AJAX/jQuery) that will let me send a command to a AJAX listener on another pc (or even eventually browser window), a bit like doing remote command/control. I thought about how does IM services do it and after research found they are dependent on a file or a db, any way to not be dependent on those? Or do I need to be? Furthermore if I do, anyone have a clean example (even a step by step tutorial) of an IM code with AJAX listener etc that I can use as an example and guide to modify into what I need? All help is greatly appreciated. Hope you all had a good NYE _ Cheers
  3. BUMP I really need and would like to get this sorted
  4. i just need to replicate the FF Plugin actions, so if someone can tell me how to do that (see screenshot above) that would be best
  5. Sorry, that last post confused me.
  6. @Muddy_Funster The post saying I get GET was from before I made the modifications listed in the next post. The post that mentions 2.php and all post onward are from where I have the code to set POST. Make sense?
  7. Sorry guys I cant upload the file it says this sites upload folder is full. So I put it here http://www.tiikoni.com/tis/view/?id=468176c
  8. Please see attached, this is the export I get from the FF Plugin. Window on the right is what I enter and when I press POST the output is the left window. I am now using a seperate file (2.php) with this code (below) to ensure it does the correct POST $postdata = http_build_query( array( 'grant_type' => 'authorization_code', 'client_id' => '0123456789ab', 'client_scret' => 'secrettest', 'code' => '3b186c90256fc572027a5eb7fb2e51f8', 'redirect_uri' => '/sandbox/' ) ); $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata ) ); $context = stream_context_create($opts); $result = file_get_contents('http://localhost/sandbox/token.php', false, $context); echo $result; But I get this error:
  9. perhaps i do thanks for pointing it out It essentially needs to post that string (I have attached to the URL) to that URL and then do file contents get from that token.php file whcih that sting was submitted to, or at least thats what the FF Plugin simulates. Cheers again.
  10. Sorry, this is the correct code link ... https://github.com/hswong3i/oauth2-php As you can see we are focused on token.php in the PDO folder Also you code is not helpful as it is not parsing the ?grant_type=a.... to the token.php, its merely splitting the URL into segments and returning them in HTML to view. An additional note, when using the FF Plugin, I press POST.
  11. Hi guys, I am using this OAuth library https://github.com/hswong3i I am trying to parse the string to token.php http://localhost/sandbox/token.php?grant_type=authorization_code&client_id=0123456789ab&client_secret=secrettest&code=3b186c90256fc572027a5eb7fb2e51f8&redirect_uri=/ Now this is not working But if I use Poster (FF Plugin) and do this: It works! So why will it not parse form URL? Any help is greatly appreciated. Cheers in advance.
  12. I seem to have it all working .... except a logout method, how to kill all the sessions etc? I tried a PHP file which was session_start(); session_destroy(); $_SESSION['active'] = false; and run it, but it still logged me in on refresh
  13. So while thorpe was off moving my post, I managed to isolate where the issue is comming from: It comes from this function checkLoggedIn() { $.ajax({ url: ajaxPage + '?event=checkLogin', success: function(response) { if(response == 'active') }); } If you delete all those lines (so that function, be it my modification or the exact of what I was given, it then works (but not the session part obviouslt, it just means when i try to login it does not fail.) So if anyone knows why this maybe the case, please do let me know. Cheers Ill see if i can figure it out as well
  14. @AGuyWithAthing You code did not work at all
  15. Do you have a suggestion for a better example? Or able to help me out with the code please?
  16. so on ever .php page in 'example' add $dbConnection = new PDO('mysql:dbname=mydb;host=localhost', 'user', 'pass'); and Change any use of new OAuth2StoragePDO() in the 'example' pages to - new OAuth2StoragePDO($dbConnection) ?
  17. I am using the code from: http://blog.webwizo.com/2011/05/04/simple-login-with-php-and-jquery-ajax/
  18. Hi guys, I am using an AJAX with PHP login, My issue is when i refresh it cancels my session! Any way to fix this? Cheers in advance.
  19. I added define("PDO_DSN", "mysql:dbname=dbname;host=localhost"); define("PDO_USER", "user"); define("PDO_PASS", "pwd"); which got rid of the above error, now i get this error Catchable fatal error: Argument 1 passed to OAuth2StoragePDO::__construct() must be an instance of PDO, none given, called in webroot\server\examples\pdo\addclient.php on line 13 and defined in webroot\server\examples\pdo\lib\OAuth2StoragePdo.php on line 50
  20. Adding $dbConnection = new PDO('mysql:dbname=mydb;host=localhost', 'user', 'pass'); $oauth = new PDOOAuth2($dbConnection); To line #11 on that file still returns the same error message!
  21. @kicken Thanks for the advice, but can you suggest where i add those lines?
  22. Basically i opened all of the files in Notepad ++ and could not find anywhere to add my db details! I found this line: * new PDOOAuth2( new PDO('mysql:dbname=mydb;host=localhost', 'user', 'pass') ); in the file: OAuth2StoragePdo.php But as you can see it is commented out and is surrounded by the following lines: /** * @file * Sample OAuth2 Library PDO DB Implementation. * * Simply pass in a configured PDO class, eg: * new PDOOAuth2( new PDO('mysql:dbname=mydb;host=localhost', 'user', 'pass') ); */ There are no instructions on how to add the DB details and/where. If I un-comment the above line in its exact location and put in my details I get this error: Fatal error: Class 'PDOOAuth2' not found in webroot\server\examples\pdo\lib\OAuth2StoragePdo.php on line 11 So any help is greatly appreciated.
×
×
  • 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.