Hyperlink question! (Full Version)

All Forums >> [Web Development] >> Microsoft FrontPage Help



Message


Irishdrinker -> Hyperlink question! (2/2/2006 9:01:07)

Hey guys I have a question about hyperlinks in codes. I am creating a shopping cart and I want to be able to create the text as a hyperlink. The problem with it is that whenever I preview it, the text is underlined and in blue just like a hyperlink, but whenever I click on it, it wont do anything. The code I use is <a href="ADDRESS">

Whenever I hover over the broken hyperlink, it shows where it is connecting to, but refuses to connect. When I try to open it in another page, nothing happens.

Thank you for any help guys




Tailslide -> RE: Hyperlink question! (2/2/2006 9:05:53)

Could you elaborate a bit and/or give us a bit more code?

You should be able to put a link to an item around any amount of text and have that work as a link - not sure why it's not working without seeing more code - if you see what I mean.




coreybryant -> RE: Hyperlink question! (2/2/2006 9:17:10)

Did you mean to use
<a href="#address">
instead? Usually you link to anchors on a page or to pages




Irishdrinker -> RE: Hyperlink question! (2/2/2006 10:05:32)

The code is on my other computer. I will transfer it over via flash drive after this message. In the shopping cart, you have to create 2 things. One is a CSV Spread Sheet with the information, and a rules file to shows you were the information goes. My website isn't live yet so I dont want to launch it now with the doubt of knowning when I launch it my shopping cart will be useless when someone searches for something.

When I try to impliment a link in the code and build the database for the search engine and try to search for something, that works. When I try to click on the hyperlink to the item though, it does nothing. When I hover over to see where the link is going, it either does 1 of 2 things.

Example:
1. file\\C:\Documents%20and%20Settings\Web%20Folder\NAME.htm
2. C:\Documents

The "NAME" is what I have it set as so whenever it reads it on the spreadsheet, it will replace NAME with the correct information. When I look at the code in notepad it looks fine. When I take it into FP 2003, it shows up as this:

Example:
<a href=C:\Documents%20and%20Settings\Web%20Folder\NAME.htm>

Now I have tried to take out the %20 because I know it subitutes the space inbetween words.
But as a result nothing happens. Let me find some code real quick.




Irishdrinker -> RE: Hyperlink question! (2/2/2006 10:11:13)

<TR>
<font size=2 face="arial, helvetica">
<TD COLSPAN=2><FONT SIZE=3><a href="C:\Documents and Settings\Owner\Desktop\The New Dfy Sports Website\ft120.htm"><b>Flat Track T-Shirt</a></p></b>
<TD ALIGN=right width="84"><font style="Bold" face="Arial" size="2"><B>  $22.00</TD></font></TR>
</TR>
<TR>
<TD width="90">
<img border="0" width="70" img src="C:\Documents and Settings\Owner\My Documents\My Web Sites\The New Dfy Sports Website\images\FT120.jpg">
<TD width="798"><font weight="700" face="Arial" size="2">Part Number: FT 120<br>Description: Flat Track T-shirt<br></font></TD>
<TD width="84"> </TD></font></TR>
<TABLE BORDER=0 WIDTH="66%" CELLSPACING=0 CELLPADDING=2 id="table1">
<TR>
<font size=2 face="arial, helvetica">
</TR>
</form>
<form action=http://www.cartserver.com/sc/cart.cgi method=POST>
<input type=hidden name=item value="s-5432^^Part Number: FT 125<br>Description: Flat Track T-shirt^22.00^1^^^^^^">




coreybryant -> RE: Hyperlink question! (2/2/2006 10:18:43)

Well you do not want to use your absolute hyperlink like that since it is pointing back to your hard drive. More than likely it would be
<a href="name.html">
If the page name.html is in the same fodler as the page where your code is.




Irishdrinker -> RE: Hyperlink question! (2/2/2006 11:00:49)

not working. It is progress though. It is now a hyperlink, but it doesnt go to the page it is assigned. if the named page is surfing.htm and I put in the code <a href='NAME.htm'>
it comes out <a href"=surfing.htm>

The problem with that is that I think it is looking for page surfing.htm, instead of looking through www.surfmaster.com/surfing.htm

(That is an example)




Irishdrinker -> RE: Hyperlink question! (2/2/2006 11:01:43)

ops I didnt know that was a real hyperlink to a real site.




coreybryant -> RE: Hyperlink question! (2/2/2006 11:03:53)

Try using the code I gave you
<a href="name.html">
and see if that works




Irishdrinker -> RE: Hyperlink question! (2/2/2006 11:18:35)

I did. That was what I my responce was. Before you told me to put in the code there was no hyperlink. Now after putting in the code I can get it to hyperlink, but now says the page cannot be found.




coreybryant -> RE: Hyperlink question! (2/2/2006 11:22:16)

in your reference, you showed single quotes, while I used double quotes.

What is the URL in which you have the code on?




Irishdrinker -> RE: Hyperlink question! (2/2/2006 11:49:05)

Okay this is what I have done.

<a href="NAME.htm">
<a href='NAME.htm'>
<a href="NAME">
<a href='NAME'>
<a href="name.htm">
<a href='name.htm'>
<a href="name">
<a href='name'>

Nothing has worked as of yet




coreybryant -> RE: Hyperlink question! (2/2/2006 12:44:17)

Can you provide the URL in which you have the code on? This would help better in answering your question

Also if you are on a UNIX server - it is case sensitive, so NAME.htm is not the same as name.htm. And also is the extension html, not htm?
quote:

ORIGINAL: Irishdrinker

<a href="name">
<a href='name'>

Nothing has worked as of yet
That won't work since it is not linking to a webpage unless you are rewriting the URLs




Irishdrinker -> RE: Hyperlink question! (2/3/2006 13:08:46)

what do you mean? One of the urls is in a previous post




rdouglass -> RE: Hyperlink question! (2/3/2006 13:53:34)

quote:

<a href=C:\Documents%20and%20Settings\Web%20Folder\NAME.htm>


So is that what you're saying your link is? If that's the case, only you and folks who actually have that file on their C: drive will be able to open it. And if you're trying to do it that way and IIRC, you need to use it like:

<a href="file///C:\blahblah..">

I suspect you don't want either. I have 2 questions:

1. Is the folder the file is in part of a website accessible from other machines via a web browser?

2. Do *all* users that would be browsing to this site have a copy of that file in their C: drive in that exact location?

The issue Corey is trying to get at is that if you're trying to serve this page via a web host, you don't want to use the "C:\.." stuff at all but put it in a format like:

<a href="http://mydomain.com/myfolder/myFile.htm">

...or am I the one 'off-base'? [8|] [;)]




Irishdrinker -> RE: Hyperlink question! (2/3/2006 14:02:29)

Well what I am doing atm is revamping a website and adding a shopping cart. The site I am revamping is www.dfysports.com

I have to keep it online until I am done with the new one so I can launch it with about a 5 min downtime inbetween be updating the site with the new version I have made. I want the shopping cart usable to all who visit the site incase they find something they like. The only problem I am having atm is that I want a certain part of the text to be hyperlinked so when you search for something, you can right to the page. I need to know what code to us to do this. I dont want to put in an address, launch the site, and it not work. I need to know it is going to work before I launch it, so I can launch it. (if that makes any sence)

Hope that answered your questions




coreybryant -> RE: Hyperlink question! (2/3/2006 14:08:12)

Well it sor of makes sense. All I need is a page to review all your code, that's all

I searched the source code of the link above and I could not locate name.html.




Irishdrinker -> RE: Hyperlink question! (2/3/2006 14:23:53)

Sorry to of confused you. Let me tell you where I am at atm. I am using Americart for my shopping cart. Right now I have a new version of www.dfysports.com but I haven't launched it yet. I wanted to get the shopping cart working first before I launched it. You wont find name.htm because I used it as an example.

The way the shopping cart works is like this: You have to create a .txt rules file that tells you where things go, I gave you the item row structure in a previous post. The second thing you need to make is a .csv spreadsheet. Now the spreadsheet subitutes different items from the rules file. For example: if you want to do a img you do <img border="0" width="70" img src="C:\Documents and Settings\Owner\My Documents\My Web Sites\The New Dfy Sports Website\images\PICTURE.jpg">

Now the PICTURE in the .csv file is named after the photo in the image file. I have an image called FT120 so when I create the shopping cart, PICTURE will be replaces with whatever image I have it saved as in my file for example:

FT120
FT125
FT130
FT213
FT214
etc....

The "NAME.htm" was just an example I was using, but even if I did use it you wouldnt find it because it would of been replaced with something different. The thing I need to know how to do is figure out how to property link all the items I have to a seperate page I have created in FP 2003 (Remeber I havevent launched it yet, the old version is still up atm)

right now I have the rules file like this: <a href="C:\Documents and Settings\Owner\Desktop\The New Dfy Sports Website\DESCRIPTION2"><b>DESCRIPTION1</a></p></b>

DESCRIPTION1 is replaced in the .csv with the name of the item. Like if FT120 is a photo, DESCRIPTION1 is the name of the item, like Flat Track T-shirt.

DESCIRPTION2 is the address of the link I need. In the .csv file I have many different links. But I dont have the right code so when I create the shopping cart, it doesnt link all, instead it comes out like this Flat Track T-shirt

When Corey told me to use just <a href="NAME.htm"> It linked it, but not to the site I had in my .csv file. Instead it took me to some americart site, or gave me a http 404 error.



Bottom line: The DESCIRPTION1 is the name if the file (Ex. Flat Track T-shirt)
DESCRIPTION2 is the code that makes DESCRIPTION1 a link.

I need to know what code to use so DECSCRIPTION1 links off to the page I have it in in the .csv file.

Phew if you have any questions just let me know...




coreybryant -> RE: Hyperlink question! (2/3/2006 14:35:05)

quote:

ORIGINAL: Irishdrinker

Bottom line: The DESCIRPTION1 is the name if the file (Ex. Flat Track T-shirt)
DESCRIPTION2 is the code that makes DESCRIPTION1 a link.

I need to know what code to use so DECSCRIPTION1 links off to the page I have it in in the .csv file.
Lets's assume that your cart is in a folder called cart. So you have in the root:
-cart
-admin
-images
image1.gif
image2.gif
image3.gif
-news
about.asp
default.asp
filename.html

So if the file is in the cart folder, then the link would be
<a href="../filename.html">Click here</a>
and the code for the images would be
<img src="../images/image1.gif" alt="text">





Irishdrinker -> RE: Hyperlink question! (2/3/2006 14:38:56)

wait so the full code would be <a href="cart/filename.htm">Click Here</a> ???




coreybryant -> RE: Hyperlink question! (2/3/2006 14:46:13)

Yes - as long as the page you are calling is in the root web using my example.

You can also use virtual links
<a href="/cart/filename.html">
which will take you back to the root and then over to cart.




Irishdrinker -> RE: Hyperlink question! (2/3/2006 15:03:43)

my folder is called The New Dfy Sports Website

The code I am putting in is
<a href="The New Dfy Sports Website\DESCRIPTION2.htm">DESCRIPTION1</a>

nothing is working though...only giving me a http 404 error whenever I click on the link.

DESCRIPTION1 is Flat Track T-shirt and DESCRIPTION2 is ft120

this is aggrivating




coreybryant -> RE: Hyperlink question! (2/3/2006 15:08:36)

Do you have a folder called The New Dfy Sports Website on your website? I think you are getting it confused to easy. You are making it harder than it is.

If you could show us the website / architecture, it would make it a lot easier.

Now going back - The New Dfy Sports Website is more than likely a folder on your local computer & maybe it is your root web? If so then DESCRIPTION2.htm page would be in the root and not in the cart. And you would not be using The New Dfy Sports Website in the path since this is local and this folder The New Dfy Sports Website will not be on your website.

Where is the page DESCRIPTION2.htm in your website (what folder name)?




Irishdrinker -> RE: Hyperlink question! (2/3/2006 15:12:07)

There is no page called DESCRIPTION2.htm

DESCIRPTION2 is the name needed in my .csv file so when I upload the .txt file and the .csv file, the .csv file turns DESCRIPTION2 into the actually file in my website folder. Right now my Website folder is on my hard drive. Are you saying I need to upload my Website fold into my FTP before the links will work?




coreybryant -> RE: Hyperlink question! (2/3/2006 15:17:03)

If there is no page called DESCRIPTION2.htm then you cannot link to it. You need to have a page called DESCRIPTION2.htm to be able to link to DESCRIPTION2.htm.

I was saying it would be easier for us to see the code if you uploaded the website but now you are saying there is know page called DESCRIPTION2.htm - so that is another reason you are getting an error




Irishdrinker -> RE: Hyperlink question! (2/3/2006 15:25:12)

START FIELDDEF
PICTURE,TITLE,PRICE,DESCRIPTION1,DESCRIPTION2
STOP FIELDDEF

START ITEM_ROW_STRUCTURE
<TR>
<font size=2 face="arial, helvetica">
<TD COLSPAN=2><FONT SIZE=3><a href="The New Dfy Sports Website\DESCRIPTION2.html"><b>DESCRIPTION1</a></p></b>
<TD ALIGN=right width="84"><font style="Bold" face="Arial" size="2"><B>  $PRICE</TD></font></TR>
</TR>
<TR>
<TD width="90">
<img border="0" width="70" img src="C:\Documents and Settings\Owner\My Documents\My Web Sites\The New Dfy Sports Website\images\PICTURE.jpg">
<TD width="798"><font weight="700" face="Arial" size="2">TITLE</font></TD>
<TD width="84"> </TD></font></TR>
<TABLE BORDER=0 WIDTH="66%" CELLSPACING=0 CELLPADDING=2 id="table1">
<TR>
<font size=2 face="arial, helvetica">
</TR>
STOP ITEM_ROW_STRUCTURE

START HEADER


STOP HEADER





START FOOTER


STOP FOOTER

PRICE_ERROR_ACTION= CAPTION

ITEMS_PER_TABLE= 10
TABLES_PER_PAGE= 1
TABLE_HEADER_ROW= <tr bgcolor=#ffffff Part#</td><font face="Arial" size="1" color="ffffff" Title</td><td> </td><font face="Arial" size="1" color="ffffff" Price</td><td> </td></tr>

TABLEPROPS= width=550 border=0 cellpadding=1 cellspacing=0

ODDROWPROPS= bgcolor=#ffffff
EVENROWPROPS= bgcolor=#ffffff


That is the .txt file I was talking about. DESCIPTION2 isnt a page and I am not trying to link to it. It is pretty much a template for every item. so If I have 50 items I am trying to put into my search engine this is how it would go. So if I am looking for items in Flat Track this is what would happen.

DESCIRPTION1 would be replace by Flat Track T-shirt
DESCIRPTION2 would be replaced by the link of it. I have it linked in my web folder as ft120

So the code for just 1 item would be:

<TR>
<font size=2 face="arial, helvetica">
<TD COLSPAN=2><FONT SIZE=3><a href="The New Dfy Sports Website\ft120.html"><b>Flat Track T-shirt</a></p></b>
<TD ALIGN=right width="84"><font style="Bold" face="Arial" size="2"><B>  $22.00</TD></font></TR>
</TR>
<TR>
<TD width="90">
<img border="0" width="70" img src="C:\Documents and Settings\Owner\My Documents\My Web Sites\The New Dfy Sports Website\images\ft120.jpg">
<TD width="798"><font weight="700" face="Arial" size="2">TITLE</font></TD>
<TD width="84"> </TD></font></TR>
<TABLE BORDER=0 WIDTH="66%" CELLSPACING=0 CELLPADDING=2 id="table1">
<TR>
<font size=2 face="arial, helvetica">
</TR>




coreybryant -> RE: Hyperlink question! (2/3/2006 15:31:17)

quote:

ORIGINAL: Irishdrinker

<TD COLSPAN=2><FONT SIZE=3><a href="The New Dfy Sports Website\DESCRIPTION2.html"><b>DESCRIPTION1</a></p></b>

The above is a link to DESCRIPTION2.html

quote:

ORIGINAL: Irishdrinker

That is the .txt file I was talking about. DESCIPTION2 isnt a page and I am not trying to link to it. It is pretty much a template for every item. so If I have 50 items I am trying to put into my search engine this is how it would go. So if I am looking for items in Flat Track this is what would happen.

I am not certain then what you are trying to do. You created a link to DESCRIPTION2.html and you said you were having problems with a hyperlink.

Sorry now I am really confused. Are you trying to create a hyperlink??????

Have you contacted the peope that you got whatever this is to ask them for help?




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.15625