<?PHP $dbhost="127.0.0.1"; $dbport="3306"; $dbuser="root"; $dbpass="1234"; $dbname="menghaozi"; if(!function_exists('mysql_pconnect')){ $mysqli = mysqli_connect("$dbhost:$dbport", $dbuser, $dbpass, $dbname); function mysql_pconnect($dbhost, $dbuser, $dbpass){ global $dbport; global $dbname; global $mysqli; $mysqli = mysqli_connect("$dbhost:$dbport", $dbuser, $dbpass, $dbname); return $mysqli; } function mysql_select_db($dbname){ global $mysqli; return mysqli_select_db($mysqli,$dbname); } function mysql_fetch_array($result){ return mysqli_fetch_array($result); } function mysql_fetch_assoc($result){ return mysqli_fetch_assoc($result); } function mysql_fetch_row($result){ return mysqli_fetch_row($result); } function mysql_query($query){ global $mysqli; $data=mysqli_query($mysqli,$query); if (!$data) { printf("Error: %s\n", mysqli_error($mysqli)); exit(); } return $data; } function mysql_escape_string($data){ global $mysqli; return mysqli_real_escape_string($mysqli, $data); //return addslashes(trim($data)); } function mysql_real_escape_string($data){ return mysql_real_escape_string($data); } function mysql_close(){ global $mysqli; return mysqli_close($mysqli); } } ?>
分类: 程序
Eclipse ADT Android SDK
Eclipse IDE for Java Developers
android-sdk_r24.4.1-windows.zip
1.下载ADT插件的zip文件(不要解压):ADT-23.0.6.zip
2.启动Eclipse,然后在菜单栏上选择 Help > Install New Software
3.单击 Add 按钮,在右上角
4.在”Add Repository”对话框,单击”Archive”
5.选择下载的adt-23.0.6.zip文件并单击”确认”。
6.在Name(名称)处输入”ADT Plugin”,单击“Finish”
7.在软件对话框中,选中”Developer Tools”复选框,然后点击”Next”
8.在下一个窗口中,您会看到一个要下载的工具列表。单击“Next”
9.阅读并接受许可协议,然后单击“Finish”
10.安装完成后,重新启动Eclipse
配置ADT插件
1.启动Eclipse,选择windows>preferences>android
2.在选项卡中选择”Browse”,选择之前下载的Android SDK的zip文件(需要解压)的目录(解压后的目录),点击确定
3.点击OK
开了CND 有页面注释掉代码都无效。
thinkphp,laravel,开了CND 有页面注释掉代码都无效。
CDN有缓存,页面不刷新
用动态CDN或临时解决方案缓存配置,文件夹,/index.php/Home,0秒刷新。
laravel $error view 里无效
\Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class,
将上面的两句在protected $middlewareGroups里移动到protected $middleware里
必须在protected $middlewareGroups里删掉
react project init
npm config set registry https://registry.npm.taobao.org --global npm config set disturl https://npm.taobao.org/dist --global npm install -g yarn react-native-cli yarn config set registry https://registry.npm.taobao.org --global yarn config set disturl https://npm.taobao.org/dist --global npm install -g create-react-native-app create-react-native-app MyApp npm start
windows php 环境变量
我的电脑,属性,高级,环境变量,phth,path
微信小程序server mysql
const { mysql } = require('../qcloud') module.exports = async (ctx, next) => { return mysql.select() .from('cSessionInfo') .then(function (response) { ctx.state.data = response }) }
react
npm install -g create-react-app
create-react-app jinguan
brew install yarn
yarn add styled-components
yarn add redux
yarn add react-redux
yarn start
alipay demo encrypt and decrypt function renamed
alipay demo 和 laravel 的加密解密全局函数冲突。
vim查找:
vimgrep /\
vimgrep /\
vim替换:
:%s/\
:%s/\
最后找到需要的替换文件如下:
aop/AopEncrypt.php
aop/AopClient.php
lotusphp_runtime/Cookie/Cookie.php
laravel5找回密码改中文
5.7
lang/zh_cn.json
{ "Login": "登陆", "E-Mail Address": "邮箱", "Password": "密码", "Remember Me": "记住我", "Forgot Your Password?": "忘记密码?", "Register": "注册", "Name": "姓名", "Confirm Password": "重复密码", "Reset Password": "重设密码", "Send Password Reset Link": "发送邮件", "Logout": "退出", "Reset Password Notification": "找回密码", "You are receiving this email because we received a password reset request for your account.": "您收到此电子邮件,因为我们收到了找回密码请求您的账户。", "If you did not request a password reset, no further action is required.": "如果没有请求找回密码,则不需要进一步的操作。", "Hello!": "您好!", "Regards": "真挚问候", "If you’re having trouble clicking the ": "如果您不能点击" }
5.4
php artisan vendor:publish --tag=laravel-notifications//找回密码邮件模版 php artisan make:notification ResetPassword//找回密码邮件通知
App/Notifications/Resetpassword.php
<?php namespace App\Notifications; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Notification; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; class ResetPassword extends Notification { use Queueable; /** * The password reset token. * * @var string */ public $token; /** * Create a notification instance. * * @param string $token * @return void */ public function __construct($token) { $this->token = $token; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { return ['mail']; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { return (new MailMessage) ->subject('找回密码') ->line('您收到此电子邮件,因为我们收到了找回密码请求您的账户。') ->action('重设密码', route('password.reset', $this->token)) ->line('如果没有请求找回密码,则不需要进一步的操作。'); } /** * Get the array representation of the notification. * * @param mixed $notifiable * @return array */ public function toArray($notifiable) { return [ // ]; } }
app\User.php
<?php namespace App; use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; use App\Notifications\ResetPassword as ResetPasswordNotification; class User extends Authenticatable { use Notifiable; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'name', 'email', 'password', ]; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; public function sendPasswordResetNotification($token) { $this->notify(new ResetPasswordNotification($token)); } }
views/vendor/notifications/email.blade.php
@component('mail::message') {{-- Greeting --}} @if (! empty($greeting)) # {{ $greeting }} @else @if ($level == 'error') # 错误! @else # 您好! @endif @endif {{-- Intro Lines --}} @foreach ($introLines as $line) {{ $line }} @endforeach {{-- Action Button --}} @if (isset($actionText)) <?php switch ($level) { case 'success': $color = 'green'; break; case 'error': $color = 'red'; break; default: $color = 'blue'; } ?> @component('mail::button', ['url' => $actionUrl, 'color' => $color]) {{ $actionText }} @endcomponent @endif {{-- Outro Lines --}} @foreach ($outroLines as $line) {{ $line }} @endforeach <!-- Salutation --> @if (! empty($salutation)) {{ $salutation }} @else 来自,<br>{{ config('app.name') }} @endif <!-- Subcopy --> @if (isset($actionText)) @component('mail::subcopy') 如果您不能点击"{{ $actionText }}"按钮,请复制下面的网址粘贴到您的浏览器: [{{ $actionUrl }}]({{ $actionUrl }}) @endcomponent @endif @endcomponent