1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Help me Please : PHP/MYSQL Inserting Multiple to textarea

Discussion in 'PHP' started by coolguy999, Sep 8, 2009.

  1. #1
    Hello to every on.
    this A Full code about my problem

    i want make Insert multi data to my textarea


    example :

    if I post

    http://www.sampledomain.com/samplepost1/
    http://www.sampledomain.com/samplepost2/
    http://www.sampledomain.com/samplepost3/
    http://www.sampledomain.com/samplepost4/
    http://www.sampledomain.com/samplepost5/

    the result must be

    MyDomain like domain.com

    http://www.domain.com/1/
    http://wwwdomain.com//2/
    http://www.domain.com/3/
    http://www.domain.com/4/
    http://wwwdomain.com/5/

    My idea talk about Protection links

    but i want insert every url to line in database

    Inserting Multiple

    Thank you
     
    coolguy999, Sep 8, 2009 IP
  2. autouch

    autouch Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't understand your question
     
    autouch, Sep 8, 2009 IP
  3. adbox

    adbox Well-Known Member

    Messages:
    906
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    155
    Digital Goods:
    1
    #3
    you will need to have your inputs like this

    <input name="urls[]" size=30>
    <input name="urls[]" size=30>
    <input name="urls[]" size=30>

    the get your posts like this

    <textarea>
    foreach ($_POST['urls'] as $value)
    {
    echo $value."\n";
    }
    </textarea>

    ... I think
     
    adbox, Sep 8, 2009 IP
  4. coolguy999

    coolguy999 Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hello frnds , Thank you for reply
    This is doubt what i am asking about. i want to add multi links in textarea and the result out also in textarea as the corresponding short links. just like the site zero10.net. i found this site while surfing but i want to add more links at a time in row to get the result as corresponding respective short links. please help me.......Thank you.
     
    coolguy999, Sep 9, 2009 IP
  5. prasanthmj

    prasanthmj Member

    Messages:
    62
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    45
    #5
    you can use the explode() function to split the lines entered in the textarea. Then iterate through the array
    
    $urls = explode("\n",$_POST['multiurls']);
    foreach ($urls as $u)
    {
    // insert into DB
    }
    
    PHP:
     
    prasanthmj, Sep 9, 2009 IP
  6. coolguy999

    coolguy999 Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hello prasanthmj thankyou for reply.
    i used the code as you you said but i didnt get any results just the page is refreshing.
    here is the code what i used
     
    coolguy999, Sep 9, 2009 IP