| Welcome to Webforumz.com. |
|
Nov 10th, 2007, 02:14
|
#1 (permalink)
|
|
Junior Member
Join Date: Oct 2007
Location: Alabama
Posts: 26
|
[SOLVED] Index Page help...
ok, my index page is giving me some problems. I have a form on the page for guests to register to recieve emails, and what not. when i run it on my localhost it works fine and goes to the proper page afterwards. But when i try it on the actuall internet it will not go to the proper page, and instead says there was an error retrieving the page, the file could not be found. anyone have any ideas...here is my code...
- HTML: Select all
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/Registry.asp" -->
<%
Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
' IIf implementation
Function MM_IIf(condition, ifTrue, ifFalse)
If condition = "" Then
MM_IIf = ifFalse
Else
MM_IIf = ifTrue
End If
End Function
%>
<%
If (CStr(Request("MM_insert")) = "form1") Then
If (Not MM_abortEdit) Then
' execute the insert
Dim MM_editCmd
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_Registry_STRING
MM_editCmd.CommandText = "INSERT INTO TB_RegisteredGuests ([First Name], [Last Name], [E-Mail Address], [Phone Number], [MrGlassHQ Updates]) VALUES (?, ?, ?, ?, ?)"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 255, Request.Form("First Name")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 255, Request.Form("Last Name")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 255, Request.Form("E-Mail Address")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202, 1, 255, Request.Form("Phone Number")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 202, 1, 255, MM_IIF(Request.Form("checkbox"), "Y", "N")) ' adVarWChar
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "GuestRegistered.html"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
|
|
|
Nov 10th, 2007, 02:32
|
#2 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: Index Page help...
I don't think there is a problem with your code if you successfully run them in your pc!
It must be the way you uploaded then in your web server.. When uploading your file, you should make sure you have all the folder that exist in your pc uploaded to the web server also.
I mean, If you put your " GuestRegistered.html" in a folder named myFolder in your pc, you should create a folder named myFolder in your web server!
Does that make sense?
__________________
Last edited by Monie; Nov 10th, 2007 at 02:38.
|
|
|
Nov 10th, 2007, 02:35
|
#3 (permalink)
|
|
Junior Member
Join Date: Oct 2007
Location: Alabama
Posts: 26
|
Re: Index Page help...
thanks monie...thats what i did though..but i cant figure out why it will not redirect to my page when i hit the submit button...i FTP'd the files directly, just as they are on my PC..is there a reference or somethin i need to change? every link on my page works, except for the two forms i have...each on separate pages..
|
|
|
Nov 10th, 2007, 02:42
|
#4 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: Index Page help...
Your code make my eyes hurt 
I don't like auto generated code (especially from dreamweaver) You dont have any idea what are they writing there.. It might take few minutes to understand the code becoz it's too crowded..
Try this..
Response.Redirect(" GuestRegistered.html")
__________________
|
|
|
Nov 10th, 2007, 02:47
|
#5 (permalink)
|
|
Junior Member
Join Date: Oct 2007
Location: Alabama
Posts: 26
|
Re: Index Page help...
i know i know, i just still havent learned alot of it yet...im trying to as i go though.
|
|
|
Nov 10th, 2007, 02:53
|
#6 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: Index Page help...
So, when you click the submit button, did you get any database error message?
__________________
|
|
|
Nov 10th, 2007, 02:54
|
#7 (permalink)
|
|
Junior Member
Join Date: Oct 2007
Location: Alabama
Posts: 26
|
Re: Index Page help...
This is the error IE7 gives me when i hit the submit button....
Microsoft OLE DB Provider for ODBC Driverserror '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified /default.asp, line 31
this is line 31---> MM_editeCmd.ActiveConnection = MM_Registry_STRING
|
|
|
Nov 10th, 2007, 02:57
|
#8 (permalink)
|
|
Junior Member
Join Date: Oct 2007
Location: Alabama
Posts: 26
|
Re: Index Page help...
could this mean that my host doesnt have the driver?
|
|
|
Nov 10th, 2007, 03:02
|
#9 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: Index Page help...
How about this folder, Did you have a folder named Connection in your web server?
- Code: Select all
<!--#include file="Connections/Registry.asp" -->
__________________
|
|
|
Nov 10th, 2007, 03:06
|
#10 (permalink)
|
|
Junior Member
Join Date: Oct 2007
Location: Alabama
Posts: 26
|
Re: Index Page help...
yes i do..and believe it or not..my index wont even load if i put the wrong path on that line.
|
|
|
Nov 10th, 2007, 03:07
|
#11 (permalink)
|
|
Junior Member
Join Date: Oct 2007
Location: Alabama
Posts: 26
|
Re: Index Page help...
this is the code for my webroot\connections\registry.asp file.
- HTML: Select all
<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_Registry_STRING
MM_Registry_STRING = "dsn=Registry;"
%>
|
|
|
Nov 10th, 2007, 03:13
|
#12 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: Index Page help...
It think it is something to do with your DNS connection!
Can I see your DNS connection file?
Check this out!
__________________
|
|
|
Nov 10th, 2007, 03:20
|
#13 (permalink)
|
|
Junior Member
Join Date: Oct 2007
Location: Alabama
Posts: 26
|
Re: Index Page help...
i cant upload that file right now..i can when i get home..i dont have the file on my work computer...
|
|
|
Nov 10th, 2007, 03:22
|
#14 (permalink)
|
|
Junior Member
Join Date: Oct 2007
Location: Alabama
Posts: 26
|
Re: Index Page help...
so..how wouuld i create a DSN on my server?
|
|
|
Nov 10th, 2007, 19:24
|
#16 (permalink)
|
|
Junior Member
Join Date: Oct 2007
Location: Alabama
Posts: 26
|
Re: Index Page help...
thanks for the help...if figured it out...it was in my host's permission settings...also i had to change my connection file
|
|
|
Nov 11th, 2007, 23:44
|
#17 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: Index Page help...
What do you change in your connection file?
__________________
|
|
|
Nov 11th, 2007, 23:57
|
#18 (permalink)
|
|
Junior Member
Join Date: Oct 2007
Location: Alabama
Posts: 26
|
Re: Index Page help...
i changed it to...
- Code: Select all
<%
Dim oConn, MM_Registry_STRING
Set oConn = Server.CreateObject("ADODB.Connection")
MM_Registry_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\sites\folder\username\database\data.mdb;" & _
"Persist Security Info=False"
oConn.Open(MM_Registry_STRING)
oConn.Close
Set oConn = nothing
%>
|
|
|
Nov 12th, 2007, 00:08
|
#19 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: Index Page help...
Thanks. Well if you want to learn the easy way to do all that stuff, you have to start from now... I mean learn how to code your page manually, not with WYSIWYG application such as DW. It's fun..!
Good luck..
__________________
Last edited by Monie; Nov 13th, 2007 at 02:02.
|
|
|
| Thread Tools |
|
|
| Rate This Thread |
|
|
Posting Rules
|
You may not post new threads
You may not post repli | | | | |