Link to home
Start Free TrialLog in
Avatar of Redscrapbook
RedscrapbookFlag for Ireland

asked on

HTML5 include text file

I've been using this to fetch .txt through PHP with php code as below and on index.php there is no problem and I've re-saved index.html and I've an issue and text/forgotten.txt no longer appear?

I'm using jQuery1.6.4 and <div> tag on index.html with .txt file as local folder.

<?php $filename="text/forgotten.txt"; $handle=fopen($filename,"r"); $contents=fread ($handle,filesize($filename)); echo($contents); ?><!-- Read permission included --> 

Open in new window



I've tried this approach to get "text/forgotten.txt" with php as above and it still doesn't work? I appreciate your pointers please?
function showHint(str)
{
  if (str.length==0)
  {
    // Reset hint box if the ID is cleared
    jQuery("#lecturer1").html("");
  }
  else
  {
    // Require at least two characters before we start searching
    if(str.length > 1)
    {
      // Load hint result into the element with the ID "txtHint"
      $('#lecturer1').load("php/studentlist_moduleNo1.php");
     }
   }
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Redscrapbook
Redscrapbook
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Redscrapbook

ASKER

Got it solved from another post from basicinstinct he should get this 500 point for steering a solution from another post with different question.