Need A Quick Solution

A Member? Please Login  
type your username and password to login
Date: November 18, 2008, 02:24 PM
262262 members and 159640 Topics
Latest Member: Businessma
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Webmasters (Moderators: Sam Milla, uspry1)  |  Need A Quick Solution
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Need A Quick Solution  (Read 201 views)
greatdbanj
Need A Quick Solution
« on: October 13, 2007, 08:08 AM »

I av a contact page that has form in it. Bt i dnt knw aw 2 create a database n connect to the database. please help me
smartsoft (m)
Re: Need A Quick Solution
« #1 on: October 13, 2007, 12:47 PM »

i think u don't need to connect to that contact page or even it depends on you,  what most of us does is just to have a script to collect all information by customers and send them to our emails address e.g info@greatdbnaj.com so what you need is a php scripts that process the contact page and redirects them to thank you page,  thats if u use PHP ooo
greatdbanj
Re: Need A Quick Solution
« #2 on: October 13, 2007, 03:28 PM »

Smartsoft please throw more lite on d connectn as in php stuf
smartsoft (m)
Re: Need A Quick Solution
« #3 on: October 13, 2007, 04:05 PM »

THE HTML FORM ( just copy this or better still make some changes to the feild) and remember to save it as contact.html or whatever
======================================================================


<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HTML Mail Form</title>
</head>
<body>
<form action="send_mail.php" method="POST">
Name: <input type="text" name="name" size="30" /><br />
Email: <input type="text" name="email" size="30"/><br />
Subject: <input type="text" name="subject" size="30"/><br />
Text:<textarea name="text" name="text" cols="50" rows="10"></textarea><br />
<input type="submit" name="submit" value="Send" />
====================================================================================

==================================================================================
PHP SCRITPS THAT WILL PROCESS THE CUSTOMER REQUEST AND DUMB IT INTO YOUR EMAIL
==================================================================================
<?php
@extract($_POST);
$name = stripslashes($name);
$email = stripslashes($email);
$subject = stripslashes($subject);
$text = stripslashes($text);
mail(' youremail@domain.com ',$subject,$text,"From: $name <$email>");
echo("Thank you for your interest, your e-mail was sent.");
?>
</form>
</body>
</html>


REMEMBER TO CHANGE THE YOUREMAIL@DOMAIN.COM TO ANY EMAIL ADDRESS YOU WANT. AFTER THAT JUST MAKE SURE THE file is saved as "send_mail.php"


you can see In the next lines i  use the stripslah function to remove any non-alfanumeric characters from the user inputed data, thus making it user friendly. 

test it,  hope  that helpsssssssss



greatdbanj
Re: Need A Quick Solution
« #4 on: October 13, 2007, 05:51 PM »

Thanx 4 d codes bt i wnt 2 undastand one thing d other script does nt av an openin tag of html n also u mean i should type d script in another page and conect it to the submit buton once again thanx
greatdbanj
Re: Need A Quick Solution
« #5 on: October 13, 2007, 10:42 PM »

Helo i tried runin d code bt is showin ")echo("thank you for interest, your email was sent.");?>
greatdbanj
Re: Need A Quick Solution
« #6 on: October 13, 2007, 10:42 PM »

Helo i tried runin d code bt is showin ")echo("thank you for interest, your email was sent.");?> after d send button
krs1 (m)
Re: Need A Quick Solution
« #7 on: October 15, 2007, 12:25 PM »

hi greatdbanj,
here is a slight modification to the script smartsoft provided. it think it should fix the bugs you mentioned (remember the file name should still be send_mail.php):

<?php
@extract($_POST);
$name = stripslashes($name);
$email = stripslashes($email);
$subject = stripslashes($subject);
$text = stripslashes($text);
if(mail(' youremail@domain.com ',$subject,$text,"From: $name <$email>")) {
echo('Thank you for your interest, your e-mail was sent.');
} else { echo('<p>Oops! Mail could not be sent. SERVER ERROR</p>'); }
?>


The guidelines provided by smartsoft still applies

also make sure the contact.html looks like this:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HTML Mail Form</title>
</head>
<body>
<form action="send_mail.php" method="POST">
Name: <input type="text" name="name" size="30" /><br />
Email: <input type="text" name="email" size="30"/><br />
Subject: <input type="text" name="subject" size="30"/><br />
Text:<textarea name="text" name="text" cols="50" rows="10"></textarea><br />
<input type="submit" name="submit" value="Send" />
</form>
</body>
</html>
 
i hope it helps
webemerald (m)
Re: Need A Quick Solution
« #8 on: October 15, 2007, 01:23 PM »

i thought this should be a form to database and not to email, if u use dreamweaver, create a connection to the database and use the insert record server behaviour, set the required parameters. youll do it in less than 5mins.
my2cents (m)
Re: Need A Quick Solution
« #9 on: October 15, 2007, 02:11 PM »

I would also expect that just to b extra sure, the "trim" function should be used to remove any whitespaces from form fields, before applying "stripslashes".

So:
$name = trim($name);
then:
$name = stripslashes($name);

I hope this helps.
uspry1 (f)
Re: Need A Quick Solution
« #10 on: October 15, 2007, 07:13 PM »

Quote from: webemerald on October 15, 2007, 01:23 PM
i thought this should be a form to database and not to email, if u use dreamweaver, create a connection to the database and use the insert record server behaviour, set the required parameters. youll do it in less than 5mins.

Only if you want to keep track of all customer information on the database to be retrieve information to be edit, delete, or view purpose, you can create form directly to the database server instead of email. 

Guestbook Online, Business Directory Online, Registration Online, Credit Card Information with MD5 hash are the examples to store customer information on the database. It must be secured database to protect from Naughty Boys.
smartsoft (m)
Re: Need A Quick Solution
« #11 on: October 16, 2007, 01:41 AM »

Quote from: krs1 on October 15, 2007, 12:25 PM
hi greatdbanj,
here is a slight modification to the script smartsoft provided. it think it should fix the bugs you mentioned (remember the file name should still be send_mail.php):

<?php
@extract($_POST);
$name = stripslashes($name);
$email = stripslashes($email);
$subject = stripslashes($subject);
$text = stripslashes($text);
if(mail(' youremail@domain.com ',$subject,$text,"From: $name <$email>")) {
echo('Thank you for your interest, your e-mail was sent.');
} else { echo('<p>Oops! Mail could not be sent. SERVER ERROR</p>'); }
?>


The guidelines provided by smartsoft still applies

also make sure the contact.html looks like this:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HTML Mail Form</title>
</head>
<body>
<form action="send_mail.php" method="POST">
Name: <input type="text" name="name" size="30" /><br />
Email: <input type="text" name="email" size="30"/><br />
Subject: <input type="text" name="subject" size="30"/><br />
Text:<textarea name="text" name="text" cols="50" rows="10"></textarea><br />
<input type="submit" name="submit" value="Send" />
</form>
</body>
</html>
 
i hope it helps


thanks kris
 Post Your Nigerian Start Up Dot Com Ventures Here  Create Website In 30 Minutes Or Less Ebook Videos  Website Review !  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 
Google
 
Web www.nairaland.com
Sections: TV/Movies (2) Music/Radio (2) Celebrities Job Talk Jobs/Vacancies (2) Career Talk Romance Books Politics Sports Fashion Travel
Health Schooling Religion General(2) Business Webmaster Programming Computers Phones Cars & Trucks

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.