Jump to content

danielbala

Members
  • Posts

    33
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

danielbala's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi thanks for your reply,but iam NIL with payment methods,Can i do it?
  2. Hi All, I jusr learnt the magento basics,i want to create a shopping cart using magento for selling old products I want to know what are the functionalities to be included in the website like.. 1.SEO 2.what Payment methods should be used. 3.for security purpose 4.what is SSL certificate should i do anything with that Thanks
  3. Hi. Iam trying to sent this form values to my email Its not working Can anyone help to solve this.. this is the form <form method="POST" action="sendemail.php"> <table width="450px"> <tr> <td valign="top"> <label for="name">Name </label> </td> <td valign="top"> <input type="text" name="name" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top"> <label for="organisation">Organisation </label> </td> <td valign="top"> <input type="text" name="organisation" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top"> <label for="contact">Contact no </label> </td> <td valign="top"> <input type="text" name="contact" maxlength="80" size="30"> </td> </tr> <tr> <td valign="top"> <label for="remarks">Remarks</label> </td> <td valign="top"> <textarea name="remarks" maxlength="50" ></textarea> </td> </tr> <tr> <td valign="top"> <label for="designation">Designation </label> </td> <td valign="top"> <input type="text" name="designation" maxlength="50" size="50"> </td> </tr> <tr> <td valign="top"> <label for="email">E-mail </label> </td> <td valign="top"> <input type="text" name="email" maxlength="50" size="40"> </td> </tr> <tr> <td colspan="2" style="text-align:center"> <input type="submit" value="Submit"> <input type="reset" value="Reset"> </td> </tr> </table> </form> sendemail.php <?php session_start(); if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "-----------------l@gmail.com"; $email_subject = "Contact Details"; function died($error) { // your error code can go here echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['name']) || !isset($_POST['organisation']) || !isset($_POST['email']) || !isset($_POST['contact']) || !isset($_POST['designation']) || !isset($_POST['remarks'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $name = $_POST['name']; $organisation = $_POST['organisation']; $email = $_POST['email']; $contact = $_POST['contact']; $designation = $_POST['designation']; $remarks = $_POST['remarks']; $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$name)) { $error_message .= 'Name you entered does not appear to be valid.<br />'; } if(strlen($remarks) < 2) { $error_message .= 'The Remarks you entered do not appear to be valid.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Name: ".clean_string($name)."\n"; $email_message .= "Organisation: ".clean_string($organisation)."\n"; $email_message .= "Contact No: ".clean_string($contact)."\n"; $email_message .= "Email: ".clean_string($email)."\n"; $email_message .= "Remarks: ".clean_string($remarks)."\n"; $email_message .= "Designation: ".clean_string($designation)."\n"; $headers = 'From: '.$email."\r\n". 'Reply-To: '.$email."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); }?> <!-- include your own success html here --> Thank you for contacting us. We will be in touch with you very soon.
  4. Hi.. I installed WAMP server... When I go to localhost iam getting this is "NOT FOUND" HTTP Error 404. The requested resource is not found. how to solve this
  5. ..Im not using any mail server..i want to write a program for identifying spam emails using naive bayes algorithm...i want to try it using php i just took this code from google..i dont know whether we should create DB table or any forms with fields?? <?php class SpamChecker { public $dbh = null; function trainFilter($text,$isspam=true) { if(is_null($this->dbh)) { throw new Exception("Database connection is null"); } $query = $this->dbh->prepare ('select totalsid,totalspam,totalham FROM totals;'); $query->execute(); $result = $query->fetchAll(); $totalsid = $result[0]['totalsid']; $totalspam = $result[0]['totalspam']; $totalham = $result[0]['totalham']; if($isspam){ $totalspam++; $query = $this->dbh->prepare ('update `totals` set totalspam=? where totalsid=1 limit 1;'); $insert = $query->execute(array($totalspam)); } else { $totalham++; $query = $this->dbh->prepare ('update `totals` set totalham=? where totalsid=1 limit 1;'); $insert = $query->execute(array($totalham)); } $text = preg_replace('/\W+/',' ',$text); $text = preg_replace('/\s\s+/',' ',$text); $text = strtolower($text); $temparray = explode(' ',$text); $gettokenquery = $this->dbh->prepare ('select `spamid`,`spamcount`,`hamcount` from spam where token=? limit 0,1;'); foreach($temparray as $token) { $gettokenquery->execute(array($token)); $result = $gettokenquery->fetchAll(); if(count($result) == 0) { if($isspam) { $query = $this->dbh->prepare ("insert into `spam` (`token`,`spamcount`,`hamcount`, `spamrating`) values (?,'1','0','1');"); $insert = $query->execute(array($token)); } else { $query = $this->dbh->prepare ("insert into `spam` (`token`,`spamcount`,`hamcount`, `spamrating`) values (?,'0','1','0');"); $insert = $query->execute(array($token)); } } else { // Already exists in the database $spamcount = $result[0]['spamcount']; $hamcount = $result[0]['hamcount']; if($isspam){ $spamcount++; } else { $hamcount++; } $hamprob = 0; $spamprob = 0; if($totalham != 0){ $hamprob = $hamcount/$totalham; } if($totalspam != 0) { $spamprob = $spamcount/$totalspam; } if($hamprob+$spamprob != 0) { $spamrating = $spamprob/($hamprob+$spamprob); } else { $spamrating = 0; } $query = $this->dbh->prepare ("update `spam` set `spamcount`=?, `hamcount`=?, `spamrating`=? where token=? limit 1;"); $query->execute(array($spamcount,$hamcount, $spamrating,$token)); } } } function checkSpam($text) { if(is_null($this->dbh)) { throw new Exception("Database connection is null"); } $text = preg_replace('/\W+/',' ',$text); $text = preg_replace('/\s\s+/',' ',$text); $text = strtolower($text); $temparray = explode(' ',$text); $gettokenquery = $this->dbh->prepare ('select `token`,`spamrating` from spam where token=? limit 0,1;'); $spamratings = array(); foreach($temparray as $token) { $gettokenquery->execute(array($token)); $result = $gettokenquery->fetchAll(); $spamrating = $result[0]['spamrating']; if($spamrating == ''){ $spamrating = 0.4; } $spamratings[] = $spamrating; } $a = null; $b = null; foreach($spamratings as $rating) { $rating = max($rating,0.01); $a = is_null($a) ? (float)$rating : $a * $rating; $b = is_null($b) ? 1-(float)$rating : $b * (1-(float)$rating); } $spam = (float)0; if((float)((float)$a+(float)$b) != 0) { $spam = (float)$a/(float)((float)$a+(float)$b); } return $spam; } function resetFilter() { if(is_null($this->dbh)) { throw new Exception("Database connection is null"); } $trun = $this->dbh->prepare('TRUNCATE TABLE `spam`;'); $trun->execute(); $trun = $this->dbh->prepare ('update totals set totalspam=0, totalham=0 limit 1;'); $trun->execute(); } } ?> Hide details Change log r31 by bboyte01 on May 23, 2010 Diff Update to remove issues with divide by zero errors. Go to: Double click a line to add a comment Older revisions r28 by bboyte01 on Apr 14, 2010 Diff r27 by bboyte01 on Feb 18, 2010 Diff r26 by bboyte01 on Feb 18, 2010 Diff All revisions of this file File info Size: 4111 bytes, 141 lines View raw file File properties svn:mergeinfo
  6. Hi.. I want to implement a program for identifying spam emails using an algorithm naive bayes in php.. How to implement this ..can any one help me.. Thx in advance
  7. Hi Im using datagrid in javascript to display a table in a page. And im using the check box field in the table..when i select the check box the value is posted in the DB table but the current employee name field is not posted to the DB field Assignedto <script type="text/javascript"> var thegrid = new drasticGrid('grid1', {pathimg:"img/", pagelength:10, columns: [ {name: 'JOB_ID',width:40}, {name: 'ASSIGN_DATE',editable:false,width:80}, {name: 'CLIENT_NAME',editable:false,width:140}, {name: 'JOB_NAME',editable:false,width:100}, {name: 'TASKS_INVOLVED',editable:false,width:140}, {name: 'ASSIGNED_TO',editable:true,width:100}, {name: 'REMARKS', editable: true,width:140}, {name: 'EXP_COMPL_DATE',editable:true,width:80}, {name: 'JOB_STATUS',editable:true,width:100}, {name: 'MANAGER_APPR',editable:false,width:80}, {name: 'Apply'} ] }); </script> <form action="" method="post" enctype="multipart/form-data" name="ActivityPhoneCallForm" target="_self"> <br /> <br /> <table border="1"> <tr width="569" colspan="2"> <td> Current User :    <input name="CurrentUser" type="text" disabled id="UserId" size="35" maxlength="35" readonly class="disabled" value="<?php if (isset($T_UserName)){echo $T_UserName;} ?>"/>   Activity :   <input name="LogActivity" type="text" disabled id="ActLog" size="35" Value="List New Jobs" maxlength="35" readonly class="disabled" />  <br /> Current Employee Name : <input name="CurrentEmpName" type="text" disabled id="CurrentEmpId" size="35" maxlength="35" readonly class="disabled" value="<?php if (isset($T_UserFullName)){echo $T_UserFullName;} ?>"/> </td> </tr> </table> <br /> <table width="1150" height = "200" border="1"> <tr> <td> <div id="grid1"></div> <script type="text/javascript" src="js/mootools-1.2-core.js"></script> <script type="text/javascript" src="js/mootools-1.2-more.js"></script> <script type="text/javascript" src="js/drasticGrid.js"></script> <script type="text/javascript"> var thegrid = new drasticGrid('grid1', {pathimg:"img/", pagelength:10, columns: [ {name: 'JOB_ID',width:40}, {name: 'ASSIGN_DATE',editable:false,width:80}, {name: 'CLIENT_NAME',editable:false,width:140}, {name: 'JOB_NAME',editable:false,width:100}, {name: 'TASKS_INVOLVED',editable:false,width:140}, {name: 'ASSIGNED_TO',editable:true,width:100}, {name: 'REMARKS', editable: true,width:140}, {name: 'EXP_COMPL_DATE',editable:true,width:80}, {name: 'JOB_STATUS',editable:true,width:100}, {name: 'MANAGER_APPR',editable:false,width:80}, {name: 'Apply'} ] }); </script> </td> </tr> </table> <br /> <br />    <input type="submit" name="AssignJob" id="AssignJobID" value="  Assign Job  " class="EmpFormButton"/> <input type="reset" name="AddJobCancel" id="AddJobCancelID" value="  Cancel  " class="EmpFormButton"/> </form> </div>
  8. Where to set the variable??
  9. where to set the variabale??
  10. im getting null and above that im getting this error also Undefined index: emp_name
  11. im getting this error Parse error: syntax error, unexpected T_IF in C:\w
  12. i gave as if (isset($_SESSION['emp_name'])){ $CurrentEmpName=$_SESSION['emp_name']; } is not correct???
  13. I already gave isset($_SESSION['emp_name'];
  14. nope this is the only code not gathered..
  15. please i dont know whether my code is correct or not??
×
×
  • 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.