Jump to content

How Do I Add This Bit Of Code?????

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
byronwells

byronwells

    Learning Programmer

  • Members
  • PipPipPip
  • 58 posts
Alright Guys

I have created a new db field called download_link and have linked it to the add products page. That is working fine. The information that is stored in that field is the filename and extention ie. text.zip

I have then attempted to get the information display on this page.. http://www.digitalre....ategory=demo_1 look under the demo 3 product

What I am trying to do is to get it to display in a url format. So all I need to do is add the file name on the add products page, then on the marketplace it will add it to a url link, and then display it..

The url link is suppose to look like this

<a href="http://www.digitalresellersvault.com/go/downloads/ "file name goes here"


I have tried all sort of cobinmations but all I can get to display is the filename, not a url link..

This is the code that I am using now

$download_link='<a href="http://www.digitalresellersvault.com/go/downloads/'$r[download_link]."></a>';

#2
Feral

Feral

    Programmer

  • Members
  • PipPipPipPip
  • 162 posts
your link is broken but if you bit of code you posted is straight from your file doing it like this

$download_link='<a href="http://www.digitalresellersvault.com/go/downloads/' . $r[download_link]. '"></a>';

should fix your problem

#3
byronwells

byronwells

    Learning Programmer

  • Members
  • PipPipPip
  • 58 posts

Feral said:

your link is broken but if you bit of code you posted is straight from your file doing it like this


$download_link='<a href="http://www.digitalresellersvault.com/go/downloads/' . $r[download_link]. '"></a>';


should fix your problem

That didnt work.. Its not showing in a url link...

#4
Feral

Feral

    Programmer

  • Members
  • PipPipPipPip
  • 162 posts
more code and a working link are needed then.

#5
byronwells

byronwells

    Learning Programmer

  • Members
  • PipPipPip
  • 58 posts

Feral said:

more code and a working link are needed then.

At the moment no url link is being dispalyed

Just the contents of the db field...

The contents of the db field needs to go into the url link

#6
webcodez

webcodez

    Programmer

  • Members
  • PipPipPipPip
  • 149 posts
Uhm Im not sure if this is the problem but you didn't specify any name/title/text to display for the link:


$download_link='<a href="http://www.digitalresellersvault.com/go/downloads/' . $r[download_link]. '">Some link name here</a>';


Should work ^^ However Im not sure what the display text of the link should be in your case.

Edited by webcodez, 16 February 2010 - 08:26 AM.


#7
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
Andrew, why would we add perl code to a PHP script?
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall