Forum Moderators: open
here full script
----
session_start();
@header("Cache-control: private");
extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
$username ="username";
$password ="password";
$databasename ="databasename";
$host ="localhost";
mysql_connect($host, $username, $password) or die();
mysql_select_db("$databasename") or die("error");
mysql_query("INSERT INTO example VALUES ('id','$text')");
echo "added";
--Admin please move it to another place if this place is wrong--
i got the error on it
It sounds to me like you are getting duplicate inserts and you only want one. If this is the case one solution is to add a distinct index on the field where you're putting $text into. Another is to solve the problem in PHP and have it check if the text exists in the db yet and not insert if it does.
Does that help?
And by the way, I know you just began but
> I wouldn't extract and begin using the values in that way, for security reasons.
> I wouldn't put the connection that way, rather I would put on a separate page and include it when needed
Have you recently installed any toolbars or plugins? Can you check your server logs to see if any of the requests for /data.php?text=whatever are coming from an IP other than your own?
To avoid this, make an HTML form that you use that uses POST instead of GET to pass the data.