Dismiss Notice
You are browsing this site as a guest. It takes 2 minutes to CREATE AN ACCOUNT and less than 1 minute to LOGIN

Php 'include' inanisumbua msaada pliizi

Discussion in 'Tech, Gadgets & Science Forum' started by Washawasha, May 27, 2011.

  1. Washawasha

    Washawasha JF-Expert Member

    #1
    May 27, 2011
    Joined: Aug 7, 2006
    Messages: 8,368
    Likes Received: 146
    Trophy Points: 160
    HESHIMA MBELE KAMA TAI WATAALAMU WA HII LUGHA YA PHP NA WANAOTAKA KUJIFUNZA KAMA MIMI,BINAFSI NAPENDA SANA KUJIFUNZA NA NIMEAMUA KUJIFUNZA HII LUGHA LKN INANISUMBUA.HII NI NDIO SITE YANGU(1) mafia island BAADA YA KUIWEKA KTK INDEX.PHP NA HAPA NDIVYO NINAVYOTAKA IWE (2)mafia island,

    SASA BASI HIZI NDIZO FILE ZANGU AMBAZO HAZITAKI KUFUNGUKA KAMA UNAVYOONA HAPO JUU KWENYE SITE NAMBA MOJA
    i.header.php
    ii.nav.php
    iii.footer
    AMBAZO ZOTE NIMEZIWEKA KATIKA INCLUDES
    NA HIZI HAPA CHINI NDIO SCRIPT NILIZOZITUMIA
    1.HEADER.PHP
    <?php include('variables/variables.php'); ?>
    <div id="header">
    <h2><?php echo $heading ?></h2>
    </div> <!-- end #header -->

    2.NAV.PHP
    <div id="nav">
    <a href="index.php">Home</a>
    <a href="about.php">About</a>
    <a href="#">Portfolio</a>
    <a href="#">Contact</a>
    </div> <!-- end #nav -->

    3.FOOTER.PHP
    <?php include('variables/variables.php'); ?>
    <div id="footer">
    <p><?php echo $footer ?></p>
    </div> <!-- end #footer -->
    NA HII NDIO VARIABLES.PHP
    <?php
    $heading='Mafia Kiss One.Uknown Paradise';
    $footer='Copyright &copy; 2011 Mafia Kiss One.Uknown Paradise';
    ?>

    LAKINI CHA AJABU HAILETI MATOKEO MAZURI INANIONESHA HIVI mafia island

    NA HII NDIO YANGU INDEX.PHP

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="description" content="" />
    <meta name="keywords" content="mafia" />
    <meta name="author" content="washawasha" />
    <link rel="stylesheet" type="text/css" href="style.css" media="screen" />
    <title>mafia island</title>
    </head>
    <body>
    <div id="wrapper">
    <?php include('includes/header.php'); ?>
    <?php include(includes/nav.php); ?>
    <div id="content">
    <h1>Kilindoni</h1>
    <h2>Bweni bay</h2>
    <h3>Mafia island marine park</h3>
    <h4>Chole island</h4>
    <h5>Nyororo island</h5>
    <h3>Jiwe fatuma</h3>
    <p>
    DA urges Zuma to help Hammerl family</p>
    <p>
    Johannesburg - The Democratic Alliance on Friday urged President Jacob Zuma to use his "good relationship" with Libyan leader Muammar Gaddafi to ensure that the remains of photographer Anton Hammerl are returned to his family.

    This, so they were able to give him a proper burial, DA international relations spokesperson Stevens Mokgalapa said in a statement.

    Zuma was likely to "raise the issue" during his visit to Tripoli next week, his spokesperson Zizi Kodwa told The Times newspaper.

    On Thursday, Hammerl's family appealed to Zuma to seek to have his remains returned.

    The photographer was covering the conflict in Libya on April 5 when he was shot by militia loyal to Gaddafi near the town of Brega.

    According to American journalists Clare Gillis, James Foley and Spanish photographer Manu Brabo, who were detained in Libya, Hammerl was left to die in the desert after they were arrested.

    </p>
    <p>Lies</p>
    <p>The South African government and the African National Congress publicly slammed the Libyan government last week after the three journalists confirmed Hammerl's death.

    South Africa accused Libya of lying, saying it had known all along that Hammerl had been shot dead on April 5, but had nonetheless kept reassuring officials that he was safe.

    International relations and co-operation department spokesperson Clayson Monyela said on Wednesday that it was only when Gillis, Foley and Brabo had been debriefed in Tunisia that the South African government become aware that the Libyan government had lied.
    </p>
    <h3>Two days earlier, on May 17, </h3>
    <p>the Associated Press news agency quoted Libyan government spokesperson Moussa Ibrahim as saying that Hammerl was not in Libyan government custody.

    Mokgalapa said that while questions remained about what was actually communicated to the South African government by Libyan authorities, it was time for the South African government to "act decisively" and repatriate Hammerl's remains.

    Kodwa on Thursday confirmed that Zuma had received information from journalists indicating the possible location of Hammerl's remains in Libya, for him "to share with the Libyan authorities next week".
    </p>
    <p>"The information... about the possible location of the remains has been passed on to the South African mission in Tripoli for further work."

    He said Zuma, who sent his condolences to the family, would do "whatever is possible" to help.
    - SAPA
    </p>
    </div> <!-- end #content -->
    <?php include('includes/sidebar.php'); ?>
    <?php include('includes/footer.php'); ?>
    </div> <!-- End #wrapper -->
    </body>
    </html>


    JE WATAALAMU WAPI NINAPOKOSEA? NITASHUKURU SANA KWA MSAADA WAKO
     
  2. Mtazamaji

    Mtazamaji JF-Expert Member

    #2
    May 27, 2011
    Joined: Feb 29, 2008
    Messages: 5,972
    Likes Received: 27
    Trophy Points: 0

    Error mesage zinazotkea kwenye index.php kuna tatizo kwenye line 13 na 14 ya index.php

    Nadhani
    <?php include('includes/header.php'); ?>
    <?php include(includes/nav.php); ?>

    Kwenye root folder yaani htdocs unatakiwa utengeze folder linaitwa inlcludes ambalo ndani yake ndo utaweka file la Header.php na nav.php

    Otheriwise jaribu kuondoa inlcudes kwenye line 13 na 14 uone yaani iwe hivi
    PHP:
    <?php include('/header.php'); ?>
         <?php include('/nav.php'); ?>
     
    kifupi nadhani tatizo ni path declaration ya yalipo mafile ya header na nav sio sahihi. Kifupi sio mzuri sana sikiliza na wataalam wengine
     
  3. Washawasha

    Washawasha JF-Expert Member

    #3
    May 27, 2011
    Joined: Aug 7, 2006
    Messages: 8,368
    Likes Received: 146
    Trophy Points: 160
    Nashukuru sana mkuu kwa majibu yako lakini hilo folder la includes lipo na files zilizomo ndani yake ni hizi header.php,nav.php.sidebar.php,footer.php lkn bado inakataa hata nikitumia hiyo code yako ya hapo chini,ngoja nijaribu kulidelete na kulirudisha tena nione itakuwaje
     
  4. Mtazamaji

    Mtazamaji JF-Expert Member

    #4
    May 27, 2011
    Joined: Feb 29, 2008
    Messages: 5,972
    Likes Received: 27
    Trophy Points: 0

    Mkuu hata mm nimekosea lakini hakisha na speling ziko sawa kama folder ni includes basi na path iwe include maana naona hata kwenye mfano wangu nimekosea. Php inataka uwe makini sana kwenye syntax ya kila neno na ni case senstive ukisahau hata ' ni tatizo.
     
  5. Einstein

    Einstein Senior Member

    #5
    May 27, 2011
    Joined: Dec 5, 2009
    Messages: 122
    Likes Received: 1
    Trophy Points: 0
    Jaribu kutumia function include_once(), badala ya include()..
     
  6. Einstein

    Einstein Senior Member

    #6
    May 27, 2011
    Joined: Dec 5, 2009
    Messages: 122
    Likes Received: 1
    Trophy Points: 0
    include_once() function instead of include() ndo mpango mzima.. Nimejaribu kuangalia code yako, nimeona header.php ime-include() variables.php, at the same time footer.php ime-include same file (variables.php), baada ya hapo, ume-include footer.php na header.php kwenye same file index.php.. Kwa maana hiyo, variable.php file has been included twice into the index.php.. Kwa ufahamu wangu, hiyo huwa haitakiwi.. Nakuomba ujaribu kutumia include_once() badala ya include() function..
     
  7. mazd

    mazd Senior Member

    #7
    May 27, 2011
    Joined: Apr 3, 2011
    Messages: 190
    Likes Received: 3
    Trophy Points: 0
    mkuu ulirikwest msaada wangu, ila kwa sasa nipo mbali na PC yangu, ili nitest script zako but anyway. jaribu kitu hiki <?php include"mahangasha/mavitu.php";?>
     
  8. mazd

    mazd Senior Member

    #8
    May 27, 2011
    Joined: Apr 3, 2011
    Messages: 190
    Likes Received: 3
    Trophy Points: 0
    pendelea sana double quotes kuliko single quote ktk php scripts zako.for details, i will back to u by tmoro.90t
     
  9. Mtazamaji

    Mtazamaji JF-Expert Member

    #9
    May 27, 2011
    Joined: Feb 29, 2008
    Messages: 5,972
    Likes Received: 27
    Trophy Points: 0
    Mkuu vile vile hakikisha pia file za nav.php na mengineyo kama footer.php zina acess sahihi nadhani kama unatumia FTP hakikisha acess right kwenye hizo file read,write na execute ziko sawa eg iwe ni 777 au 677.

    BTN
    Safi sana mkuu kazi na majaribio kwa vitendo
     
  10. Chamoto

    Chamoto JF-Expert Member

    #10
    May 28, 2011
    Joined: Dec 7, 2007
    Messages: 1,432
    Likes Received: 19
    Trophy Points: 135
    Jaribu ku-run hizi files kwenye server

    index.php

    PHP:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="description" content="" />
    <meta name="keywords" content="mafia" />
    <meta name="author" content="washawasha" />
    <link rel="stylesheet" type="text/css" href="./style.css" media="screen" />
    <title>mafia island</title>
    </head>
    <body>
    <div id="wrapper">
    <?php include'./include/header.php'?>
    <?php 
    include'./include/nav.php'?>
    <div id="content">
    <h1>Kilindoni</h1>
    <h2>Bweni bay</h2>
    <h3>Mafia island marine park</h3>
    <h4>Chole island</h4>
    <h5>Nyororo island</h5>
    <h3>Jiwe fatuma</h3>
    <p>
    DA urges Zuma to help Hammerl family</p>
    <p>
    Johannesburg - The Democratic Alliance on Friday urged President Jacob Zuma to use his "good relationship" with Libyan leader Muammar Gaddafi to ensure that the remains of photographer Anton Hammerl are returned to his family.

    This, so they were able to give him a proper burial, DA international relations spokesperson Stevens Mokgalapa said in a statement.

    Zuma was likely to "raise the issue" during his visit to Tripoli next week, his spokesperson Zizi Kodwa told The Times newspaper.

    On Thursday, Hammerl's family appealed to Zuma to seek to have his remains returned.

    The photographer was covering the conflict in Libya on April 5 when he was shot by militia loyal to Gaddafi near the town of Brega.

    According to American journalists Clare Gillis, James Foley and Spanish photographer Manu Brabo, who were detained in Libya, Hammerl was left to die in the desert after they were arrested.

    </p>
    <p>Lies</p>
    <p>The South African government and the African National Congress publicly slammed the Libyan government last week after the three journalists confirmed Hammerl's death.

    South Africa accused Libya of lying, saying it had known all along that Hammerl had been shot dead on April 5, but had nonetheless kept reassuring officials that he was safe.

    International relations and co-operation department spokesperson Clayson Monyela said on Wednesday that it was only when Gillis, Foley and Brabo had been debriefed in Tunisia that the South African government become aware that the Libyan government had lied.
    </p>
    <h3>Two days earlier, on May 17, </h3>
    <p>the Associated Press news agency quoted Libyan government spokesperson Moussa Ibrahim as saying that Hammerl was not in Libyan government custody.

    Mokgalapa said that while questions remained about what was actually communicated to the South African government by Libyan authorities, it was time for the South African government to "act decisively" and repatriate Hammerl's remains.

    Kodwa on Thursday confirmed that Zuma had received information from journalists indicating the possible location of Hammerl's remains in Libya, for him "to share with the Libyan authorities next week".
    </p>
    <p>"The information... about the possible location of the remains has been passed on to the South African mission in Tripoli for further work."

    He said Zuma, who sent his condolences to the family, would do "whatever is possible" to help.
    - SAPA
    </p>
    </div> <!-- end #content -->
    <?php include'./include/sidebar.php'?>
    <?php 
    include'./include/footer.php'?>
    </div> <!-- End #wrapper -->
    </body>
    </html>


    Ziweke hizi file kwenye include folder

    header.php

    PHP:
    <?php include'variables.php'?>
    <div id="header">
    <h2><?php echo $heading ?></h2>
    </div> <!-- end #header -->
    footer.php
    PHP:
    <?php include'variables.php'?>
    <div id="footer">
    <p><?php echo $footer ?></p>
    </div> <!-- end #footer -->
    nav.php
    PHP:
    <?php
    echo '
    <div id="nav">
    <a href="index.php">Home</a>
    <a href="about.php">About</a>
    <a href="#">Portfolio</a>
    <a href="#">Contact</a>
    </div> <!-- end #nav -->'
    ;
    ?>
    sidebar.php (missing)
    PHP:
    <?php   ?>
    variables.php
    PHP:
    <?php
    $heading
    ='Mafia Kiss One.Uknown Paradise';
    $footer='Copyright &copy; 2011 Mafia Kiss One.Uknown Paradise';
    ?>
     
  11. Washawasha

    Washawasha JF-Expert Member

    #11
    May 28, 2011
    Joined: Aug 7, 2006
    Messages: 8,368
    Likes Received: 146
    Trophy Points: 160
    wakuu nashukuru sana kwa majibu yenu,namuömba Mungu nifike kesho ili niende cafe kufanya marekebisho halafu nitaleta ripoti hapa
     
  12. Washawasha

    Washawasha JF-Expert Member

    #12
    May 28, 2011
    Joined: Aug 7, 2006
    Messages: 8,368
    Likes Received: 146
    Trophy Points: 160
    Mkuu heshia mbele nimejaribu kuitoa footer.php kwenye index.php lakini bado haileti majibu mazuri,naomba unioneshe mfano halisi wa nini nifanye ili hizi pages ziweze kudisplay.Nitashukuru
     
  13. Washawasha

    Washawasha JF-Expert Member

    #13
    May 28, 2011
    Joined: Aug 7, 2006
    Messages: 8,368
    Likes Received: 146
    Trophy Points: 160
    Mkuu hii ndio sidebar.php yangu
    <div id="sidebar">

    <h3>Navigation</h3>
    <li><a href="index.php">Home</a></li>
    <li><a href="about.php">About Us</a></li>
    <li><a href="#">Links</a></li>
    <li><a href="#">Portfolio</a></li>
    <li><a href="#">Contact</a></li>
    <h3>Box Two</h3>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    <h3>Box Three</h3>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    </div> <!-- end #sidebar -->
    HTML:
    
    
    Lakini bado inakataa
     
  14. Chamoto

    Chamoto JF-Expert Member

    #14
    May 28, 2011
    Joined: Dec 7, 2007
    Messages: 1,432
    Likes Received: 19
    Trophy Points: 135
    sidebar.php

    PHP:
    <?php
    echo 
    '<div id="sidebar">
    <h3>Navigation</h3>
    <li><a href="index.php">Home</a></li>
    <li><a href="about.php">About Us</a></li>
    <li><a href="#">Links</a></li>
    <li><a href="#">Portfolio</a></li>
    <li><a href="#">Contact</a></li>
    <h3>Box Two</h3>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    <h3>Box Three</h3>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    <li><a href="#">Link Here</a></li>
    </div> <!-- end #sidebar -->'
    ;
    ?>
    Mkuu nimeibadilisha kidogo hiyo sidebar.php labda kunakitu unakosea kwasababu nimezijaribu hizi files kwenye local server (xampp) na kwenye remote server na kote zinakubali. Bonyeza hapo Mafia Kiss One.Uknown Paradise

    Bonyeza hapa kudownload files zote ili uweke kwenye server yako.
     
  15. Washawasha

    Washawasha JF-Expert Member

    #15
    May 29, 2011
    Joined: Aug 7, 2006
    Messages: 8,368
    Likes Received: 146
    Trophy Points: 160
    Asante sana mkuu kesho nikiamka salama nakwenda cafe kuzi upload,,,NIMESHAAMKA NA NIKO Cafe na imekubali,thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you,imekubali mkuu ubarikiwe SAAAAANA si unalijua dua la kuombewa na mnyonge? MUNGU LAZIMA ALIKUBALI niko hewani sasa http://mafiakissone.zxq.net/, more staff to come
     
  16. Einstein

    Einstein Senior Member

    #16
    May 29, 2011
    Joined: Dec 5, 2009
    Messages: 122
    Likes Received: 1
    Trophy Points: 0
    Mkuu sikumaanisha kua utoe footer.php, nilichomaanisha ni kwamba, sehemu zote ulipotumia include() function, tumia include_once()
     
Loading...