11spec0 の回答履歴

全44件中21~40件表示
  • Array Array と表示される

    Pagerを入れてみたらArray Arrayと表示されます。何が原因なのかわからず困っています。お力をお願い致します。

  • Array Array と表示される

    Pagerを入れてみたらArray Arrayと表示されます。何が原因なのかわからず困っています。お力をお願い致します。

  • Array Array と表示される

    Pagerを入れてみたらArray Arrayと表示されます。何が原因なのかわからず困っています。お力をお願い致します。

  • smartyでページングするには

    このようなsmartyのphpの場合はどのようにページングをしたらいいのかわかりません。どなたかお知恵をお貸し下さい。 $cache_id = 'rakuten:' . serialize($_GET); if (!$smarty->is_cached($tmpl_name, $cache_id)) { $query = "楽天の情報を取得"; if ($affiliate_id) { $query .= "&affiliateId=${affiliate_id}"; } $query .= "&keyword=" . urlencode($_GET['keyword']); $max = intval($_GET['max']); if ($max > 0 && $max <= 30) { $query .= "&hits=${max}"; } if (isset($_GET['sort'])) { $query .= "&sort=" . urlencode($_GET['sort']); } if (intval($_GET['genreId'])) { $query .= "&genreId=" . intval($_GET['genreId']); } if ($_GET['field'] == 'use') { $query .= "&field=0"; } if (intval($_GET['imageFlag']) == 1) { $query .= "&imageFlag=1"; } if (intval($_GET['minPrice']) > 0) { $query .= "&minPrice=" . intval($_GET['minPrice']); } if (intval($_GET['maxPrice']) > 0) { $query .= "&maxPrice=" . intval($_GET['maxPrice']); } if ($_GET['orFlag'] == 'use') { $query .= "&orFlag=1"; } $client =& new HTTP_Client(); $client->get($query); $resp =& $client->currentResponse(); if ($resp['code'] != 200) { $smarty->assign('tid', intval($_GET["tid"])); $smarty->assign('is_error', 1); $smarty->assign('is_connection_error', 1); $smarty->assign('errmsg', '接続に失敗しました。'); $smarty->caching = 0; $smarty->display('error.tpl'); exit(); } //print_r($resp['body']); //exit(); $xml = new XML_Unserializer(); $xml->setOption('complexType', 'array'); $xml->setOption('forceEnum', array('Item')); $result = $xml->unserialize($resp['body'], FALSE); $data = $xml->getUnserializedData(); $status = $data['header:Header']['Status']; if ($status == 'ClientError' || $status == 'ServerError' || $status == 'Maintenance') { $smarty->assign('tid', intval($_GET["tid"])); $smarty->assign('is_error', 1); $smarty->assign('is_api_error', 1); $smarty->assign('api_errmsg', $data['header:Header']['StatusMsg']); $smarty->caching = 0; $smarty->display('error.tpl'); exit(); } // print("query = $query<br />\n"); // print_r($data); // exit(); $smarty->assign('total_count', $data['Body']['itemSearch:ItemSearch']['count']); $smarty->assign('items', $data['Body']['itemSearch:ItemSearch']['Items']['Item']); } // テンプレートの表示 $smarty->display($tmpl_name, $cache_id);

    • ベストアンサー
    • jimmy1977
    • PHP
    • 回答数4
  • SESSIONの取得タイミングについて

    現在簡単な会員登録のサイトを作っているのですが フォームに入力してもらった値を同じ画面でDBに登録するのではなく、 確認画面を新しく起こしてそこで登録ボタンを押せばDBに書き込むようにしたいのですが上手くいきません。 処理の順番は 1.フォームの確認ボタンを押されると値をSESSIONに登録(PHP)  ↓ 2.確認ボタンで新しいWindowをJavaで起こします  ↓ 3.確認画面でSESSIONの値を確認  ↓ 4.SESSIONの値をDBに登録 としたいのですが どうも2.の処理が1.よりも先に入って確認画面にはSESSIONの値が入っていません。 親WindowではSESSIONの値は入っているのですが。 確認ボタンに値の取得と新しいWindowを開くJavaと2つの機能を持たしていることが原因だろうとは思うのですが、 Windowを開くタイミングを遅らせる等の処理でうまく回す方法はありませんでしょうか? (Javaを使ったのはWindowサイズを変更したかったからです。) ご存知の方おられましたらご教授願えないでしょうか。 よろしくお願いします。 環境 レンタルサーバーにてPHP4+MySQL4

    • 締切済み
    • ppalot
    • PHP
    • 回答数1
  • PHPで特定のURLにジャンプする方法

    こんにちは。HTMLファイル上のText(mytext)から受け取ったデータに基づいて、特定のURLにジャンプさせる方法を探しています。 以下のようなコードを作りました。しかし、これだとエラーになります。 header("Location: ") の使い方自体に問題があるのか、それ以外に問題があるのかわかりません。 アドバイスをいただきたく、よろしくいお願いいたします。 <?php if ($_POST['mytext'] == "google") { header("Location: http://google.co.jp"); } else { header("Location: http://yahoo.co.jp"); } ?>

    • ベストアンサー
    • nice-chap
    • PHP
    • 回答数6
  • PHPで特定のURLにジャンプする方法

    こんにちは。HTMLファイル上のText(mytext)から受け取ったデータに基づいて、特定のURLにジャンプさせる方法を探しています。 以下のようなコードを作りました。しかし、これだとエラーになります。 header("Location: ") の使い方自体に問題があるのか、それ以外に問題があるのかわかりません。 アドバイスをいただきたく、よろしくいお願いいたします。 <?php if ($_POST['mytext'] == "google") { header("Location: http://google.co.jp"); } else { header("Location: http://yahoo.co.jp"); } ?>

    • ベストアンサー
    • nice-chap
    • PHP
    • 回答数6
  • PHPで特定のURLにジャンプする方法

    こんにちは。HTMLファイル上のText(mytext)から受け取ったデータに基づいて、特定のURLにジャンプさせる方法を探しています。 以下のようなコードを作りました。しかし、これだとエラーになります。 header("Location: ") の使い方自体に問題があるのか、それ以外に問題があるのかわかりません。 アドバイスをいただきたく、よろしくいお願いいたします。 <?php if ($_POST['mytext'] == "google") { header("Location: http://google.co.jp"); } else { header("Location: http://yahoo.co.jp"); } ?>

    • ベストアンサー
    • nice-chap
    • PHP
    • 回答数6
  • smartyでページングするには

    このようなsmartyのphpの場合はどのようにページングをしたらいいのかわかりません。どなたかお知恵をお貸し下さい。 $cache_id = 'rakuten:' . serialize($_GET); if (!$smarty->is_cached($tmpl_name, $cache_id)) { $query = "楽天の情報を取得"; if ($affiliate_id) { $query .= "&affiliateId=${affiliate_id}"; } $query .= "&keyword=" . urlencode($_GET['keyword']); $max = intval($_GET['max']); if ($max > 0 && $max <= 30) { $query .= "&hits=${max}"; } if (isset($_GET['sort'])) { $query .= "&sort=" . urlencode($_GET['sort']); } if (intval($_GET['genreId'])) { $query .= "&genreId=" . intval($_GET['genreId']); } if ($_GET['field'] == 'use') { $query .= "&field=0"; } if (intval($_GET['imageFlag']) == 1) { $query .= "&imageFlag=1"; } if (intval($_GET['minPrice']) > 0) { $query .= "&minPrice=" . intval($_GET['minPrice']); } if (intval($_GET['maxPrice']) > 0) { $query .= "&maxPrice=" . intval($_GET['maxPrice']); } if ($_GET['orFlag'] == 'use') { $query .= "&orFlag=1"; } $client =& new HTTP_Client(); $client->get($query); $resp =& $client->currentResponse(); if ($resp['code'] != 200) { $smarty->assign('tid', intval($_GET["tid"])); $smarty->assign('is_error', 1); $smarty->assign('is_connection_error', 1); $smarty->assign('errmsg', '接続に失敗しました。'); $smarty->caching = 0; $smarty->display('error.tpl'); exit(); } //print_r($resp['body']); //exit(); $xml = new XML_Unserializer(); $xml->setOption('complexType', 'array'); $xml->setOption('forceEnum', array('Item')); $result = $xml->unserialize($resp['body'], FALSE); $data = $xml->getUnserializedData(); $status = $data['header:Header']['Status']; if ($status == 'ClientError' || $status == 'ServerError' || $status == 'Maintenance') { $smarty->assign('tid', intval($_GET["tid"])); $smarty->assign('is_error', 1); $smarty->assign('is_api_error', 1); $smarty->assign('api_errmsg', $data['header:Header']['StatusMsg']); $smarty->caching = 0; $smarty->display('error.tpl'); exit(); } // print("query = $query<br />\n"); // print_r($data); // exit(); $smarty->assign('total_count', $data['Body']['itemSearch:ItemSearch']['count']); $smarty->assign('items', $data['Body']['itemSearch:ItemSearch']['Items']['Item']); } // テンプレートの表示 $smarty->display($tmpl_name, $cache_id);

    • ベストアンサー
    • jimmy1977
    • PHP
    • 回答数4
  • smartyでページングするには

    このようなsmartyのphpの場合はどのようにページングをしたらいいのかわかりません。どなたかお知恵をお貸し下さい。 $cache_id = 'rakuten:' . serialize($_GET); if (!$smarty->is_cached($tmpl_name, $cache_id)) { $query = "楽天の情報を取得"; if ($affiliate_id) { $query .= "&affiliateId=${affiliate_id}"; } $query .= "&keyword=" . urlencode($_GET['keyword']); $max = intval($_GET['max']); if ($max > 0 && $max <= 30) { $query .= "&hits=${max}"; } if (isset($_GET['sort'])) { $query .= "&sort=" . urlencode($_GET['sort']); } if (intval($_GET['genreId'])) { $query .= "&genreId=" . intval($_GET['genreId']); } if ($_GET['field'] == 'use') { $query .= "&field=0"; } if (intval($_GET['imageFlag']) == 1) { $query .= "&imageFlag=1"; } if (intval($_GET['minPrice']) > 0) { $query .= "&minPrice=" . intval($_GET['minPrice']); } if (intval($_GET['maxPrice']) > 0) { $query .= "&maxPrice=" . intval($_GET['maxPrice']); } if ($_GET['orFlag'] == 'use') { $query .= "&orFlag=1"; } $client =& new HTTP_Client(); $client->get($query); $resp =& $client->currentResponse(); if ($resp['code'] != 200) { $smarty->assign('tid', intval($_GET["tid"])); $smarty->assign('is_error', 1); $smarty->assign('is_connection_error', 1); $smarty->assign('errmsg', '接続に失敗しました。'); $smarty->caching = 0; $smarty->display('error.tpl'); exit(); } //print_r($resp['body']); //exit(); $xml = new XML_Unserializer(); $xml->setOption('complexType', 'array'); $xml->setOption('forceEnum', array('Item')); $result = $xml->unserialize($resp['body'], FALSE); $data = $xml->getUnserializedData(); $status = $data['header:Header']['Status']; if ($status == 'ClientError' || $status == 'ServerError' || $status == 'Maintenance') { $smarty->assign('tid', intval($_GET["tid"])); $smarty->assign('is_error', 1); $smarty->assign('is_api_error', 1); $smarty->assign('api_errmsg', $data['header:Header']['StatusMsg']); $smarty->caching = 0; $smarty->display('error.tpl'); exit(); } // print("query = $query<br />\n"); // print_r($data); // exit(); $smarty->assign('total_count', $data['Body']['itemSearch:ItemSearch']['count']); $smarty->assign('items', $data['Body']['itemSearch:ItemSearch']['Items']['Item']); } // テンプレートの表示 $smarty->display($tmpl_name, $cache_id);

    • ベストアンサー
    • jimmy1977
    • PHP
    • 回答数4
  • サーバーにPHPを拒否されてしまう

    無料HPでPHPの練習をしている初心者です。 PHPファイルをサーバーにアップしてブラウザでみてみると・・・ ------------------------------------------------------------- 今日は、2008/07/26 です☆ Warning: fopen() [function.fopen]: Unable to access count.txt in /home/freeuser/ameyuki/htdocs/test.php on line 19 Warning: fopen(count.txt) [function.fopen]: failed to open stream: No such file or directory in /home/freeuser/ameyuki/htdocs/test.php on line 19 Warning: fgets(): supplied argument is not a valid stream resource in /home/freeuser/ameyuki/htdocs/test.php on line 20 Warning: fseek(): supplied argument is not a valid stream resource in /home/freeuser/ameyuki/htdocs/test.php on line 22 Warning: fputs(): supplied argument is not a valid stream resource in /home/freeuser/ameyuki/htdocs/test.php on line 23 Warning: fclose(): supplied argument is not a valid stream resource in /home/freeuser/ameyuki/htdocs/test.php on line 24 あなたは 1 人目のお客様です。 -------------------------------------------------------------- このような警告ばかりでて、PHPのコマンドが働いていないようなのです。日付は表示されますし、お客様の人数も一応1となっていますが、TOPへ戻ってから再度きても1人なのです。だから働いていないと思うのです。どうしたらPHPのコマンドを受け入れてもらえますか?無料HP、PHP可のところでは無理なのでしょうか? お願いします!

    • ベストアンサー
    • chopinthe3
    • PHP
    • 回答数5
  • sessionで表示されません

    <?php session_start(); ?> <html><body> <?php $_SESSION["bridge"]=1; $a=$_SESSION["bridge"]; print "$a"; ?> <a href="s2.php">2へ</a> </body></html> を書いたのですが、 ブラウザで見ても表示されません。 どこがもんだいなのでしょうか。 宜しくお願い致します。

    • ベストアンサー
    • abesouri
    • PHP
    • 回答数1
  • PHPで特定のURLにジャンプする方法

    こんにちは。HTMLファイル上のText(mytext)から受け取ったデータに基づいて、特定のURLにジャンプさせる方法を探しています。 以下のようなコードを作りました。しかし、これだとエラーになります。 header("Location: ") の使い方自体に問題があるのか、それ以外に問題があるのかわかりません。 アドバイスをいただきたく、よろしくいお願いいたします。 <?php if ($_POST['mytext'] == "google") { header("Location: http://google.co.jp"); } else { header("Location: http://yahoo.co.jp"); } ?>

    • ベストアンサー
    • nice-chap
    • PHP
    • 回答数6
  • smartyでページングするには

    このようなsmartyのphpの場合はどのようにページングをしたらいいのかわかりません。どなたかお知恵をお貸し下さい。 $cache_id = 'rakuten:' . serialize($_GET); if (!$smarty->is_cached($tmpl_name, $cache_id)) { $query = "楽天の情報を取得"; if ($affiliate_id) { $query .= "&affiliateId=${affiliate_id}"; } $query .= "&keyword=" . urlencode($_GET['keyword']); $max = intval($_GET['max']); if ($max > 0 && $max <= 30) { $query .= "&hits=${max}"; } if (isset($_GET['sort'])) { $query .= "&sort=" . urlencode($_GET['sort']); } if (intval($_GET['genreId'])) { $query .= "&genreId=" . intval($_GET['genreId']); } if ($_GET['field'] == 'use') { $query .= "&field=0"; } if (intval($_GET['imageFlag']) == 1) { $query .= "&imageFlag=1"; } if (intval($_GET['minPrice']) > 0) { $query .= "&minPrice=" . intval($_GET['minPrice']); } if (intval($_GET['maxPrice']) > 0) { $query .= "&maxPrice=" . intval($_GET['maxPrice']); } if ($_GET['orFlag'] == 'use') { $query .= "&orFlag=1"; } $client =& new HTTP_Client(); $client->get($query); $resp =& $client->currentResponse(); if ($resp['code'] != 200) { $smarty->assign('tid', intval($_GET["tid"])); $smarty->assign('is_error', 1); $smarty->assign('is_connection_error', 1); $smarty->assign('errmsg', '接続に失敗しました。'); $smarty->caching = 0; $smarty->display('error.tpl'); exit(); } //print_r($resp['body']); //exit(); $xml = new XML_Unserializer(); $xml->setOption('complexType', 'array'); $xml->setOption('forceEnum', array('Item')); $result = $xml->unserialize($resp['body'], FALSE); $data = $xml->getUnserializedData(); $status = $data['header:Header']['Status']; if ($status == 'ClientError' || $status == 'ServerError' || $status == 'Maintenance') { $smarty->assign('tid', intval($_GET["tid"])); $smarty->assign('is_error', 1); $smarty->assign('is_api_error', 1); $smarty->assign('api_errmsg', $data['header:Header']['StatusMsg']); $smarty->caching = 0; $smarty->display('error.tpl'); exit(); } // print("query = $query<br />\n"); // print_r($data); // exit(); $smarty->assign('total_count', $data['Body']['itemSearch:ItemSearch']['count']); $smarty->assign('items', $data['Body']['itemSearch:ItemSearch']['Items']['Item']); } // テンプレートの表示 $smarty->display($tmpl_name, $cache_id);

    • ベストアンサー
    • jimmy1977
    • PHP
    • 回答数4
  • Pleskサーバ利用時にSmartyのassignが出来ません

    現在、Pleskサーバを利用して、 Apache+Smarty+PHPのWEBプログラミングを行っているのですが、 PHPのユーザ関数内で、Smartyのassign()関数を使用した場合に、Smarty変数の生成を行うことが出来ません。 例としては以下のような感じになります。 ================================================================ <? $smarty->assign( 'a', 'a' ); // テンプレート上で{$a}とするとaと表示される test( $smarty ); $smarty->display('index.tpl'); // index.tplを表示する function test( $smarty ) { $smarty->assign( 'b', 'b' ); // テンプレート上で{$b}としてもbは表示されない } ?> ================================================================ $smartyというのは、$smarty = new Smarty();を行ったものです。 このプログラム自体は、Plesk導入前は動作しておりましたが、 Plesk導入後は上記のように、ユーザ関数外では、通常通りassign()を行うことが出来るのですが、ユーザ関数内だと無効となってしまいます。 また、Pleskのsafe_modeはOffにしております。 Pleskは初めて使用するため、動作上まだ知らないことばかりで、とても初歩的なミスをしているかと思いますが、Pleskに詳しい方がおりましたらどうか教えて頂きたいと思います。

    • ベストアンサー
    • teala
    • PHP
    • 回答数1
  • Smartyでtplファイルから配列をassignする方法

    Smartyを使っているんですが、テンプレートファイル(.tpl)側から配列の要素を入れることができません。 PHPからだと、 $test[test]="内容"; $smarty->assign("test",$test); でいけるんですが、tplからだと、 {assign var="test.test" value="内容"} としても入らないんです。 よろしくお願いいたします。

    • ベストアンサー
    • kfan
    • PHP
    • 回答数1
  • rename関数 できない

    どうもこんばんは ファイル名を変更したくて、多数のサイトを調べてました。 どのサイトも全く同じことを書いてて rename("b.txt","a.txt"); a.txt を b.txt に変更する場合の記述。 そのとおりにやったのですが、 「Warning: rename(b.txt,a.txt) [function.rename]: No such file or directory in C:\xampp\htdocs\test\test.php on line 13 」 とエラーが吐いてしまい、いくらやってもこうなってしまいます。 エラー文は該当ファイルかディレクトリが無いとかそういう類だと思いますが、原因がわかりません。 これで数時間費やしてしまいまして、ヒントや答えのレスをいただくころには、 copy関数で代用していると思いますが、どうしてrenameできないのか気になります・・ ヒントでもいいので、レスいただければと思います。 因みにwindowsXPでのテスト環境下(XAMPP)です。 PHP Version 5.2.5

    • ベストアンサー
    • bakadesuyo
    • PHP
    • 回答数1
  • チェックボックス(複数選択可)の値をPOST送信し、

    果物テーブルの中身を入力フォームにて、チェックボックスにより選択 得られた果物コードをSELECT文により、果物名に変換して表示 保存時は好きな果物1、好きな果物2、好きな果物3、、カラムにコードを保存。 例)あなたの好きな果物は? りんご  みかん  いちご  メロン (チェックボックスにより選択) 果物テーブル: 1 りんご 2 みかん 3 いちご 4 メロン 入力フォームよりPOSTにて選択された果物のコードを送信 入力確認画面にて得られたコードより果物名に変換 選択されたコードを保存 上記のようなイメージです。 例えば、りんご、みかん、いちごを選択された場合、(1,2,3)が得られ、これを分解してSELECTする方法が分かりません。 すなわち配列の操作になるかと思われます。 (1,2,3)コードは取得出来ています。 以上、ご教授頂けたら助かります。

    • ベストアンサー
    • annika54
    • PHP
    • 回答数2
  • pearDBでの接続エラー(mysqliの部分について)

    こんにちは。 hetemlというレンタルサーバを使い、php5&mysqlでログインシステムを作っています。pear authを使うにあたり、DBに接続できなかったので、prarDBのほうで接続テストをしています。 php5では mysqli://usrname@password@serveradd/dbname と記述すると思うのですが、mysqliとかくとError: extension not foundと出ます。iniの設定が出来ないので、.httaccessでなんとかなるのでしょうか? わかる方いましたらご指導いただけると助かります。 よろしくお願いします。

    • ベストアンサー
    • ataru2
    • PHP
    • 回答数1
  • PHPのファイル書き込み、呼び出しにおいて

    PHP初心者です。 最初にscore.txtから配列score[]に値を代入し、その後FORMで送られてきた値をPOSTで引き取り、その値をscore[]に代入し、それをscore.txtに書き込む…。 ということをしたいのですが、以下のソースでは、書き込む際にscore.txtの値にすべて0が入ってしまいます。 $score[$k] = $_POST["sel_$k"]; で値が送られているのは確認済みですが、if文でscore配列がすべて0にされてしまうようです。 その理由と対策がわかりません。 わかる方がいらっしゃいましたら是非教えてください。 <?php $fname = "score.txt"; $file = fopen($fname,"r"); for($l=0; $l<20; $l++){ $sc[$l]= fgets($file); $score[$l] = $sc[$l]; ) } fclose($file); print_r($score); $pointer=fopen("score.txt", "w"); flock($pointer, LOCK_EX); for($k=0; $k<20; $k++){ $score[$k] = $_POST["sel_$k"]; if($score[$k] == null){ $score[$k] =0; } fputs($pointer, "$score[$k]\n"); } flock($pointer, LOCK_UN); fclose($pointer);

    • ベストアンサー
    • hikky22423
    • PHP
    • 回答数5