Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

braxton's avatar

Working with PHP and Javascript

Hello, I am working with PHPMailer, and I am trying to send email(I got that part working) but when I add the text of the input field, it doesn't work. I can see why, because it doesn't send a full post request and it doesn't refresh the page, so there is no using $_POST[] or $_GET[]. I was wondering if there is some way in PHP to get the value of the input when I click the "save" button. Here is the code where I need it to be done.

  sendUpdateEmail("questions@techmatemn.com", $pcemail, "Techmate: There has been an update to your device!", "Hello! There has been an update to your " . $pcmake . " (Ticket number: " . $pcid . "). Update: " . $_POST['thenote']);

Where $_POST['thenote'] is where the field input should be. Keep in mind that I am not refreshing the page, so I cannot use $_POST[] and $_GET[].

0 likes
3 replies
bashy's avatar

Is this Laravel related or?

Not refreshing the page so no $_POST or $_GET? Huh?! Show some more code of what you're doing.

opheliadesign's avatar

I'm guessing what you're after is something like an Ajax request? Google jQuery Ajax and Javascript Ajax, see if that points you in the right direction.

As @bashy said, more code and a better explanation would be helpful here. :)

braxton's avatar
braxton
OP
Best Answer
Level 2

I've solved it, I was just checking for the POST request in the wrong file, it turns out that there was a POST request after all.

Please or to participate in this conversation.