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


PHP csrf_token_tag函数代码示例

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


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

示例1: csrf_token_tag

                        </p>

                        <div class="row">
                            <div class="col-md-12">
<!--        <form id="" class="form-horizontal" action="--><?php 
//echo $_SERVER['PHP_SELF'].$url;
?>
<!--" method="POST">-->
            <form class="m-t" role="form" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
" method="POST">


                <?php 
echo csrf_token_tag();
?>

                <p class="help-block col-lg-offset-2 col-md-offset-2"><a style="color:blue-decoration: underline" href="login.php">back to login</a></p>

                <div class="form-group">
                    <input type="password" name="password" class="form-control" placeholder="New Password" required="">
                </div>

                <div class="form-group">
                    <input type="password" name="password_confirm" class="form-control" placeholder="Confirm new password" required="">
                </div>



开发者ID:kamy333,项目名称:rajah,代码行数:27,代码来源:login_reset_password.php

示例2: Create_form

 public static function Create_form()
 {
     //        $is_data=false
     //        if($is_data){
     //
     //            $qr_str="?class_name=".get_called_class()."&";
     //        } else {
     //            $qr_str='?';
     //        }
     if (isset($_GET['id'])) {
         //            $post_link=$_SERVER["PHP_SELF"]."?id=".urldecode($_GET['id'].$qr_str);
         //            $post_link=$_SERVER["PHP_SELF"].$qr_str."id=".urldecode($_GET['id']);
         $post_link = clean_query_string(static::$page_edit . "?id=" . urldecode($_GET['id']));
         $page = "Update";
         $page1 = "Update ";
         $text_post = "Updated";
         $text_post1 = "update";
     } else {
         $post_link = clean_query_string(static::$page_new);
         $page = "New";
         $page1 = "Add New ";
         $text_post = "created";
         $text_post1 = "creation";
     }
     //        var_dump($post_link);
     //        echo "<pre>";
     //
     //        print_r($_SERVER['QUERY_STRING']);
     //        echo BR;
     //        print_r($_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']);
     //        echo BR;
     //        print_r($_SERVER);
     //
     //        echo "</pre>";
     $output = "";
     $link = "<a href='" . $_SERVER["PHP_SELF"] . " '>" . ' ' . $page1 . "' " . clean_query_string(static::$page_name) . "</a>";
     $h4 = "<h4 class='text-center'>{$link} </h4>";
     //        $output.= $h4;
     $output .= "<div class =\"background_light_blue\">";
     $output .= "<form name='form_ToDo'  class='form-horizontal' method='post' action='{$post_link}'> ";
     $output .= "<fieldset id=\"login\" title=\"Client\"><legend class=\"text-center\" style=\"color: #0000ff\">" . $link . "</legend>";
     if (request_is_get()) {
         if (isset($_GET['id'])) {
             $id = $_GET['id'];
             $get_item = static::find_by_id($id);
             $output .= static::construct_form($get_item, $_GET);
         } else {
             $output .= static::construct_form(false, $_GET);
         }
     }
     $output .= Form::form_id();
     $output .= csrf_token_tag();
     $output .= "</fieldset>";
     $output .= " <div class=\"col-sm-offset-3 col-sm-7 col-xs-3\">\n                   <button type=\"submit\" name=\"submit\" class=\"btn btn-primary\">" . $page . ' ' . get_called_class() . "</button></div>";
     $output .= "<div class=\"text-right \" ><a href=\"" . clean_query_string(static::$page_manage) . "\"" . " class=\"btn btn-info \" role=\"button\">Cancel</a></div>";
     $output .= "";
     $output .= "  </form>";
     $output .= "</div>";
     return $output;
 }
开发者ID:kamy333,项目名称:rajah,代码行数:60,代码来源:database_object.php

示例3: chat_input_form

 public static function chat_input_form($id = null)
 {
     if ($id) {
         $chat = static::find_by_id($id);
         $message = $chat->message;
         $image = "";
         if (!empty($chat->img)) {
             $image .= "<img class='hover_img' style='width:50px; height:50px' ";
             $image .= "src='";
             $image .= $chat->chat_path_and_placeholder();
             $image .= "' alt='' >";
         }
         $header_form = "<h4>Edit your message here</h4>";
         $submit_value = "Update it";
         $submit_name = "submit_edit";
         $get = "?id=" . urlencode($id);
         $form_id = Form::form_id();
     } else {
         $message = "";
         $image = "";
         $header_form = "";
         $submit_value = "Send it";
         $submit_name = "submit_new";
         $get = "";
         $form_id = "";
     }
     $output = "";
     $output .= "<div class='row'>";
     $output .= "<div class='col-lg-9'>";
     $output .= $header_form;
     $output .= "<div class='chat-message-form'>";
     $output .= "<form action='" . static::$page_public;
     $output .= $get;
     $output .= "' method='post' enctype='multipart/form-data'>";
     $output .= "<div class='form-group'>";
     $output .= " <textarea class='summernote form-control message-input' name='message'  placeholder='Enter message text'>";
     $output .= $message;
     $output .= "</textarea>";
     $output .= "<span class='pull-right' style='margin-right: 50%'>";
     $output .= "<input type='file' name='chat_image' id='chat_image'  class='form-control' >";
     $output .= "</span>";
     $output .= "<span > ";
     $output .= "<input class='btn btn-primary' type='submit' name='";
     $output .= $submit_name;
     $output .= "' value='";
     $output .= $submit_value;
     $output .= "'>";
     $output .= " </span>";
     if ($id) {
         $output .= "<span > ";
         $output .= "<a class='btn btn-info' href='";
         $output .= static::$page_public;
         $output .= "' >";
         $output .= "Cancel";
         $output .= "</a>";
         $output .= " </span>";
         $output .= "<span class='pull-right'>";
         $output .= $image;
         $output .= "</span>";
     }
     $output .= $form_id;
     $output .= csrf_token_tag();
     $output .= "</div>";
     $output .= "</form>";
     $output .= "</div>";
     $output .= "</div>";
     $output .= "</div>";
     return $output;
 }
开发者ID:kamy333,项目名称:rajah,代码行数:69,代码来源:ChatFriend.php

示例4: form_photo

 public static function form_photo()
 {
     global $session;
     $user = static::find_by_id($session->user_id);
     $sm = 9;
     $class_label = " class='col-sm-3 control-label left'";
     $output = "";
     $output .= "<form class='form-horizontal' id='update_photo' action='" . $_SERVER["PHP_SELF"] . "' method='post'  enctype=\"multipart/form-data\" >";
     //        $output .= "<div class=\"form-group\">";
     //        $output .= "<label $class_label for=\"email\">email</label>";
     //        $output .= "<div class='col-sm-$sm'>";
     //        $output.="<input type='text' class='form-control' name='email' id='email' value='{$user->email}'>";
     //        $output .= "</div>";
     //        $output .= "</div>";
     //
     $output .= "<input type='hidden' class='hidden' name='id' id='id' value='{$user->id}'> ";
     $output .= csrf_token_tag(3);
     $output .= "<div class=\"form-group\">\n    <label for='user_image'>File input</label>\n    <input type='file' name='user_image' id='user_image'>\n    <p class=\"help-block\">choose picture.</p>\n  </div>";
     $output .= "<div class='col-sm-{$sm} col-sm-offset-3'>";
     $output .= "<input type='submit' name='submit' class='btn btn-primary' value='Update Photo'  >";
     $output .= "</div>";
     $output .= "</form>";
     //        $output .= "<div class='col-sm-4'>
     //                <div class='text-center pull-right '>
     //                    <img alt=\"image\" class=\"img-circle m-t-xs img-responsive\" src=\"";
     //
     //        $output .=  $user->user_path_and_placeholder();
     //        $output .= "            \" >
     //                    <div class=\"m-t-xs font-bold\">";
     //
     //        $output .=  $user->user_type;
     //              $output .= "           </div>
     //                </div>
     //            </div>;";
     return $output;
 }
开发者ID:kamy333,项目名称:rajah,代码行数:36,代码来源:user.php


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