I would like to send data that the user the filled in a show prompt box. I originally planned to send the data from a regular form, but changed my mind and want to do it through a show prompt box.
Here is my code:
the html for the form is:
and the PHP is
I also try this:
And for the Mysql:
I m new to programming, so I hope I was clear.
Thank you
Edit by Jazzc: don't forget the code tags - makes the post actually readable
Here is my code:
Code:
<script type="text/javascript">
function show_prompt()
{
var name=prompt("question");
if (name!=null && name!="")
{
document.write("<p>This is your question " + name + "</p>");
}
}
</script>
Code:
<form id="propose" name="input" action="insertpropose.php" method="post"><br/>
<input type="submit" onclick="show_prompt()" value="propose" />
</form>
Code:
$query="SELECT propose* FROM propose";
$result=mysql_query($query);
$result = mysql_query("SELECT * FROM propose");
I also try this:
Code:
<script type="text/javascript">
function show_prompt()
{
var name=prompt("question");
if (name!=null && name!="")
{
//set the hidden input value to the value entered in the prompt
document.input.purpose.value = name; //document.input referring to the form named 'input'
document.input.submit(); //submit the form
}
}
</script>
Code:
$purpose = $_POST['purpose'];
$query="SELECT propose FROM propose WHERE purpose = ". $purpose;
$result=mysql_query($query);
Thank you
Edit by Jazzc: don't forget the code tags - makes the post actually readable
Last edited by a moderator: