Jump to content

Yahweh

Members
  • Posts

    186
  • Joined

  • Last visited

Everything posted by Yahweh

  1. Yahweh

    dynamic table

    Glad you learned about response.BinaryWrite in time, however displaying the images in a dropdown list usually requires some CSS, something that looks like this:<select name="products"><option value="1" style="height : 100px; background-image : url(someimage1.gif);"></option><option value="2" style="height : 100px; background-image : url(someimage2.gif);"></option><option value="3" style="height : 100px; background-image : url(someimage3.gif);"></option><option value="4" style="height : 100px; background-image : url(someimage4.gif);"></option><option value="5" style="height : 100px; background-image : url(someimage5.gif);"></option></select> If that doesn't work, you can try displaying the images in a table (you can use Javascript to collapse/expand parts of the table).
  2. This is exactly what databases are for. It is possible to save information to an Excel or a text file, but it isn't as cut-and-dry as using a simple database.The number of clients expected to be accessing a database at any given time will determine the type of database you want to use. If you don't expect more than, say, 10 people be simultaneously connecting to a database at any given time, then you can safely use an MSAccess database. Otherwise, use MySQL or PostGres.About a month ago, someone asked me how to make a script that stores errors, which does exactly the same function that you want from script, but you want the database to store hours instead. Maybe the error script will help you out as a reference:- Working version of error script.- Zip of all the files used in that script.With a few minor changes, such as changing the name and datatype of at least one field, and changing the name of the field in the ASP scripts, the script will do exactly what you want it to do.
  3. Well actually I write content management systems in my spare time, and I could probably whip a Friendster in about a week. There are actually pretty good reasons why a person would want to create a site like that, namely on the basis that they get millions of hits a day and just a single Google ad on each page can generate a lot revenue (about 5500 hits per day average US$1 in Google Ad revenue, so having hundreds of times the traffic earns hundreds of times the income).But if you are a newbie ASP programmer, then the task of creating that kind of site requires such insane amounts of overhead that'd you'd never be able to do it. I recommend starting a little smaller, perhaps by writing a messageboard. However, if you are up to the challenge, then here's the information you need:Linking pages together is easy, it usually requires a session object. But personally, I really dislike Session Objects, they slow down page processing and rarely last for more than 20 minutes; after that, a user has to log in again. Use cookies instead.Sessions and Cookies are the same thing, but a Cookie is a textfile that stays on a clients computer, and a session deletes itself after the client's session has ended (usually after 20 minutes).Heres some information on ASP cookies:http://www.aspwebpro.com/aspscripts/miscel...ookiebasics.aspAfter a user logs in, use this code to set a cookie:<% Response.Cookies("MyCOOKIE").Domain = "www.yourdomain.com"Response.Cookies("MyCOOKIE").Expires = Date() + 1Response.Cookies("MyCOOKIE")("Username") = UsernameResponse.Cookies("MyCOOKIE")("Password") = Password%> After the cookie is set, use this code to access the cookie: <% DIM strUsername, strPasswordstrUsername = Request.Cookies("MyCOOKIE")("Username")strPassword = Request.Cookies("MyCOOKIE")("Password")response.write "Hello, " & strUsername%>
  4. Use the CStr function. Example:<%=cstr(250)%> And to convert the string back into a number, use CInt.
  5. Yahweh

    hello

    Among other things, you can't have an anchor tag embeded inside the attribute of your input tag, and "action" isn't an attribute of buttons. And unless dconn_rla.asp is a javascript snippet, then it doesn't have a purpose being in the onClick event of your button. In other words, you don't have valid HTML syntax at all.Also, you're going to get nothing but syntax errors because the VBScript comparison operator is one equal sign ("="), not two ("=="). So the line objConn == "true" is wrong. And if you're checking something that is true or false, or something that a boolean value, don't put the word "true" or "false" in quotations. The correct syntax is objConn = True. And you cannot use HTML within your ASP tags, you need to precede those statements with response.write "<a href....>sometext</a>", otherwise you'll get syntax errors.To get the results you want, use this code instead:<%Dim myURLIf objConn.state then 'Is the connection open? myURL = "http://127.0.0.1/muneet/l_QuerymainP.asp"else myURL = "http://127.0.0.1/muneet/puneet.asp"end if%><form action="<%=myURL%>" method="post"><input type="submit" value="Submit"></font>
  6. Very likely, the author of the website you were viewing put his site in frames. Example: <frameset rows="50,*"> <frame name="Top" src="top.asp" marginwidth="10" marginheight="10" scrolling="no" frameborder="0"> <frame name="bottom" src="bottom.asp" marginwidth="10" marginheight="10" scrolling="auto" frameborder="0"></frameset> The URL in the browser is always the URL of the topmost window, and in this case the topmost window houses two frames, so you'll see the URL of that window instead of the URLs of the frames. When clicking links in a frame, unless you specifically set your href's target="_top", then you'll never see the URL change.
×
×
  • Create New...