Jodi_the_g
Member
Registered: 7th Aug 01
Location: Washington D.C
User status: Offline
|
Right wrote a php contact form did not work despite the script being perfect and checked about a million times, decided it in perl then, wrote the script and once again it does not work. any ideas why not goes straight to the error page i set up both times
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
i take it, it emails you??
|
Jodi_the_g
Member
Registered: 7th Aug 01
Location: Washington D.C
User status: Offline
|
it should e-mail be but some reason it does not work
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
quote: Originally posted by Jodi_the_g
it should e-mail be but some reason it does not work
email me the script mate and ill run it on my server and see if i can get it going
|
Laney
Member
Registered: 6th May 03
Location: Leeds
User status: Offline
|
Is the mail(); set up on the server?
I think it is by default
|
Nismo
Member
Registered: 12th Sep 02
User status: Offline
|
easy option use CGI
|
Jodi_the_g
Member
Registered: 7th Aug 01
Location: Washington D.C
User status: Offline
|
do it in cgi as well nath but it just ain't working getting really fuck off now
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
write a simple script to send an email, then work from that....atleast then you will know that the email stuff should be working etc
|
Nismo
Member
Registered: 12th Sep 02
User status: Offline
|
did you find out if it had the send mail function on the server?
|
Jodi_the_g
Member
Registered: 7th Aug 01
Location: Washington D.C
User status: Offline
|
No but i got one installed and i know that that is correct and working just so confused now as i have tried everything
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
quote: Originally posted by Jodi_the_g
No but i got one installed and i know that that is correct and working just so confused now as i have tried everything
wack some echos or print to screens at certain points so you can see how far the script is going to - thats if the error thats coming up is fairly basic and isnt saying anything etc etc
eitherway lad, wack us the script if you want and ill see what i can do
|
Jodi_the_g
Member
Registered: 7th Aug 01
Location: Washington D.C
User status: Offline
|
e-mailed it to your hotmail account
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
havnt had chance to look at it properly, but its something to do with the form data parsing at the bottom (under main program) thats causing it i think.
print the strings to a text file or screen to see if there ok
|
Tim
Site Administrator
Registered: 21st Apr 00
User status: Offline
|
quote: Originally posted by Nismo
easy option use CGI
Um, and what do you think Perl and PHP are applications of? CGI is an interface (it's even in the name )
|
Jodi_the_g
Member
Registered: 7th Aug 01
Location: Washington D.C
User status: Offline
|
well its still pssing me right off
|
Laney
Member
Registered: 6th May 03
Location: Leeds
User status: Offline
|
<?php
$to = $contactemail;
$subject = "Subject";
$message_send = "
<html>
<body>
<p>
Text goes here
</p>
</body>
</html>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: bot@domain.co.uk";
mail ($to, $subject, $message_send, $headers);
?>
Thats the code that I use. I've never had any probs with it
|
Jodi_the_g
Member
Registered: 7th Aug 01
Location: Washington D.C
User status: Offline
|
Right got it to semi work now just messup on the last line of the script
now getting a
Parse error: parse error in /home/httpd/vhosts/jodimyatt.co.uk/httpdocs/feedback.php on line 47
thats the last line of the code and is just ?>
|
ed
Member
Registered: 10th Sep 03
User status: Offline
|
Should just need a ?> or you will have left out a closing statement somewhere - make sure all the if's while's e.t.c... start with a { and end with a }
|
Jodi_the_g
Member
Registered: 7th Aug 01
Location: Washington D.C
User status: Offline
|
<?
$mailto = 'jodimyatt@evolutiondevelopments.org.uk' ;
$subject = "Contact Us" ;
$formurl = "http://jodimyatt.co.uk/contact.htm" ;
$errorurl = "http://www.jodimyatt.co.uk/error.htm" ;
$thankyouurl = "http://www.jodimyatt.co.uk/thankc.htm" ;
$name = $_POST['name'] ;
$surname = $_POST['surname'] ;
$company = $_POST['company'] ;
$phone = $_POST['phone'] ;
$email = $_POST['email'] ;
$url = $_POST['url'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) ||empty($surname) || empty($phone) || empty($company) || empty($email) || empty($comments)) {
header( "Location: $errorurl" );
exit ;
//}
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$messageproper =
"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$name .
$surname .
$company .
$phone .
$email .
$url .
$comments .
"\n\n------------------------------------------------------------\n" ;
mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\nReply-To:
\"$name\" <$email>\nX-Mailer: chfeedback.php 2.02" );
header( "Location: $thankyouurl" );
exit ;
?>
Thats the script
|
Nismo
Member
Registered: 12th Sep 02
User status: Offline
|
quote: Originally posted by Tim
quote: Originally posted by Nismo
easy option use CGI
Um, and what do you think Perl and PHP are applications of? CGI is an interface (it's even in the name )
STFU Newbie
i do not work with PHP and Perl like you chump
|
Laney
Member
Registered: 6th May 03
Location: Leeds
User status: Offline
|
mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\nReply-To:
\"$name\" <$email>\nX-Mailer: chfeedback.php 2.02" ), "Location: $thankyouurl");
I think?
Edit - ?
[Edited on 22-11-2004 by Laney]
|
Jodi_the_g
Member
Registered: 7th Aug 01
Location: Washington D.C
User status: Offline
|
nope
|
ed
Member
Registered: 10th Sep 03
User status: Offline
|
I'm sure you don't need the slashes in the mail() part... I think
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
quote: Originally posted by Nismo
quote: Originally posted by Tim
quote: Originally posted by Nismo
easy option use CGI
Um, and what do you think Perl and PHP are applications of? CGI is an interface (it's even in the name )
STFU Newbie
i do not work with PHP and Perl like you chump
victor meldrew is coming out
|
Nismo
Member
Registered: 12th Sep 02
User status: Offline
|
|