Home  >  Q&A  >  body text

Execute PHP without leaving the page

I have a form - textarea (named su) and submit button.

After submitting the form, I need

  1. Run PHP script without refreshing/leaving the page
  2. "echo" or print the return in some way on the screen

I'm pretty sure this can be achieved with some kind of ajax request. But I don't know what to do.

Like I said, I have no education in ajax or java. A simple example would be great.

P粉561323975P粉561323975335 days ago771

reply all(1)I'll reply

  • P粉184747536

    P粉1847475362023-10-24 11:38:17

    It's very simple, it's the so-called AJAX. This solution uses Javascript more than PHP.

    With Jquery you can do it with a simple function call:

    sssccc
    
    sssccc

    Successful.

    reply
    0
  • Cancelreply