Permalink
Browse files

fixed link writing code so that it actually works

  • Loading branch information...
1 parent 4173a91 commit 74e2f031535752a6aea2a513761cf96cc5f111e5 @K-Felk K-Felk committed Mar 28, 2012
Showing with 18 additions and 16 deletions.
  1. BIN .DS_Store
  2. +11 −6 360link-reset.2.0.js
  3. +1 −1 360link-reset.2.0.min.js
  4. +6 −9 url_write.php
View
BIN .DS_Store
Binary file not shown.
View
@@ -374,15 +374,20 @@ jQuery("#360link-reset ul li a").click(function() {
jQuery(".doc-del-tooltip").show();
//lets also grap the openURL we are passing to the browser and pass it off
//to a PHP script that will write it elsewhere, so it can be checked
- var URL = jQuery("div#ArticleCL a").attr('href');
+ var link = jQuery(this).attr('href');
+ var msg;
+ link = encodeURIComponent(link);
+ link = "URL=" + link;
+
jQuery.ajax({
- type: "POST"
- data: {URL : URL},
- dataType: "text",
- url: "url_write.php"
-
+ dataType: "string",
+ type: "GET",
+ url: "url_write.php",
+ data: link
});
+
+
}
});
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,16 +1,13 @@
<?
- if (isset($_POST['URL'])) {
- $url = trim($_POST['URL']) . "\n";
- $DataFile = fopen("dodgy_urls.txt", "a");
- fwrite($DataFile, $url);
- fclose($DataFile);
- } else {
- die;
+$url = trim($_GET['URL']) . "\n";
+if (!$DataFile = fopen("dodgy_urls.txt", "a")) {echo "Failure: cannot open file"; die;};
+if (!fwrite($DataFile, $url)) {echo "Failure: cannot write to file"; die;};
+fclose($DataFile);
+echo "file write successful";
+
- }
-

0 comments on commit 74e2f03

Please sign in to comment.