0

I want to send a variable $stuff frome page.php to load.php via POST

I have something like this in javascript

$.post("load.php", {'start': count }, function(data){
            $("#posts").append(data);

        });

I know I need to modify {'start': count } but im confused as to how to pass $stuff in since it isn't a javascript variable.

Thanks

1 Answer 1

1

Just echo it out.

$.post("load.php", {'start': '<?php echo $stuff ?>' }, function(data){
        $("#posts").append(data);

    });
Sign up to request clarification or add additional context in comments.

1 Comment

cool thanks...so if i had multiple variables would it be {'var':'<?=$stuff1?>', 'var2':'<?=$stuff2?>'}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.