0

So thanks to the response to my previous question, I've tried to make a code to e-mail me if the code is on another site.

Here is my javascript which is intended for a potential code theif to take with them to their website:

<script type="text/javascript">
var mypostrequest=new ajaxRequest()
mypostrequest.onreadystatechange=function(){
 if (mypostrequest.readyState==4){
  if (mypostrequest.status==200 || window.location.href.indexOf("http")==-1){
   document.getElementById("result").innerHTML=mypostrequest.responseText
  }
  else{
   alert("An error has occured making the request")
  }
 }
}

var url = document.domain;
var joel="www.joelhoskin.net76.net";
if (url!=joel)
{
mypostrequest.open("POST", "http://www.joelhoskin.net76.net/email.php", true)   
mypostrequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
mypostrequest.send(url)
}
</script>

and here is the php at joelhoskin.net76.net/email.php

    `<?php
      $url=$_POST['url'];
      if(isset($url))
            {
            $to = '[email protected]';
            $from = '[email protected]';
            $subject = 'Stolen Page';
            $content = $url."Site Stolen";
            $result = mail($to,$subject,$content,'From: '.$from."\r\n");
                die($result);
              }

         ?>`    

It isn't emailing me like it should

1 Answer 1

1
mypostrequest.send(url)

You do send data, but without key. Do it this way:

mypostrequest.send('url='+url)

It should make it work.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks I looked back at the reference I was using and it turns out I did miss that bit However, it still isnt sending me e-mails

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.