Ask a Question related to Dreamweaver AppDev, Design and Development.
-
0shania0 #1
displaying info from database that was entered in aprevious page
HI All.
im using DWMX vbScript + Access
i have just made a very simle user registeration form - basic name, add,
payment deatails etc using text fields.
which are entered into my database when completed. (With insert server
behaviour)
Im trying to create a confirmation page -
which the user is sent to after the registeration form is completed
with a copy of all the info they filled in the previous page ( registeration
page)
ive been using hidden fields and binding them to request.form and then
inserting that into a table
ive tried with a session variable
and also a recordset to get the info from my database
but the page is being returned blank.
what am i doing wrong?
ive used this feature before but in that instance i wasnt inserting any data
into my database
does any one have any suggestions?
any other methods to do this then how im going about it?
please help if you can
shana
0shania0 Guest
-
JavaScript entered in a page blocks editing page inContribute
I have entered a set of JavaScript tags into a html page via FTPand the page displays correctly on the web. When I go to Contribute to and attempt... -
displaying mysql info via php in flash
I have a movie sample that I downloaded because I dupoicated the same movie how I wanted it to look. However when I was done it didn't work. To... -
How to access values entered in User control in the main page.
Hi Guys, i have a user control which allows the user to enter Name& Address in text boxes. I use the same user control in the main page... ... -
Passing database info to page allow user input then pass into another database
Hi I really am going crazy! I'm using VBScript, ASP, and SQL My page reminds me of a shopping cart but looking at shopping cart examples has not... -
Update Record only displaying first entry of database in the details page
Update Record only displaying first entry of database in the details page. It will update the record, it seems for some reason no matter what... -
SpiderFromMars #2
Re: displaying info from database that was entered in aprevious page
It sounds to me like there are some misplaced or inproperly nested tags in the
file that you are redirected to. Does the information get inserted into the
database alright? Is the confirmation page that you are directing to on the
same page as the one that inserts the database records? Can you post the form
and the confirmation page so I can analyze the code? Kind Regards, Peter
SpiderFromMars Guest
-
0shania0 #3
Re: displaying info from database that was entered in aprevious page
Hi peter.
Appreciate the prompt reply.
the data inseretd into the database can sometimes corrupt as well.
i cant understand it - i have other fields which are entered fine into the
database
however with this subscription form its an off/on happening problem
where i get "mismatch error problem"
then i delete a few text or numbers (randomly)
and it entered the data fine -
just cant understand it - reallly up against time
--------------------------------------------------------------------------------
-------------------------------------------------------
subscription.asp-----
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/conForum.asp" -->
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
If (CStr(Request("MM_insert")) = "SubUserForm") Then
MM_editConnection = MM_conForum_STRING
MM_editTable = "SubscriptionUser"
MM_editRedirectUrl = "subConfirm.asp"
MM_fieldsStr =
"wbTitle|value|wbLastName|value|wbAddress|value|wb Town|value|wbPostCode|value|wb
CityCounty|value|wbCountry|value|wbEmail|value|wbC ardType|value|wbCardNo|value|w
bExpire|value|wbIssueNo|value|wbNameCard|value"
MM_columnsStr =
"wbTitle|',none,''|wbLastName|',none,''|wbAddress| ',none,''|wbTown|',none,''|wbP
ostCode|',none,''|wbCityCounty|',none,''|wbCountry |',none,''|wbEmail|',none,''|w
bCardType|',none,''|wbCardNo|none,none,NULL|wbExpi re|none,none,NULL|wbIssueNo|no
ne,none,NULL|wbNameCard|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And
Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it
Dim MM_tableValues
Dim MM_dbValues
If (CStr(Request("MM_insert")) <> "") Then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End If
MM_tableValues = MM_tableValues & MM_columns(MM_i)
MM_dbValues = MM_dbValues & MM_formVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ")
values (" & MM_dbValues & ")"
If (Not MM_abortEdit) Then
' execute the insert
Set 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 <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<html>
<head>
<title>::::::</title>
<!-- linked in .css styles -->
<link href="font.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- Placed here: so title will show -->
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function YY_checkform() { //v4.71
//copyright (c)1998,2002 Yaromat.com
var
a=YY_checkform.arguments,oo=true,v='',s='',err=fal se,r,o,at,o1,t,i,j,ma,rx,cd,cm
,cy,dte,at;
for (i=1; i<a.length;i=i+4){
if (a[i+1].charAt(0)=='#'){r=true;
a[i+1]=a[i+1].substring(1);}else{r=false}
o=MM_findObj(a.replace(/\[\d+\]/ig,""));
o1=MM_findObj(a[i+1].replace(/\[\d+\]/ig,""));
v=o.value;t=a[i+2];
if (o.type=='text'||o.type=='password'||o.type=='hidd en'){
if (r&&v.length==0){err=true}
if (v.length>0)
if (t==1){ //fromto
ma=a[i+1].split('_');if(isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true}
} else if (t==2){
rx=new
RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true;
} else if (t==3){ // date
ma=a[i+1].split("#");at=v.match(ma[0]);
if(at){
cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]];
dte=new Date(cy,cm,cd);
if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.g etMonth()!=cm){err=true};
}else{err=true}
} else if (t==4){ // time
ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true}
} else if (t==5){ // check this 2
if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")];
if(!o1.checked){err=true}
} else if (t==6){ // the same
if(v!=MM_findObj(a[i+1]).value){err=true}
}
} else
if (!o.type&&o.length>0&&o[0].type=='radio'){
at = a.match(/(.*)\[(\d+)\].*/i);
o2=(o.length>1)?o[at[2]]:o;
if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true}
if (t==2){
oo=false;
for(j=0;j<o.length;j++){oo=oo||o[j].checked}
if(!oo){s+='* '+a[i+3]+'\n'}
}
} else if (o.type=='checkbox'){
if((t==1&&o.checked==false)||(t==2&&o.checked&&o1& &o1.value.length/1==0)){err=tr
ue}
} else if (o.type=='select-one'||o.type=='select-multiple'){
if(t==1&&o.selectedIndex/1==0){err=true}
}else if (o.type=='textarea'){
if(v.length<a[i+1]){err=true}
}
if (err){s+='* '+a[i+3]+'\n'; err=false}
}
if (s!=''){alert('The required information is incomplete or contains
errors:\t\t\t\t\t\n\n'+s)}
document.MM_returnValue = (s=='');
}
//-->
</script>
</head>
<body>
<div id="Layer1" style="position:absolute; left:81px; top:26px; width:250px;
height:225px; z-index:2">
<form ACTION="<%=MM_editAction%>" METHOD="POST" name="SubUserForm"
id="SubUserForm">
<table width="580" border="0" cellpadding="0" cellspacing="1">
<tr class="text">
<td colspan="9"> </td>
<td> </td>
<td colspan="4"> </td>
</tr>
<tr class="text">
<td colspan="9"> </td>
<td> </td>
<td colspan="4"> </td>
</tr>
<tr class="text">
<td> </td>
<td colspan="13">Leave Checked if billing and delivery address </td>
</tr>
<tr class="text">
<td colspan="9" class="title">Billing Address Details</td>
<td class="text"> </td>
<td colspan="4" class="title"> </td>
</tr>
<tr class="text">
<td width="72">Title</td>
<td width="20"><input type="radio" name="wbTitle" value="Mr"> </td>
<td width="19">Mr</td>
<td width="20"><input type="radio" name="wbTitle" value="Mrs"></td>
<td width="20">Mrs</td>
<td><input type="radio" name="wbTitle" value="Miss"></td>
<td>Miss</td>
<td><input type="radio" name="wbTitle" value="Ms"> </td>
<td>Ms</td>
<td width="29"> </td>
<td width="65"> </td>
<td width="63"> </td>
<td width="43"> </td>
<td width="68"> </td>
</tr>
<tr class="text">
<td height="13">Surname</td>
<td colspan="4"> <input name="wbLastName" type="text" id="wbLastName2"
size="10"></td>
<td colspan="4"> </td>
<td> </td>
<td> </td>
<td colspan="3"> </td>
</tr>
<tr class="text">
<td>Address</td>
<td colspan="4"> <input name="wbAddress" type="text" id="wbAddress"
size="10"></td>
<td colspan="4"> </td>
<td> </td>
0shania0 Guest
-
SpiderFromMars #4
Re: displaying info from database that was entered in aprevious page
A 'mismatch error problem' is when you are trying to set a variable with the
wrong type of value. For instance, if you try to assign an object to a string
or a number to a object... Instead of randomly deleting text or numbers, try
deleting one value at a time until the error goes away. Then you will know
which value is not getting set correctly. You will find that you are trying to
do something like setting a number to a string value or something like that...
Please let me know how it goes... Hope this helps, Peter
SpiderFromMars Guest



Reply With Quote

