Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2002
    Posts
    66
    Thanks
    2
    Thanked 0 Times in 0 Posts

    help with IMG (not quite sure how to define)

    hey all

    i am a bit of a newb and was wondering if someone could help me!

    basically, i have a DB that stores IMG's by code, so i have like a img_id, img_url, img_txt, and img_title. Now i have a way of grabbing the URL and putting it into the img src tag, thats no problem.

    i am using this feature in a news system i am developing for my site and was wondering, is there way i could like just insert a small tag like <img=101> into my story and have the pic come up?

    I hope i haven't confused u all.

    thanks very much!

  • #2
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    I suppose you could do it bb style, like this:

    Code:
    [img=101]
    Then in your php do something like this...
    PHP Code:
    $imgID preg_match('/\[img=(.*?)\]/i'$_POST[formVar]); 

  • #3
    New Coder
    Join Date
    Aug 2002
    Posts
    66
    Thanks
    2
    Thanked 0 Times in 0 Posts
    ok thanks but i dont get that.. so that code will convert [img=101] to like <img src=101.jpg> or soemthing?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •