deleted

Let me google that for you

Google before asking questions.

You'd have to be retarded to offer that as a solution to his problem, if you aren't going to offer any help then don't bother posting.
It would have taken less time to actually tell him what he needed to do. Considering googling 500 error would give you a bunch of useless articles.
/done_ranting

Hello EliteGM

Thanks for the answer it helped me to some extend. Now i have a last problem occuring:

My Output:

PHP:
<?php
require_once('../pe13f/SSI.php');
require_once ('../PE13/smf_2_api.php');
?>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
function MakeRequest(id)
{
    $.ajax({
        url : 'display.php',
        data:{"id":id},
        type: 'GET',

        success: function(data){
            $('#streaminnern').html(data);
        }
    });
}
</script>

    <div id="stream" class="bg4 roundedcrop shadow"> 
     <div class="ph25 pv20"> 
      <h1>News</h1> 
      <input id="streamcnt" name="streamcnt" type="hidden" value="" /> 
     </div> 
     <div id="streamadd"></div> 
     <div id="streaminnern">

<?php 
$num_recent = 5;
ssi_ErecentTopics($num_recent, $exclude_boards = null, $include_boards = 2, $output_method = 'echo'); 
?> 

</div> 
	<a id=""><div onclick="MakeRequest(<?php echo $num_recent; ?>);" id="streammore">More News articles</div></a>
</div>

and the backend display.php

PHP:
<?php 
$num_recent = $_GET['id']+5;
ssi_ErecentTopics($num_recent, $exclude_boards = null, $include_boards = 2, $output_method = 'echo'); 
?>

After clicking "More News articles" I can see in the Developer mode in chrome this error:

Code:
GET http://eubboline.net/connuh/display.php?id=5 500 (Internal Server Error)                                                            jquery.js:9597

Check your php error log this can be caused by any number things.
 
Last edited:
You'd have to be retarded to offer that as a solution to his problem, if you aren't going to offer any help then don't bother posting.
It would have taken less time to actually tell him what he needed to do. Considering googling 500 error would give you a bunch of useless articles.
/done_ranting



Check your php error log this can be caused by any number things.

On the contrary, but from the tone of your response I shouldn't expect you to understand the intention of my post.

Learning what a 500 error is would have led him to know that it is a server side error and that he should check server logs, while at the same time teaching him something infinity much more useful than being given an answer of "can be caused by any number of things". Its much more helpful to him if he learns how to take steps to solve his own problem by taking that extra step of gaining an understanding of HTML error codes if he is going to be working on web development.
 
Give this a shot!

default.php
PHP:
<?php
	require_once('../pe13f/SSI.php');
	require_once ('../PE13/smf_2_api.php');
	
	ssi_ErecentTopics($num_recent = $_GET['id'], $exclude_boards = null, $include_boards = 2, $output_method = 'echo');
?>

output.php
PHP:
<?php
	require_once('../pe13f/SSI.php');
	require_once ('../PE13/smf_2_api.php');
?>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
	var num_recent = 5; //Start of the script, num_recent is 5.
	
	function MakeRequest()
	{
		num_recent += 5; //We know that we're going to load 5 more news items.
		
		$.ajax({
			type: 'GET',
			url: 'display.php',
			data: {
				'id': num_recent //So that's already got that +5 increment on it
			},
			success: function(data) {
				$('#streaminnern').html(data);
			}
		});
	}
</script>

<div id="stream" class="bg4 roundedcrop shadow"> 
	<div class="ph25 pv20"> 
		<h1>News</h1> 
		<input id="streamcnt" name="streamcnt" type="hidden" value="" /> 
	</div> 
	<div id="streamadd"></div> 
	<div id="streaminnern">
		<?php ssi_ErecentTopics($num_recent = 5, $exclude_boards = null, $include_boards = 2, $output_method = 'echo'); ?>
	</div> 
	<div onclick="MakeRequest();" id="streammore">More News articles</div>
</div>

I cleaned up your code slightly, and changed several things, most noteworthy:
- default.php now loads just the specified $_GET["id"], the +5 increment is all done on the JavaScript side of things.
- There is no need to pass an argument to your MakeRequest function as we know already that we just want a +5 increment every time the button is clicked, and default.php (as stated above) listens to whatever $_GET["id"] is sent by the AJAX call.
 
Back