Mssql:
<! -- # Include file = "conn. asp" -->
<%
Hid = request. QueryString ("id ")
SQL = "select * from admin where id =" & hid
Set rsw.conn.exe cute (SQL)
%>
Access:
<%
Db = "aspzhuru. mdb" Modify the database path or name here
Set conn = Server. CreateObject ("ADODB. Connection ")
Dbpath = "Provider = Microsoft. Jet. OLEDB.4.0; Data Source =" & Server. MapPath (db)
Conn. Open dbpath
%>
Php:
<?
$ Mysql_server_name = "localhost ";
$ Mysql_username = "root ";
$ Mysql_password = "password ";
$ Mysql_database = "phpzr ";
$ Conn = mysql_connect ($ mysql_server_name, $ mysql_username, $ mysql_password );
Mysql_select_db ($ mysql_database, $ conn );
$ Id = $ _ GET [id];
$ SQL = "select username, password from admin where id = $ id ";
$ Result = mysql_db_query ($ mysql_database, $ SQL, $ conn );
$ Row = mysql_fetch_row ($ result );
?>
. Net (put in the code file. cs ):
Using System. Data;
Using System. Configuration;
Using System. Collections;
Using System. Web;
Using System. Web. Security;
Using System. Web. UI;
Using System. Web. UI. WebControls;
Using System. Web. UI. WebControls. WebParts;
Using System. Web. UI. HtmlControls;
Using System. Data. SqlClient;
Public partial class Default2: System. Web. UI. Page
{
Protected void Page_Load (object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection ();
Conn. ConnectionString = ConfigurationManager. ConnectionStrings ["StudyConnectionString"]. ToString ();
Conn. Open ();
SqlCommand cmd = new SqlCommand ("select * from [table] where id =" + this. Page. Request. Params ["getid"], conn );
Cmd. ExecuteNonQuery ();
This. Page. RegisterClientScriptBlock ("script", "<script> alert (injection successful) </script> ");
}
}