maydhyam 38 Posting Pro :)

Ok, I'm not quite sure what to do...I found the php.ini file, and this is what it says:

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

maydhyam 38 Posting Pro :)

Hello,

Quick question...For the email code in the PHP script to work, do I have to make any server settings? or make any accomodation for the type of server it is being run on? If so, then please guide me...

The application is located on a Linux server.

maydhyam 38 Posting Pro :)

it still doesn't display anything, even if I concactinate the headers...can anyone axplain to me why this is happening?

maydhyam 38 Posting Pro :)

Well I have a bigger problem, today when I tried to register, the page is blank, but as soon as I comment off this chunk of code, the page displays as normal...

//sends an email notification to administrator about new account registered.
if($al=="NULL")
{
    $mailheaders = "From : ".'$username'."\n";
    $mailheaders = "Goodday, \n I just registered in the your Website.\n Awaiting your finalization.";
    $to = "someone@somewhere.com";
    $subject = "New Account";

    mail($to,$subject,$mailheaders);
}
maydhyam 38 Posting Pro :)

I did that, but it didn't make any difference...:'(

here's the code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/TAIStemplate.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Operator Assisted Calls</title>
<!-- InstanceEndEditable -->
<style type="text/css">
<!--
.style1 {
	color: #FFFFFF;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-style: normal;
	font-weight: lighter;
	font-size: 20px;
}
body {
	background-color: #FFFFFF;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style2 {
	font-size: 20px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style3 {
	font-size: 18px;
	font-weight: bold;
	color:#0000CC
}
-->
</style>
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
body {
	background-color: #CCFFFF;
}
.style4 {color: #000000}
.style17 {
	color:#FF0000;
	font-size:16px;
	font-family: Times New Roman, Times, serif;
	text-transform:uppercase;
}
-->
</style>
<!-- InstanceEndEditable -->

</head>

<body>
<table width="700" height="244" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
  <tr bordercolor="#FF0000">
    <th width="794" height="136" bordercolor="#FFFFFF" scope="col"><img src="/images/Operator_Banner.jpg" alt="Web page banner" width="791" height="136" longdesc="/images/Operator_Banner.jpg" /></th>
  </tr>
  <tr bordercolor="#0000FF" bgcolor="#0000FF">
    <td height="107" bordercolor="#FFFFFF" bgcolor="#FFFFFF"><div align="center">
      <div align="center"><img src="/images/menu.jpg" alt="menu" width="775" height="30" border="0" usemap="#Map" /></div>
      <table width="775" border="0">
        <tr bordercolor="#99CCFF">
          <td>&nbsp;</td>
        </tr>

        <!-- InstanceBeginEditable name="body" -->
		<script src="functions.js" type="text/javascript" language="javascript">
			
		</script>
        <?
session_start(); 
include("./connect.php");
/**
 * Returns true if the username has been taken
 * by another user, false otherwise.
 */
function usernameTaken($username)
{
   global $conn;
   if(!get_magic_quotes_gpc())
   {
      $username = addslashes($username);
   }
   $q = "select EmployeeID from Operators where username = '$username'";
   $result = mysql_query($q,$conn);
   $row=mysql_fetch_array($result);
   $_POST['badge_num']=trim($_POST['badge_num']);
   if($row['EmployeeID']==$_POST['badge_num'])
   	return true;
   else return false;
}
/**
 * Inserts the given (username, password) …
maydhyam 38 Posting Pro :)

Hi,
Can anyone tell me what is wrong with my code? I am trying to have an email sent to the email addy hardcoded informing the the email receiver that the info was sent into the DB...and when I do add a user, no email was sent...only the registration data was added to the DB...

function addNewOperator($Badge, $fn, $ln, $username, $password)
{
   global $conn;
   $f=strtoupper(substr ( $fn, 0 , 1 ));
   $l=strtoupper(substr ( $ln, 0 , 1 ));
   $initials=$f."".$l;
   $al="NULL";
   $q = "INSERT INTO Operators (EmployeeID,LastName,FirstName,Initials,username,password,accessLevel) VALUES ('$Badge','$ln','$fn','$initials','$username', '$password','$al')";   
   return mysql_query($q,$conn);  
      
   //sends an email notification to administrator about new account registered.
	if($al=="NULL")
	{
		$mailheaders = "From : ".'$username'."\n";
		$mailheaders = "Goodday, \n I just registered in the your Website.\n Awaiting your finalization.";
		$to = "someone@somewhere.com";
		$subject = "New Account";
	
		mail($to,$subject,$mailheaders);
	}    
}
maydhyam 38 Posting Pro :)

Hi All,

I have a form with a submit button that enters the registration data into the MySQL DB...is there a way for a notification to be sent to the System Administrator notifying her about the registration?

maydhyam 38 Posting Pro :)

Hi,

I have a web application where the users have to create an account to be able to access the entry form. I have 2 types of users, 1. Admin and 2. User. I have a Java application that is called via a link on the page, but I only want the link to work for the Admin users...

Is this possible? and if so, can you please guide me

Thanks in advance...

maydhyam 38 Posting Pro :)

ok, this is what I just got...in the .bat file instead of
java -jar "MyJar.jar"
type this...
start javaw -jar "MyJar.jar"
and I tried it, and guess what...it works...

maydhyam 38 Posting Pro :)

Hi,

I have an application set to run in a .bat file, and would like to know what I can do to hide the command window that comes up with the application when it is executed, but still have the application running.

maydhyam 38 Posting Pro :)

Thanks you all...
:)

maydhyam 38 Posting Pro :)

Hi,

Could anyone help me with this problem, the following code contains the GUI for a chargeback application which was handed on to me. I want to be able to test the components DC1 and DC2 to make sure information was entered when the btnGenChargeReport button is clicked...
:?:
I used an if/else statement within the try statement before the writeable workbook statement, but nothing happens...

package chargereport;


import java.awt.event.ActionEvent;
import java.io.*;
import javax.swing.*;
import java.sql.*;
import java.util.*;
import java.io.File; 
import jxl.*; 
import jxl.write.*; 
import com.toedter.calendar.JDateChooser;
import java.text.SimpleDateFormat;


public class CRTest extends javax.swing.JFrame
{

    String username;
    String password;
    private com.toedter.calendar.JDateChooser txtDC1;
    private com.toedter.calendar.JDateChooser txtDC2;
    javax.swing.JButton btnClose = new javax.swing.JButton();


    public void setUsername(String newValue) 
    {
        username = newValue;
    }   

    public void setPassword(String newValue) 
    {
        password = newValue;
    }  


    /** Creates new form ChargeReport */
    public CRTest()
    {
        initComponents();

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                          
    private void initComponents() 
    {
        javax.swing.JButton btnGenChargeReport;

        javax.swing.JLabel jLabel1;
        javax.swing.JLabel jLabel2;
        javax.swing.JLabel jLabel3;
        javax.swing.JLabel jLabel4;
        /*javax.swing.JTextField tfEndDate;
        javax.swing.JTextField tfStartDate;*/

        btnGenChargeReport = new javax.swing.JButton();

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        txtDC1=new JDateChooser("yyyy-MM-dd","##-##-####",'_');
        txtDC2=new JDateChooser("yyyy-MM-dd","##-##-####",'_');


        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Generate Charge Report");

        btnClose.setText("Close");


        btnGenChargeReport.setText("Generate Charge Report");
        btnGenChargeReport.addActionListener(new java.awt.event.ActionListener() {            
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGenChargeReportActionPerformed(evt);
            }
        });

        btnClose.addActionListener(new java.awt.event.ActionListener() {            
            public void actionPerformed(java.awt.event.ActionEvent …
maydhyam 38 Posting Pro :)

Hi DangerDev,

When I executed the .jar file from the link, some of the components doesn't work, but when the actual file was executed, it works just fine...
The .bat file works properly from the link as well, but the command window opens up, and I do not want that...

maydhyam 38 Posting Pro :)

it's opening the .bat file from a link in the webpage(the command window opens by default)

maydhyam 38 Posting Pro :)

Hi,

I created an executable jar file for my Java application, and I was wondering if I should leave it like that or should I change it to a .bat file for execution via a webpage.

May

maydhyam 38 Posting Pro :)

Hi Everyone,

My name is Maydhya (25 yrs) and I am from the the last island in the Chain of Caribbean Islands called Trinidad and Tobago.
I got my BSc (Hons) in Computing 2 years ago. This year, for the first time, I am working in the IT Department and i have to use what I learnt in school, but it can be challanging at times...I sure do hope that this site can help me as much as needed, and of courrse, one must not only expect to receive, but give also...so I would try my best to help out wherever I can too...
I stumbled upon this site when searching for a way to hide the command window when executing a batch file running a Java application, and this seems like a really interesting site to be included in hence my joining...
:-)
Well do take care for now...