Jump to content

Submit Form to a php script


Recommended Posts

I have a form, that is a

chat apps am building

for project. Now

everything seems to be

working fine to the best of

my ability.

I want to submit

the data from the form

into my php script

without any form of

reload. That means i

don't want redirection,

to the action page and

back to the chat page.

What i want is for the

page to submit the

form at the background.

And i know i need ajax

to this bt i cnt get it

right. Here is my form

 

<form method="post"

id='chatbox'

action="reply.php">

<input type="text"

id="text"

name="adchat"/>

<input type='hidden'

id='user_id' name='id'

value='1'>

<input type='hidden'

id='user_name' name='id'

value='Ben'>

<input type='submit'

id='submit' name='chat'

value='send'></form>

 

 

What i need is an ajax

code to submit d

variable to the reply.php

scrit and maybe a

message to display

when the form it been

submitted say

something like

(sending...). Thanks for

assiting. Pls i don't know anything when it comes to AJAX. Please forgive me and help me. Don't borther about displaying the user input just make it submit it to the php script. Thank you once again.

Link to comment
https://forums.phpfreaks.com/topic/287007-submit-form-to-a-php-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.