Ver Mensaje Individual
  #12 (permalink)  
Antiguo 31/03/2008, 15:30
pabje
 
Fecha de Ingreso: marzo-2008
Ubicación: Posadas Misiones Argentina
Mensajes: 480
Antigüedad: 17 años, 1 mes
Puntos: 1
Re: Problemas con 2 paginas asp

Hola a todos
Le recuerdo mi problemas: Eran 2 paginas asp que andaban bien en mi PC, pero al publicar en www.brinkster.com no andan bien.


Estos son los 2 codigos depurados de las 2 paginas :
En negrita esta donde mas o menos puede estar el error.
No se casi nada(o nada) de ASP. Me interes es aprender Dreamweaber,
Le pido entonces su gran ayuda para encontrar el error en los codigos.

La ruta raiz que me dio brinkster.com (en donde estan guardadas las paginas) es:
c:\sites\content\p\a\b\pabje.




Aqui van los codigos:

codigo de la pagina de ingreso de comentario


<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/pabloalmada.asp" -->

// set the form action variable
var MM_editAction = Request.ServerVariables("SCRIPT_NAME");
if (Request.QueryString) {
MM_editAction += "?" + Request.QueryString;
}

// boolean to abort record edit
var MM_abortEdit = false;

// query string to execute
var MM_editQuery = "";
%>
<%
// *** Insert Record: set variables

if (String(Request("MM_insert")) == "form1") {

var MM_editConnection = MM_pabloalmada_STRING;
var MM_editTable = "Comentarios";
var MM_editRedirectUrl = "mensaje.htm";
var MM_fieldsStr = "comentario|value";
var MM_columnsStr = "pal_com|',none,''";

// 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[i]));
}

// 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;

}
}
%>
<%






// *** Insert Record: construct a sql insert statement and execute it
// create the sql insert statement
var MM_tableValues = "", MM_dbValues = "";
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_tableValues += ((i != 0) ? "," : "") + MM_columns[i];
MM_dbValues += ((i != 0) ? "," : "") + formVal;
}
MM_editQuery = "insert into " + MM_editTable + " (" + MM_tableValues + ") values (" + MM_dbValues + ")";

if (!MM_abortEdit) {
// execute the insert
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);
}
}
}

<form ACTION="<%=MM_editAction%>" METHOD="POST" name="form1">
.
.
.
.
<input type="reset" name="Submit2" value="Restablecer">
<input type="submit" name="Submit" value="Enviar">
<input type="hidden" name="MM_insert" value="form1">
</form>




codigo de la pagina de consulta de comentario


<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/pabloalmada.asp" -->
<%
var rsconeccion = Server.CreateObject("ADODB.Recordset");
rsconeccion.ActiveConnection = MM_pabloalmada_STRING;
rsconeccion.Source = "SELECT * FROM Comentarios";
rsconeccion.CursorType = 0;
rsconeccion.CursorLocation = 2;
rsconeccion.LockType = 1;
rsconeccion.Open();
var rsconeccion_numRows = 0;
%>
<%
var Repeat1__numRows = 10;
var Repeat1__index = 0;
rsconeccion_numRows += Repeat1__numRows;
%>


/ create the list of parameters which should not be maintained
var MM_removeList = "&index=";
if (MM_paramName != "") MM_removeList += "&" + MM_paramName.toLowerCase() + "=";
var MM_keepURL="",MM_keepForm="",MM_keepBoth="",MM_kee pNone="";

// add the URL parameters to the MM_keepURL string
for (var items=new Enumerator(Request.QueryString); !items.atEnd(); items.moveNext()) {
var nextItem = "&" + items.item().toLowerCase() + "=";
if (MM_removeList.indexOf(nextItem) == -1) {
MM_keepURL += "&" + items.item() + "=" + Server.URLencode(Request.QueryString(items.item()) );
}
}

// add the Form variables to the MM_keepForm string
for (var items=new Enumerator(Request.Form); !items.atEnd(); items.moveNext()) {
var nextItem = "&" + items.item().toLowerCase() + "=";
if (MM_removeList.indexOf(nextItem) == -1) {
MM_keepForm += "&" + items.item() + "=" + Server.URLencode(Request.Form(items.item()));
}
}
// create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL + MM_keepForm;
if (MM_keepBoth.length > 0) MM_keepBoth = MM_keepBoth.substring(1);
if (MM_keepURL.length > 0) MM_keepURL = MM_keepURL.substring(1);
if (MM_keepForm.length > 0) MM_keepForm = MM_keepForm.substring(1);
%>
<%

<%
// *** Move To Record: set the strings for the first, last, next, and previous links

var MM_moveFirst="",MM_moveLast="",MM_moveNext="",MM_m ovePrev="";
var MM_keepMove = MM_keepBoth; // keep both Form and URL parameters for moves
var MM_moveParam = "index";

// if the page has a repeated region, remove 'offset' from the maintained parameters
if (MM_size > 1) {
MM_moveParam = "offset";
if (MM_keepMove.length > 0) {
params = MM_keepMove.split("&");
MM_keepMove = "";
for (var i=0; i < params.length; i++) {
var nextItem = params[i].substring(0,params[i].indexOf("="));
if (nextItem.toLowerCase() != MM_moveParam) {
MM_keepMove += "&" + params[i];
}
}
if (MM_keepMove.length > 0) MM_keepMove = MM_keepMove.substring(1);
}
}
// set the strings for the move to links
if (MM_keepMove.length > 0) MM_keepMove += "&";
var urlStr = Request.ServerVariables("URL") + "?" + MM_keepMove + MM_moveParam + "=";
MM_moveFirst = urlStr + "0";
MM_moveLast = urlStr + "-1";
MM_moveNext = urlStr + (MM_offset + MM_size);
MM_movePrev = urlStr + Math.max(MM_offset - MM_size,0);

%>
%
<td width="31%" align="center"> <% if (MM_offset != 0) { %>
<a href="<%=MM_movePrev%>">Anterior</a>
<% } // end MM_offset != 0 %>
</td>
<td width="23%" align="center">
<% if (!MM_atTotal) { %>
<a href="<%=MM_moveNext%>">Siguiente</a>
<% } // end !MM_atTotal %>
</td>
%