Moderators: Derry, Goldie, Harpo
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Working Mechanic
Posted
Hi there, I know this has been asked before, but for the life of me I can not get a form to work. I have researched and followed the tutorial, but I still am not having nay luck.

Now I do not know if it is something between my web page and the php, or my server, although when I run a test.php script on it it works fine with all the details coming up.

Would some people who are smarter than me please have a look to see if they can see what I am doing wrong - please...

The link to the page in question is

http://202.134.236.70/hbmc/contact.html

(deleted test.php link as it was no longer need for this thread.)

TIA
Ken..

This message has been edited. Last edited by: KBEagle,
 
Posts: 23 | Registered: January 08, 2008Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
Can you paste your SendMail.php script here on the forum? When I submitted a test, I was redirected back to your contact.html page, so I do not know what PHP errors may have occurred, if any.
 
Posts: 5083 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Working Mechanic
Posted Hide Post
<?
$ForwardTo="email_removed@supernerd.com.au";
$email=$_REQUEST['email'];
$entry=$_REQUEST['enq'];
mail($ForwardTo, "Enquiry", $entry, "From:$email");
header("Location: contact.html");
?>
 
Posts: 23 | Registered: January 08, 2008Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
My first thought is to change the first line from

<?

to

<?php

Some servers to not allow the short-hand <? method to signal a start of PHP code.
 
Posts: 5083 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Working Mechanic
Posted Hide Post
Thanks for the reply.

Unfortunately it did not make it work.
 
Posts: 23 | Registered: January 08, 2008Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
When you ran your PHP test, was it testing the mail() function? The problem may be with the way your host interfaces PHP with its mail system. You can run a simple test script:
<?php
$result = mail("you@your-email.com", "Test", "Just a test", "From:you@your-email.com");
echo "$result\n";
?>
Change the you@your-email.com to your email address, save the file as mailtest.php, and upload it to your server. Execute it from your browser address bar (supernerd.com.au/mailtest.php) and if it works you should see a "1" displayed on the page and should recieve a test email. If you see an error or "0", then there is something amiss in the way they have connected PHP mail, and you will have to contact their customer support for help.

I took a quick browse thru their FAQs and see they supply a formmail.pl script (a PERL script) for their users. You could possible use this script instead of trying to create your own. I'm sure you will find usage directions in the FAQs.
 
Posts: 5083 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Working Mechanic
Posted Hide Post
Thanks heap for the help Larry.

The one thing that I did find was that MY php.ini file was not pointing to a correct smtp server.

Next thing will be to look up how to set up a smtp server on my computer.

No wonder I was pulling hair out.
 
Posts: 23 | Registered: January 08, 2008Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
I saw that your domain was hosted thru 1&1; I assumed your site was also hosted there.

Are you using a server package like XAMPP or WAMP? I'm using the XAMPP package. I also use the Ability Mail Server from Code-Crafters. I got the Standard Lite version which is only $40, and easy to set-up and maintain.
 
Posts: 5083 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Working Mechanic
Posted Hide Post
WAMP. When I was setting up my weather station site, some of the software that is needed to collect data would only run in windows. Just made more sense to run a server on the same machine instead of adding FTP to the scenario.

Thanks for helping - pity I could not have worked it out before posting.
 
Posts: 23 | Registered: January 08, 2008Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
I assume you are using a router. If so, make sure you remember to open port 25 as a pass-thru to your server; it's needed for the SMTP server.
 
Posts: 5083 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Working Mechanic
Posted Hide Post
Yeah, I had that open. I have finally got it to do what I needed, now to alter the script to filter and check.

This has been one of the hardest things I have had to do, but half of the angst could have been reduced if I knew that my php.ini needed tweaking.

Oh well, should work now for everyone, just hope that when I ftp it to it's home site that it will still work.
 
Posts: 23 | Registered: January 08, 2008Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 


™ & © 1998 - 2008, Virtual Mechanics Inc. All rights reserved.