text input with links, etc..

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave Moore

    text input with links, etc..

    Hi All,
    I hope you can give me a few pointers on this issue.

    I'd like visitors to my website to be able to enter text to be viewed on the
    site - a bit like a bulletin board or forum. I can do this for regular text
    easily by simply populating a 'TEXT' field within my MySQL database and
    grabbing it back when rendering the site using PHP. However, I'd also like
    visitors to be able to put in URL links or email items that can be clicked.
    How would I go about doing this?.I've seen this sort of thing on forums
    where words can be selected and a URL applied, but I have no idea how to do
    this and how this information (ie. the link and the associated text) would
    be stored in the database field(s).
    Any ideas?. Are there any PHP examples available for this sort of thing?.

    Thanks for any comments.

    Regards,
    Dave



  • J.O. Aho

    #2
    Re: text input with links, etc..

    Dave Moore wrote:[color=blue]
    > Hi All,
    > I hope you can give me a few pointers on this issue.
    >
    > I'd like visitors to my website to be able to enter text to be viewed on the
    > site - a bit like a bulletin board or forum. I can do this for regular text
    > easily by simply populating a 'TEXT' field within my MySQL database and
    > grabbing it back when rendering the site using PHP. However, I'd also like
    > visitors to be able to put in URL links or email items that can be clicked.
    > How would I go about doing this?.I've seen this sort of thing on forums
    > where words can be selected and a URL applied, but I have no idea how to do
    > this and how this information (ie. the link and the associated text) would
    > be stored in the database field(s).
    > Any ideas?. Are there any PHP examples available for this sort of thing?.[/color]

    IMHO the easiest way is to allow users to use HTML-tags, that way they can set
    URLs.

    I think there are quite a lot of examples around the net, you can even take a
    look at the online manual


    Fetch a result row as an associative array, a numeric array, or both



    To catch the sent data, you can use $_REQUEST['text-name'] to get the data
    from the form.


    //Aho

    Comment

    • Dave Moore

      #3
      Re: text input with links, etc..

      Thanks Aho, but that's not what I'm trying to achieve.

      "J.O. Aho" <user@example.n et> wrote in message
      news:3h0q6jFekm 3oU1@individual .net...[color=blue]
      > Dave Moore wrote:[color=green]
      > > Hi All,
      > > I hope you can give me a few pointers on this issue.
      > >
      > > I'd like visitors to my website to be able to enter text to be viewed on[/color][/color]
      the[color=blue][color=green]
      > > site - a bit like a bulletin board or forum. I can do this for regular[/color][/color]
      text[color=blue][color=green]
      > > easily by simply populating a 'TEXT' field within my MySQL database and
      > > grabbing it back when rendering the site using PHP. However, I'd also[/color][/color]
      like[color=blue][color=green]
      > > visitors to be able to put in URL links or email items that can be[/color][/color]
      clicked.[color=blue][color=green]
      > > How would I go about doing this?.I've seen this sort of thing on forums
      > > where words can be selected and a URL applied, but I have no idea how to[/color][/color]
      do[color=blue][color=green]
      > > this and how this information (ie. the link and the associated text)[/color][/color]
      would[color=blue][color=green]
      > > be stored in the database field(s).
      > > Any ideas?. Are there any PHP examples available for this sort of[/color][/color]
      thing?.[color=blue]
      >
      > IMHO the easiest way is to allow users to use HTML-tags, that way they can[/color]
      set[color=blue]
      > URLs.
      >
      > I think there are quite a lot of examples around the net, you can even[/color]
      take a[color=blue]
      > look at the online manual
      >
      > http://www.php.net/manual/en/function.mysql-connect.php
      > http://www.php.net/manual/en/functio...etch-array.php
      > http://www.php.net/manual/en/function.mysql-query.php
      >
      > To catch the sent data, you can use $_REQUEST['text-name'] to get the data
      > from the form.
      >
      >
      > //Aho[/color]


      Comment

      • J.O. Aho

        #4
        Re: text input with links, etc..

        Dave Moore wrote:[color=blue]
        > Thanks Aho, but that's not what I'm trying to achieve.[/color]

        So it's not that you have a page with a text filed where users can write
        something and the submit and your php page take the text written and stores
        it in a mysql database which later on can be displayed on another page?



        //Aho

        Comment

        • Dave Moore

          #5
          Re: text input with links, etc..


          "J.O. Aho" <user@example.n et> wrote in message
          news:3h3257Ff0d 0tU1@individual .net...[color=blue]
          > Dave Moore wrote:[color=green]
          > > Thanks Aho, but that's not what I'm trying to achieve.[/color]
          >
          > So it's not that you have a page with a text filed where users can write
          > something and the submit and your php page take the text written and[/color]
          stores[color=blue]
          > it in a mysql database which later on can be displayed on another page?[/color]

          Well Yes and No. I can already do this using the functions you highlighted
          in your previous post. What I'd like to do in addition is to allow the user
          (some how) to include hypertext links in with their text such that when the
          information is rendered, visitors can click on the links and navigate to
          other pages. I assume that some sort of special form would be required to do
          this and I'd like to see some example code.

          Dave


          Comment

          Working...