2

I have code like this

function firstload(maxid, next_page, results, animation_image, btn_load, url, endpoint) {
        var a = ''+maxid+'';
        var b = ''+next_page+'';
        var c = ''+endpoint+'';

        $('#'+results+'').load('<?php echo base_url()?>create/firstload', { max_id: a, next_page: b, endpoint: c }, function() { 
            var nextpage = $('#'+next_page+'').val();
            if (nextpage != 0) { $('.'+btn_load+'').show(); }
            else {  $('.'+btn_load+'').hide();  }
            $('.'+animation_image+'').hide();
        });
    }

firstload('max_id','nextpage','results','animation_image','load_more','load','get_user_recent');

and php backend like this :

function firstload($max_id, $next_page, $endpoint) {
 echo '<p> '$max_id' </p> //just a piece of code
}

[EDIT] I add some code on the function. i want id #result at frontend contain 'max id' from firstload function.

But it is returning some error :

Severity: Warning
Message: Missing argument 1 for Create::firstload()
Filename: controllers/Create.php
Line Number: 156

and it happened to argument 2 and 3 too.

What's wrong with my code?

dionajie
  • 404
  • 1
  • 7
  • 19

1 Answers1

-3

Place <?php ?> tags around your code that you want to run as php. It looks like you are missing these tags around you call to firstload(...)

Robert
  • 10,126
  • 19
  • 78
  • 130