Jump to content

alwaysme

Members
  • Posts

    55
  • Joined

  • Last visited

    Never

Posts posted by alwaysme

  1. Hello there,

     

    I find a little script on the net for ajax which loads hello.html (pageone), but lets say i want another link that loads statistics.html, how do i do that? this is the code

     

    <script type="text/javascript">
    var http = false;
    
    if(navigator.appName == "Microsoft Internet Explorer") {
      http = new ActiveXObject("Microsoft.XMLHTTP");
    } else {
      http = new XMLHttpRequest();
    } 
    
    function replace() {
      http.open("GET", "hello.html", true);
      http.onreadystatechange=function() {
        if(http.readyState == 4) {
          document.getElementById('pageone').innerHTML = http.responseText;
        }
      }
      http.send(null);
    }
    </script></head>
    <body>
    <p><a href="javascript:replace()">page one</a></p>
    
    <div id="pageone">
      Hello, world!
    </div>
    </body>
    
    

     

    like i need another link (maybe more later) where each load different page, now i can only load one page with the above...

     

    i.e

    <p><a href="javascript:replace()">page one</a></p>  // this takes me to hello.html (working)
    <p><a href="javascript:replace()">page two</a></p> //this take me to statistics.html
    

     

     

     

    how can i make that?

  2. anybody find a resolution for me?

     

    /* 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<>''");          <-------------- this line??
    while(list($admin_email)=sqlfetchrow($q)) {
    

    i added

     

    $myblah = array(3, 5);

     

    under this line

     

     $from="noreply@$email_domain";

     

    and then i get stuck adding your changes to this

     

     group_id=3 and notify=1 and email<>''"); ??

     

     

    againi want it to send email to also group id 5 instead of 3 only.... :-\

  3. Hello, i totally understand the stance u are taking with this. I'd have a more upset approach if i were in your place also..but please understand i did not write any of that code. Its a ready made script i want to use for my website. When someone fills in a form they get an email

     

    i tried hard just searching for that line of code that is responsible for dispatching the email. I tried applying your code but i do get errors...

     

     

    i know you offered solutions but i am having trouble applying them to this code. kindly help me fix this

     

    $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<>''");  

           

     

     

  4. thanks guys, but this is getting too complicated. when i make changes im getting a blank page...

     

    can we work with larger junks of code or its not allowed here??

     

    for example...the script im using sends an email to the admin once someone fills out a complete form

     

    /* 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<>''");          <-------------- this line??
    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();
    } 

     

     

     

    the code above dispatchs an email to group "3" which is adminstrators...id like that email to also go to group "5" which are sub-admins...can you please guide me with this?

     

    i appreciate this. If anyone needs help with logo design i am happy to assist..

    thank u

  5. hello, thanks for  your quick response. but u are not done with me... :D

     

    what do i place inside the

     

    { ... }

    ?

     

    lets say i only want it for group 3 and 5 and thats it (no 4)?

     

    what would it be? and im not sure what the $blah function is...sorry this is extremely amatuer q's..

     

    /*
    * Send a notification to the user who applied
    */
    if($op=='message' && $group_id==3) {

     

  6. yes i do know HTML, but very little php in terms of writing it.

     

    The script on its own without the added html displays correctly to 100% width of the page. Once i add my html the table breaks only on step 2 (the finish button). Deduction logic shows that the line below is causing it.

     

    EndForm($msg_resume_register[FINISH]);

     

    Like you said, i need to close tags correctly around the finish button. But i dont see the html code that creates it. I dont know where to look. And the forms.php file i posted contains many form fields that really confuse the hell out of me. Im not sure which form is for what as the script comes with an application form, contact form, login form etc...

     

    anyone can clue me in? i jsut need the finish button stop breaking the layout

  7. Hello, i have a form that no one seems to know why it breaks when i integrate it into a current template...so i assume a getto fix would be to place it in an iframe since the script works byitself.

     

    Anyway this form when complete it takes me to jobsearch.php with a succesful msg. I want this page to target to the parent frame. Is this possible?

     

     

    this is the segment of code from the form that i assume takes you to the successful page....where can i add _parent?

     

     

    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();
    }
    

     

    This is the post with the original problem

  8. hi blue..im not sure where to find this function....

     

    however theres a file named forms.php, could it be responsible for this behavior?

     

    <?php
    
    
    function FrmEcho( $text ='<br>' ) {
        global $form_output;
        $form_output.=$text;
    }
    
    function FrmItemFormat( $format=' $(bad)  $(prompt) $(input) ') {
        global $form_output_auto_format;
        $form_output_auto_format=$format;
    }
    
    function BeginForm($auto=1,$multipart=0,$header='',$image='',
    	    $action='',$table_bg='#5b87b3',$table_forecolor='#ffffff',$width='100%') {
        global $form_output,$form_output_auto,
    $form_output_auto_format,$form_tbl,$bad_form,$arr_vars;
        if(!$action) {
    $action=$GLOBALS['PHP_SELF'];
        }
        $form_output_auto=$auto;
        $bad_form=''; $form_output="";
        $arr_vars=array();
        $form_tbl=0;
        $form_output="<form action=$action method=post".
    ($multipart==1?" enctype='multipart/form-data'>":">");
        switch($auto) {
        case 0:
    $form_output_auto_format="$(req) $(prompt) $(bad) $(input)<br>\n";
    break;
        case 2:
    $form_output.="<table width=$width border=0 cellpadding=0 cellspacing=0><tr valign=top><td>
                      <table border=0 cellpadding=4 cellspacing=0 bordercolor=#CCCCCC style='border-collapse:collapse;' align=center width=100%>
    	  <tr bgcolor=$table_bg>
    	    <td colspan=3><font color=$table_forecolor><b>$header</b></font></td>
    	  </tr>";
    $form_output_auto_format="<tr><td align=right bgcolor=#dbe5ef class=whiteborders><b>$(req) $(prompt) $(bad)</b></td>
        <td align=left bgcolor=#f5f5f5 class=whiteborders>$(input)</td></tr>\n";
    break;
        case 1:
        default:
    $form_output.="<table width=$width border=1 cellpadding=0 cellspacing=0 bordercolor=#CCCCCC style='border-collapse:collapse;'>
                        <tr valign=top> 
                          <td height=21 align=center valign=middle nowrap background=../images/title_bg.jpg class=Arial12Grey><div align=left><b>$header</b></div></td>
                        </tr>
                      </table>
                      <table width=100%  border=0 cellspacing=0 cellpadding=0>
                        <tr> 
                          <td><img src=../images/spacer.gif width=1 height=1></td>
                        </tr>
                      </table>
                      <table width=722 border=1 cellpadding=5 cellspacing=0 bordercolor=#CCCCCC style='border-collapse:collapse;'>";
    $form_output_auto_format="<tr bgcolor=#$(><td class=Arial11Grey>$(req) $(prompt) $(bad)</td><td class=Arial11Blue>$(input)</td></tr>\n";
    break;
        }
    }
    
    function EndForm($name='Submit',$image='',$align='left') {
        global $form_output,$bad_form,$_POST,$form_output_auto,
    $form_output_auto_format,$format_color1,$format_color2;
        switch($form_output_auto) {
        case 0:
    $form_output.=
        ($image?"<input type=image name=check src='$image' border=5>
        <input type=hidden name=check value='$name'>":"<input type=submit name=check value='$name'>")."</form>";
    break;
        case 2:
    $form_output.="</table></td><tr><tr><td align=$align><br>".
        ($image?"<input type=image name=check src='$image' border=0>
        <input type=hidden name=check value='$name'>":"<input type=submit name=check value='$name'>").
        "</td></tr>
        </table></form>";
    break;
        default:
        case 1:
    $form_output.="<tr bgcolor=$format_color1><td colspan=2 class=Arial11Grey align=$align>".
        ($image?"<input type=image name=check src='$image' border=0>
        <input type=hidden name=check value='$name'>":"<input type=submit name=check value='$name'>").
        "</td></tr>
        </table></form>";
    break;
        }
    }
    
    function ShowForm($force=0) {
        global $form_output,$bad_form,$_POST,$form_output_auto,$form_output_auto_format,
    $form_onsubmit,$form_defvals;
        if(  ($bad_form!='') || (!isset($_POST['check']) || $force) )  {
    if($form_onsubmit) {
        $form_output=eregi_replace('<form',"<form onsubmit=\"$form_onsubmit\" ",$form_output);
    }
    if($form_defvals) {
        $form_output.="<script language=javascript>\n$form_defvals\n</script>";
    }
    echo "$form_output";
    $bad_form.='.';
        }
    }
    
    function InputField( $prompt, $name, $options="",$format="") {
        global $_POST,$HTTP_GET_VARS,$bad_form,$form_output,$form_tbl,
    $form_output_auto,$form_output_auto_format,$arr_vars,$HTTP_USER_AGENT,
    $form_onsubmit,$form_defvals,$format_color1, $format_color2,
    $server_name2,$editors,$spaw_root,$allow_html_editor,$msg_common;
    
        if(!isset($format_color1)) {
    $format_color1='f4f4f4';
        }
        if(!isset($format_color2)) {
    $format_color2='f4f4f4';
        }
    
        $input='';
        $def=isset($options['default'])?$options['default']:"";
        $type=isset($options['type'])?$options['type']:"text";
        $req=(isset($options['required']) && $options['required']=='yes')?'*':'';
        $validator_def=($req=='*')?"validator_def":"validator_empty";
        $validator=isset($options['validator'])?$options['validator']:$validator_def;
        if( !isset($options['validator_param'])) {
    $options['validator_param']=array();
        }
        if( isset($options['fparam'])) {
    $fparam=$options['fparam'];
        }
        else {
    $fparam='';
        }
        if( isset($options['fparam2'])) {
    $fparam2=$options['fparam2'];
        }
        else {
    $fparam2='';
        }
        $options[validator_param][type]=$type;
        $bad='';
    
        if(!$allow_html_editor && $type=='editor') {
    $type='textarea';
    $options[fparam]=$options[fparam2];
    #	if(!$options[fparam])
    #	    $options[fparam]=" rows=5 cols=40";
        }
    
        /*
         * This is the form validation after the post. The posted value
         * overrides the default value of the variable
         */
        if( isset($_POST["check"]) || isset($HTTP_GET_VARS["check"]) ) {
    $name2=eregi_replace('\[\]','',$name);
    preg_match("/\[(\-?\d+?)\]/",$name,$ind);
    if($ind[1]) {
        $index=$ind[1];
        $name3=preg_replace("/\[\-?\d+?\]/","",$name);
    }
    else unset($index);
    /* the variable is an array */
    if($name2!=$name && $options['type']!='text' && $options['type']!='textarea' &&
    	$options['type']!='checkbox' && $options['type']!='') {
        $def=$_POST[$name2]?$_POST[$name2]:
        	    $HTTP_GET_VARS[$name2];
    }
    else if(isset($index)) {
        $tmp1=$_POST[$name3];
        $tmp2=$_POST[$name3];
        $def=$tmp1[$index]?$tmp1[$index]:$tmp2[$index];
    }
    /* the variable is a scalar */
    else {
        $def=$_POST[$name]?$_POST[$name]:
    	    $HTTP_GET_VARS[$name];
    }
    if(is_array($def)) {
        $arr_vars[$name2]++;
        #$def=$def[$arr_vars[$name2]-1];
    }
    $bad=$validator($name,$def,$options['validator_param']);
        }
        if(!is_array($def) && $type!='editor')  {
    $def=htmlspecialchars($def);
        }
    
        if( $type=='select_radio' ) {
    if (!$def && $options['ddefault']) {
        $def = $options['ddefault'];
    }
    if(isset($options['combo'])) {
        while(list($id,$ename)=each($options['combo'])) {
    	$selected=("$id"=="$def")?' checked':' ';
    	$input.= "<input type=radio name=$name value='$id' $selected>$ename\n";
        }
    }
            if(isset($options['SQL'])) {
        $sq=SQLQuery($options['SQL']);
        while( $sr=SQLFetchRow( $sq ) ) {
    	$selected=("$sr[id]"=="$def")?" checked ":" ";
    	$input.= "<input type=radio name=$name value='$sr[id]'$selected>$sr[name]\n";
        }
        SQLFree($sq);
    }
        }
        elseif( $type=='select_checkbox' ) {
    if (!$def && $options['ddefault']) {
        $def = $options['ddefault'];
    }
    if (!is_array($def)) {
        if ($def != '') {
        	        $def = explode("|", $def);
        } else {
        	        $def = array();
        }
    }
    if(isset($options['combo'])) {
        while(list($id,$ename)=each($options['combo'])) {
    	$selected=in_array($id, $def)?' checked':' ';
    	$input.= "<input type=checkbox name=${name}[] value='$id' $selected>$ename\n";
        }
    }
            if(isset($options['SQL'])) {
        $sq=SQLQuery($options['SQL']);
        while( $sr=SQLFetchRow( $sq ) ) {
    	$selected=in_array($sr['id'], $def)?' checked':' ';
    	$input.= "<input type=checkbox name=${name}[] value='$sr[id]'$selected>$sr[name]\n";
        }
        SQLFree($sq);
    }
        }
        else if( $type=='select' ) {
    if (!$def && $options['ddefault']) {
        $def = $options['ddefault'];
    }
    if ($options['multiple'] && !is_array($def)) {
        if ($def != '') {
            $def = explode("|", $def);
        } else {
            $def = array();
        }
    }
    $input="<select name=$name"."$fparam>";
    if(isset($options['combo'])) {
        while(list($id,$name)=each($options['combo'])) {
    #		$selected=($id==$def)?" selected ":" ";
    	/* handling multiple choices */
    	if(is_array($def)) {
    	    for($j=0;$j<count($def);$j++) {
    		if($id==$def[$j]) {
        		    $selected=' selected'; break;
    		}
    		else { $selected=''; }
    	    }
    	}
    	else {
    	    $selected=($id==$def)?" selected ":" ";
    	}
    	$input.= "<option value='$id' $selected>$name</option>\n";
        }
    }
            if(isset($options['SQL'])) {
        $sq=SQLQuery($options['SQL']);
        while( $sr=SQLFetchRow( $sq ) ) {
    	/* handling multiple choices */
    	if(is_array($def)) {
    	    for($j=0;$j<count($def);$j++) {
    		if("$sr[id]"=="$def[$j]") {
        		    $selected=' selected'; break;
    		}
    		else { $selected=''; }
    	    }
    	}
    	else {
    	    $selected=("$sr[id]"=="$def")?" selected ":" ";
    	}
    	$input.= "<option value='$sr[id]' $selected>$sr[name]</option>\n";
        }
        SQLFree($sq);
    }
    $input.="</select>";
        }
        else if($type=='textarea') {
    $input="<textarea name='$name' $fparam>$def</textarea>";
        }
        else if($type=='editor') {
    if(strstr($HTTP_USER_AGENT,'Gecko') || strstr($HTTP_USER_AGENT,'MSIE')) {
        $f=$name;
        $spaw=$options['spaw'];
        if(!$spaw[width])
    	$spaw[width]='100%';
        if(!$spaw[height])
    	$spaw[height]='300px';
        if(!$spaw[mode])
    	$spaw[mode]='full';
        $editors[$f]=new SPAW_Wysiwyg($name,$def,$spaw['lang'],$spaw['mode'],
    	$spaw['theme'],$spaw['width'],$spaw['height'],$spaw['css'],
    	    $spaw['dropdown']);
        $input=$editors[$f]->show();
    }
    else {
        $input="<script language=javascript src=editor.php?f=$name></script>
        <INPUT TYPE=reset VALUE=\"Erase and Restart Document\" onClick=\"HjReset(this.form)\"><br>
        <textarea name='$name' $fparam2>$def</textarea>";
    }
        }
        else if($type=='month') {
    $input="<select name=$name>
    <option value=''>$msg_common[MONTH]</option>";
    for($i='01';$i<='12';$i++) {
        $selected=($i==$def)?" selected ":" ";
        $input.="\n<option value=$i $selected>".(strftime('%B',mktime(1,1,1,$i,1,2000)))."</option>";
    }
    if(isset($options['combo'])) {
        while(list($id,$name)=each($options['combo'])) {
    	$selected=($id==$def)?" selected ":" ";
    	$input.= "<option value='$id' $selected>$name</option>\n";
        }
    }
    $input.='</select>';
        }
        else if($type=='day') {
    $input="<select name=$name>
    <option value=''>$msg_common[DAY]</option>";
    for($i='01';$i<='31';$i++) {
        $selected=($i==$def)?" selected ":" ";
        $input.="\n<option $selected>$i</option>";
    }
    if(isset($options['combo'])) {
        while(list($id,$name)=each($options['combo'])) {
    	$selected=($id==$def)?" selected ":" ";
    	$input.= "<option value='$id' $selected>$name</option>\n";
        }
    }
    $input.='</select>';
        }
        else if($type=='year') {
    $input="<select name=$name>
    <option value=''>$msg_common[YEAR]</option>";
    if(!isset($options['start'])) $options['start']='2000';
    if(!isset($options['end'])) $options['end']=date('Y')+10;
    for($i=$options['start'];$i<=$options['end'];$i++) {
        $selected=($i==$def)?" selected ":" ";
        $input.="\n<option $selected>$i</option>";
    }
    if(isset($options['combo'])) {
        while(list($id,$name)=each($options['combo'])) {
    	$selected=($id==$def)?" selected ":" ";
    	$input.= "<option value='$id' $selected>$name</option>\n";
        }
    }
    $input.='</select>';
        }
        else if($type=='hour') {
    if($options['end'])
        $end=$options['end'];
    else $end=23;
    $input="<select name=$name>
    <option value=''>$msg_common[HOUR]</option>";
    for($i='1';$i<=$end;$i++) {
        $selected=($i==$def)?" selected ":" ";
        $input.="\n<option $selected>$i</option>";
    }
    if(isset($options['combo'])) {
        while(list($id,$name)=each($options['combo'])) {
    	$selected=($id==$def)?" selected ":" ";
    	$input.= "<option value='$id' $selected>$name</option>\n";
        }
    }
    $input.='</select>';
        }
        else if($type=='minute' || $type=='second') {
    if($type=='minute')
        $tmp=$msg_common[MINUTE];
    else $tmp=$msg_common[sECOND];
    $input="<select name=$name>
    <option value=''>$tmp</option>";
    for($i='0';$i<='59';$i++) {
        if(strlen($i)==1)
    	$tmp="0$i";
        else $tmp=$i;
        $selected=($i==$def)?" selected ":" ";
        $input.="\n<option $selected>$tmp</option>";
    }
    if(isset($options['combo'])) {
        while(list($id,$name)=each($options['combo'])) {
    	$selected=($id==$def)?" selected ":" ";
    	$input.= "<option value='$id' $selected>$name</option>\n";
        }
    }
    $input.='</select>';
        }
        else if($type=='checkbox') {
    $checked=$on='';
    if($options['on']!='') {
        $on="value='".$options['on']."'";
    }
    if($def==$options['on'] && $def!='') {
        $checked='checked';
    }
    $input="<input type=checkbox name='$name' $on $checked $fparam>";
        }
        else if($type=='text_radio') {
    //$checked = $options['def_radio'] ? 'checked' : '';
    $def_base = $options['def_base'] ? $options['def_base'] : '_def_';
    $def_value = is_numeric($options['def_value']) ? $options['def_value'] : $name;
    #	$def_value = $options['def_value'] ? $options['def_value'] : $name;
    
    // radio value
    if ($_REQUEST[$def_base]) {
        $checked = ($def_value == $_REQUEST[$def_base]  ? 'checked' : '');
    } else {
        $checked = $options['def_radio'] ? 'checked' : '';
    }
    if ($options['is_radio']) {
        $radio_style	= '';
        $checkbox_style	= ' style="display:none;"';
    } else {
        $radio_style	= ' style="display:none;"';
        $checkbox_style	= '';
    }
    
    $input= ($options['notext']?"":"<input type=$type name='$name' value=\"$def\" $fparam> ").
    	"<input type=radio id='{$def_base}_r_$def_value' name='$def_base' value='$def_value' $checked $radio_style><input id='{$def_base}_c_$def_value' type=checkbox name='{$def_base}_{$def_value}_c' value='1' $checked $checkbox_style> Default";
        }
        else {
    $input="<input type=$type name='$name' value=\"$def\" $fparam>";
        }
    
        if($bad!='') {
    $bad_form.=$bad."<br>"; $bad="<small><font color=red> $bad </font></small>";
        }
    
        $oa=array(
    'bad'=>" $bad",
            ':'=>(($form_tbl++ % 2)!=0?$format_color1:$format_color2),
    'req'=>" $req",
            'prompt'=>$prompt,
    'input'=>$input,
            'format'=>$format
        );
    
        $form_output.=FormatRemove(FormatArray($form_output_auto_format,$oa));
    }
    
    
    function validator_empty($name,$value,$options) {
        return '';
    }
    
    function validator_def( $name,$value,$options ) {
        global $_FILES;
        if($options[type]=='file') {
            $name=str_replace("[]",'',$name);
            if(is_array($_FILES[$name]))
                foreach($_FILES[$name][name] as $idx=>$junk) {
            if(!is_uploaded_file($_FILES[$name][tmp_name][$idx]))
                return 'This is a required field';
            else return '';
                }
            else {
                if(!is_uploaded_file($_FILES[$name][tmp_name]))
            return 'This is a required field';
        else return '';
    }
    
        }
        else
    return $value!=''?'':'This is a required field';
    }
    
    function validator_password( $name,$value,$options ) {
        global $_POST;
        if( strlen($_POST['f_password']) < 5 ) {
    return 'Password is too short';
        }
    
        return $_POST['f_password']==$_POST['f_password2']?'':
    'Passwords do not match';
    }
    
    /*
    * Difference from validator_password() is that it accepts empty fields
    */
    function validator_password2($name,$value,$options) {
        global $_POST;
        if($_POST['f_password']=='') {
    return '';
        }
    
        return validator_password($name,$value,$options);
    }
    
    
    function validator_db( $name,$value,$options ) {
        $options['value']=$value;
    #echo "<hr>".FormatArray($options['SQL'],$options);
        if( $row=SQLGet( FormatArray($options['SQL'],$options) ) ) {
    return $row['res'];
        }
        return '';
    }
    
    
    function validator_email( $name, $email, $option )
    {
        if( !eregi("^.+\\@.+",$email) ) {
    return "Incorrect E-Mail";
        }
    
        list ( $user, $domain ) = split (  "@", $email, 2 );
        if( !isset($domain) ) {
    return 'You must enter E-Mail';
        }
    
        if ( checkdnsrr ( $domain,  "ANY" ) ) {
        return '';
        }
        return 'Incorrect E-Mail';
    }
    
    function validator_email2($name,$email,$options) {
        if(!$email && $options['required']!='yes') {
    return '';
        }
        if( !eregi("^.+\\@.+",$email) ) {
    return "Incorrect E-Mail";
        }
        return '';
    }
    
    /* draws a grey box with the text inside */
    function box($str,$width=722) {
        return "<table width=$width  border=1 cellpadding=0 cellspacing=0 bordercolor=#CCCCCC style='border-collapse:collapse;' align=center>
      <tr>
        <td><table border=0 cellspacing=0 cellpadding=10 width=100%>
          <tr>
            <td>$str</td>
          </tr>
        </table></td>
      </tr>
    </table>";
    }
    
    function flink($name,$link,$target='',$bullet='../images/arrow.gif width=4 height=8') {
        if($target)
    $target="target=$target";
        return "<span class=Arial11Blue><img src=$bullet border=0> <a href=$link $target>$name</a></span>";
    }
    
    $bad_form='';
    $form_output="";
    
    ?>
    

     

     

    any hints or solutions please let me know =\

     

     

  9. hi

     

    I am integrating a script into a website, so far step 1 of the form is working perfectly. Step 2 is when someone completes the form they are taken to a smaller form to upload a file and a finish button, this table for some reason breaks the whole layout of the page. And both forms are located in the same file resume_register.php

     

    Can anyone take a look at it for me please and tell me what i can do to stop that? again the first form is ok once filled in, you click continue and it takes you to the page below in the image where the user has to click FINISH. id like that page to align properly..

     

    this is a screen shot

    out.php?i=11848_msedup.jpg

     

    The form starts where you see

     

    <?php

    include "top2.php";

    if(!$allow_register) {

        ob_end_clean();

        exit();

    }

     

    this is the file contents

    <?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();
    
    
    ?>
    
    <body class="mainbody">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="6"><img src="http://fccg.com.kw/templates/fccg-kn-1-2/images/spacer.png" alt="top" border="0" height="1" width="1" /></td>
      </tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td> </td>
        <td width="12"><img src="http://fccg.com.kw/templates/fccg-kn-1-2/images/top-left.jpg" alt="topleft" width="12" height="104" /></td>
        <td width="220" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><img src="http://fccg.com.kw/templates/fccg-kn-1-2/images/left-top.jpg" alt="lefttop" width="220" height="12" /></td>
          </tr>
          <tr>
            <td><a href="http://fccg.com.kw"><img src="http://fccg.com.kw/templates/fccg-kn-1-2/images/fccg-logo.jpg" alt="FCCG logo" width="220" height="92" border="0" /></a></td>
          </tr>
        </table></td>
        <td width="12"><img src="http://fccg.com.kw/templates/fccg-kn-1-2/images/top-right.jpg" alt="topright" width="12" height="104" /></td>
        <td width="548"><table width="100%" height="104" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td height="72" align="right"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td> </td>
                <td width="160" align="right"></td>
                <td width="96" align="right"><link href="http://fccg.com.kw/modules/mod_jflanguageselection.css" rel="stylesheet" type="text/css"/>
    <label for="jflanguageselection" class="jflanguageselection">Select</label>
    <select name="lang" id="jflanguageselection" class="jflanguageselection" size="1" onchange="document.location.replace(this.value);">
    <option value="http://fccg.com.kw/index.php?lang=ar">عربي</option>
    <option value="http://fccg.com.kw/index.php?lang=en" selected="selected">English</option>
    </select>
    <!--Joom!fish V1.7 (2006-05-01)-->
    <!-- © 2003-2006 Think Network, released under the LGPL. -->
    <!-- More information: at http://forge.joomla.org/sf/sfmain/do/viewProject/projects.joomfish -->
    </td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="32"><!-- Begin menu -->
    
    
    
    		<link rel="stylesheet" type="text/css" href="http://fccg.com.kw/modules/ja_transmenu/transmenuh.css">
    		<script language="javascript" src="http://fccg.com.kw/modules/ja_transmenu/transmenu.js"></script>
    	<div id="wrap"><div id="menu"><table cellpadding=0 cellspacing=0 border=0><tr><td><a href="http://fccg.com.kw/index.php" class="mainlevel-trans" id="menu17">Home</a></td><td><a href="http://fccg.com.kw/index.php?option=com_content&task=blogsection&id=8&Itemid=29" class="mainlevel-trans" id="menu29">Investors</a></td><td><a href="http://fccg.com.kw/index.php?option=com_content&task=blogsection&id=1&Itemid=27" class="mainlevel-trans" id="menu27">News</a></td><td><a href="http://fccg.com.kw/index.php?option=com_content&task=blogsection&id=7&Itemid=28" class="mainlevel-trans" id="menu28">Companies</a></td><td><a href="http://fccg.com.kw/index.php?option=com_contact&Itemid=3" class="mainlevel-trans" id="menu18">Contact Us</a></td></tr></table></div></div>
    		<script language="javascript">
    		if (TransMenu.isSupported()) {
    			TransMenu.updateImgPath('http://fccg.com.kw/modules/ja_transmenu/');
    			var ms = new TransMenuSet(TransMenu.direction.down, 0, 0, TransMenu.reference.bottomLeft);
    			TransMenu.subpad_x = 1;
    			TransMenu.subpad_y = 0;
    
    
    			document.getElementById("menu17").onmouseover = function() {
    				ms.hideCurrent();
    			}
    			var tmenu29 = ms.addMenu(document.getElementById("menu29"));
    tmenu29.addItem("Current Stock Quotes", "http://fccg.com.kw/index.php?option=com_content&task=view&id=35&Itemid=73", 0, 0);
    tmenu29.addItem("Investor News Release", "http://fccg.com.kw/index.php?option=com_content&task=view&id=36&Itemid=74", 0, 0);
    tmenu29.addItem("Annual Reports", "http://fccg.com.kw/index.php?option=com_content&task=view&id=37&Itemid=75", 0, 0);
    
    			document.getElementById("menu27").onmouseover = function() {
    				ms.hideCurrent();
    			}
    			var tmenu28 = ms.addMenu(document.getElementById("menu28"));
    tmenu28.addItem("FCC", "http://fccg.com.kw/index.php?option=com_content&task=blogcategory&id=17&Itemid=37", 0, 0);
    tmenu28.addItem("FCCI", "http://fccg.com.kw/index.php?option=com_content&task=blogcategory&id=18&Itemid=36", 0, 0);
    tmenu28.addItem("FTI", "http://fccg.com.kw/index.php?option=com_content&task=blogcategory&id=19&Itemid=35", 0, 0);
    tmenu28.addItem("FutureRFID", "http://fccg.com.kw/index.php?option=com_content&task=blogcategory&id=20&Itemid=34", 0, 0);
    tmenu28.addItem("MCC", "http://fccg.com.kw/index.php?option=com_content&task=blogcategory&id=24&Itemid=33", 0, 0);
    
    			document.getElementById("menu18").onmouseover = function() {
    				ms.hideCurrent();
    			}
    
    			TransMenu.renderAll();
    		}
    		init1=function(){TransMenu.initialize();}
    		if (window.attachEvent) {
    			window.attachEvent("onload", init1);
    		}else{
    			TransMenu.initialize();			
    		}
    		</script>
    	<!-- End menu -->
    
    </td>
          </tr>
        </table></td>
        <td width="12"> </td>
        <td width="12"> </td>	
        <td> </td>
      </tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td> </td>
        <td width="12" valign="top"><img src="http://fccg.com.kw/templates/fccg-kn-1-2/images/leftshade1.jpg" alt="leftshade" width="12" height="252" /></td>
        <td width="220" valign="top" class="whitebg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="10"> </td>
            <td valign="top" class="leftpanel"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="12"><img src="http://fccg.com.kw/templates/fccg-kn-1-2/images/spacer.png" alt="top" border="0" height="1" width="1" /></td>
              </tr>
              <tr>
                <td>		<table cellpadding="0" cellspacing="0" class="moduletable">
    			<tr>
    		<td>
    
    <!--(c) Infinity Menus For Mambo - Guy Thomas 2005  -->
    
    <!-- START OF MODULE 'Mygosu Menus'   -->
    <!--File to check for is /home/fccg/public_html//modules/infinity_menus/css/dropdown/coldblue.css-->		<script type='text/javascript'>
    	<!--
    	function importStyleSheet(shtName){
    		// add style sheet via javascript
    		var link = document.createElement( 'link' );
    		link.setAttribute( 'href', shtName );
    		link.setAttribute( 'type', 'text/css' );
    		link.setAttribute( 'rel', 'stylesheet' );			
    		var head = document.getElementsByTagName('head').item(0);
    		head.appendChild(link);
    	}
    	-->
    	</script>
    
    		<!--<link rel="stylesheet" type="text/css" href="http://fccg.com.kw/modules/infinity_menus/css/dropdown/coldblue.css" /> -->
    		<script type='text/javascript'>
    		<!--
    			importStyleSheet('http://fccg.com.kw/modules/infinity_menus/css/dropdown/coldblue.css');
    		-->
    		</script>
    		<!--CSS file exists (/home/fccg/public_html//modules/infinity_menus/css/dropdown/coldblue.css)--><div style='z-index:500; height:auto;'>
    <table cellspacing='0' cellpadding='0' id='infinity_menu_1' class='coldblue'>
    <tr>
    <td>
    		<div class='menuCont_1' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='parentItem' target='_self' href='http://fccg.com.kw/index.php?option=com_frontpage&Itemid=1'><span>Home </span></a></div>
    		<div class='menuCont_1' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='parentItem' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=blogsection&id=1&Itemid=26'><span>News </span></a></div>
    		<div class='menuCont_1' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='parentItem' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=blogsection&id=9&Itemid=42'><span>Corporate Information </span><img class='rgtImg' border='0' src='http://fccg.com.kw/images/M_images/arrow2.png' alt='Corporate Information'/></a></div>
    		<div class='section' ><div class='shadow' ><div class='menuBox' >
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=21&Itemid=59'><span>Introduction FCCG </span></a></div>
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=22&Itemid=60'><span>Company Profile </span></a></div>
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=23&Itemid=61'><span>Brief History </span></a></div>
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=24&Itemid=62'><span>Global Operation </span></a></div>
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=25&Itemid=63'><span>Annual Report </span></a></div>
    		</div></div></div>
    		<div class='menuCont_1' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='parentItem' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=blogsection&id=10&Itemid=43'><span>Corporate Responsibility </span><img class='rgtImg' border='0' src='http://fccg.com.kw/images/M_images/arrow2.png' alt='Corporate Responsibility'/></a></div>
    		<div class='section' ><div class='shadow' ><div class='menuBox' >
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=26&Itemid=64'><span>Our Responsibility </span></a></div>
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=27&Itemid=65'><span>Environment </span></a></div>
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=28&Itemid=66'><span>Employee </span></a></div>
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=29&Itemid=67'><span>Education </span></a></div>
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=30&Itemid=68'><span>Society </span></a></div>
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=31&Itemid=69'><span>Technology </span></a></div>
    		</div></div></div>
    		<div class='menuCont_1' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='parentItem' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=blogsection&id=11&Itemid=44'><span>Corporate Governance </span><img class='rgtImg' border='0' src='http://fccg.com.kw/images/M_images/arrow2.png' alt='Corporate Governance'/></a></div>
    		<div class='section' ><div class='shadow' ><div class='menuBox' >
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=32&Itemid=70'><span>Board of Directors </span></a></div>
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=33&Itemid=71'><span>Message from the Chairman </span></a></div>
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=34&Itemid=72'><span>Corporate GM’s </span></a></div>
    		</div></div></div>
    		<div class='menuCont_1' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='parentItem' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=38&Itemid=76'><span>Our Partnership </span></a></div>
    		<div class='menuCont_1' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='parentItem' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=39&Itemid=77'><span>Services </span><img class='rgtImg' border='0' src='http://fccg.com.kw/images/M_images/arrow2.png' alt='Services'/></a></div>
    		<div class='section' ><div class='shadow' ><div class='menuBox' >
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=40&Itemid=79'><span>FCC </span></a></div>
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=41&Itemid=80'><span>FCCI </span></a></div>
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=42&Itemid=81'><span>FutureRFID </span></a></div>
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=43&Itemid=82'><span>FTI </span></a></div>
    				<div class='menuCont_2' ><a style=' white-space:no-wrap !important; font-size:11px !important;' class='subItem_2' target='_self' href='http://fccg.com.kw/index.php?option=com_content&task=view&id=44&Itemid=83'><span>MCC </span></a></div>
    		</div></div></div>
    	</td>
    </tr>
    </table>
    </div>
    
    	<script type = "text/javaScript" src="http://fccg.com.kw/modules/infinity_menus/js/dropdownmenux_crunched.js"></script> <!--Mod by Guy Thomas 2004/12/06-->
    	<script type = "text/javaScript" src="http://fccg.com.kw/modules/infinity_menus/js/dropdownmenux_ie5_crunched.js"></script> <!--Mod by Guy Thomas 2004/12/06-->
    
    	<!-- add menu initialise to onload event-->
    	<script type="text/javascript">	
    	<!--					
    	// create init function
    	function infinity_menu_1_init(){eval("var infinity_menu_1 = new DropDownMenuX('infinity_menu_1');infinity_menu_1.type = 'vertical';infinity_menu_1.delay.show = 20;infinity_menu_1.delay.hide = 400;infinity_menu_1.position.level1.left = 0;infinity_menu_1.position.levelX.left = 0;infinity_menu_1.fitWidth = 0;infinity_menu_1.init();");}
    	// add init function to onload event
    	if (document.body.currentStyle){
    		//ie code
    		window.attachEvent('onload', infinity_menu_1_init);
    	} else {
    		//mozilla code
    		window.addEventListener("load", infinity_menu_1_init, false);
    	}
    	-->
    	</script>			
    
    
    <!-- END OF MODULE 'Mygosu Menus'   --> 
    
    
    
    		</td>
    	</tr>
    	</table>
    
    
    Stuff hello later.....
    
    
    	</td>
         </tr>
              <tr>
                <td> </td>
              </tr>
              <tr>
                <td> </td>
              </tr>
            </table></td>
            <td width="10"> </td>
          </tr>
        </table></td>
        <td width="12" valign="top" class="mainbodybg"><img src="http://fccg.com.kw/templates/fccg-kn-1-2/images/leftshade2.jpg" alt="Leftshade2" width="12" height="252" /></td>
        <td width="548" valign="top" class="mainbodybg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="12"><img src="http://fccg.com.kw/templates/fccg-kn-1-2/images/spacer.png" alt="top" border="0" height="1" width="1" /></td>
          </tr>
            <tr>
            <td>		<div class="moduletable">
    		 </div>
    	</td>
          </tr>
      	  	  
         
          <tr>
    
    
    
    
    
    
    
    
    
    
            <td class="mainbodytd"><table class="blog" cellpadding="0" cellspacing="0"><tr><td valign="top"><div>				<table class="contentpaneopen">
    
    
    		</table>
    		</table>
    
    
    
    
    <?php
    
    
    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("$msg_resume_register[TEXT]");
        if($job2)
    FrmEcho("
        $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("<b>$(req) $(prompt) $(bad)</b>
    $(input)\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();
    }
    
    ?>
    
    
    
    
    
    	<table class="contentpaneopen">
    			<tr>
    		<td valign="top" colspan="2">
    
    
    
    
    
    
    
    FCCG is a holding company operating through its subsidiaries namely five (5) businesses whose main business interest is NOKIA Mobile Wholesale, Retail and Services Provider, NOKIA Networks, Radio Frequency Identification Technology, Information Technology and Wireless Service Provider.<br /><br />FCCG’s place in the State of Kuwait business has for its cornerstone a business portfolio of market leaders, strong financial capability, remarkable management team, and a vision of leading the country to global-competitiveness and making life better for every citizen of Kuwait. 			</td>
    	</tr>
    			</table>
    
    	<span class="article_seperator"> </span>
    
    	</div></td></tr></table></td>
          </tr>
          <tr>
            <td> </td>
          </tr>
      	  
          <tr>
            <td class="mainbodytd"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="174" valign="top" class="boxbg2">		<table cellpadding="0" cellspacing="0" class="moduletable-box1">
    				<tr>
    			<th valign="top">
    				Corporate Governance				</th>
    		</tr>
    				<tr>
    		<td>
    			In today’s increasingly global marketplace, sound corporate governance plays a critical role to create value for its businesses and stakeholders and to contribute to the overall development of the society it serves.			</td>
    	</tr>
    	</table>
    	</td>
                <td> </td>
                <td width="174" valign="top" class="boxbg2">		<table cellpadding="0" cellspacing="0" class="moduletable-box2">
    				<tr>
    			<th valign="top">
    				Business Interest				</th>
    		</tr>
    				<tr>
    		<td>
    			FCCG is the leading company in advance communication industry in the State of Kuwait, with strategic investment in the communications services and infrastructure businesses which contribute to the countries long-term development.			</td>
    	</tr>
    	</table>
    	</td>
                <td> </td>
                <td width="174" valign="top" class="boxbg2">		<table cellpadding="0" cellspacing="0" class="moduletable-box3">
    				<tr>
    			<th valign="top">
    				Telecommunication				</th>
    		</tr>
    				<tr>
    		<td>
    			Full-service telecommunications provider with digital wireless communication, data transmission, local and international communication and mobile-commerce services 			</td>
    	</tr>
    	</table>
    	</td>
              </tr>
            </table></td>
          </tr>
      	  <tr>
            <td> </td>
          </tr>
        </table></td>
        <td width="12" valign="top" class="mainbodybg"> </td>
        <td width="12" valign="top"> </td>
        <td> </td>
      </tr>
    </table>
    
    
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="footerbg">
      <tr>
        <td> </td>
        <td width="12"> </td>
        <td width="792" class="footer"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>		<div class="moduletable-btmenu">
    		<ul id="mainlevel-bttm"><li><a href="http://fccg.com.kw/index.php" class="mainlevel-bttm" >Home</a></li><li><a href="http://fccg.com.kw/index.php?option=com_content&task=blogsection&id=8&Itemid=29" class="mainlevel-bttm" >Investors</a></li><li><a href="http://fccg.com.kw/index.php?option=com_content&task=blogsection&id=1&Itemid=27" class="mainlevel-bttm" >News</a></li><li><a href="http://fccg.com.kw/index.php?option=com_content&task=blogsection&id=7&Itemid=28" class="mainlevel-bttm" >Companies</a></li><li><a href="http://fccg.com.kw/index.php?option=com_contact&Itemid=3" class="mainlevel-bttm" >Contact Us</a></li></ul>		</div>
    	</td>
          </tr>
          <tr>
            <td class="copyright">Copyright 2006 © Future Communications Company Global</td>
          </tr>
        </table>
        <br />
        <br /></td>
        <td width="12"> </td>
        <td> </td>
      </tr>
    </table>
    </body>
    </html>
    

     

     

     

  10. gosh finally i solved this

    thanks to all who helped especially uiniflare...i experimented and placed the code above the first instance "<?php

    " and it worked

    so silly......

     

     

    in conclusion...its just shame that you get great responses before u buy the software and when u buy it i recieve one liner comments from the developers. I will not mention the company i bought the script from (180$) and will give them another chance.

     

  11.  

    guys neither solution work...and i wish i have time to understand all that programing thats why i purchased this script for 180$... im stuck and cannot get it to display right...the support takes forever sending tickets to them...i already have 3 "bug" tickets open so i dont want to flood them with this as its only a cosmetic thing...

     

    back to the issue....i tried

    <?php
    
    include "top2.php";
    if(!$allow_register)
    {
       echo " my html stuff here";
        ob_end_clean();
        exit();
    }
    
    

     

    wont work either....please anyone know how to bypass this ob thing?

  12. Uniflare, thanks for your persistant helping

     

    i know what youre saying seems very specific to you, but for me its very complex, sorry...So  do i just change the line

     

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

     

    to

     

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

     

    like that?

    and thanks for recommending that program it will save me so much time

     

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