Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,352 members, 7,815,741 topics. Date: Thursday, 02 May 2024 at 05:25 PM

Need A Quick Solution - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Need A Quick Solution (1176 Views)

A Quick Question For Bloggers. / Website Designer Needed For A Quick Job / Syskay's Outage - Quick Solution! (2) (3) (4)

(1) (Reply) (Go Down)

Need A Quick Solution by greatdbanj: 8:08am On Oct 13, 2007
I av a contact page that has form in it. Bt i dnt knw aw 2 create a database n connect 2 d database. Pls help me
Re: Need A Quick Solution by smartsoft(m): 12:47pm On Oct 13, 2007
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
Re: Need A Quick Solution by greatdbanj: 3:28pm On Oct 13, 2007
Smartsoft pls throw more lite on d connectn as in php stuf
Re: Need A Quick Solution by smartsoft(m): 4:05pm On Oct 13, 2007
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" />

Email: <input type="text" name="email" size="30"/>

Subject: <input type="text" name="subject" size="30"/>

Text:<textarea name="text" name="text" cols="50" rows="10"></textarea>

<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>"wink;
echo("Thank you for your interest, your e-mail was sent."wink;
?>
</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
Re: Need A Quick Solution by greatdbanj: 5:51pm On Oct 13, 2007
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 shd type d script in another page and conect it 2 d submit buton once again thanx
Re: Need A Quick Solution by greatdbanj: 10:42pm On Oct 13, 2007
Helo i tried runin d code bt is showin "winkecho("thank you for interest, your email was sent."wink;?>
Re: Need A Quick Solution by greatdbanj: 10:42pm On Oct 13, 2007
Helo i tried runin d code bt is showin "winkecho("thank you for interest, your email was sent."wink;?> after d send button
Re: Need A Quick Solution by krs1(m): 12:25pm On Oct 15, 2007
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>"wink) {
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" />

Email: <input type="text" name="email" size="30"/>

Subject: <input type="text" name="subject" size="30"/>

Text:<textarea name="text" name="text" cols="50" rows="10"></textarea>

<input type="submit" name="submit" value="Send" />
</form>
</body>
</html>

i hope it helps
Re: Need A Quick Solution by webemerald(m): 1:23pm On Oct 15, 2007
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.
Re: Need A Quick Solution by my2cents(m): 2:11pm On Oct 15, 2007
I would also expect that just to b extra sure, the "trim" function shd be used to remove any whitespaces from form fields, b4 applying "stripslashes".

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

I hope this helps.
Re: Need A Quick Solution by uspry1(f): 7:13pm On Oct 15, 2007
webemerald:

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 hackers.
Re: Need A Quick Solution by smartsoft(m): 1:41am On Oct 16, 2007
krs1:

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>"wink) {
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" />

Email: <input type="text" name="email" size="30"/>

Subject: <input type="text" name="subject" size="30"/>

Text:<textarea name="text" name="text" cols="50" rows="10"></textarea>

<input type="submit" name="submit" value="Send" />
</form>
</body>
</html>

i hope it helps


thanks kris

(1) (Reply)

[funny]404 Error Page[/funny] / Site Down - Etisalat Nigeria **FIXED** / Can I Get A Guide How To Download Or Where To Download Drupal 7 Bible

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 34
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.