Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Pages: [1] 2
Send this topic | Print
Topic: A "Contact Me" section without having to give email  (Read 10032 times)
« on: June 04, 2005, 08:23:53 PM »
mariomics Offline
Newbie

View Profile
*
Posts: 8



I want to make, in the contact me section of my website (mariomics.t35.com),a little form with the following inputs, followed by different input types:

Subject: *text box goes here*
Type of query: *drop down box goes here with the choices: complaint, suggestion, question, idea for comic, shout out, other*
Email (if reply is necessary): *text box*
Messgage: *big text box*
*submit button*

When the submit button is pressed, an email is sent to my address and a "Thank you, your message has been submitted." alert come up.However, the only coding I know is HTML and basic JavaScript, so I'm out of luck doing it myself. Can anyone out there tell me how to do this please?
Report to moderator   Logged

 
« Reply #1 on: June 04, 2005, 09:02:36 PM »
adragons
Guest

well, mail is disabled on free host.
Report to moderator   Logged
« Reply #2 on: June 05, 2005, 08:29:52 AM »
mariomics Offline
Newbie

View Profile
*
Posts: 8



Really? Even the basic mailto links dont work?
Report to moderator   Logged
« Reply #3 on: June 05, 2005, 09:04:00 AM »
Working for Rielst...
Ryanbi Offline
Junior Member
Newbie

View Profile WWW
*
Posts: 34



A mailto is used by the browser to send e-mail with the default e-mail client. So mailto should work.
Report to moderator   Logged
« Reply #4 on: June 05, 2005, 09:46:54 AM »
adragons
Guest

Yes mailto will work but that requires you to put your email on your website...
Report to moderator   Logged
« Reply #5 on: June 05, 2005, 12:56:20 PM »
mariomics Offline
Newbie

View Profile
*
Posts: 8



Yes, I realise that! Which is why I am wondering if there was a php script or something I could use?
Report to moderator   Logged
« Reply #6 on: June 05, 2005, 01:16:07 PM »
adragons
Guest

One thing you could do, is make a php script to simulate mail where it doesnt mail but writes a message to a text file on your account. That way you can mail them/receive their message.
Report to moderator   Logged
« Reply #7 on: June 05, 2005, 06:11:45 PM »
mariomics Offline
Newbie

View Profile
*
Posts: 8



One problem:I havnt a clue on how to write/use PHP, and I have tried to learn it before but did not suceed...
Report to moderator   Logged
« Reply #8 on: June 06, 2005, 09:27:29 AM »
Working for Rielst...
Ryanbi Offline
Junior Member
Newbie

View Profile WWW
*
Posts: 34



Just use the code
Code:
<?php

$name 
$_POST['name'];
$message $_POST['message'];
$type $_POST['type'];
$email $_POST['email'];

$write2file '
Name = '
.$name.'
Message = '
.$message.'
Type = '
.$type.'
E-Mail = '
.$email.'
'
;

$file2write 'path/to/your/file.dat';
$write = @fopen($file2write,"w");
@
fwrite($write$write2file);
@
fclose($write);

if(
$write){echo 'Your message has been submitted !';}
else{echo 
'ERROR : Your message has not been submitted !';}
?>

Save that in post.php

In the page you want to show, write
Code:
<form action="post.php" method="post">
Name<input type="text" name="name"><BR>
Email<input type="text" name="email"><BR>
Type
<select name="type">
<option value="complaint">Complaint</option>
<option value="suggestion">Suggestion</option>
<option value="question">Question</option>
<option value="idea">Idea for comic</option>
<option value="other">Other</option>
</select><BR>
<textarea name="message"></textarea><BR>
<input type="submit">

</form>
Report to moderator   Logged
« Reply #9 on: June 06, 2005, 10:11:40 AM »
mariomics Offline
Newbie

View Profile
*
Posts: 8



Ty, but, for symplicities sake, is there any way to configure the script so that the responce is sent in a email to mariomics@gmail.com? If not, this will work well enough. Thanks again.
Report to moderator   Logged
« Reply #10 on: June 06, 2005, 11:12:58 AM »
Working for Rielst...
Ryanbi Offline
Junior Member
Newbie

View Profile WWW
*
Posts: 34



maybe you could just searching on google for free form submitter
Report to moderator   Logged
« Reply #11 on: July 13, 2005, 11:04:50 AM »
John Offline
Newbie

View Profile
*
Posts: 3



Just use the code
Code:
<?php

$name 
$_POST['name'];
$message $_POST['message'];
$type $_POST['type'];
$email $_POST['email'];

$write2file '
Name = '
.$name.'
Message = '
.$message.'
Type = '
.$type.'
E-Mail = '
.$email.'
'
;

$file2write 'path/to/your/file.dat';
$write = @fopen($file2write,"w");
@
fwrite($write$write2file);
@
fclose($write);

if(
$write){echo 'Your message has been submitted !';}
else{echo 
'ERROR : Your message has not been submitted !';}
?>

Save that in post.php

In the page you want to show, write
Code:
<form action="post.php" method="post">
Name<input type="text" name="name"><BR>
Email<input type="text" name="email"><BR>
Type
<select name="type">
<option value="complaint">Complaint</option>
<option value="suggestion">Suggestion</option>
<option value="question">Question</option>
<option value="idea">Idea for comic</option>
<option value="other">Other</option>
</select><BR>
<textarea name="message"></textarea><BR>
<input type="submit">

</form>

Hi, I have tested your code, it works.
But there is a problem, in the file where the message goes, the latest post overwrites all the others.
you only have the latest post in other words.
Could someone who is good with scripts fix this?

Thanks, John
« Last Edit: July 13, 2005, 11:08:10 AM by John » Report to moderator   Logged
« Reply #12 on: July 13, 2005, 02:45:02 PM »
John Offline
Newbie

View Profile
*
Posts: 3



looks like I worked it out myself.
I replaced the 'w' with 'a+'

John  wink
Report to moderator   Logged
« Reply #13 on: May 01, 2006, 02:18:29 PM »
pokeworld
Guest

Did you know that HTML works in the section where you write the message that appears when the form is submitted
Report to moderator   Logged
« Reply #14 on: May 02, 2006, 12:25:36 PM »
Do you practice what you preach?
cool1.t35.com Offline
Member

View Profile WWW
***
Posts: 161



this can proably be fixed by adding the

<p> tag.
Report to moderator   Logged

The Light can never overpower the darkness alone. Love is needed.

Islam is peace.

http://www.islamhope.net
 
Pages: [1] 2
Send this topic | Print
Jump to:  

Powered by SMF | SMF © 2006-2008, Simple Machines LLC