Current location: Hot Scripts Forums » Programming Languages » PHP » Need help with a form....


Need help with a form....

Reply
  #1 (permalink)  
Old 01-16-05, 05:14 PM
DazzlyWorks DazzlyWorks is offline
Newbie Coder
 
Join Date: Jan 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Need help with a form....

Okay the problem is when I test it out it dosen't send an email here is the link to the form: Form

Heres the code where the problem is:
PHP Code:

<? //initilize PHP

if($Submit//If Submit is hit
{
    
mail("dazzlyworks@gmail.com""$name""$email""$button""$website name""$siteurl""linkimageurl""linkimagepage""$subject""$comments");
}

$URL="http://www.dazzlyworks.tk";
header ("Location: $URL");
?>

Thank You for Contacting DazzlyWorks, we will get back to you shortly...

<html>
<head></head>
<body>
</body>
It says I can only have 5 parameters, How do I have 10?

Also in IE its all messed up, but not in firefox how do I fix this?
Reply With Quote
  #2 (permalink)  
Old 01-16-05, 05:38 PM
1jetsam 1jetsam is offline
Wannabe Coder
 
Join Date: Apr 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
I'm not sure why you have 10 parimiters.

This is how it should be:
PHP Code:

$to $_POST["to"];

$from $_POST["from"];
$subject $_POST["subject"];
$message $_POST["message"];
$headers "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$headers .= "From: " $from "\r\n";
$mailsent mail($to$subject$message$headers); 
This should work because I copied and pasted little bits of my email spammer program that does work. Also The mail() function works differently with servers. Sometimes you enter in the from field, for example "me" and it comes out "me@myhost.com" rather than just "me". If it does come out as "me@myhost.com", you better be sure you got that to email address right, otherwise it bounces back (Imagine that with my email spammer program - it can send repeat emails...)

Hope that helps.
__________________
Quate CMS 0.3.3 Released - A simple, fast Content Management System.
Reply With Quote
  #3 (permalink)  
Old 01-16-05, 05:41 PM
DazzlyWorks DazzlyWorks is offline
Newbie Coder
 
Join Date: Jan 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks, but how do I add the other parameters, I need 10 as you can see in my form...

and where do I put my email address sorry im not much of a programer.
Reply With Quote
  #4 (permalink)  
Old 01-16-05, 06:01 PM
1jetsam 1jetsam is offline
Wannabe Coder
 
Join Date: Apr 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
I'm not sure you need all those. If you want variables to be in the message:
Code:
 $to = $_POST["to"];
$from = $_POST["from"];
$subject = $_POST["subject"];
$message = $_POST["message"];

// Added: 
$message = "Website: <a href=\"" .$_POST['siteurl']. "\">" .$_POST['website name']. "</a><br>" .$message. ""

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$headers .= "From: " . $from . "\r\n";
$mailsent = mail($to, $subject, $message, $headers);
You should be able to continue from there...
__________________
Quate CMS 0.3.3 Released - A simple, fast Content Management System.
Reply With Quote
  #5 (permalink)  
Old 01-16-05, 06:11 PM
DazzlyWorks DazzlyWorks is offline
Newbie Coder
 
Join Date: Jan 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks but where do I add my email address?
Reply With Quote
  #6 (permalink)  
Old 01-16-05, 06:23 PM
1jetsam 1jetsam is offline
Wannabe Coder
 
Join Date: Apr 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
For the email to send to or from something?
You'll need another page: submit.php
PHP Code:

<form action="submit2.php" method="post"><br>

To:<input name="to" type="text" value=""><br>
From:<input name="from" type="text" value=""><br>
Website: <input name="website name" type="text" value=""><br>
Website URL: <input name="siteurl" type="text" value=""><br>
Message:<input name="message" type="text" value=""><br>
</
form
Also name the script I gave you before as :submit2.php
__________________
Quate CMS 0.3.3 Released - A simple, fast Content Management System.
Reply With Quote
  #7 (permalink)  
Old 01-16-05, 06:26 PM
DazzlyWorks DazzlyWorks is offline
Newbie Coder
 
Join Date: Jan 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
okay im confused so have 3 scripts in the folder? cuz right now i have the index and the submit one
Reply With Quote
  #8 (permalink)  
Old 01-16-05, 06:39 PM
1jetsam 1jetsam is offline
Wannabe Coder
 
Join Date: Apr 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Copy and paste these scripts to a (html/php) editor:

submit2.php
PHP Code:

$to $_POST["to"];

$from $_POST["from"];
$subject $_POST["subject"];
$message $_POST["message"];

// Added: 
$message "Website: <a href=\"" .$_POST['siteurl']. "\">" .$_POST['website name']. "</a><br>" .$message""

$headers "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$headers .= "From: " $from "\r\n";
$mailsent mail($to$subject$message$headers); 
submit.php
PHP Code:

<form action="submit2.php" method="post"><br>

To:<input name="to" type="text" value=""><br>
From:<input name="from" type="text" value=""><br>
Website: <input name="website name" type="text" value=""><br>
Website URL: <input name="siteurl" type="text" value=""><br>
Message:<input name="message" type="text" value=""><br>
<
input type="submit">
</
form
You may have other pages on your website, but theses are the ones that do the process. To test them out, view the "submit.php" page (when it is uploaded).

I think that about sums it up. I you don't understand, ask your host about server uploading or whatever your server problems are (unless it is a php error).
__________________
Quate CMS 0.3.3 Released - A simple, fast Content Management System.
Reply With Quote
  #9 (permalink)  
Old 01-16-05, 06:51 PM
DazzlyWorks DazzlyWorks is offline
Newbie Coder
 
Join Date: Jan 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks!!!!!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
checkCheckboxGroup broken after form consolidation ski_woman JavaScript 0 01-12-05 11:00 AM
formmail problem gscraper Perl 12 08-27-04 03:06 AM
Limit the form submission according to time bionicsamir PHP 7 05-09-04 11:10 PM
make form box TEXT? lylesback2 JavaScript 2 04-05-04 06:58 PM
SQL database registration form help vinhkhuong PHP 3 10-10-03 03:49 AM


All times are GMT -5. The time now is 05:27 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.