Jump to content

mmsolutions

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mmsolutions's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. So in the following instance, what do we replace $foo with ? is it $content ? <?php function autolink_test($foo) { // Modified from: http://www.totallyphp.co.uk/code/convert_links_into_clickable_hyperlinks.htm $foo = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '<a href="\\1">\\1</a>', $page_content1); if( strpos($foo, "http") === FALSE ) { $foo = eregi_replace('(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '<a href="http://\\1" target=_blank rel=nofollow >\\1</a>', $page_content1); } else { $foo = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)', '\\1<a href="http://\\2" target=_blank rel=nofollow >\\2</a>', $page_content1); } $foo = eregi_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})', '<a href="mailto:\\1">\\1</a>', $page_content1); return $foo; } ?>
  2. Dear all I have the following code: <?php $query="select * from website_pages_sub WHERE subpage_id = ".$_SESSION['mainpage'] ." AND subpage_status LIKE '%live%'"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { ?> <?php echo $row['content1';?> Content1 is a field within a row in a table as you know but it contains lots of text like a new entry. Within this field of text could be something like: "Contact the club website at http://www.google.co.uk" I want code to assess the contents of this field and if it finds a website entry to turn it into a url. Can this be done ? Kind reagards Mark
  3. This is a bit of a niche really. What I want is when you type the following URL ( http://www.google.co.uk ) and it gets saved into the mysql database. Next step is when this is echoed onto the website I want this to be displayed as <a href="http://www.google.co.uk">http://www.google.co.uk</a> so that users can click on the link as a live hyperlink. This is often acheived on most blogs and it must be relatively simple. Many thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.