If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

And I do, indeed have the ID correct for <div id="right"></div> I made sure of that.

Again, I get this every time I write ajax. I did copy/paste the browser support from tizag (it is tedious, won't work if it doesn't achieve a uniform function, and they said they didn't mind), but I expect that is the only right part.

Users who have thanked sunfighter for this 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.

Users who have thanked sunfighter for this post:

Scriptr you have a workable solution already, why do you need to work on the latest script to achieve what you have?

This is for a social network I have been writing for the past 2 years. all but the first 2 months were spent on the AJAX. The workable solution is for the other one. That is a website I was asked to do for a local church. Then I told my boss that JS couldn't do form submission without using server side script, and the JS isn't really necessary. I haven't heard from him in 3 days. He wanted to use <form action="mailto:address@site.com">...</form>