/ Published in: PHP
Vitor......porque esta codigo não funciona?
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php // inputs: $to, $title, $tags, $subj, $code // computed: $id, $sys $errmsg = ''; $id = $_SERVER['REMOTE_ADDR']; if ($_SERVER['REMOTE_HOST']!='') $id.=' '.$_SERVER['REMOTE_HOST']; $to = $_REQUEST['to']; if ($to=='') { $errmsg = "A destination address is required.<br>"; } { $errmsg = "Invalid destination: ".$to."<br>Domain must be: ".$sys."<br>"; } $title = $_REQUEST['title']; $tags = $_REQUEST['tags']; $subj = $_REQUEST['subj']; $msg = $_REQUEST['code']; // connect to references data base $username=""; $password=""; $database=""; //put data into database $createdby="skye"; $created= $_REQUEST['who']; $type="video"; $url="blanck"; $query = "INSERT INTO references VALUES ('$title','$createdby','$created','$tags','$msg','$type','$url')"; ?> <center> <table border=1 bgcolor=#ffffff cellspacing=0 cellpadding=2><tr><td> <font face="verdana,arial,helvetica" size=-2> <i>Titulo:</i> <?php echo $title ?> <<?php echo $from ?>> [IP: <?php echo $id ?>]<br> <i>TAGs:</i> <?php echo $tags ?><br> <i>SUBJECT:</i> <?php echo $subj ?><br> </font> </td></tr><tr><td align=center> <font face="verdana,arial,helvetica" size=-2><b><?php if ($errmsg!="") echo $errmsg."Please try again."; else { // send message mail($to,$subj,'[ Visitor IP: '.$id." ]\n\n".$title."\n".$tags." ".$createdby." ".$created." ".$url." ".$type."\n".$msg."\n\n From: <".$from.'>'); echo "Thank you. Your message has been sent"; } ?><b></font> </td></tr></table> </center>