Quantcast
Channel: OKWAVE 最新質問([技術者向] コンピューター/205)【本日】
Viewing all articles
Browse latest Browse all 38062

日付をPHPに渡す

$
0
0
下記のようなPHPとHTMLがあります。 HTMLに日付を指定できるフォームを設置しており、ここに入力されたデータを、 PHPの日付の部分に渡せるようにしたいと思っております。 <?PHP //言語設定、内部エンコーディングを指定する mb_language("japanese"); mb_internal_encoding("UTF-8"); //ライブラリ include('googleanalytics.class.php'); //アカウント $ga = new GoogleAnalytics('ID','PW'); $ga->setProfile('ga:GAID'); //日付指定 $today1 = mktime(0, 0, 0, date("m"), date("d")-30, date("Y")); $today2 = mktime(0, 0, 0, date("m"), date("d")-30, date("Y")); $g1 = date("Y-m-d", $today1); $g2 = date("Y-m-d", $today2); $ga->setDateRange($g2,$g1); //読み込み $report = $ga->getReport( array('dimensions'=>urlencode('ga:keyword'), 'metrics'=>urlencode('ga:visits,ga:pageviews'), 'sort'=>'-ga:pageviews' ) ); //表示 echo "<html><head><meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/>"; echo "</head><body>"; echo "キーワード:セッション数:ページビュー数<BR>- - - - - <BR>"; foreach( $report as $d => $m ){ echo $d; foreach( $m as $a => $b ){ echo " : ".$b; } echo "<BR>"; } echo "</body></html>"; ?> <html> <br> ■ 期間 <form action="gaapisample.php" method="post"><label>日付(type="date1"):<input type="date" name="date"></label> <br> <form action="gaapisample.php" method="post"><label>日付(type="date2"):<input type="date" name="date"></label> <input type="submit" value="期間設定"></form> </html>

Viewing all articles
Browse latest Browse all 38062

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>