July 31, 201313 yr Hello. I am making a contact form for my Brothers website. I have been using a tutorial to make it and code it with php. The problem I am having is testing it with xampp, plus I haven't a clue when it comes to php, I have a few problems that I would be very greatful if anyone could help me out. Cheers Stuey
July 31, 201313 yr You need to configure a mail server on your machine to send mail through Localhost. A work around is to test the email on a hosting server, or you can check out this link: http://stackoverflow.com/questions/3429605/how-to-send-mail-through-localhost
July 31, 201313 yr Author I fixed the port and password and it sent it. Lyndsey strikes again How can I re direct the message to another page?
July 31, 201313 yr Author When I get the email there is nothing. Why isn't it sending me what is in the fields?
July 31, 201313 yr Looks like a syntax error on your $body variable declaration; £message should be $message $body = "From: $name \n Email: $email \n Message: $message \n"; To redirect to another page once it's done, use the header function: if(mail($to, $subject, $body, $headers)) { header('location: the_page.html'); } else { echo "oops, error!"; } Hope this helps.
Create an account or sign in to comment