Jump to content

my php dies when i add little html


alwaysme

Recommended Posts

hello folks.....i have a script installed where u can send your resume...anyhow the code from the resume submission form works when i have it on its own which is a white page with a form only

 

once i add simple HTML even little or one line it wont work and doesnt redirect or continue to successful page......

 

 

Working version no HTML

<?php
/*
* Resume application form
*/

ob_start();

require_once "../lib/etools2.php";
require_once "../display_fields.php";
include_once "../lib/misc.php";
include_once "../lib/mail.php";

no_cache();

include "top2.php";
if(!$allow_register) {
    ob_end_clean();
    exit();
}

/* cash all the form fields, produce the hashed names from it
* and put it in array with real names */
$field_types=get_field_types('resume');


/*
* Show a form
*/
if($check!=$msg_resume_register[FINISH]) {
    BeginForm(2,0,$msg_resume_register[HEADER1]);
    FrmEcho("<tr><td colspan=3>$msg_resume_register[TEXT]</td></tr>");
    if($job2)
FrmEcho("<tr><td colspan=3 bgcolor=#dbe5ef class=whiteborders>
    $msg_resume_register[LOGIN]</td></tr>");
    FrmItemFormat("<tr><td width=31% bgcolor=#dbe5ef align=right class=whiteborders><b>$(req) $(prompt) $(bad)</b></td>
<td width=69% class=whiteborders bgcolor=#f5f5f5 colspan=2>$(input)</td></tr>\n");
    display_fields('resume','',1," active=1 and type<>22 and type<>21",array(
'bold_login'=>1/*,'fparam'=>' size=40'*/));
    frmecho("<input type=hidden name=job2 value='$job2'>");
#    EndForm('Continue');
    FrmEcho("<tr><td colspan=3 align=left bgcolor=#f5f5f5 class=whiteborders>
<input type=hidden name=check value='$msg_resume_register[CONTINUE_]'>
<input type=image src=../images/continue.jpg border=0></td></tr></table>");

}

/* step 2 */
if(($check==$msg_resume_register[CONTINUE_] && !$bad_form) || $check==$msg_resume_register[FINISH]) {
    if($check==$msg_resume_register[CONTINUE_]) {
unset($check);
unset($_POST['check']);
unset($HTTP_POST_VARS['check']);
$form_output='';
    }
    BeginForm(2,1,$msg_resume_register[HEADER2]);
    FrmItemFormat("<tr><td width=41% bgcolor=#dbe5ef align=right class=whiteborders><b>$(req) $(prompt) $(bad)</b></td>
<td width=59% class=whiteborders bgcolor=#f5f5f5>$(input)</td></tr>\n");
    display_fields('resume','',1," 0=1",array('show_resume'=>1));
    // display fields for upload .doc files and other attachments
    list($resume_file,$resume_file_required)=sqlget("select resume_file,resume_file_required from job_config");
    if($resume_file) {
$nfiles=1;
for($i=1;$i<=$nfiles;$i++) {
    InputField($msg_resume_register[RESUME_FILE],"f_resume_doc[]",array('type'=>'file',
        'required'=>($resume_file_required?'yes':'no'),'validator_param'=>array('type'=>'file')));
}
$nfiles=0;
for($i=1;$i<=$nfiles;$i++) {
    InputField($msg_resume_register[ADD_ATTACH],"f_resume_attach[]",array('type'=>'file','validator_param'=>array('type'=>'file')));
}
    }
    while(list($var,$val)=each($_POST)) {
if($var!='check')
    if(is_array($val))
	while(list($a,$b)=each($val))
	    FrmEcho("<input type=hidden name=$var"."[$a] value=\"$b\">\n");
    else
	FrmEcho("<input type=hidden name=$var value=\"$val\">\n");
    }
    EndForm($msg_resume_register[FINISH]);
}

# ْل‏هي üôï ?
if($bad_form) {
    $page_id=$x_title=$x_header=$x_footer=$x_bg=$x_has1=$x_has2=$x_has3=$x_has4=$x_has5=$x_hasbg=
$x_color=$x_font_size=$x_shading='';
    $_POST['check']=$_POST['check_x']=$_POST['check_y']='';
    $check=$check_x=$check_y='';
    ob_end_clean();
    include "top2.php";
}
ShowForm();

/*
* Submit form
*/
if($check==$msg_resume_register[FINISH] && !$bad_form) {
    $fields=$vals=array();
    if($f_resume) {
$f_resume=addslashes(stripslashes($f_resume));
$fields[]='resume';
$vals[]=$f_resume;
    }

    /* we want to fetch confirmation message body here
     * to expand some macros in a loop below */
    // Job Application Email
    list($body,$from,$subject,$html,$return_path,$reply_to)=sqlget("
select body,from_addr,subject,html,return_path,reply_to from system_emails
where email_id=2 and active=1");
    if(!$from)
$from="noreply@$email_domain";
    // New Resume email
    list($staff_from,$staff_subject,$staff_body,$staff_active,
$staff_reply_to,$staff_return_path)=sqlget("
select from_addr,subject,body,active,reply_to,return_path from system_emails
where email_id=4");
/*    $fp=fopen($url,'r');
    if($fp) {
while(!feof($fp)) {
    $html.=fgets($fp);
}
fclose($fp);
    }
*/
    /* process fields in a loop */
    reset($_POST);
    while(list($field,$val)=each($_POST)) {
$tmp_arr=explode('_',$field);
if($tmp_arr[0]=='resume' && $tmp_arr[1]!='id') {
    array_shift($tmp_arr);
    $field=join('_',$tmp_arr);
    if(!in_array($field_types[$field],$dead_fields)) {
	if($field_types[$field]==7 || $field_types[$field]==24) {
	    $f_login=$val;
	}
	if($field_types[$field]==5) {
	    if($val)
	    	$val2='Yes';
	    else $val2='No';
	}
	else if(in_array($field_types[$field],$multival_arr)) {
	    if(in_array($field_types[$field],$manyval_arr)) {
		$val2=array();
		for($i=0;$i<count($val);$i++) {
		    list($tmp)=sqlget("
			select name from resume_$field"."_options
			where resume_$field"."_option_id='$val[$i]'");
		    $val2[]=$tmp;
		}
    		$val=join('|',$val);
		$val2=join('; ',$val2);
	    }
	    else 
		list($val2)=sqlget("
		    select name from resume_$field"."_options
		    where resume_$field"."_option_id='$val'");
	}
	else $val2=$val;
        $fields[]="custom_".$field;
	$vals[]=$val;
    }
    else if($field_types[$field]== {
	$f_password=$val;
    }
    $body=str_replace("%$field%",$val2,$body);
    $html=str_replace("%$field%",$val2,$html);
    $staff_body=str_replace("%$field%",$val2,$staff_body);
    $staff_subject=str_replace("%$field%",$val2,$staff_subject);
}
    }

    $fields=join(',',$fields);
    $vals=join("','",$vals);
    if($vals) {
        $vals=",'$vals'";
        $fields=",$fields";
    }

    if($f_login) {
$q=sqlquery("insert into user (name,password) values ('$f_login','$f_password')");
$user_id=sqlinsid($q);
sqlquery("insert into user_group (user_id,group_id) values ('$user_id',4)");
$user=$f_login;
$password=$f_password;
checkuser(4);
    }
    $f_first=addslashes(stripslashes($f_first));
    $f_last=addslashes(stripslashes($f_last));
    $f_address=addslashes(stripslashes($f_address));
    $f_address2=addslashes(stripslashes($f_address2));
    $f_city=addslashes(stripslashes($f_city));
    $f_state=addslashes(stripslashes($f_state));
    // fix state
    list($state)=sqlget("select code from states where name='$f_state'");
    if($state)
$f_state=$state;
    $f_zip=addslashes(stripslashes($f_zip));
    $f_phone=addslashes(stripslashes($f_phone));
    $q=sqlquery("
        insert into resume (status,added,added_by,user_id $fields)
values (1,now(),'$user_id','$user_id' $vals)");
    $resume_id=sqlinsid($q);
    /* add skills to resume */
    for($i=0;$i<count($f_skills);$i++) {
        sqlquery("
    insert into skillsets (resume_id,skill_id)
    values ('$resume_id','$f_skills[$i]')");
list($tmp)=sqlget("select name from skills where skill_id='$f_skills[$i]'");
$skill[]=$tmp;
    }
    // resume files
    while(list($idx,$f)=each($_FILES[f_resume_doc][tmp_name])) {
if(is_uploaded_file($_FILES[f_resume_doc][tmp_name][$idx])) {
    if(($err=is_valid_upload($_FILES[f_resume_doc][name][$idx]))=='') {
        $doc=addslashes(file_get_contents($_FILES[f_resume_doc][tmp_name][$idx]));
	sqlquery("insert into resume_docs (resume_id,fname,doc)
		  values ('$resume_id','".addslashes($_FILES[f_resume_doc][name][$idx])."','$doc')");
    }
    else echo "<p>$err</p>";
}
    }
    // additional attachments
    while(list($idx,$f)=each($_FILES[f_resume_attach][tmp_name])) {
if(is_uploaded_file($_FILES[f_resume_attach][tmp_name][$idx])) {
    if(($err=is_valid_upload($_FILES[f_resume_attach][name][$idx]))=='') {
        $attach=addslashes(file_get_contents($_FILES[f_resume_attach][tmp_name][$idx]));
	sqlquery("insert into resume_attach (resume_id,fname,attach)
		  values ('$resume_id','".addslashes($_FILES[f_resume_attach][name][$idx])."','$attach')");
    }
    else echo "<p>$err</p>";
}
    }

    list($jobno)=sqlget("select name from resume_fields where type=22");
    list($jobcateg)=sqlget("select name from resume_fields where type=21");
    list($jobskills)=sqlget("select name from resume_fields where type=20");
    list($email_field)=sqlget("select name from resume_fields where type=7 or type=24");
    $jobno=castrate($jobno);
    $jobcateg=castrate($jobcateg);
    $jobskills=castrate($jobskills);
    list($ref,$jobtitle)=sqlget("select ref,title from jobs where job_id='$job2'");

    /* notify all subscribed admins */
    if($staff_active) {
if(!$staff_from)
    $staff_from="noreply@$email_domain";
        $staff_body=str_replace("%$jobno%",$ref,$staff_body);
$staff_body=str_replace("%jobtitle%",$jobtitle,$staff_body);
$q=sqlquery("
    select distinct email from user,user_group
    where user.user_id=user_group.user_id and
	user_group.group_id=3 and notify=1 and email<>''");
while(list($admin_email)=sqlfetchrow($q)) {
    mail2($admin_email,$staff_subject,
	str_replace('%link%',
	    "$server_name2/admin/resumes.php?op=edit&id=$resume_id",
	    $staff_body),"From: $staff_from".
	    ($staff_reply_to?"\nReply-To: $staff_reply_to":"").
	    ($staff_return_path?"\nReturn-Path: $staff_return_path":""));
}
    }

    /* confirmation email for the user himself */
    if($job2) {
        $body=str_replace("%$jobno%",$ref,$body);
$html=str_replace("%$jobno%",$ref,$html);
$body=str_replace("%jobtitle%",$jobtitle,$body);
$html=str_replace("%jobtitle%",$jobtitle,$html);
$skill=join(', ',$skill);
        $body=str_replace("%$jobskills%",$skill,$body);
$html=str_replace("%$jobskills%",$skill,$html);
list($category)=sqlget("
    select name from job_categories
    where category_id='$f_category'");
$body=str_replace("%$jobcateg%",$category,$body);
        $html=str_replace("%$jobcateg%",$category,$html);
$body=str_replace("%firstname%",stripslashes($resume_First_Name_),$body);
$html=str_replace("%firstname%",stripslashes($resume_First_Name_),$html);
$body=str_replace("%lastname%",stripslashes($resume_Last_Name_),$body);
$html=str_replace("%lastname%",stripslashes($resume_Last_Name_),$html);
$msg = new message($from,$_POST["resume_".castrate($email_field)],$subject);
$msg->body($body);
if($reply_to)
    $msg->headers.="\nReply-To: $reply_to";
if($return_path)
    $msg->headers.="\nReturn-Path: $return_path";
if($html)
    $msg->body($html,'text/html');
if($body)
    $msg->send();

/* confirmation email to staff */
list($body,$from,$subject,$html,$reply_to,$return_path)=sqlget("
    select body,from_addr,subject,html,reply_to,return_path from system_emails
    where email_id=5 and active=1");
        $body=str_replace("%jobno%",$ref,$body);
$html=str_replace("%jobno%",$ref,$html);
$subject=str_replace("%jobno%",$ref,$subject);
$body=str_replace("%link%","$server_name2/admin/resumes.php?op=edit&id=$resume_id",$body);
$html=str_replace("%link%","<a href=$server_name2/admin/resumes.php?op=edit&id=$resume_id>$server_name2/admin/resumes.php?op=edit&id=$resume_id</a>",$html);
if(!$from)
    $from="noreply@$email_domain";

$q=sqlquery("select distinct email from user,user_group
	     where user.user_id=user_group.user_id and
	        group_id=3 and notify=1 and email<>''");
while(list($admin_email)=sqlfetchrow($q)) {
    $msg = new message($from,$admin_email,$subject);
    $msg->body($body);
    if($reply_to)
	$msg->headers.="\nReply-To: $reply_to";
    if($return_path)
	$msg->headers.="\nReturn-Path: $return_path";
    if($html)
	$msg->body($html,'text/html');
    if($body)
	$msg->send();
}
    }

    ob_end_clean();
    if($job2)
        header("Location: jobsearch.php?job2=$job2".($f_login?"":"&resume_id=$resume_id").
    "&msg=".urlencode($msg_resume_register[LOGGED]));
    else
header("Location: jobsearch.php?msg=".urlencode($msg_resume_register[sUCCESS]));
    exit();
}

include "bottom.php";
?>

 

 

 

Non working version little HTML in the beginning stops whole thing working correctly

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html>
<head>
<title>testng</title>

    <link href='../css.css' rel=stylesheet type='text/css'>


<link href="css/template_css.css" rel="stylesheet" type="text/css" />
</head>
<body class="mainbody">



hello meyaw meyawwwwwwwwwwwww<br>meyaaaaaaaaw




<?php
/*
* Resume application form
*/

ob_start();

require_once "../lib/etools2.php";
require_once "../display_fields.php";
include_once "../lib/misc.php";
include_once "../lib/mail.php";

no_cache();

include "top2.php";
if(!$allow_register) {
    ob_end_clean();
    exit();
}

/* cash all the form fields, produce the hashed names from it
* and put it in array with real names */
$field_types=get_field_types('resume');


/*
* Show a form
*/
if($check!=$msg_resume_register[FINISH]) {
    BeginForm(2,0,$msg_resume_register[HEADER1]);
    FrmEcho("<tr><td colspan=3>$msg_resume_register[TEXT]</td></tr>");
    if($job2)
FrmEcho("<tr><td colspan=3 bgcolor=#dbe5ef class=whiteborders>
    $msg_resume_register[LOGIN]</td></tr>");
    FrmItemFormat("<tr><td width=31% bgcolor=#dbe5ef align=right class=whiteborders><b>$(req) $(prompt) $(bad)</b></td>
<td width=69% class=whiteborders bgcolor=#f5f5f5 colspan=2>$(input)</td></tr>\n");
    display_fields('resume','',1," active=1 and type<>22 and type<>21",array(
'bold_login'=>1/*,'fparam'=>' size=40'*/));
    frmecho("<input type=hidden name=job2 value='$job2'>");
#    EndForm('Continue');
    FrmEcho("<tr><td colspan=3 align=left bgcolor=#f5f5f5 class=whiteborders>
<input type=hidden name=check value='$msg_resume_register[CONTINUE_]'>
<input type=image src=../images/continue.jpg border=0></td></tr></table>");

}

/* step 2 */
if(($check==$msg_resume_register[CONTINUE_] && !$bad_form) || $check==$msg_resume_register[FINISH]) {
    if($check==$msg_resume_register[CONTINUE_]) {
unset($check);
unset($_POST['check']);
unset($HTTP_POST_VARS['check']);
$form_output='';
    }
    BeginForm(2,1,$msg_resume_register[HEADER2]);
    FrmItemFormat("<tr><td width=41% bgcolor=#dbe5ef align=right class=whiteborders><b>$(req) $(prompt) $(bad)</b></td>
<td width=59% class=whiteborders bgcolor=#f5f5f5>$(input)</td></tr>\n");
    display_fields('resume','',1," 0=1",array('show_resume'=>1));
    // display fields for upload .doc files and other attachments
    list($resume_file,$resume_file_required)=sqlget("select resume_file,resume_file_required from job_config");
    if($resume_file) {
$nfiles=1;
for($i=1;$i<=$nfiles;$i++) {
    InputField($msg_resume_register[RESUME_FILE],"f_resume_doc[]",array('type'=>'file',
        'required'=>($resume_file_required?'yes':'no'),'validator_param'=>array('type'=>'file')));
}
$nfiles=0;
for($i=1;$i<=$nfiles;$i++) {
    InputField($msg_resume_register[ADD_ATTACH],"f_resume_attach[]",array('type'=>'file','validator_param'=>array('type'=>'file')));
}
    }
    while(list($var,$val)=each($_POST)) {
if($var!='check')
    if(is_array($val))
	while(list($a,$b)=each($val))
	    FrmEcho("<input type=hidden name=$var"."[$a] value=\"$b\">\n");
    else
	FrmEcho("<input type=hidden name=$var value=\"$val\">\n");
    }
    EndForm($msg_resume_register[FINISH]);
}

# ْل‏هي üôï ?
if($bad_form) {
    $page_id=$x_title=$x_header=$x_footer=$x_bg=$x_has1=$x_has2=$x_has3=$x_has4=$x_has5=$x_hasbg=
$x_color=$x_font_size=$x_shading='';
    $_POST['check']=$_POST['check_x']=$_POST['check_y']='';
    $check=$check_x=$check_y='';
    ob_end_clean();
    include "top2.php";
}
ShowForm();

/*
* Submit form
*/
if($check==$msg_resume_register[FINISH] && !$bad_form) {
    $fields=$vals=array();
    if($f_resume) {
$f_resume=addslashes(stripslashes($f_resume));
$fields[]='resume';
$vals[]=$f_resume;
    }

    /* we want to fetch confirmation message body here
     * to expand some macros in a loop below */
    // Job Application Email
    list($body,$from,$subject,$html,$return_path,$reply_to)=sqlget("
select body,from_addr,subject,html,return_path,reply_to from system_emails
where email_id=2 and active=1");
    if(!$from)
$from="noreply@$email_domain";
    // New Resume email
    list($staff_from,$staff_subject,$staff_body,$staff_active,
$staff_reply_to,$staff_return_path)=sqlget("
select from_addr,subject,body,active,reply_to,return_path from system_emails
where email_id=4");
/*    $fp=fopen($url,'r');
    if($fp) {
while(!feof($fp)) {
    $html.=fgets($fp);
}
fclose($fp);
    }
*/
    /* process fields in a loop */
    reset($_POST);
    while(list($field,$val)=each($_POST)) {
$tmp_arr=explode('_',$field);
if($tmp_arr[0]=='resume' && $tmp_arr[1]!='id') {
    array_shift($tmp_arr);
    $field=join('_',$tmp_arr);
    if(!in_array($field_types[$field],$dead_fields)) {
	if($field_types[$field]==7 || $field_types[$field]==24) {
	    $f_login=$val;
	}
	if($field_types[$field]==5) {
	    if($val)
	    	$val2='Yes';
	    else $val2='No';
	}
	else if(in_array($field_types[$field],$multival_arr)) {
	    if(in_array($field_types[$field],$manyval_arr)) {
		$val2=array();
		for($i=0;$i<count($val);$i++) {
		    list($tmp)=sqlget("
			select name from resume_$field"."_options
			where resume_$field"."_option_id='$val[$i]'");
		    $val2[]=$tmp;
		}
    		$val=join('|',$val);
		$val2=join('; ',$val2);
	    }
	    else 
		list($val2)=sqlget("
		    select name from resume_$field"."_options
		    where resume_$field"."_option_id='$val'");
	}
	else $val2=$val;
        $fields[]="custom_".$field;
	$vals[]=$val;
    }
    else if($field_types[$field]== {
	$f_password=$val;
    }
    $body=str_replace("%$field%",$val2,$body);
    $html=str_replace("%$field%",$val2,$html);
    $staff_body=str_replace("%$field%",$val2,$staff_body);
    $staff_subject=str_replace("%$field%",$val2,$staff_subject);
}
    }

    $fields=join(',',$fields);
    $vals=join("','",$vals);
    if($vals) {
        $vals=",'$vals'";
        $fields=",$fields";
    }

    if($f_login) {
$q=sqlquery("insert into user (name,password) values ('$f_login','$f_password')");
$user_id=sqlinsid($q);
sqlquery("insert into user_group (user_id,group_id) values ('$user_id',4)");
$user=$f_login;
$password=$f_password;
checkuser(4);
    }
    $f_first=addslashes(stripslashes($f_first));
    $f_last=addslashes(stripslashes($f_last));
    $f_address=addslashes(stripslashes($f_address));
    $f_address2=addslashes(stripslashes($f_address2));
    $f_city=addslashes(stripslashes($f_city));
    $f_state=addslashes(stripslashes($f_state));
    // fix state
    list($state)=sqlget("select code from states where name='$f_state'");
    if($state)
$f_state=$state;
    $f_zip=addslashes(stripslashes($f_zip));
    $f_phone=addslashes(stripslashes($f_phone));
    $q=sqlquery("
        insert into resume (status,added,added_by,user_id $fields)
values (1,now(),'$user_id','$user_id' $vals)");
    $resume_id=sqlinsid($q);
    /* add skills to resume */
    for($i=0;$i<count($f_skills);$i++) {
        sqlquery("
    insert into skillsets (resume_id,skill_id)
    values ('$resume_id','$f_skills[$i]')");
list($tmp)=sqlget("select name from skills where skill_id='$f_skills[$i]'");
$skill[]=$tmp;
    }
    // resume files
    while(list($idx,$f)=each($_FILES[f_resume_doc][tmp_name])) {
if(is_uploaded_file($_FILES[f_resume_doc][tmp_name][$idx])) {
    if(($err=is_valid_upload($_FILES[f_resume_doc][name][$idx]))=='') {
        $doc=addslashes(file_get_contents($_FILES[f_resume_doc][tmp_name][$idx]));
	sqlquery("insert into resume_docs (resume_id,fname,doc)
		  values ('$resume_id','".addslashes($_FILES[f_resume_doc][name][$idx])."','$doc')");
    }
    else echo "<p>$err</p>";
}
    }
    // additional attachments
    while(list($idx,$f)=each($_FILES[f_resume_attach][tmp_name])) {
if(is_uploaded_file($_FILES[f_resume_attach][tmp_name][$idx])) {
    if(($err=is_valid_upload($_FILES[f_resume_attach][name][$idx]))=='') {
        $attach=addslashes(file_get_contents($_FILES[f_resume_attach][tmp_name][$idx]));
	sqlquery("insert into resume_attach (resume_id,fname,attach)
		  values ('$resume_id','".addslashes($_FILES[f_resume_attach][name][$idx])."','$attach')");
    }
    else echo "<p>$err</p>";
}
    }

    list($jobno)=sqlget("select name from resume_fields where type=22");
    list($jobcateg)=sqlget("select name from resume_fields where type=21");
    list($jobskills)=sqlget("select name from resume_fields where type=20");
    list($email_field)=sqlget("select name from resume_fields where type=7 or type=24");
    $jobno=castrate($jobno);
    $jobcateg=castrate($jobcateg);
    $jobskills=castrate($jobskills);
    list($ref,$jobtitle)=sqlget("select ref,title from jobs where job_id='$job2'");

    /* notify all subscribed admins */
    if($staff_active) {
if(!$staff_from)
    $staff_from="noreply@$email_domain";
        $staff_body=str_replace("%$jobno%",$ref,$staff_body);
$staff_body=str_replace("%jobtitle%",$jobtitle,$staff_body);
$q=sqlquery("
    select distinct email from user,user_group
    where user.user_id=user_group.user_id and
	user_group.group_id=3 and notify=1 and email<>''");
while(list($admin_email)=sqlfetchrow($q)) {
    mail2($admin_email,$staff_subject,
	str_replace('%link%',
	    "$server_name2/admin/resumes.php?op=edit&id=$resume_id",
	    $staff_body),"From: $staff_from".
	    ($staff_reply_to?"\nReply-To: $staff_reply_to":"").
	    ($staff_return_path?"\nReturn-Path: $staff_return_path":""));
}
    }

    /* confirmation email for the user himself */
    if($job2) {
        $body=str_replace("%$jobno%",$ref,$body);
$html=str_replace("%$jobno%",$ref,$html);
$body=str_replace("%jobtitle%",$jobtitle,$body);
$html=str_replace("%jobtitle%",$jobtitle,$html);
$skill=join(', ',$skill);
        $body=str_replace("%$jobskills%",$skill,$body);
$html=str_replace("%$jobskills%",$skill,$html);
list($category)=sqlget("
    select name from job_categories
    where category_id='$f_category'");
$body=str_replace("%$jobcateg%",$category,$body);
        $html=str_replace("%$jobcateg%",$category,$html);
$body=str_replace("%firstname%",stripslashes($resume_First_Name_),$body);
$html=str_replace("%firstname%",stripslashes($resume_First_Name_),$html);
$body=str_replace("%lastname%",stripslashes($resume_Last_Name_),$body);
$html=str_replace("%lastname%",stripslashes($resume_Last_Name_),$html);
$msg = new message($from,$_POST["resume_".castrate($email_field)],$subject);
$msg->body($body);
if($reply_to)
    $msg->headers.="\nReply-To: $reply_to";
if($return_path)
    $msg->headers.="\nReturn-Path: $return_path";
if($html)
    $msg->body($html,'text/html');
if($body)
    $msg->send();

/* confirmation email to staff */
list($body,$from,$subject,$html,$reply_to,$return_path)=sqlget("
    select body,from_addr,subject,html,reply_to,return_path from system_emails
    where email_id=5 and active=1");
        $body=str_replace("%jobno%",$ref,$body);
$html=str_replace("%jobno%",$ref,$html);
$subject=str_replace("%jobno%",$ref,$subject);
$body=str_replace("%link%","$server_name2/admin/resumes.php?op=edit&id=$resume_id",$body);
$html=str_replace("%link%","<a href=$server_name2/admin/resumes.php?op=edit&id=$resume_id>$server_name2/admin/resumes.php?op=edit&id=$resume_id</a>",$html);
if(!$from)
    $from="noreply@$email_domain";

$q=sqlquery("select distinct email from user,user_group
	     where user.user_id=user_group.user_id and
	        group_id=3 and notify=1 and email<>''");
while(list($admin_email)=sqlfetchrow($q)) {
    $msg = new message($from,$admin_email,$subject);
    $msg->body($body);
    if($reply_to)
	$msg->headers.="\nReply-To: $reply_to";
    if($return_path)
	$msg->headers.="\nReturn-Path: $return_path";
    if($html)
	$msg->body($html,'text/html');
    if($body)
	$msg->send();
}
    }

    ob_end_clean();
    if($job2)
        header("Location: jobsearch.php?job2=$job2".($f_login?"":"&resume_id=$resume_id").
    "&msg=".urlencode($msg_resume_register[LOGGED]));
    else
header("Location: jobsearch.php?msg=".urlencode($msg_resume_register[sUCCESS]));
    exit();
}

include "bottom.php";
?>





 

 

 

can someone help me determine why this wont work? i want to add html to make it look nicer and fit my template

thanks

 

 

 

 

Link to comment
Share on other sites

You can't put any HTML before your ob_start() in the php.

Your headers are already sent. is that your error message?

 

I'm with bob,

 

session_start(), and ob_start() should be placed first in your code, before outputting anything.

 

Any error message, or it just doesn't function properly?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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