Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. the $url array handles JUST the url's for redirect. Those just need to be the URL's you want to redirect to. The arrays you need to change for what is blocked are $referrers, $badAgents, and $deny which is all below the url array.
  2. Where is your session_start(), or do you have them set to auto-start?
  3. <?php /* Standard redirect function (for re-use) */ function redirect($url) { header('Location: ' . $url); } // Setup URL's $url['ip'] = 'http://www.google.com'; $url['referrer'] = 'http://www.yahoo.com'; $url['agent'] = 'http://www.msn.com'; // Setup rules for redirection $referrers = array('yousuck.org', 'welikefruit.com'); $badAgents = array('useragent1', 'useragent2'); $deny = array('78.105.191.38'); /* Check for IP Redirects */ if (!empty($deny)) { // Only if there are denied IP's foreach ($deny as $ip) { if ($ip == $_SERVER['REMOTE_ADDR']) { redirect($url['ip']); } } } /* Check for Referrer Redirects */ if (isset($_SERVER['HTTP_REFERRER'])) { if (!empty($referrers)) { foreach ($referrers as $value) { if (strstr($_SERVER['HTTP_REFERRER'], $value) === true) { redirect($url['referrer']); } } } } /* Check for Agent redirects */ if (isset($_SERVER['HTTP_USER_AGENT'])) { if (!empty($badAgents)) { foreach ($badAgents as $value) { if (strstr($_SERVER['HTTP_USER_AGENT'], $value) === true) { redirect($url['agent']); } } } } // Activate fallback redirect redirect("http://www.msn.com"); ?> 1. This should work. I cannot guarantee that it works entirely because I barely tested it. If this does not work, then you could easily get a working solution from this within a few minutes. 2. Understand, you cannot rely on referrers. They are not always trust worthy. Neither is user agent. Neither is IP for that matter. Good luck.
  4. He is right. There is nothing wrong with that array. Which leads me to believe that perhaps the session is being overwritten at some point. Can you please post the entire code. Everything on the entire page (minus sensitive data) so I can get a better look. Rule out the session getting overwritten, or some other logic error in the way your structuring it.
  5. Yes, you would need Ajax functionality for that. There are many tutorials that cover Ajax/Javascript functionality.
  6. Starting up a bunch of random tools. Just curious if anyone had any web tool ideas they wanted to toss around (That they are not wanting) or wouldn't mind having. I am talking about pretty small tools. Onces that can function in 1-2 pages. Anything considered "small" tools. Is there anything you would have like to have seen at some point, or think might be pretty useful?
  7. I appreciate the feedback. Thank you.
  8. I finally got it figured out. You have to have the "same" url that is in the redirect throughout the entire application. I tried doing the processes on two different pages. I had to combine them into one.
  9. I tried that, but for some reason I am still getting the same error. That sounds like something related to my APP ID or my secret key. So I went ahead and triple checked those. The "Client ID" is my app id, and the "Client Secret" is my secret key. I have made sure all the information is correct, but it's still returning the same error. I did the encoding, but it didn't do anything. Any more advice?
  10. I normally would, but according to the Facebook API Docs, this is the way they intended for you to get access. If I can't figure this out after a minute, I might try that. This is what I have now, I got a step closer but still having issues. I have gotten a little further. I realized I was missing a step (the APP Auth). So I redid the same thing. However on that second set of code, I did a redirect instead to try and get the code. So first I changed my code to this <a href="https://www.facebook.com/dialog/oauth?client_id=162015613847432&redirect_uri=http://www.mywebsite.com/facebook_connect.php?response_type=token">Facebook Connect</a> The facebook_connect.php was also altered. /* Facebook OAuth Procedures */ $app_id = 'IDHERE'; $app_secret = "SECRETKEYHERE"; $keycode = $_REQUEST["code"]; $url = 'https://graph.facebook.com/oauth/access_token?client_id=' . $app_id . '&redirect_uri=http://www.mywebsite.com/facebook_connect2.php&client_secret=' . $app_secret . '&code=' . $keycode; header('Location: ' . $url); OK, so this is the step I was missing. So this takes me to the page..I have another page called facebook_connect2.php. This is suppose to grab it, do the auth, and log them into my system. <?php echo '<pre>'; print_r($_REQUEST); echo '</pre>'; ?> i haven't worked out this step yet, was just printing out the request variables for testing. Now, when it redirects to that URL though it returns the following error: How can I fix this.
  11. Been fighting with this for awhile. Finally needed to seek advice. I have a URL setup to go to facebook and get information. It's just a standard link... a href="https://www.facebook.com/dialog/oauth?client_id=CLIENTIDHERE&redirect_uri=http://www.website.com/facebook_connect.php?response_type=token">Facebook Connect</a></p> That ends up sending them back to my receiver script. I have it laid out as follows: <?php /* Facebook OAuth Procedures */ $app_id = APPIDHERE; $app_secret = SECRETKEYHERE; $code = $_REQUEST["code"]; $url = 'https://graph.facebook.com/me?access_token=' . $code; $user = json_decode(file_get_contents($url)); echo("Hello " . $user->name); ?> That should be very simple. The link takes them to facebook. This part works. If they are logged in and have approved it, it then takes them to my receiver URL. If they are not logged in, it prompts for login, or if they decline and then it takes them to a failure page at that point. So all of that works. Now this receiver page also receives the code back from the previous URL. That all works fine. However, when I try to get to the graph to get the user data, it returns "File Get Contents" and a bad request message. That doesn't make any sense. According to the Facebook API Documentation this is suppose to be how you get the data back. But in this situation I don't even need there name. The only data I need is the Facebook userid so I can match that up with my database and find a connection, then log them into my system. Any advice on why this is not working?
  12. Reference URL: http://developers.facebook.com/docs/reference/dialogs/oauth I am trying to set this up on one of my clients sites, that use Codeigniter (because that's why I prefer using). But having some issues with the URL. http://www.website.com/index.php/members/facebook_login/response_type=token I am using that (replacing website.com with the URL) as the return URL. It does everything fine, but then returns page not found when it does the redirect. It's messing up the string..at the end of token it adds this long string, and CI isn't able to pick it up. Has anyone successfully integrated Facebook Login into a Codeigniter Structure, and has any tips on how to make this part work. Thanks again. My code for this function is below: <?php function facebook_login($test) { echo $test; echo $test2; echo 'test this'; } ?> That is the page function extrapolated from Code Igniter.
  13. I passed it onto a friend of mine (he specializes in bots, he did it in about 20 minutes. There were a lot of configuration options he had to set in Curl to get it to work, but it seems entirely possible. He did it successfully, with flawless execution.
  14. I want to ask this, because I would rather be safe than sorry. I am starting to try to do affiliate marketing on the side for Host Gator. Trying to get some extra money from selling hosting using a referrer link. I was going to either put a link to the affiliate, or put a banner from the affiliate in my Signature. I read through the TOS and I read this: It says advertisements. However, I already advertise my business site and blog. I have not had any complaints about that, and everyone else on the forum does. I am not good with much of this Legal text. So to make it a short question: Would me putting a banner or link to promote my affiliate link to Host Gator in my post signatures be against the terms of service?
  15. I do not understand what you are wanting. It sounds like you want to customize the file download box. You have no control over this. This is entirely controlled by the browser that the download is taking place in. There might be a technique I am not aware of, but as far as I know there isn't.
  16. Thank you for the suggestions. I appreciate that.
  17. I have 3 basic questions. I did a few Google Searches for this data and could not find anything substantion. What options are available to somewho who wants to send notifications to a Desktop PC (main thing), Android phone, and maybe a few other phone types. The main thing I need to figure out is about desktop notifications. I heard that GMail was about to release this feature soon, so I know there must be options out there for it. Are there any options, besides a standard custom desktop application development?
  18. http://stackoverflow.com/questions/3599127/in-php-why-wasnt-echo-implemented-as-a-function-not-echo-vs-printf
  19. Bottom left hand corner of the posts, when your reviewing the posts themselves.
  20. <?php $content = 'clickpost.php'; $content = '<a href="clickpost.php">Link</a>'; ?> Is that what you mean?
  21. Or you could do it the convoluted way: <?php $str = '<img src="img.jpg" />'; for ($x=1; $x <= 6; $x++) { echo $str; } ?> That is what I would have done. However, I did not know about the str_repeat() function until he posted it. Wish I had of known about that in the past. So this post helped me out as well. Simplifies things.
  22. All I want to know first, is this possible... I want to go <a href="http://mirage.smc.edu/pls/pub/f?p=207:1:4398391836116838:HIDE:NO::P1_CLASSTYPE,P1_STATUS,P1_SUBJECTS,P1_LOCATION,P1_INSTRUCTOR,P1_MEETDAYS,P1_BEGINWK,P1_STARTIME:%2C%2C%2C%2C%2C%2C%2C">Here</a>. I want to be able to use Curl or something to go to this page, and submit the data. All I want to control is what Subject is selected, and what Semester radio button is picked. Is this possible with Curl? I have tried to do this. The page linked above, loads some other page via ajax and updates this page dynamically. I tried to posting to that page instead, and it throws an application error. Is it possible to do this and actually get back the table listings. All I want is to be able to specify the subject and semester, and get that table back. If it is possible, how can you get it back with just a standard curl call. I tried doing a straight post to the page it calls, and to that page and neither way is working. Any advice is appreciated.
  23. What does, .*? mean? http://networking.ringofsaturn.com/Web/regex.php This is what I am using as a reference. . Matches any character. cat. matches catT and cat2 but not catty ? Preceeding item must match one or zero times. colou?r matches color or colour but not colouur * Preceeding item must match zero or more times. This is what does not make sense. I have been using .*? to match anything. And it works fine. So why not just . to do th ematching. I do not understand this. Why the *? I basically got this basic pattern offline and have been reusing and modifying it as I learn new patterns and what they all mean. Any advice is greatly appreciated.
  24. Hmm your right. It would help if I had the right URL in there. I had copied/pasted the wrong URL into my script. That has never happened before.
×
×
  • 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.