change $link_to_user = "<a href=/view.php?id=$id>view link</a>
to
$link_to_user = "<a href=/view.php?id=$id>view link</a>";
here you go, the complete code
<?
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','staff');
pt_register('POST','cnum');
pt_register('POST','boss');
pt_register('POST','jury');
pt_register('POST','rate');
pt_register('POST','comments');
$comments=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $comments);
if($staff=="" || $cnum=="" || $boss=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if($errors==1){
echo $error;
}else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message = "Prepared By: ".$staff."Case No.: ".$cnum."Boss: ".$boss."Jury: ".$jury."Rate: ".$rate."Comments: ".$comments."";
mail("me@here.com","Memo - $cnum",$message,"From: $staff");
$link = mysql_connect("blah","blah","blah");
mysql_select_db("memos",$link);
$query="insert into conflicts (staff,cnum,boss,jury,rate,comments) values ('".$staff."','".$cnum."','".$boss."','".$jury."','".$rate."','".$comments."')";
mysql_query($query);
$id_query = "select id from conflicts where ";
$id_query .= "staff = '".$staff."',;
$id_query .= "cnum = '".$cnum."',;
$id_query .= "boss = '".$boss."',;
$id_query .= "jury = '".$jury."',;
$id_query .= "rate = '".$rate."',;
$id_query .= "comments = '".$comments."'";
$id_result = mysql_query($id_query);
if(mysql_num_rows($id_result)==1){
$id_row = mysql_fetch_array($id_result);
$id = $id_row['id'];// assuming that id is the name in the table
$link_to_user = "<a href=/view.php?id=$id>view link</a>";
print($link_to_user);
// mail this to the user.
}
}
reg
kevin