Jump to content

sheraz

Members
  • Posts

    44
  • Joined

  • Last visited

    Never

Everything posted by sheraz

  1. hi sir i m working with fseek() and ftell(). i don't know what is the problem.i have just moved the position indicator 4 steps ahead and write the data on file. the code is correctly writing in the file but it is not displaying when i try to display it. here the code is.. reading the data from file. <?php if(! $fp=fopen("abc.txt", "w")) die("could not find the required file"); else { fseek($fp,4); fwrite($fp,"welcome to php programming"); } $file=fopen("abc.txt", "r"); $fi=ftell($file); fseek($file,$fi); echo fread($file,20); ?> it does not display anything. but data has been written on the file. please help me. :'(
  2. ok Thanks sir, i m very thankful to u.
  3. sir if it only return the total number of readed characters then i don't understand that why it is returning the file contents.
  4. hi i m working on fie handling. i have used fpassthru() to read the data froma file . it outputs the contents of file but at the end it also prints total number of characters. please tell me what the problem is. here is the code. if(! $fp=fopen("abc.txt", "r")) die("could not find the required file"); else { echo fpassthru($fp); } ?> its output is welcome to php programming.we are working on the php file handling. 68
  5. dear if i access cookies on the same page i.e( cookies.php) then it works correctly. but after typint name and password when it click login then on next page it should access cookies i. username But it is not working. :'( i have tried your code its output doesnot containg username. please help me.
  6. hi. i m trying to acces cookies values entered on page 1 to page 2 but it is not working well. i m sending you the code and guide me what is the problem? cookie.php <? if(isset($_POST['name']) ) { setCookie("username",$_POST['name'], time()+3600); } if(isset($_POST['pw'] ) ) { setcookie("password",$_POST['pw'],time()+3600); } echo "<html><head></head>"; echo "<body>"; echo "<form action=cookie_login.php method=post>"; echo " Enter Name: <input type=text name=name><br>"; echo "Enter Password: <input type=password name=pw><br>"; echo "<input type=submit value=login></form>"; echo "</body></html>"; ?> cookie_login.php <? if(isset($_COOKIE['username'] ) ) { echo "Welcome $_COOKIE[username] : You have been LoggedIn"; } else echo "Enter correct username or password"; ?>
  7. ok dude sorry.
  8. can i store and retrieve pictures in the mysql using PHP. if yes then tell me how can i store and retrieve data
  9. sir, i m trying to design a database of a school.my question is that in the exams result section, when i enter the roll number of a student then the results should also include the image of that student. the code is successfully reading the record from table. but i want to read its picture also. how can i do this.
  10. my quewstion is that. we can easily search data from database in a website. but if i want to find any line or even a word then how can i do this. i.e how search engines find data on web regarding the written words.
  11. sir i m trying to get data from a file but it is not working correctly.please tell me the solution. Here is the code. <? if(!($fp=fopen("abc.txt", "r")) ) die ("cannot connect to the file"); else { $lines[]=file("abc.txt"); foreach($lines as $line_num=>$lines) { echo $line_num; } } ?> i want the data written in file. but its output is 0.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.