Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with hyperlink url changing quotes (") to %22


sailajakreddy

Recommended Posts

Posted

Hello all,

 

I am trying to add hyperlinks to text within the webpages in my site but the href quotes are decoded to %22 and throwing webpage cannot found error in internet explorer

 

In detail in the html code <a href="blog.php/basics-of-hanging-a-wall-art">Check Out </a>basics of hanging a wallart</strong></span> the quotes (") are converted to % 22 and the url is displayed as below

 

http://www.essentialethnics.com/%22blog.php/basics-of-hanging-a-wall-art/%22

 

OR if I use the entire url in the href like shown

<a href="http://www.essentialethnics.com/blog.php/basics-of-hanging-a-wall-art/">Check Out </a>basics of hanging a wallart

 

the url has %22 & .. and displayed as http://www.essentialethnics.com/%22../blog.php/basics-of-hanging-a-wall-art//%22

 

Firefox browser behaves differently and the url is displayed as http://www.essentialethnics.com/%5C%22../blog.php/basics-of-hanging-a-wall-art/%5C%22

 

in either browsers the the page throws a 404 error and is not displayed. Can anyone please help or throw some insights.

 

Thanks,

Sailaja

Posted

Use tep_href_link() to build your <a> links. You're doing something very wrong if you are getting " around the href attribute included in the URL.

Posted

Thank you for responding

 

The url I am trying to link to the text is a blog post, the blog is maitained by word press and integrated into my Oscommerce store. In such a case how do I get the filename or cpaths to pass to tep_href_link()?

 

This is what I was trying to achieve, I am trying to hyperlink the url to the blog post to the check out text.

Check Out basics of hanging a wallart

 

Pardon my ignorance here I am still learning Oscommerce.

 

Appreciate your suggestions.

Posted

So is this link (<a> tag) being created in osC and not in WP? If in osC, the PHP code would be something like

...<a href="' . tep_href_link("../blog.php/basics-of-hanging-a-wall-art", '', '') . '">Link text here</a>'...

Posted

Yes the <a tag> is created in osC and not in WP.

 

So when I try to edit the hyper link, HTML source editor opens up, would it be the same syntax as PHP since I tried this

'<a href="' . tep_href_link("../blog.php/basics-of-hanging-a-wall-art", '', '') . '"> Check Out </a>'

and it is not allowing me to update that means a syntax error

 

Please let me know.

 

Thanks!

Posted

HTML source editor????? On a .php file? You're doing something very, very wrong. Just use a very plain text editor with no fancy bells and whistles.

 

Copy here the offending line and 4 or 5 before and after it. Hopefully I'll see what's causing your syntax error.

Posted

Attached is a screen shot of where I wanted a clickable text.

 

This is in the oscommerce admin panel of my site in catalog -> categories/products.

 

I can easily add a hyper link using the hyperlink icon available in the format/ tools above. Now if I need to change the look and feel of any of the text I open up the HTML editor icon available in the same format tools above.

 

Like I mentioned the simple hyperlink or any HTML edits does not point to the right link, a 404 page not found error is displayed.

 

Am I working in the correct place in the first place? Thanks!

Posted

Never, ever use a WYSIWYG HTML editor on PHP code. Use your PC or host File Manager's plain text editor, such as Notepad or (better yet) Notepad++ or ViM. These will not do strange things behind your back and add odd cruft to the page.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...