
February 23rd, 2000, 09:55 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
<i><b>Originally posted by : Brian (brianjmoss@mindspring.com)</b></i><br /><br />Triniry,<br /><br />The number signs (#) you see are used to link to different parts of a HTML file by using the <A NAME> HTML command. For example, let's supposed you have a very long HTML page. If you don't want to require the viewer to have to scroll all the back to the top of the page, you would put the command <A NAME="top"> at the beginning of your HTML. Then at the bottom of your page, you would put the command, <A HREF="#top">Return to top</A>. When someone clicks on this link, it takes that person to the very top of the page. <br /><br />I think the sample code in question uses this technique because the information is truly dynamic (i.e. not contained in a database). The developer probably puts each each grouping of titles in its own section sorted by it's first letter.<br /><br />Let me suggest a different approach... Replace all of the #'s in your link code with the following: <br /><br />?letter= <br /><br />For example, instead of having:<br /><br /><a HREF="title_search.asp#C">C</a> <br /><br />you would have:<br /><br /><A HREF="title_search.asp?letter=C">C</A><br /><br />In the beginning of the title_search.asp page, test to see if letter exists (i.e. if request.querystring("letter") <> "" then...). If it does, grab the letter and assign it to a variable (i.e. Letter = request.querystring("letter") ). Then use the following SQL query (you will have to adapt it to fit your situation):<br /><br />SQL = "SELECT TITLE FROM MOVIES WHERE TITLE LIKE " & letter & "%"<br /><br />Finally open a recordset to your database using the above SQL query.<br /><br />------------<br />Trinity at 2/23/2000 7:01:02 AM<br /><br />To anyone out there, I really need some help for my school project, on how to code an <br />A-Z title link search.<br />For example: if the user clicks on C, it will take he/she to a page with all the movies starting<br />with the letter C.<br />I need to see what the SQL query would look like for this type of search.<br />My html file will have something like this...<br /><br /><b>View showtimes for movie titles that begin with:</b><br><br /> <a HREF="title_search.asp#A">A</a> <br /> <a HREF="title_search.asp#B">B</a> <br /> <a HREF="title_search.asp#C">C</a> <br /> .<br /> .<br /> .<br /> <a HREF="title_search.asp#Z">Z</a><br />I got this little code of some web site. I've just started learning ASP on the side, therefore I'm not <br />very familiar with it.<br />I do not understand why they're using the '#' in the HREF.<br />I have successfully built in a little ASP prototype that selects all the movie title from <br />my database. But the question is now, how to do this particular feature A-Z ????<br /><br />Thank you for taking your time to ready my humble help message.<br />I would reaaaally appreciate if anybody could help on this ASAP.<br /><br />Thaks again <br /><br />Trinity  )<br />
|