PDA

View Full Version : Help - Code on Site which I do not recognise



ashaffiliates
23 Mar 2011, 11:23 AM
Hi,

Recently discovered the following code on my site which i do not recognise.

I think it may be some sort of hacking attempt to pass details onto other site or something - please can anyone help as I am definitely sure this has no place on that page of my site - http://bit.ly/bnqpE7

<script language="javascript" type="text/javascript">
function contactform(usraction)
{
var myFrom = document.contactus;

if(usraction == 'submit')
{
if(myFrom.name.value=="")
{
alert('Please enter your name.');
myFrom.name.focus();
return false;
}
if((myFrom.email.value=="") || (myFrom.email.value.indexOf('@')==-1) || (myFrom.email.value.indexOf('.', myFrom.email.value.indexOf('@')+2)==-1) || (myFrom.email.value.lastIndexOf('.')==myFrom.email.value.length-1))
{
alert('You must enter a valid email');
myFrom.email.focus();
return false;
}
if(myFrom.comments.value=="")
{
alert('Please enter comments.');
myFrom.comments.focus();
return false;
}
myFrom.submit();
return true;
}
if(usraction == 'cancel')
{
myFrom.name.value="";
myFrom.email.value="";
myFrom.comments.value="";
return false;
}
}
</script>


Please help

Cheers

Ash

Adam.Baldry
25 Mar 2011, 11:06 AM
This is just a script to check the values of a form and prevent it from sending if incorrect values are entered. While this code is not going to send information elsewhere the question of where it came from is a worrying one. What level of conrol do you have over the domain and what have you used to build the site?