[tanya] ganti webserver lain scrip php tdk jalan?

Discussion in 'Desain Web dan Programming' started by kaka, 18 Sep 2011.

Thread Status:
Not open for further replies.
  1. kaka

    kaka Beginner 1.0

    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    3
    Minta bantuanya master-master..:77::77:mklum msh nubi...

    saya lg krjain tgas web...
    wktu buat web saya pke webserver appserv dan dpt brjlan normal, lalu yg jdi mslah saat ganti pke xampp-win32-1.7.4...script phpnya tdk jln....

    cuplikan code :
    code:home.php
    PHP:
    $hiburan_query=mysql_query("select * from artikel where news_kategori = 'hiburan' ORDER by id desc limit 0,1");
    $hiburan_detail=mysql_fetch_array($hiburan_query);
    $hiburan_id="$hiburan_detail[id]";
    $hiburan_tanggal="$hiburan_detail[news_tanggal]";
    $hiburan_kategori="$hiburan_detail[news_kategori]";
    $hiburan_judul="$hiburan_detail[news_judul]";
    $hiburan_head="$hiburan_detail[news_head]";
    $hiburan_gambar="$hiburan_detail[news_gambar]";
    PHP:
    <a href="?page=artikel-view_detail.html&amp;judul=<?php echo"$hiburan_id";?>">Read More . . .</a>
    lalu pada halaman home saya klik Read More....


    code :artikel-view_detail.php (halaman yg di tuju)
    PHP:
    $artikel_query=mysql_query("select * from artikel where id = '$judul'");
    $artikel_detail=mysql_fetch_array($artikel_query);
    $artikel_id="$artikel_detail[id]";
    $artikel_tanggal="$artikel_detail[news_tanggal]";
    $artikel_kategori="$artikel_detail[news_kategori]";
    $artikel_penulis="$artikel_detail[news_penulis]";
    $artikel_judul="$artikel_detail[news_judul]";
    $artikel_head="$artikel_detail[news_head]";
    $artikel_isi="$artikel_detail[news_isi]";
    setelah diklik di halaman yg dituju tidak muncul artikel dan muncul pesan :

    Notice: Undefined variable: judul in C:\xampp\htdocs\gestured\artikel-view_detail.php on line 2

    mhn ..bantuannya..
    :77::77::77:
     
  2. PusatHosting

    PusatHosting Hosting Guru Web Hosting

    Messages:
    3,346
    Likes Received:
    326
    Trophy Points:
    83
    yang ini $artikel_query=mysql_query("select * from artikel where id = '$judul'");

    coba kalau begini

    $artikel_query=mysql_query("select * from artikel where id = '".$_GET['judul']."'");
     
  3. kaka

    kaka Beginner 1.0

    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    3
    mksh bnyak pencerahan'a....:):)
    mo dcoba dlu info'a
     
  4. kaka

    kaka Beginner 1.0

    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    3
    wah brgna bngt nh ilmu'a.....mksh bnyak wat master @pusat hosting :D:D:D
     
  5. vkios01

    vkios01 Expert 1.0

    Messages:
    749
    Likes Received:
    18
    Trophy Points:
    18
    sedikit merapikan aja sih :D

    PHP:
    $judul $_REQUEST['judul'];
    $artikel_query=mysql_query("select * from artikel where id = '$judul'"); 
    kenapa pakai request? lebih suka pakai itu :p -> lebih bagus untuk masalah security.
    ow iya, jangan lupa buat dicek kalau itu datanya dalam bentuk integer (security)..
     
  6. kaka

    kaka Beginner 1.0

    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    3
    wat master" mksh info'a.
    lgsng dcoba.....:)
     
  7. DapurHosting

    DapurHosting Apprentice 1.0

    Messages:
    225
    Likes Received:
    3
    Trophy Points:
    18
    wah terimakasih nih atas info nya
     
Loading...
Thread Status:
Not open for further replies.

Share This Page

Loading...