How do I create a contact form if I don't have PHP installed ?

aleca

New Member
Messages
2
Reaction score
0
Points
0
Hi, as far as I know, to be able to send a contact form, you need the PHP mail() function. As I don't have PHP installed, is there some other solution to do it ?
 

ichwar

Community Advocate
Community Support
Messages
1,454
Reaction score
7
Points
0
But then you need .net installed.

Aleca, x10's servers do have both php and mono's .net installed.
 

callumacrae

not alex mac
Community Support
Messages
5,257
Reaction score
97
Points
48
Subtle :)

I once heard of a way to send emails using javascript, but that's about as secure writing your email address, so probably slightly pointless :)
 

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
There is no way of sending an email without use of a server. You may be able to use AJAX to connect to a server, but not by JavaScript alone. The best you can do without a server is a mailto form, which uses the basic maito syntax:
HTML:
<html>
  <body>
    <form method="get" action="mailto:youremailaddress@gmail.com"enctype="text/plain">
      <input type="text" name="subject" value="subject..."/><br />
      <textarea name="body" />Type your message here...</textarea><br />
      <input type="reset" value="Reset" />
      <input type="submit" value="Send" />
    </form>
  </body>
</html>
This creates a mailto link which opens up the clients email client to send the message, using the email you supplied in the form (ex: outlook).
 
Last edited:

allofus

New Member
Messages
183
Reaction score
2
Points
0
or use an external smtp provider...
Edit:
I have a script that monitors file activity in a folder. If a file is accessed it triggers the script. THe files are accessed via an abyss webserver on the same machine and then the email is sent automatically.
Edit:
don't ask me why...
 
Last edited:

kkenny

Active Member
Messages
1,950
Reaction score
0
Points
36
If you can't use PHP MAIL, then using a SMTP method is your only other option that I know of. But unfortunately I don't know how to do it.
 

aleca

New Member
Messages
2
Reaction score
0
Points
0
Thanks for all your suggestions but I barely know a little PHP, I won't dear approach ASP :))

I searched the web a little and discovered the remotely hosted forms. I have to choose between http://www.freedback.com and http://www.123contactform.com. Both are free, Freedback has some ads and 123ContactForm requires a backlink. I think one of them will save my day :D
 

allofus

New Member
Messages
183
Reaction score
2
Points
0
there is a phpform generator in the softaculous installer on x10.

If you are hosting with x10 you have all you need to host this yourself.

go to your cpanel and take a look at the installer software. The form generator is easy to use and you will maybe learn a few things from seeing the coding it provides.
 

maattheeww

New Member
Messages
1
Reaction score
0
Points
0
If you use X10 host then you can do a html form that mails it via php...



Copy and paste below in notepad, save it as "sendresults.php"
PHP:
<?php
//--------------------------Set these paramaters--------------------------

// Subject of email sent to you.
$subject = 'form results'; 

// Your email address. This is where the form information will be sent. 
$emailadd = 'youremail@yourdomain.com';

// Where to redirect after form is processed. 
$url = 'http://www.yourdomain.com/confirmation.html'; 

// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0'; 

// --------------------------Do not edit below this line--------------------------
$text = "results from form:\n\n"; 
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>

Then your HTML form, I placed an example below of something you could do...

HTML:
<form action="http://www.yourdomain.com/sendresults.php" method="post">
<input type="text" name="name">
<input type="submit" value="Send">
</form>

Then you would click "send" it would send your form to your email, and redirect the user to "confirmation.html"

If your server doesn't host php, you can use an x10 host to host the "sendresults.php" and host your html on your html site...
 

sval23

New Member
Messages
7
Reaction score
0
Points
0
there is a phpform generator in the softaculous installer on x10.

If you are hosting with x10 you have all you need to host this yourself.

go to your cpanel and take a look at the installer software. The form generator is easy to use and you will maybe learn a few things from seeing the coding it provides.

I'm not seeing a form generator on the softaculous page, what's it called exactly.
 

deathevor

New Member
Messages
5
Reaction score
0
Points
0
As I know "mailto"function didn't work recently for some reasons. Does it works now?
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Don't threadjack, and don't resurrect long dead threads.
 

allofus

New Member
Messages
183
Reaction score
2
Points
0
I'm not seeing a form generator on the softaculous page, what's it called exactly.
phpFormGenerator is in fantastico, my error!

Personally I would not use it other than to create a few forms to see how they work then you can just do your own using the same coding principles!
 
Top