Jump to content

Ask question


Mamo

Recommended Posts

It sounds like you just want a generic feedback-type form. Here is some simply code that would push the input of a textarea into your database:

<form method="post">
Question:<br/>
<textarea name="answer"></textarea>
<input type="submit"/>
</form>

<?php

if (isset($_POST['answer']))	//Form was submitted
{
	mysql_connect('localhost', 'user', 'pass');
	mysql_select_db('database');
	mysql_query('INSERT INTO tablename VALUES ("'.$_POST['answer'].'")');
}

?>

That is very generic and obviously needs to be adjusted for your scenario. Is this the sort of form you are looking for?

Link to comment
https://forums.phpfreaks.com/topic/276988-ask-question/#findComment-1424939
Share on other sites

It sounds like you just want a generic feedback-type form. Here is some simply code that would push the input of a textarea into your database:

<form method="post">
Question:<br/>
<textarea name="answer"></textarea>
<input type="submit"/>
</form>

<?php

if (isset($_POST['answer']))	//Form was submitted
{
	mysql_connect('localhost', 'user', 'pass');
	mysql_select_db('database');
	mysql_query('INSERT INTO tablename VALUES ("'.$_POST['answer'].'")');
}

?>

That is very generic and obviously needs to be adjusted for your scenario. Is this the sort of form you are looking for?

Thank you,

i understood that, but i need other users on the website to be able to answer the question that i saved . Like the concept of  "phpfreaks"  website.

Link to comment
https://forums.phpfreaks.com/topic/276988-ask-question/#findComment-1424940
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.