LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-09-2012, 05:20 PM   #1
nothing07
LQ Newbie
 
Registered: Jun 2012
Posts: 11

Rep: Reputation: Disabled
is it something different about 000webhost and localhost that stop scripts from worki


Unable To Send Any Mail

the warning massage is
Code:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\Test\registrationcheck.php on line 37
the script for registrationcheck
Code:
<?php
include('DB_connect.php'); //connect to database

$name = strip_tags($_POST['name']);
$email = strip_tags($_POST['email']);
$password = strip_tags($_POST['password']);
$repeat_password = strip_tags($_POST['repeat-password']);

//test to see if name only contains letters
if(!preg_match(("[^A-Za-z ]"),$name))
{
	//remember to make one for "too long name"
	
	//check if email in use
	
	$checkemailcommand="SELECT * FROM users WHERE email = '$email'";
	$checkemailresult = mysql_query($checkemailcommand);
	$num=mysql_num_rows($checkemailresult);

	if($num==0){
	
		//if passwords match up (should do it for email to but it ist done)
		 if($password==$repeat_password){
		 
			//we generate random code for confirmation email
			$confirm_code=md5(uniqid(rand()));
			
			//then we insert their info in a temporary database
			$insertinfocommand="INSERT INTO temp SET code='$confirm_code', name = '$name', email = '$email', password = '$password'";
			$insertinforesult=mysql_query($insertinfocommand);
			
			//if the info is succsesfully entered temp, we are going to send an email
			if($insertinforesult){
				
				$message = "Your Confirmation link: \r\n http://localhost/test/confirmation.php?passkey=$confirm_code";  //link to the confirmation page where the var passkey is the same as their code
				
				$sendmail = mail("$email","Redbook confirmation code","$message");
				
				echo "confirmation link have been sent to your email ".$email;
			}else{
			echo "couldn't find your email in our database";
			}
		 
		 		 }else{
		 echo "password doesn't match";
		 //header("Location:passworddoesntmatch.html")
		 }
		 
	}else{
	echo "email in use";
	//header("Location:alreadyregistered.html");
	}
	
}else{
echo "invalid name";
//header("Location:invalidname.html");
}



?>
I think i have to write in something about "From" where i tell where the email its sent from, don't really know if its right or not I am new at this

and how can you change the name of the thread??

Last edited by nothing07; 06-10-2012 at 06:13 AM. Reason: I manged to fix the other problem, that i posted before in this thread
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix: SASL & Send mail through scripts frol localhost snjv Linux - Server 2 06-02-2007 10:53 AM
[SOLVED] Printing Help !! (http://localhost:631/) (WTF did it stop working?) MBA Whore Linux - Hardware 31 08-28-2006 01:35 AM
How do I get cron mail to stop forwarding through localhost on CentOS 4? alexmkt Linux - Enterprise 3 11-23-2005 01:27 PM
Oracle 9i Start/Stop scripts vous Linux - Software 0 01-16-2004 01:59 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration