Urgent PHP Script Help

Discussion in 'PHP' started by B R Bhatt, Jun 4, 2008.

  1. #1
    Any body can provide any idea to solve my PHP problem. My problem listed below:

    ****************************************************

    Please see below line of html .

    <table width="100%" border="0">
    <tr>

    <td>The 2nd NATTA Himalayan International <img src="file:///D|/wamp/www/bhoj/asian_exped_new_update/images/pic_06.jpg" width="101" height="28" />Travel Mart 2007 was held in Kathmandu from 11-13 May,<img src="file:///D|/wamp/www/bhoj/asian_exped_new_update/images/pic_01.jpg" width="253" height="124" /></td>

    </tr>
    </table>

    Note: I don't Know how many images are there and above information should be should be taken Text Area

    *******************************************************


    Now I would like to delete the path of the both images (file:///D|/wamp/www/bhoj/asian_exped_new_update/images/) and add extra folder name: uploadfile . I mean I would like to keep image name with uploadfile name in database. That is only (uploadfile /pic_06.jpg) and (uploadfile / pic_01.jpg). That is

    ******************************************************

    Output


    <table width="100%" border="0">

    <tr>

    <td>The 2nd NATTA Himalayan International <img src="uploadfile/pic_06.jpg" width="101" height="28" />Travel Mart 2007 was held in Kathmandu from 11-13 May,<img src="uploadfile/pic_01.jpg" width="253" height="124" /></td>

    </tr>

    </table>

    ***************************************************

    Please try to share your knowledge to solve my problem by using PHP scripts.
    I am waiting for your reply. Please try to give your logic.
    Reply With Quote
     
    B R Bhatt, Jun 4, 2008 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    I don't get your problem at all, please give more info!
     
    EricBruggema, Jun 4, 2008 IP
  3. q7m

    q7m Well-Known Member

    Messages:
    1,178
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    150
    Digital Goods:
    1
    #3
    I think what you need is:
    
    str_replace("file:///D|/wamp/www/bhoj/asian_exped_new_update/", "uploadfile/", $_POST['your_textarea']);
    
    Code (markup):
     
    q7m, Jun 4, 2008 IP
  4. B R Bhatt

    B R Bhatt Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hello friend,

    My problem is that I would like to make online news posting editor.
    where i can upload both text and image in database.

    So if u have any resources then plz share with me

    Regards,
    B R B
     
    B R Bhatt, Jun 7, 2008 IP
  5. wrxbuzz

    wrxbuzz Peon

    Messages:
    41
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I never store images into the database as it is consume too much resources from the SQL server.
    Simply store your text + the physical path to your image. That way your database will stay small
    and will run more quickly and efficiently.

    Hope this helps.

    --Tal
     
    wrxbuzz, Jun 8, 2008 IP