Jump to content

Newbie to PHP, need help!


Recommended Posts

I am not familiar with PHP, but I tried running through the tutorial on how to the PHP Mailer form to work, http://www.phpfreaks.com/tutorials/130/3.php. I uploaded the files to my server, but I don't know what to do next. I had a CGI script working until my hosting company upgraded their perl and the script is no longer compatible with the latest version. All I wanted to do is create a simple feedback form on my site and have the results sent to my e-mail box. I don't get how the PHP communicates with the form. Any suggestions and help would greatly be appreciated. ???

 

Thanks!

 

 

Link to comment
Share on other sites

1- submit your form as usual to any .php file e.g. process_form.php

2- here you can get all your form variables in PHP built-in array $_POST

3- You can access it as

<?php
   $_POST['form_field_name1'];
   $_POST['form_field_name2'];
   $_POST['form_field_name3'];
?>

 

4- concat all your form field the way you want.

<?php
   $email_message = '';
   $email_message .=   $_POST['form_field_name1'];
   $email_message .=   $_POST['form_field_name2'];
   $email_message .=   $_POST['form_field_name3'];
?>

5- now you have your message ready to be sent to any email address using following php function
bool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]] )
[url]http://php.net/mail[/url]

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.