Skip to content

Instantly share code, notes, and snippets.

View gari8641's full-sized avatar

Hidenobu Miyata gari8641

View GitHub Profile
@gari8641
gari8641 / sessoin_register.php
Created March 24, 2023 10:12
phpマニュアルに載ってた例
<?php
// session_register() の使用は推奨されません。
$barney = "A big purple dinosaur.";
session_register("barney");
SQL> desc table_name;
名前 NULL? 型
----------------------------------------- -------- ----------------------------
// iPhoneXとMacのSafariでContactForm7のカレンダーが表示されないバグ対応
add_filter( 'wpcf7_support_html5_fallback', '__return_true' );
<?php
// css読み込ませない start
function my_delete_plugin_files() {
wp_dequeue_style('twentytwenty-style');
//wp_dequeue_style('twentytwenty-style-inline');
//wp_dequeue_style('twentytwenty-print-style');
}
add_action( 'wp_enqueue_scripts', 'my_delete_plugin_files' );
// css読み込ませない end
require_once $_SERVER['DOCUMENT_ROOT'].'/ファイルパス';
require_once(dirname(__FILE__).'/common.php');
<ifModule mod_rewrite.c>
RewriteEngine On
# httpの場合、httpsにリダイレクト
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
# www無しの場合、www有りにリダイレクト
RewriteCond %{HTTP_HOST} ^ドメイン名$
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [R,L]
# URL正規化。https://wwwありに301リダイレクト↓ ↓ ↓
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
<div class="hoge">click me !</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function() {
$(".hoge").click(function(){
$(this).toggleClass("hoge");
});
});
</script>
<p id="aa_1">a</p>
<p id="aa_2">aa</p>
<p id="aa_3">aaa</p>
<p id="bb_1">b</p>
<p id="cc_1">c</p>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function() {
$('p[id^="aa_"]').css('color', 'red');
});