|
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%>
<!--#include file="../Connections/cojgxyfuckyou.asp" -->
<%
// *** Edit Operations: declare variables
// set the form action variable
var MM_editAction = Request.ServerVariables("SCRIPT_NAME");
if (Request.QueryString) {
MM_editAction += "?" + Server.HTMLEncode(Request.QueryString);
}
// boolean to abort record edit
var MM_abortEdit = false;
// query string to execute
var MM_editQuery = "";
%>
<%
// *** Update Record: set variables
if (String(Request("MM_update")) == "add2" &&
String(Request("MM_recordId")) != "undefined") {
var MM_editConnection = MM_cojgxyfuckyou_STRING;
var MM_editTable = "fuckyou";
var MM_editColumn = "IP";
var MM_recordId = "'" + Request.Form("MM_recordId") + "'";
var MM_editRedirectUrl = "thanks.html";
var MM_fieldsStr = "no+1|value";
var MM_columnsStr = "number|none,none,NULL";
// create the MM_fields and MM_columns arrays
var MM_fields = MM_fieldsStr.split("|");
var MM_columns = MM_columnsStr.split("|");
// set the form values
for (var i=0; i+1 < MM_fields.length; i+=2) {
MM_fields[i+1] = String(Request.Form(MM_fields));
}
// append the query string to the redirect URL
if (MM_editRedirectUrl && Request.QueryString && Request.QueryString.Count > 0) {
MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1)?"?":"&") + Request.QueryString;
}
}
%>
<%
// *** Update Record: construct a sql update statement and execute it
if (String(Request("MM_update")) != "undefined" &&
String(Request("MM_recordId")) != "undefined") {
// create the sql update statement
MM_editQuery = "update " + MM_editTable + " set ";
for (var i=0; i+1 < MM_fields.length; i+=2) {
var formVal = MM_fields[i+1];
var MM_typesArray = MM_columns[i+1].split(",");
var delim = (MM_typesArray[0] != "none") ? MM_typesArray[0] : "";
var altVal = (MM_typesArray[1] != "none") ? MM_typesArray[1] : "";
var emptyVal = (MM_typesArray[2] != "none") ? MM_typesArray[2] : "";
if (formVal == "" || formVal == "undefined") {
formVal = emptyVal;
} else {
if (altVal != "") {
formVal = altVal;
} else if (delim == "'") { // escape quotes
formVal = "'" + formVal.replace(/'/g,"''") + "'";
} else {
formVal = delim + formVal + delim;
}
}
MM_editQuery += ((i != 0) ? "," : "") + MM_columns + " = " + formVal;
}
MM_editQuery += " where " + MM_editColumn + " = " + MM_recordId;
if (!MM_abortEdit) {
// execute the update
var MM_editCmd = Server.CreateObject('ADODB.Command');
MM_editCmd.ActiveConnection = MM_editConnection;
MM_editCmd.CommandText = MM_editQuery;
MM_editCmd.Execute();
MM_editCmd.ActiveConnection.Close();
if (MM_editRedirectUrl) {
Response.Redirect(MM_editRedirectUrl);
}
}
}
%>
<%
var Recordset1__MMColParam = "1";
if (String(Request.Form("hfVoteIP")) != "undefined" &&
String(Request.Form("hfVoteIP")) != "") {
Recordset1__MMColParam = String(Request.Form("hfVoteIP"));
}
%>
<%
var Recordset1 = Server.CreateObject("ADODB.Recordset");
Recordset1.ActiveConnection = MM_cojgxyfuckyou_STRING;
Recordset1.Source = "SELECT * FROM fuckyou WHERE IP = '"+ Recordset1__MMColParam.replace(/'/g, "''") + "'";
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();
var Recordset1_numRows = 0;
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>ADD2</title>
</head>
<body>
<form ACTION="<%=MM_editAction%>" METHOD="POST" name="add2">
<input name="hfVoteIP" type="hidden" value="<%= Request.ServerVariables("Remote_ADDR") %>">
<input name="no+1" type="hidden" value="<%=(Recordset1("number")+1)%>">
<input name="MM_update" type="hidden" value="add2">
<input type="hidden" name="MM_recordId" value="<%= Recordset1.Fields.Item("IP").Value %>">
</form>
</body>
</html>
<%
Recordset1.Close();
%> |
|