Jump to content

PHP Registration form not working


alandean

Recommended Posts

Hi, php newbie here, web developer newbie too!

 

Some time ago I did a website which included a course registration form which someone else created for me in php.  This worked fine and I amended the original to work on another website.  I am currently updating this second website and the php has stopped working, and I am no longer in contact with the original developer of the code.

 

The form is at: http://www.bisntechnologies.com/register.htm, and the php is:

 

<?php

 

/* ------- Stuff You Can Change --------- */

 

$recipient = '[email protected]';

$redirect  = 'confirmation.php';

 

/* -------------------------------------- */

 

$name = $HTTP_POST_VARS['name'];

$company = $HTTP_POST_VARS['company'];

$position = $HTTP_POST_VARS['position'];

$telephone = $HTTP_POST_VARS['telephone'];

$email = $HTTP_POST_VARS['email'];

$interest = $HTTP_POST_VARS['interest'];

$clientip = $_SERVER['REMOTE_ADDR'];

 

$msg = "Name: $name\nCompany: $company\nPosition: $position\nTelephone: $telephone\nE-mail: $email\nInterest: $interest\n\nIP Address: $clientip";

 

$replymsg = "<html><body style=\"font-family: Trebuchet MS; font-size: 13px\"><p>Dear $name,</p><p>Thank you for registering.</p><p><a href=\"http://www.bisntechnologies.com\"><img border=0 src=\"http://www.bisntechnologies.com/images/NewLogo.jpg\" alt=\"BiSN Technologies Ltd\"></a></p></body></html>";

 

if (mail($email,'Registration',$replymsg,"MIME-Version: 1.0\r\nContent-type: text/html;charset=iso-8859-1\r\nFrom: [email protected]")) {

mail($recipient,'Registration Confirmation',$msg,"From: $email");

include($redirect);

} else {

  echo "<h4>\"$email\" is an invalid e-mail address. Please click the browser's Back button.</h4>";

}

 

?>

 

Putting in valid information gives the error:  "" is an invalid e-mail address. Please click the browser's Back button." which it didn't used to do.  I expect it is a very simple mistake but I cannot trace it.

 

Any help to pinpoint the problem greatly appreciated.

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/225039-php-registration-form-not-working/
Share on other sites

DA,

 

Thank you for the very prompt reply.

 

Have changed as you advised with a global search and replace.  The form appears to be working correctly now.

 

Thank you so much.

 

 

 

PE - Not sure what you mean but will check whwn I have more time.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.