Jump to content

Recommended Posts

Posted (edited)

Hello there,

 

I am having a bit of trouble setting up my form using the cPanel's Formmail Clone.

 

The script runs fine, but for documentation I am sent to Matt's Script Archive. However, since the script here is a clone, it does not seem to accept the same variables and options.

 

I am trying to set a custom subject instead of the default 'No subject given', which looks (to me) really stupid on a form submission.

 

html looks like this, according to documentation:

 

<input type=hidden name="subject" value="Sent by My Form">

 

 

Anyone else had and fixed this little issue I couldn't find the answer performing a search on the forum, but since I'm a newbie, I may have done something wrong in the search as well... :)

 

Thanks in advance...

 

Cygni

Edited by Cygni
Posted

Hi Cygni

 

Because of continued problems with spammers attempting to exploit the cgi-sys install of formmail and cgiemail they have generally been disabled on all servers. It looks like there was part of it enabled on your server.

 

There are a number of alternative, safe form mail scripts which can do the job you want, will be more secure, and will enable you to set the subject properly.

Posted
There are a number of alternative, safe form mail scripts which can do the job you want, will be more secure, and will enable you to set the subject properly.

 

Thanks Andy!

 

I'll have a look around for the alternatives. :)

Posted

If all you are after is a script that takes an email address and message froma form then send it to your it would be easier, and more secure, to just write your own. If all yo uwant is something that simple email me with the requirments and I'll throw something together.

Posted
If all yo uwant is something that simple email me with the requirments and I'll throw something together.

 

Wow, that would be nice! I don't know a thing about scripting (yet)... :blink:

 

I'm more into Flash and graphics and HTML than programming... :)

 

What information do you need exactly?

Posted

Yup. And I'm using a number of different form fields, like drop down menu's and stuff for it. I just don't like the standard 'No subject specified' line in the one I'm using now. f any of the scripts mentioned by other forum members can do that as well, what's the added worth and security in writing a new one?

 

Or do you just like to script around for those who need assistance (or can't do it themselves at all, like me)? :)

Posted

I just like to make things for practise. It's always a good form of practise to make stuff based upon others specifications as then you have rules and guidelines to stick to.

Posted

A basic and quick generic form mailer. It just goes through all the submitted inputs and sends them in the form of inputname = inputvalue. You'd just usephp include to put the form where you want it and edit the obvious form in the script to however you want the form.

><?php
$messagesubject = 'Submitted Form'; //Subject for emails
$messageto = 'you@******'; // Where to send the emails to
$messagefrom = 'rom@******'; // address you want the emailsto be from
$successmess = '<b>Thank you for your input</b>'; //Message to say thanks.
$errormess = '<b>There was a problem submitting your form</b>'; // Message for when there is an error in sending

if (isset($_POST))
{
  $messagebody = '';
  while (list($name, $value) = each($_POST))
  {
     $messagebody .= $name.' = '.$value."\n";
  }
  if(@mail($messageto, $messagesubject, $messagebody, 'From: '.$messagefrom))
  {
     echo ($successmess);
  }
  else
  {
     echo ($errormess);
  }
}
else
{
echo ('
<form action="'.$_SERVER['PHP_SELF'].'" method="post">
<input type="text" name="input1">
<input type="submit">
</form>
');
}
?>

 

I could do one for you that checks the inputs but I would need to know the inputs you need and what is expected for each input.

Posted
I could do one for you that checks the inputs but I would need to know the inputs you need and what is expected for each input.

 

Wow, looks impressive... :) And this code just goes into my html where I want the form to be? So I don't have to refer to a script outside my html? Or was that a dumb question? :unsure:

 

On the quote, ...I always hate those forms you can't get past without filling out EVERYTHING they want to know, and then in the format they want to have it in... :blink:

 

Since I'm running the website of a church, not 'inputting' (new word?) selling info like credit card numbers and expiry dates or things like that, the only one I would like to have checked is if an e-mail address specified is a complete and possible e-mail address like a@b.c or so. :huh:

 

And I have special html pages with the 'Thank you' message. Not with an error message, because I didn't know how to get it clear to the server that an error occured at all... So (I can at least interpret SOME code) I would like a referer hyperlink instead of an echoed message.

 

I like this, I'd like to get into php some more when I would have the time for it. Have a book on it from Sitepoint.com on database driven websites. Very interesting, but I simply don't have that much time available... :offtopic: :D

Posted

Email me a copy of the form you want to use, any restrictions imposed on the inputs, which (if any) inputs are required, which inputs need to be verified and for what (ie email address, url) and what you want to happen upon a successful submittal and upon an error (ie new page, message where form was etc).

Posted

ps. I could easily alter the above script to send them to a nwe page upon success as well as just having the form in your page submit the data to the script rather than putting the script in your page.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...