PDA

View Full Version : How can i upload a simple ASP site on GEOCITIES?


sameermaira
12-13-2005, 09:48 PM
Hi ,

I am somwhat of a beginner in ASP. I created a project once for my college using ASP with VBSCRIPT but It worked on IIS and I never got a chance to upload the site on a server. Anyway,

I was curious to know how one can upload their ASP sites on a server like geocities.?

For example...

I would like to create a simple asp PAGE which asks the users to fill a form. When they submit the form an email should come to me with their details and their name should also be listed on the same PAGE under "REGISTERED USERS". I understand that I would have to interface asp with a database in order to save the users and display them on the asp page. I would really appreciate it if someone could guide me as to how I could achieve the above.

In my previous projects I used an ADODB object and a DSN name. I had entered my access database in the SYSTEM DSN (CONTROL PANEL-> ADMINISTRATIVE TOOLS->ODBC) ... Do i do the same thing if I want to upload the site on a server like GEOCITIES? . Is it possible to link ASP with an access database without using ODBC ?

Looking forward to your help.

Thanks

Sameer

BarrMan
12-13-2005, 10:06 PM
If you want to use dsn on geocities you need to check if they have this feature, if not, just upload your database to geocities and connect it with the provider: Conn.Open = "Provider=microsoft.jet.oledb.4.0;data source=" & MapPath("The location of the database includes the name of the database and the end of it like: foldername/database.mdb")

First if you don't know asp so good it's strongly recommanded for you to visit www.w3schools.com,
then you'll know the base and you have there some nice explanations.
Second, to write information in your database you should first have the tables of your datbase and inside the tables the properties of them.
then you connect the connection to the database and set a recordset:
Set rs = Server.CreateObject("ADODB.RecordSet")
then you open the recordset and set a location on the database:
rs.open "SELECT * FROM user_information", conn
then you can write this to view all the information shown there:
while not rs.eof
response.write rs("username") & VBCrlf
response.write rs("password")
wend

To insert the information into the database use:
Conn.execute "INSERT INTO user_information([username],[password]) VALUES('" & session("username") & "','" & request.form("password") & "')"
If you don't understand what i wrote here just read some tutorials cuz i can't explain you all.

Good luck.

sameermaira
12-13-2005, 10:20 PM
If you want to use dsn on geocities you need to check if they have this feature, if not, just upload your database to geocities and connect it with the provider: Conn.Open = "Provider=microsoft.jet.oledb.4.0;data source=" & MapPath("The location of the database includes the name of the database and the end of it like: foldername/database.mdb")

Hi the following is a file called "DatabaseConnect.asp" which I used to open a connection to my DSN database in the previous project.

<%Dim objConn
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="DSN=MyData"
objConn.Open
%>

Could you change the code around for me so that I can use it to interface with an ACCESS 2000 Database present in c:\database (for example).

Could you also let me know the reason behind using a DSN instead of just directly connecting to a database? What purpose does it serve?

Im sorry I am asking a lot of questions in a single post but I am just curious to learn more. Could you also let me know how I could send the information to my email address everytime a user hits the SUBMIT button after filling a simple form? .

Basically , the following is my requirement.

NAME FIELD
EMAIL ID
PHONE

SUBMIT CANCEL

If Submit's then an email should automatically be posted to me with the details and the details should also be saved in the database and printed on the page.

I really appreciate your help.
Thank you so much.

sameermaira
12-13-2005, 10:26 PM
Hey Im sorry when I checked your post last i just saw 2 lines in it. I just reverted back to see if my post was posted correctly and then I came across ur entire post. Sorry for that.

I understood most of the code you wrote there. I know how to read and write information into a database. I am still having problems connecting to the access database. If you could explain that to me be editing the DatabaseConnect.asp file i sent you in my previous post , it would help me understand things a lot better.

Also , if u could let me know how I could EMAIL the submitted information to me automatically every time the user presses Submit.

Thanks again for your help

sameermaira
12-13-2005, 10:29 PM
<%Dim objConn
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="Provider=microsoft.jet.oledb.4.0;data source=" & c:\database\databse1.mdb"
objConn.Open
%>

Is the above correct ? ? What is the need for the '&' in the following line

data source=" & c:\database\databse1.mdb"

Deekman
12-14-2005, 12:03 AM
hey mate you can't link it up to the database on your hard drive you're actually going to need to upload the entire database to the webhost.
if Geocities doesn't work try out http://www.domaindlx.com they're a free ASP web hosting service with less adds than geocities.

Freon22
12-14-2005, 04:27 AM
Or you can go with Brinkster they also do free web hosting. Its the Educational package.


http://www.brinkster.com/Default.aspx

sameermaira
12-14-2005, 06:56 AM
Actually I am aware that I cannot use a database on my LOCAL DISK with an ASP PAGE that I have uploaded on a server. The code I pasted was just so that I could test if the page works on my computer before I upload both the page and the database to a server.

I just needed verification if the method I had posted would allow me to connect to a standalone database? .... After I upload the page and the database to the server I would make sure that I change the path of the database from "c:\database" to "..\Whatever"... Would that work ?

I still need to know how I can email the details to me after the user presses the SUBMIT button while at the same time updating the records in the database to add a new user.

Please look at the code I pasted in the previous posts. Ive stated my requirement there.

Thanks...

BarrMan
12-14-2005, 03:10 PM
To make things easier please user the code wrap like this .
Second: <%Dim objConn
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.Open "DSN=MyData"
%>

That should work.

degsy
12-14-2005, 03:24 PM
There are a few free ASP hosts available, but they are not great.
Usually unreliable, have limited function support and limited FTP support.

You may be best off going for a budget host. You can get good deals for £20 per year.

Free with no ads
http://www1.websamba.com/default.asp
http://www.1asphost.com/

sameermaira
12-14-2005, 04:50 PM
<%Dim objConn
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="Provider=microsoft.jet.oledb.4.0;data source=" & c:\database\databse1.mdb"
objConn.Open
%>

Is the above correct ? ? What is the need for the '&' in the following line

[CODE]data source=" & c:\database\databse1.mdb[\CODE]

I am still looking for someone to give me a way in which I can automatically get the details emailed to me when the user presses SUBMIT.

THanks.

BarrMan
12-14-2005, 04:53 PM
<%Dim objConn
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="Provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("database location on the server")
objConn.Open
%>

You need to upload the database into the server and then connect it to the page... otherwise, it'll try to find it on the user's computer.

sameermaira
12-14-2005, 05:11 PM
Okay I think I got it. I will upload it to the server and then try connecting it.

Just two things though

1. data source=" & server.mappath("database location on the server")

Is the "&" supposed to come. I will try it and see.

2. I still need to attach email function in the ASP script after user presses SUBMIT.

BarrMan
12-14-2005, 05:16 PM
you have to have & on the conn string, this is what allows you to move from quoted strings to asp, otherwise you'll get errors, because it'll count your quoted strings as an asp function.

I didn't understand your second question... do you want to send an email to a user using the asp functions?

sameermaira
12-14-2005, 05:22 PM
OKay i get the purpose of "&"

The email thing is as follows.

The person sees a form, he fills it up and presses submit. The database gets updated using the "ASP" file. Now , I want that every time a user registers an email is sent to me with his details. So when he presses the submit button two things should happen.

1. A new record with his details should be added to the databse.

2. An email should be sent to me with his details.

Thanks so much for your help .

BarrMan
12-14-2005, 05:32 PM
if you'll look at the other posts in here you can find your answer easily.

Set email = server.createobject("CDO.Message")
email.from = "your site"
email.to = "your email"
email.subject = "another user registered"
email.htmlbody = "These are the following details of user " & request.form("user") & "<br><br>email: " & request.form("email") & "<br><br>etc..etc..."
email.send

sameermaira
12-14-2005, 05:37 PM
THANK YOU SO SO MUCH for your help BARRMAN .... I am trying to finish the site right now .. Its just a page... I will post the link here..

Thanks once again.

Youve been a tremendous help.

Thank you others for helping me out too.

sameermaira
12-14-2005, 06:34 PM
Hey Im facing problems :(

This is the SETUP.

I have a folder in c:\inetpub\wwwroot\Yahoo idol , this is where the ASP and HTML files are. There is another folder c:\inetpub\wwwroot\Yahoo idol\db, this contains my database file "users.mdb". I am facing the following errors.


Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/yahoo idol/register.asp, line 21


I am attaching 2 files that are relevant to this error.

This is the first file called "DatabaseConnect.asp"

<%Dim objConn
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="Provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("db/users.mdb")
objConn.Open
%>



This next one is put in the ACTION for the form and is called Register.asp


<%@ Language=VBScript%>
<% Option Explicit %>
<!--#include virtual="adovbs.inc"-->
<!--#include file="DatabaseConnect.asp"-->
<%
Dim objRS
Set objRS=Server.CreateObject("ADODB.Recordset")

objRS.Open "info", objConn, 3, 3

While Not objRS.EOF
If (Request.Form("Name")="" OR Request.Form("Nick")="" OR Request.Form("Country")="") then
Response.Redirect "null.html"
end if
If Request.Form("Nick")=objRS("Nick") then
Response.Redirect "exists.html"
end if
objRS.MoveNext
Wend

objRS.AddNew
objRS("Nick")=Request.Form("Nick")
objRS("Name")=Request.Form("Name")
objRS("Country")=Request.Form("Country")
objRS.Update
objRS.Close
Set objRS=Nothing
objConn.Close
Set objConn=Nothing
Response.Redirect "thanks.html"
%>



Could you please tell me why am i getting that error above? ... I thought it would have been because of ACCESS2000 database format so i converted it into ACCESS97 , but i still get the same error.

BarrMan
12-14-2005, 06:46 PM
First... please don't put all your problems in one post, make for each problem a thread or make a thread name please help me with my problems or so, sorry for every reply with a comment on your post :) but i'm really trying to help the new users learn how to use this forum better.

Second: Right click on your db and go to properties, then click on the tab security and then change the necessary group of users to have full access to the database or just the read and execute part.

sameermaira
12-14-2005, 07:01 PM
Im sorry , Im new to this forum so I didnt know the followed rules.

I have right clicked on the database but I dont see "Security under properties. I have XP PRo.

BarrMan
12-14-2005, 07:24 PM
you should have security tab, next to general and summary tags... you can see it in the middle of them.

sameermaira
12-14-2005, 10:07 PM
Just have general and summary ... No security anywhere. Not in the middle not anywhere else in Properties for the Database.

BarrMan
12-15-2005, 06:37 AM
thats weird :S, send me your database through email emree3@gmail.com and i'll change the security for you.

BarrMan
12-18-2005, 04:23 PM
Ok i found the soloution for your problem:
Go to Control pannel and click on the Folder Options then go to View tab and scroll down untill you see Use simple file sharing(recommanded) and then uncheck that.