Thread: Debugging help
View Single Post
Old 02-07-2012, 09:53 PM   PM User | #3
Scriptr
Regular Coder

 
Join Date: Oct 2011
Posts: 106
Thanks: 12
Thanked 0 Times in 0 Posts
Scriptr is an unknown quantity at this point
Quote:
Originally Posted by sunfighter View Post
Your problems are all in the view.php file.
All of your CASE statements are case 1: You need to change that. And your first
Code:
$view = $_GET['view'];
will be a zero, so your first case must be
Code:
case 0:
Your
Code:
$theData = fread($fh, 5);
contained in all cases only reads 5 bytes. Use this to get the entire file.
Code:
$theData = fread($fh, filesize($myFile));
Make those changes and it should work.

I am assuming that in you real code you have a div to display the returning files
Code:
.....
</form>
<div id="right">Info here</div>
</body>
</html>
PS. You now have code to get ajax files. You need to make a php file with
Code:
<?php
echo 'made it';
?>
So you can tell which file if you have a problem with.
Thanks. I usually get that 5 bytes thing, and it turns out to just be a problem with which case is which for the other, but I was working quickly, so I copied/pasted a lot of it, intending to clean it up later. That doesn't explain my problems with my other AJAX scripts. I'll put them in the next response. Those, I have been working on for literally a year.
Scriptr is offline   Reply With Quote