当前位置: 首页>>代码示例>>PHP>>正文


PHP clean_up函数代码示例

本文整理汇总了PHP中clean_up函数的典型用法代码示例。如果您正苦于以下问题:PHP clean_up函数的具体用法?PHP clean_up怎么用?PHP clean_up使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了clean_up函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: login

function login($username, $password)
{
    $username = clean_up("{$username}");
    $password = clean_up("{$password}");
    $user_key = get_user_id($username);
    $results = mysql_db_query("rowanprep", "SELECT user_key FROM users WHERE username = '{$username}' AND password = '{$password}'");
    if (mysql_num_rows($results) === 0) {
        return false;
    } else {
        return $user_key;
    }
}
开发者ID:ayswanny,项目名称:Senior-Project,代码行数:12,代码来源:users.php

示例2: generateXmlCache

function generateXmlCache($xmlFiles, $callback = 'parseDatabaseDefinitionFile')
{
    global $aSkipFiles, $aOptions, $oDbh, $oCache;
    foreach ($xmlFiles as $fileName) {
        if (!in_array(baseName($fileName), $aSkipFiles)) {
            echo "  => " . basename($fileName) . ": ";
            flush();
            $oSchema =& MDB2_Schema::factory($oDbh, $aOptions);
            $result = $oSchema->{$callback}($fileName, true);
            if (PEAR::isError($result)) {
                clean_up();
                die("Failed\n");
            } else {
                $oCache->save($result, $fileName);
                echo "Processed";
                eol_flush();
            }
            unset($result);
        }
    }
}
开发者ID:akirsch,项目名称:revive-adserver,代码行数:21,代码来源:buildXmlCache.php

示例3: clean_up

<?php

require '../init.php';
$addnew = true;
if (isset($_GET['orchestra'])) {
    $orchestra = clean_up($_GET['orchestra']);
    if ($result = mysql_db_query("rowanprep", "SELECT * FROM orchestra WHERE registration_key LIKE '{$orchestra}'")) {
        $row = mysql_fetch_assoc($result);
        if (mysql_num_rows($result) !== 0) {
            $addnew = false;
        }
    }
}
$student = $_POST["student"];
$instrument = $_POST["instrument"];
$ryo_form = $_POST["ryo_form"];
$tuition_due = $_POST["tuition_due"];
$notes = $_POST["notes"];
$tuition_owed = $tuition_due - $tuition_paid;
if ($addnew) {
    $sql = "INSERT INTO `orchestra` (student, instrument, ryo_form, tuition_due, notes) VALUES ('{$student}', '{$instrument}', '{$ryo_form}', '{$tuition_due}', '{$notes}')";
} else {
    $sql = "UPDATE `orchestra` SET student='{$student}', instrument='{$instrument}', ryo_form='{$ryo_form}', tuition_due='{$tuition_due}', notes='{$notes}' WHERE registration_key= '{$orchestra}'";
}
$link = connectDB();
$results = mysql_db_query("rowanprep", $sql);
if (!$results) {
    echo 'Input failed...<br>';
    echo mysql_errno($link) . ": " . mysql_error($link) . "\n";
} else {
    header("Location:../../reports.php");
开发者ID:MoxieWhimsy,项目名称:Senior-Project,代码行数:31,代码来源:add-edit-orchestra.php

示例4: clean_up

<?php

function clean_up()
{
    $_SESSION['returnArray'] = "";
}
session_start();
if (isset($_SESSION['returnArray'])) {
    echo $_SESSION['returnArray'];
    clean_up();
}
$newActive = 0;
if (isset($_GET['stop']) && $_GET['stop'] == "yes") {
    $newActive = 0;
} else {
    if (isset($_GET['stop']) && $_GET['stop'] == "no") {
        $newActive = 1;
    }
}
if (!isset($_SESSION['entrance'])) {
    $_SESSION['entrance']['on'] = false;
    $_SESSION['entrance']['email'] = "";
    $_SESSION['entrance']['password'] = "";
}
?>
<!doctype html>
<html class="no-js" lang="en">
  <head>
    <meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title><?php 
开发者ID:EfraimKrug,项目名称:Canneur,代码行数:31,代码来源:StopServiceForm.php

示例5: error_reporting

// Called after the Office Visit Form is submitted.
// If you need an example backend script, please see `submit_pain_form.php`
include 'core/init.php';
/* For Debugging */
error_reporting(E_ALL);
ini_set('display_errors', 1);
/* patient_id will be propagated through a GET variable */
$form_status = STATUS_EMPTY;
//assume EMPTY until we determine otherwise
if (!isset($_GET['patient_id']) or !isset($_GET['slot_id']) or !isset($_GET['addnew'])) {
    die("Patient ID and Slot ID and Addnew required");
}
$patient_id = clean_up($_GET['patient_id']);
$slot_id = clean_up($_GET['slot_id']);
$addnew = clean_up($_GET['addnew']);
// whether this is new (SQL INSERT) or adding (SQL UPDATE)
$form_status = get_form_status($patient_id, $slot_id);
$user_role = get_user_role($_SESSION['id']);
//role of user (doctor, med student, admin); not the patient
if ($form_status == STATUS_LOCKED and $user_role != 'ADMIN') {
    // Form is locked, sorry, you can't edit it!
    die("Sorry, this form is locked! <a href = 'patient-info.php?patient_id={$patient_id}'>Click here for a read-only copy of this patient's data</a>");
}
/*----------------------------------------------------------------------------------------------------------------------
 * Step 1: Collect our POST variables into PHP variables for readability.
 * We will perform data validation with helper functions.
 * Pay careful attention to variables which have bounds
 * As well as date parsing. SQL date convention is: YYYY-MM-DD
 * As well as Yes/No or True/False responses. SQL convention dictates we
 * store such information as CHAR(1): 'Y' or 'N'.
开发者ID:rwsmith,项目名称:RowanEMR,代码行数:30,代码来源:submit_visit_form.php

示例6: xmlrpc_encode_request

    }
}
if (array_key_exists('buildalways', $_GET)) {
    $force_build = (bool) $_GET['buildalways'];
}
//echo $force_build;
//Check if vtid and version were provided
//echo $vtid . $version;
if ($vtid != '' and $version != '') {
    //echo $host . $port . $dbname . $vtid . $version;
    $request = xmlrpc_encode_request('get_wf_xml', array($host, $port, $dbname, $vtid, $version));
    //echo $request;
    $response = do_call($VT_HOST, $VT_PORT, $request);
    $response = html_entity_decode($response);
    header("Content-Type: text/xml");
    clean_up($response);
} else {
    echo "ERROR: Vistrails id or version not provided.\n";
}
function get_version_from_response($xmlstring)
{
    try {
        $node = @new SimpleXMLElement($xmlstring);
        return $node->params[0]->param[0]->value[0]->array[0]->data[0]->value[0]->int[0];
    } catch (Exception $e) {
        echo "bad xml";
    }
}
function clean_up($xmlstring)
{
    try {
开发者ID:hjanime,项目名称:VisTrails,代码行数:31,代码来源:get_wf_xml.php

示例7: clean_up

    }
}
//var_dumpclean_up($_POST);
$first_name = clean_up($_POST["first_name"]);
$last_name = clean_up($_POST["last_name"]);
$street_address = clean_up($_POST["street_address"]);
$city = clean_up($_POST["city"]);
$state = clean_up($_POST["state"]);
$zip_code = clean_up($_POST["zip_code"]);
$email = clean_up($_POST["email"]);
$banner_id = clean_up($_POST["banner_id"]);
$home_phone = store_phone(clean_up($_POST["home_phone"]));
$mobile_phone = store_phone(clean_up($_POST["mobile_phone"]));
$alternate_email = clean_up($_POST["alternate_email"]);
$faculty_status = clean_up($_POST["faculty_status"]);
$instrument = clean_up($_POST["instrument"]);
$background_check = clean_up($_POST["background_check"]);
/* Prepared statement, stage 1: prepare */
if ($addnew) {
    $sql = "INSERT INTO teachers (last_name, first_name, banner_id, home_phone, mobile_phone, email, alternate_email, street_address, city, state, zip_code, faculty_status, instrument, background_check) VALUES ('{$last_name}', '{$first_name}','{$banner_id}','{$home_phone}','{$mobile_phone}','{$email}','{$alternate_email}','{$street_address}','{$city}','{$state}','{$zip_code}','{$faculty_status}','{$instrument}','{$background_check}')";
} else {
    $sql = "UPDATE teachers SET last_name='{$last_name}', first_name='{$first_name}', banner_id='{$banner_id}', home_phone='{$home_phone}', mobile_phone='{$mobile_phone}', email='{$email}', alternate_email='{$alternate_email}', street_address='{$street_address}', city='{$city}', state='{$state}', zip_code='{$zip_code}', faculty_status='{$faculty_status}', instrument='{$instrument}', background_check='{$background_check}' WHERE teacher_key = '{$teacher}'";
}
$link = connectDB();
$results = mysql_db_query("rowanprep", $sql);
if (!$results) {
    echo 'Input failed...<br>';
    echo mysql_errno($link) . ": " . mysql_error($link) . "\n";
} else {
    header("Location:../../reports.php?tab=teachers");
}
开发者ID:ayswanny,项目名称:Senior-Project,代码行数:31,代码来源:add-edit-teacher.php

示例8: clean_up

                         <td><div class="text-center">', $row['notes'], '</div></td>';
                        }
                        echo '</tbody>';
                    }
                    ?>
      </table>
    </div>
  </div>
  <?php 
                } else {
                    if ($tab == 'class') {
                        ?>
  <div id="class" class="table-responsive">
    <?php 
                        if (isset($_GET['class-key'])) {
                            $class_key = clean_up($_GET['class-key']);
                            $results = get_student_list($class_key);
                        }
                        $results = get_class_name($class_key);
                        $row = mysql_fetch_assoc($results);
                        echo "<h3>" . $row['class_name'] . " Class</h3>";
                        ?>
    <ul class="list-inline">
      <li><a href="reports.php?tab=class&class-key=<?php 
                        echo $class_key;
                        ?>
&sortby=1">Last Name</a></li>
      <li><a href="reports.php?tab=class&class-key=<?php 
                        echo $class_key;
                        ?>
&sortby=2">First name</a></li>
开发者ID:ayswanny,项目名称:Senior-Project,代码行数:31,代码来源:reports-content.php

示例9: header

<?php

require '../init.php';
if (!isAdmin($_SESSION[id])) {
    header("Location: ../../index.php");
}
if (isset($_GET['key'])) {
    $key = clean_up($_GET['key']);
    $delete = false;
    mysql_db_query("rowanprep", "DELETE FROM `classes` WHERE `class_id` LIKE '{$key}'");
    if ($result = mysql_db_query("rowanprep", "SELECT * FROM `classes` WHERE `class_id` LIKE '{$key}'")) {
        $row = mysql_fetch_assoc($result);
        if ($result->num_rows == 0) {
            $delete = true;
        }
    }
}
header("Location: ../../reports.php");
开发者ID:ayswanny,项目名称:Senior-Project,代码行数:18,代码来源:delete-class.php

示例10: clean_up

}
// of else user filled form
?>
   <footer>
     <div class="container">
       <div class="row">
         <div class="col-md-12">
           <br>
           <p><small>&copy; B.Ζαχαριουδάκης<br><a href="mailto:it@dipe.ira.sch.gr">Τμ. Μηχανογράφησης ΔΙ.Π.Ε. Ηρακλείου</a>, 2015</small></p>
         </div>
       </div>
     </div>
   </footer>
<?php 
// Clean up old pdf files
clean_up($cleanUpAfter);
?>
</body>
<script type = "text/javascript">
     $(document).ready(function() {
       var div = document.getElementById("postData");
       var myData = div.textContent;
       var userAfm = <?php 
echo $inpAfm;
?>
;
        $("#pdfButton").click(function(event){
            $.post(
              "pdf.php",
              { afm: userAfm, data: myData },
              function(data) {
开发者ID:dipeira,项目名称:espa-payments,代码行数:31,代码来源:index.php

示例11: create_conversation

function create_conversation($chater2)
{
    echo "conversation {$chater2}\n";
    //variables globales
    global $table_general, $table_messages, $table_conversations, $id, $session_time;
    $binome = new Binome($chater2);
    //un peu de nettoyage...
    //effacer des messages
    $sql = "DELETE FROM " . $table_messages . " WHERE conversation IN ( SELECT id_conversation FROM " . $table_conversations . " WHERE user1 = '" . $binome->nom1 . "' AND user2 = '" . $binome->nom2 . "'); ";
    //effacer les conversations precedentes concernant les noms
    if (!mysql_query($sql)) {
        return -1;
    }
    //effacer la conversation precedente (les noms sont dans l'ordre)
    $sql = "DELETE FROM " . $table_conversations . " WHERE user1 = '" . $binome->nom1 . "' AND user2 = '" . $binome->nom2 . "';";
    //envoi de la requete
    if (!mysql_query($sql)) {
        return -1;
    }
    //un peu plus de nettoyage ?
    $aleat = rand(0, 20);
    if (aleat < 2) {
        clean_up();
    }
    //creer la conversation
    $sql = "INSERT INTO " . $table_conversations . " (user1,session_1,user2,session_2) " . "VALUES ('" . $binome->nom1 . "','" . $binome->session1 . "','" . $binome->nom2 . "','" . $binome->session2 . "');";
    if (!mysql_query($sql)) {
        echo $sql . " " . mysql_error() . "\n";
        return -1;
    }
    echo $sql . "\n";
    return mysql_insert_id();
    //retourne l'index
}
开发者ID:laiello,项目名称:mon-projet-lapinou,代码行数:34,代码来源:chat_comm.inc.php

示例12: clean_up

<?php

if (isset($_GET['lesson'])) {
    $lesson = clean_up($_GET['lesson']);
} else {
}
$addnew = false;
$link = connectDB();
$result = mysql_db_query("rowanprep", "SELECT * FROM lessons WHERE lesson_key LIKE '{$lesson}'");
$num_rows = mysql_num_rows($result);
if ($num_rows === 0) {
    $addnew = true;
}
$row = mysql_fetch_assoc($result);
?>

<form action="core/database/add-edit-lessons.php?lesson=<?php 
echo $row['lesson_key'];
?>
" class="form-horizontal" method="post" onsubmit="validate()">
<fieldset>

  <!-- Form Name -->
  <legend><div class="row text-center"><?php 
echo $addnew ? "Add" : "Edit";
?>
 Lesson</div></legend>
  <!-- Text input-->
  <form class="form-horizontal">
  <fieldset>
开发者ID:ayswanny,项目名称:Senior-Project,代码行数:30,代码来源:edit-lessons-form-content.php

示例13: clean_up

<?php

if (isset($_GET['band'])) {
    $band = clean_up($_GET['band']);
} else {
}
$addnew = false;
$link = connectDB();
$result = mysql_db_query("rowanprep", "SELECT * FROM brass_band WHERE registration_key LIKE '{$band}'");
$num_rows = mysql_num_rows($result);
if ($num_rows === 0) {
    $addnew = true;
} else {
    $row = mysql_fetch_assoc($result);
}
?>

<form action="core/database/add-edit-band.php?band=<?php 
echo $row['registration_key'];
?>
" class="form-horizontal" method="post" onsubmit="validate()">
<fieldset>

	<legend><div class="row text-center"><?php 
echo $addnew ? "Add" : "Edit";
?>
 Band Student</div></legend>

	

	<!-- Text input-->
开发者ID:MoxieWhimsy,项目名称:Senior-Project,代码行数:31,代码来源:edit-band-form-content.php

示例14: clean_up

    <li class="active"><a data-toggle="tab" href="#intake">Intake Paperwork</a></li>
    <li><a data-toggle="tab" href="#complaint">Chief Complaint</a></li>
    <li><a data-toggle="tab" href="#history">History</a></li>
    <li><a data-toggle="tab" href="#vitals">Vitals</a></li>
    <li><a data-toggle="tab" href="#physical">Physical</a></li>
    <li><a data-toggle="tab" href="#omm">OMM Exam</a></li>
    <li><a data-toggle="tab" href="#notes">Notes</a></li>
  </ul>
</div>


  <div class="tab-content" align="center">
<div id = "intake" class="tab-pane active">
  <h2 align="center">Intake Work</h2>
  <?php 
$patient_id = clean_up($_GET['patient_id']);
//pass patient ID
include 'patient-info-content.php';
?>
</div>

<!-- Chief Complaint Tab -->
    <div id="complaint" class="tab-pane">

    <form action="submit_visit_form.php?patient_id=<?php 
echo $patient_id;
?>
&slot_id=<?php 
echo $slot_id;
?>
&addnew=<?php 
开发者ID:rwsmith,项目名称:RowanEMR,代码行数:31,代码来源:visit-form.php

示例15: get_form_status

/**
 * Returns the form status, stored in one of the constants at the top of this file
 * Example Usage: get_form_status(1, 1) => STATUS_EMPTY
 * @param $patient_id int The patient ID to look for
 * @param $slot_id int The scheduled slot aka visit date ID (OfficeVisitForm.visit_date_id)
 * @return string The status of this form: one of: (STATUS_EMPTY, STATUS_AWAITING_APPROVAL, STATUS_LOCKED)
 */
function get_form_status($patient_id, $slot_id)
{
    global $db;
    $patient_id = clean_up($patient_id);
    $slot_id = clean_up($slot_id);
    $result = $db->query("SELECT status FROM OfficeVisitForm WHERE patient_id = '{$patient_id}' AND visit_date_id = '{$slot_id}'");
    $row = $result->fetch_assoc();
    if ($result->num_rows === 0) {
        return STATUS_EMPTY;
    } else {
        return $row['status'];
    }
    // return the status, either waiting for doctor approval or locked.
}
开发者ID:rwsmith,项目名称:RowanEMR,代码行数:21,代码来源:users.php


注:本文中的clean_up函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。