コード例 #1
0
include "top.html";
?>
<div class="container">
	<strong>Thank you!</strong><br><br>
	Welcome to Cousin Connects <?php 
echo $_POST['name'];
?>
!!<br>
	<br>
	Now <a class="button" href="matches.php">log in</a> to see your matches!<br>
	<br>
</div>
<?php 
$name = $_POST['surname'];
require_once 'Phonetic/Phonetic.php';
$phonetic = Phonetic::app()->run();
// can also be >run('sep'); or ash or gen (generic)
$soundkeys = $phonetic->BMSoundex->getNumericKeys($name);
$file = fopen('members.txt', 'a');
// The new data to add to the file
$data = "\n\n\n\n" . implode(",", $_POST) . "," . $soundkeys[0][0] . PHP_EOL;
//for ($i = 0; $i < count($soundkeys[0]); $i++) {
//$data .= "," . $soundkeys[0][0];
//}
// Write the contents to the file,
// using the FILE_APPEND flag to append the content to the end of the file
// and the LOCK_EX flag to prevent anyone else writing to the file at the same time
//file_put_contents($file, $data, FILE_APPEND | LOCK_EX);fwrite($file, $data);
?>
	
<?php 
コード例 #2
0
ファイル: Phonetic.php プロジェクト: aurek/BMDMSoundex
 /**
  * Application constructor.
  * Instances child classes building application hierarchy.
  *
  * @param $type
  * @return mixed
  */
 public function run($type = null)
 {
     // Type adjustment
     if (in_array($type, $this->types)) {
         self::$type = $type;
     }
     $this->DMSoundex = new DMSoundex();
     $this->BMSoundex = new BMSoundex();
     return self::$instance;
 }
コード例 #3
0
ファイル: functions.php プロジェクト: schpill/standalone
 function phonetic()
 {
     if (!class_exists('Phonetic')) {
         require_once LIBRARIES_PATH . DS . 'Phonetic/Phonetic.php';
     }
     return Phonetic::app()->run()->BMSoundex;
 }