Jump to content

[SOLVED] Beginner Needs Help


Ajna

Recommended Posts

 

Greetings!

 

I am a beginner of PHP. I have a Flash Contact Form Template that I downloaded from the internet. The Contact Form sends the email to my address but the  Subject, Message and From does not appear in the email.

 

I would appreciate any assistance on what I need to do to correct it.

 

Here is the code...

 

<?

   $to = "your@email.com";
   $msg = "$name\n\n";
   $msg .= "$message\n\n";

  mail($to, $subject, $msg, "Message From: Online client\nReply-To: $email\n");

?>

 

Where it says your email I have put my email.

 

Here is the page

http://nvi.hostei.com/gptw/form.html

 

Thanks in advanced.

 

 

Link to comment
Share on other sites

That is how the code was given to me.

I copy and paste what I see and follow the instructions included.

 

Like I said I am a beginner.

I am posting at this site because it seems friendly to those learning PHP. I of course have lots to learn.

 

Can anyone suggest something that will work and is simple?

 

 

 

Link to comment
Share on other sites

There are countless form processors out there for download. Many of them include very concise install and config instructions.

 

You can also look for online form generators that will create a form based on your input.

 

Google "php form processor" and you can spend the rest of the day finding one that fits your needs.

Link to comment
Share on other sites

If I were you I would consider finding a new code.

here is one from php.net:

<?php
// multiple recipients
$to  = 'aidan@example.com' . ', '; // note the comma
$to .= 'wez@example.com';

// subject
$subject = 'Birthday Reminders for August';

// message
$message = '
<html>
<head>
  <title>Birthday Reminders for August</title>
</head>
<body>
  <p>Here are the birthdays upcoming in August!</p>
  <table>
    <tr>
      <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
    </tr>
    <tr>
      <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
    </tr>
    <tr>
      <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
    </tr>
  </table>
</body>
</html>
';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";

// Mail it
mail($to, $subject, $message, $headers);
?>

Link to comment
Share on other sites

Ajna.

 

I have decompiled your form.swf and I found this

 

        loadVariablesNum("form.php", 0, "POST";

 

it means it uses POST it also means you have error there.. you are missing closing bracket before the ; (semicolon).. maybe my decompiler is bad.

<?

 

  $to = "your@email.com";

  $msg = "$name\n\n";

  $msg .= "$message\n\n";

 

  mail($to, $subject, $msg, "Message From: Online client\nReply-To: $email\n");

 

?>

 

has to be

<?php
   $name = $_POST['name'];
   $subject = $_POST['subject'];
   $message = $_POST['message'];
   $email=  $_POST['email'];

   $to = "your@email.com";
   $msg = "$name\n\n";
   $msg .= "$message\n\n";

  mail($to, $subject, $msg, "Message From: Online client\nReply-To: $email\n");

?>

 

should work then.

Link to comment
Share on other sites

I found some codes that finally worked.

 

Thanks pkedpker!

When I get a chance I will definitely use the codes that you have posted.

Since you went through all of that work. :)

Then I will post my results.

Link to comment
Share on other sites

  • 2 weeks later...

pkedpker,

 

I finally got a chance to add the corrected codes that you provided.

 

Your decompiler misread the code... there was a bracket before the semicolon.

 

Your PHP script allowed the email to be sent but the name, email, subject and message was not filled in.

Thank You for your time.  Truly appreciated it.

 

I would like to learn more, could you provide some good beginner sources to learn PHP?

 

 

Ajna

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.