Jump to content

php echo ...


heirani1

Recommended Posts

im new to php so please bare with me, im working on this sign up script and a message is echoed in the php, i want to echo the message in the html so i can move and position the text easier. hope you can help, heres the code ...

 

<?php
include('config.php');

// table name 
$tbl_name=temp_members_db;

// Random confirmation code 
$confirm_code=md5(uniqid(rand())); 

// values sent from form 
$name=$_POST['name'];
$email=$_POST['email'];
$password=$_POST['password'];
$country=$_POST['country'];

// Insert data into database 
$sql="INSERT INTO $tbl_name(confirm_code, name, email, password, country)VALUES('$confirm_code', '$name', '$email', '$password', '$country')";
$result=mysql_query($sql);

// if suceesfully inserted data into database, send confirmation link to email 
if($result){

// ---------------- SEND MAIL FORM ----------------

// send e-mail to ...
$to=$email;

// Your subject
$subject="Your confirmation link here";

// From
$header="from: [email protected]";

// Your message
$message="Your Comfirmation link \r\n";
$message.="Click on this link to activate your account \r\n";
$message.="http://localhost/Test/log/confirmation.php?passkey=$confirm_code";

// send email
$sentmail = mail($to,$subject,$message,$header);

}

// if not found 
else {
echo "Not found your email in our database";
}

// if your email succesfully sent
if($sentmail){
echo "Your Confirmation link Has Been Sent To Your Email Address.<br>
You will now be directed back to the login page.
<META HTTP-EQUIV=\"refresh\" content=\"2; URL=index.php\">";

}
else {
echo "Cannot send Confirmation link to your e-mail address";
}

?>

Link to comment
https://forums.phpfreaks.com/topic/110809-php-echo/
Share on other sites

use the print function for each tag, e.g. print "<div class=\"text\"></div>". The advantage of this function is its use to output more complicated actions and messages apposed to echo which is generally used to out put a single line of text.

 

My bullshit monitor just went off the scale

Link to comment
https://forums.phpfreaks.com/topic/110809-php-echo/#findComment-568644
Share on other sites

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.