Jump to content

javascript prompt box then store input on database


violinrocker

Recommended Posts

<input type="button" value="prompt box" name="B3" onClick="prompt('Prompt boxes allow the user to enter text or a value!','Enter your text here')">

 

I found this javascript prompt box code and thought that it would work great with my site,

how do I use it with the following code to store data in my database?

 

<?php
$con = mysql_connect("host","user","pass");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("database", $con);

$sql="INSERT INTO broken_links (r_title, page_id, r_date, r_expiry, r_message)
VALUES
('$_GET[title]','$_GET[page_id]',NOW(), DATE_ADD(NOW(), INTERVAL 2 MONTH), $POST[r_message])";

if (!mysql_query($sql,$con))
  {
  }
echo "Your Report has been sent! thank you for sending a report, the administrators will fix it as soon as they see your report";

mysql_close($con)
?> 

  • 4 years later...

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.