need help with asigning a variable

Discussion in 'PHP' started by dougvcd, Sep 8, 2008.

  1. #1
    ok i need to asign a variable but dont know how
    have this bit of code
    Echo "<b>Information:  </b><a href=/".$info['slide'].".php?id=".$info['username'].">More Info</a><hr>"; 
    PHP:
    i want to asign the value of slide to a variable so i can put the the variable here
    imgAr1[0] = "http://www.djbcaravanhire.co.uk/show/slide/1.jpg";
    PHP:
    if you see what i mean
    cheers
    Doug
     
    dougvcd, Sep 8, 2008 IP
  2. vasago

    vasago Peon

    Messages:
    95
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    imgAr1[0] = "http://www.djbcaravanhire.co.uk/show/[COLOR="Red"]$info['slide'][/COLOR]/1.jpg";
    Code (markup):
    it should work. the html string is in double quotes so you should be able to insert the array variable directly.
    If not, try this:

    imgAr1[0] = "http://www.djbcaravanhire.co.uk/show/".[COLOR="Red"]$info['slide'][/COLOR]."/1.jpg";
    Code (markup):
     
    vasago, Sep 8, 2008 IP
  3. dougvcd

    dougvcd Peon

    Messages:
    267
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks for that but didnt work
    the first bit of code is on 1 page
    and 2nd code on diff page
    i forgot to say that it needs to be taken to a diff page
    cheers
    Doug
     
    dougvcd, Sep 8, 2008 IP
  4. zerxer

    zerxer Peon

    Messages:
    368
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I'm sort of confused what you're trying to do. Maybe you can explain it a bit better? Also, you'd have to do $imgAr1[0] when setting it (need the $ of course).
     
    zerxer, Sep 8, 2008 IP