SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard edshuck's Avatar
    Join Date
    Jul 2000
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a piece of code that uses data from mysql to present entertainment information. This is done in two steps.

    Access the code and the event category and a count is presented. Click on an event category and the events meeting that category are displayed.

    Some of the events also have a url and I am having a problem knowing where to place the url code that Kevin provided in the tutorial.

    The problem may be viewed on http://www.noevalley.com/ent_2.php3 . Then clicking on Stage Performance.

    The problem is that I cannot handle the url shown at the bottom of the announcement.

    thanks and peace

  2. #2
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Place it before you send $body (if that's the name of your general text field) to the client...like this...


    // Kevin's Link code...
    $body = eregi_replace(blah blah blah, $body);
    echo($body);


    Good luck! If you need a more detailed example, just let me know.

  3. #3
    SitePoint Wizard edshuck's Avatar
    Join Date
    Jul 2000
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Chris

    I will try it, just one more confirmation. What I am doing is going from row to row and meeting some WHERE criteria and getting the information. In the following, am I on track.

    $message = ereg_replace(Kevin's code,$row[message]);
    print($message);

    The first row reads, "Read the data in row number ($row) and data cell message [message], do the ereg replace on that data, and place that data in varable $message.

    The second row reads, "Print the contents of variable $message."

    Am I close? If I am, what I could not see is how the variable could work between the {braces}. But I will give it a try.

    Thanks again

    Ed

  4. #4
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, that should work - only I would replace "ereg" with "eregi" - eregi is case INsensitive - not a big deal, but if not used you might end up tearing your hair out trying to debug the problem.

    If that code doesn't work for whatever reason, you can give the variable a new name first:

    Code:
    $message = $row["message"];
    $message = ereg_replace(Kevin's code, $message);
    print($message);
    If you have problem with the "Kevin's code" part, let me know: I have it here on my hard-drive somewhere, so I'm sure I can provide an actual, working example.


Bookmarks

Posting Permissions

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