Hollow Gram
02-05-2010, 03:33 PM
Hey,
I'm having difficulty wrapping my mind over PHP syntax and I have a project that should already be online but it all hinges on getting the form to work. It's very simple, but for some reason all the scripts I've found and tried fail to work when I modify them and I don't understand why.
I need to send $name, $email, $phone and $message. I don't know why this is so difficult.
I've managed to get it to send me emails, but they're always blank. I have jQuery scripts and Google Analytics in the HTML but I don't know why that would cause any problems. Below is the code for the form, below that my <head> code:
<form id="inputArea" action="sendmail.php" method="post" enctype="text/plain">
<fieldset>
<p class="first">
<label for="name"></label>
<input type="text" name="name" id="name" size="30" onFocus="clearText(this)" value="Your Name" />
</p>
<p>
<label for="email"></label>
<input type="text" name="email" id="email" size="30" onFocus="clearText(this)" value="Your Email" />
</p>
<p>
<label for="phone"></label>
<input type="text" name="phone" id="phone" size="30" onFocus="clearText(this)" value="Your Phone Number" />
</p>
<p>
<label for="message"></label>
<textarea name="message" id="message" rows="12" cols="30" onFocus="clearText(this)">Your Message</textarea>
</p>
<p class="submit"><button type="submit">Send</button></p>
</fieldset>
</form>
<meta name="robots" content="index, follow" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="mytext" />
<meta name="keywords" content="mytext" />
<link REL="SHORTCUT ICON" HREF="favicon.ico">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript" src="js/slimbox2.js"></script>
<script type="text/javascript" src="js/easySlider1.5.js"></script>
<script type="text/javascript" src="js/scroll.js"></script>
<script>
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}
</script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-12630870-1");
pageTracker._trackPageview();
} catch(err) {}
</script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
$("#slider").easySlider();
});
//]]>
</script>
<script type="text/javascript">
function param() {
if(!("search" in location))return null;
var q=location.search,n,i,l,pn;
if(!q)return null;
if(q.charAt(0)!="?")return null;
q=q.substr(1);
q=q.split("&");
n=[];
l=q.length;
for(i=0;i<l;i++){
n[n.length]=q[i].split("=");
}
p=[];
pn=[];
l=n.length;
for(i=0;i<l;i++){
p[(decodeURI(n[i][0])).replace(/\+/g," ")]=(decodeURI(n[i][1])).replace(/\+/g," ");
pn[pn.length]=(decodeURI(n[i][0])).replace(/\+/g," ");
}
n=[];
l=arguments.length;
if(l==0)return pn;
for(i=0;i<l;i++){
if(arguments[i]+1==arguments[i]-0+1){if(arguments[i] in pn){n[n.length]=pn[arguments[i]];continue}}
if(arguments[i] in p){n[n.length]=p[arguments[i]];continue}
}
return n;
}
</script>
<script type="text/javascript">
onload=function(){
if(!param("refresh")){
if(location.search=="")location.search="?refresh=true"
else location.search=location.search+"&refresh=true"
}
}
</script>
<link href="printstyles.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/slimbox2.css" type="text/css" media="screen" />
I'm having difficulty wrapping my mind over PHP syntax and I have a project that should already be online but it all hinges on getting the form to work. It's very simple, but for some reason all the scripts I've found and tried fail to work when I modify them and I don't understand why.
I need to send $name, $email, $phone and $message. I don't know why this is so difficult.
I've managed to get it to send me emails, but they're always blank. I have jQuery scripts and Google Analytics in the HTML but I don't know why that would cause any problems. Below is the code for the form, below that my <head> code:
<form id="inputArea" action="sendmail.php" method="post" enctype="text/plain">
<fieldset>
<p class="first">
<label for="name"></label>
<input type="text" name="name" id="name" size="30" onFocus="clearText(this)" value="Your Name" />
</p>
<p>
<label for="email"></label>
<input type="text" name="email" id="email" size="30" onFocus="clearText(this)" value="Your Email" />
</p>
<p>
<label for="phone"></label>
<input type="text" name="phone" id="phone" size="30" onFocus="clearText(this)" value="Your Phone Number" />
</p>
<p>
<label for="message"></label>
<textarea name="message" id="message" rows="12" cols="30" onFocus="clearText(this)">Your Message</textarea>
</p>
<p class="submit"><button type="submit">Send</button></p>
</fieldset>
</form>
<meta name="robots" content="index, follow" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="mytext" />
<meta name="keywords" content="mytext" />
<link REL="SHORTCUT ICON" HREF="favicon.ico">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript" src="js/slimbox2.js"></script>
<script type="text/javascript" src="js/easySlider1.5.js"></script>
<script type="text/javascript" src="js/scroll.js"></script>
<script>
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}
</script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-12630870-1");
pageTracker._trackPageview();
} catch(err) {}
</script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
$("#slider").easySlider();
});
//]]>
</script>
<script type="text/javascript">
function param() {
if(!("search" in location))return null;
var q=location.search,n,i,l,pn;
if(!q)return null;
if(q.charAt(0)!="?")return null;
q=q.substr(1);
q=q.split("&");
n=[];
l=q.length;
for(i=0;i<l;i++){
n[n.length]=q[i].split("=");
}
p=[];
pn=[];
l=n.length;
for(i=0;i<l;i++){
p[(decodeURI(n[i][0])).replace(/\+/g," ")]=(decodeURI(n[i][1])).replace(/\+/g," ");
pn[pn.length]=(decodeURI(n[i][0])).replace(/\+/g," ");
}
n=[];
l=arguments.length;
if(l==0)return pn;
for(i=0;i<l;i++){
if(arguments[i]+1==arguments[i]-0+1){if(arguments[i] in pn){n[n.length]=pn[arguments[i]];continue}}
if(arguments[i] in p){n[n.length]=p[arguments[i]];continue}
}
return n;
}
</script>
<script type="text/javascript">
onload=function(){
if(!param("refresh")){
if(location.search=="")location.search="?refresh=true"
else location.search=location.search+"&refresh=true"
}
}
</script>
<link href="printstyles.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/slimbox2.css" type="text/css" media="screen" />