Jump to content

email or URL link...?


NoDoze

Recommended Posts

  • 2 months later...

Sorry, I thought this was what I was looking for, and it looked correct at first, but after thinking more about it, this is incorrect. Let me provide an example of what I'm asking.

 

I have this paragraph being submited by form into a mysql database as "section1":

"If you are interested in applying to this position, please send to firstnamelastname@domain.com or visit http://www.domain.com for more information"

 

Then when this info is called up onto a html page via, example:

<td width='682' align='left' class='table-header'>$section1<br><br></td>

 

On the html page the email address and url show up as text and not links.

 

How do I get the email address and url to show up as links?

 

The above suggestion is if ONLY the URL or email is stored in the DB, and will be on the html page as a link. But in the case I need, I have the urls in the middle of text.

 

Thanks again.

Link to comment
Share on other sites

You could try:

 

<?php

$value = 'blah@blah.com';
$check = stripos($value, '@');

if ($check == true)
{
echo ("<a href=\"mailto:$value\">$value</a>");
} else
if ($check == false)
{
echo ("<a href=\"$value\">$value</a>");
}

?>

 

Hope it helps,

 

~ Chocopi

Link to comment
Share on other sites

hey, I've been really bored so I just wrote you a check method for emails and urls.

If the url doesn't contain http:// then it adds it in, because many people forget it, which would cause the page to open incorrectly.

 

<?php
$string = 'fghfg gvfhfghm www.mydomain.co.uk gmje7gfjk 654hjk me@mydomain.co.uk hgoi  gnmguyhb9 o http://www.mydomain.co.uk hgf';

$ex = explode(' ', $string);

foreach($ex as $key => $value){
if(ereg("^[^@]{1,64}@[^@]{1,255}$", $value)){
	$value = str_replace($value, '<a href="mailto:' . $value . '">' . $value . '</a>', $value);
}elseif(ereg('^((http|https)://)?(((www\.)?[^ ]+\.([com|org|net|edu|gov|us]|[co\.uk]))|([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+))([^ ]+)?$', $value)){
		if(preg_match('(http|https)', $value)){
			$value = str_replace($value, '<a href="' . $value . '" target="_blank">' . $value . '</a>', $value);
		}else{
			$value = str_replace($value, '<a href="http://' . $value . '" target="_blank">' . $value . '</a>', $value);
		}
}
$text[] = $value;
}
$string = implode(" ", $text);

echo $string;
?>

I've tested it and it works. Just pass everything through it as $string and it gets outputted back as $string for the echo.

Link to comment
Share on other sites

  • 2 weeks later...

OMG! Thank you! This is AWESOME!

 

...but how would I impliment it?

 

Currently a form inserts text into the database, ex:

sec1 on the form = sec1 into the database = then is pulled from the database by $sec1

 

How would I route this or include the code you provided?

 

Would I just substitute line #2 to be:

$string = $sect1

 

then just dump the code you provided where the text is to appear?

 

Link to comment
Share on other sites

This should work. Just replace all instances of $string with $sect1 (and remove the line which set what $string was as it's not needed)

<?php
$ex = explode(' ', $sect1);

foreach($ex as $key => $value){
if(ereg("^[^@]{1,64}@[^@]{1,255}$", $value)){
	$value = str_replace($value, '<a href="mailto:' . $value . '">' . $value . '</a>', $value);
}elseif(ereg('^((http|https)://)?(((www\.)?[^ ]+\.([com|org|net|edu|gov|us]|[co\.uk]))|([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+))([^ ]+)?$', $value)){
		if(preg_match('(http|https)', $value)){
			$value = str_replace($value, '<a href="' . $value . '" target="_blank">' . $value . '</a>', $value);
		}else{
			$value = str_replace($value, '<a href="http://' . $value . '" target="_blank">' . $value . '</a>', $value);
		}
}
$text[] = $value;
}
$sect1 = implode(" ", $text);

echo $sect1;
?>

Link to comment
Share on other sites

Ok, thanks for the above help....but now I was thinking....an extension from that...

 

Here is my code for this one:

<?
include 'config.php';
include 'opendb.php';
?>
<?

$query="SELECT * ,DATE_FORMAT(indate, '%b %d %Y') AS findate FROM jobs ORDER BY indate DESC";

if(isset($_GET['sortby'])){

$query .= " ORDER BY '" . $_GET['sortby'] . "'";
}

$result=mysql_query($query);

mysql_close();

$num=mysql_numrows($result);
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$findate=mysql_result($result,$i,"findate");
$title=mysql_result($result,$i,"title");
$sec1h=mysql_result($result,$i,"sec1h");
$sec1t=mysql_result($result,$i,"sec1t");
$sec2h=mysql_result($result,$i,"sec2h");
$sec2t=mysql_result($result,$i,"sec2t");
$sec3h=mysql_result($result,$i,"sec3h");
$sec3t=mysql_result($result,$i,"sec3t");
$sec4h=mysql_result($result,$i,"sec4h");
$sec4t=mysql_result($result,$i,"sec4t");


$ex = explode(' ', $sec4t);

foreach($ex as $key => $value){
if(ereg("^[^@]{1,64}@[^@]{1,255}$", $value)){
	$value = str_replace($value, '<a href="mailto:' . $value . '">' . $value . '</a>', $value);
}elseif(ereg('^((http|https)://)?(((www\.)?[^ ]+\.([com|org|net|edu|gov|us]|[co\.uk]))|([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+))([^ ]+)?$', $value)){
		if(preg_match('(http|https)', $value)){
			$value = str_replace($value, '<a href="' . $value . '" target="_blank">' . $value . '</a>', $value);
		}else{
			$value = str_replace($value, '<a href="http://' . $value . '" target="_blank">' . $value . '</a>', $value);
		}
}
$text[] = $value;
}
$sec4t = implode(" ", $text);


print "<tr>";
print "<td width='450' colspan='2' align='left'><hr></td>";
print "</tr>";
print "<tr>";
print "<td width='682' align='left' class='table-header'>$title<br><br></td><td width='120' align='left'>$findate</td>";
print "</tr>";
print "<tr>";
print "<td colspan='2' align='left'><b>$sec1h</b><br>$sec1t<br><br></td>";
print "</tr>";
print "<tr>";
print "<td colspan='2' align='left'><b>$sec2h</b><br>$sec2t<br><br></td>";
print "</tr>";
print "<tr>";
print "<td colspan='2' align='left'><b>$sec3h</b><br>$sec3t<br><br></td>";
print "</tr>";
print "<tr>";
print "<td colspan='2' align='left'><b>$sec4h</b><br>$sec4t<br><br></td>";
print "</tr>";





++$i;
}




?>
<?php
include 'closedb.php';
?> 

 

As you can see I have multiple sections, in a loop to sort by column headers... though I need the link code you provided to scan through each section for urls and emails. As you can probably guess, it works fine for one section, but if I add your code multiple times for each section...it loops the first section over and over. How can I amend or add your code so that it scans every section for urls and emails?

 

Thanks again!

Link to comment
Share on other sites

I haven't tested this at all but try this:

<?php
include 'config.php';
include 'opendb.php';

$query="SELECT * ,DATE_FORMAT(indate, '%b %d %Y') AS findate FROM jobs ORDER BY indate DESC";
if(isset($_GET['sortby'])){
	$query .= " ORDER BY '" . $_GET['sortby'] . "'";
}

$result=mysql_query($query);
mysql_close();

$num=mysql_numrows($result);
$i=0;
while ($i < $num) {
$id = mysql_result($result,$i,"id");
$findate = mysql_result($result,$i,"findate");
$title = mysql_result($result,$i,"title");
	$secs['sec1h'] = mysql_result($result,$i,"sec1h");
	$secs['sec1t'] = mysql_result($result,$i,"sec1t");
	$secs['sec2h'] = mysql_result($result,$i,"sec2h");
	$secs['sec2t'] = mysql_result($result,$i,"sec2t");
	$secs['sec3h'] = mysql_result($result,$i,"sec3h");
	$secs['sec3t'] = mysql_result($result,$i,"sec3t");
	$secs['sec4h'] = mysql_result($result,$i,"sec4h");
	$secs['sec4t'] = mysql_result($result,$i,"sec4t");

foreach($secs as $k => $v){
	$ex = explode(' ', $v);
	foreach($ex as $key => $value){
		if(ereg("^[^@]{1,64}@[^@]{1,255}$", $value)){
			$value = str_replace($value, '<a href="mailto:' . $value . '">' . $value . '</a>', $value);
		}elseif(ereg('^((http|https)://)?(((www\.)?[^ ]+\.([com|org|net|edu|gov|us]|[co\.uk]))|([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+))([^ ]+)?$', $value)){
				if(preg_match('(http|https)', $value)){
					$value = str_replace($value, '<a href="' . $value . '" target="_blank">' . $value . '</a>', $value);
				}else{
					$value = str_replace($value, '<a href="http://' . $value . '" target="_blank">' . $value . '</a>', $value);
				}
		}
		$text[] = $value;
	}
	$v = implode(" ", $text);

	print "<tr>";
	print "<td width='450' colspan='2' align='left'><hr></td>";
	print "</tr>";
	print "<tr>";
	print "<td width='682' align='left' class='table-header'>$title<br><br></td><td width='120' align='left'>$findate</td>";
	print "</tr>";
	print "<tr>";
	print "<td colspan='2' align='left'><b>$sec1h</b><br>$sec1t<br><br></td>";
	print "</tr>";
	print "<tr>";
	print "<td colspan='2' align='left'><b>$sec2h</b><br>$sec2t<br><br></td>";
	print "</tr>";
	print "<tr>";
	print "<td colspan='2' align='left'><b>$sec3h</b><br>$sec3t<br><br></td>";
	print "</tr>";
	print "<tr>";
	print "<td colspan='2' align='left'><b>$sec4h</b><br>$sec4t<br><br></td>";
	print "</tr>";
}
$i++;
}

include 'closedb.php';
?>

 

EDIT: that code is under the presumption that

	$id = mysql_result($result,$i,"id");
$findate = mysql_result($result,$i,"findate");
$title = mysql_result($result,$i,"title");

aren't meant to be checked...

Link to comment
Share on other sites

Opps...when I change the code to what you have above, the headers of the sections get looped...

 

And what do you mean by:

 

EDIT: that code is under the presumption that

Code:

$id = mysql_result($result,$i,"id");

$findate = mysql_result($result,$i,"findate");

$title = mysql_result($result,$i,"title");aren't meant to be checked...

 

What "checked" are you talking about?

 

btw, fyi, this is the only php on this page.

 

Link to comment
Share on other sites

Opps...when I change the code to what you have above, the headers of the sections get looped...

okay.. try this:

<?php
include 'config.php';
include 'opendb.php';

$query = "SELECT * ,DATE_FORMAT(indate, '%b %d %Y') AS findate FROM jobs ORDER BY indate DESC";
if(isset($_GET['sortby'])){
	$query .= " ORDER BY '" . $_GET['sortby'] . "'";
}

$result = mysql_query($query);
mysql_close();

$num = mysql_numrows($result);
$i = 0;
while ($i < $num) {
	print "<tr>";
	print "<td width='450' colspan='2' align='left'><hr></td>";
	print "</tr>";
	print "<tr>";
	print "<td width='682' align='left' class='table-header'>$title<br><br></td><td width='120' align='left'>$findate</td>";
	print "</tr>";
	print "<tr>";

$id = mysql_result($result,$i,"id");
$findate = mysql_result($result,$i,"findate");
$title = mysql_result($result,$i,"title");
	$secs['sec1h'] = mysql_result($result,$i,"sec1h");
	$secs['sec1t'] = mysql_result($result,$i,"sec1t");
	$secs['sec2h'] = mysql_result($result,$i,"sec2h");
	$secs['sec2t'] = mysql_result($result,$i,"sec2t");
	$secs['sec3h'] = mysql_result($result,$i,"sec3h");
	$secs['sec3t'] = mysql_result($result,$i,"sec3t");
	$secs['sec4h'] = mysql_result($result,$i,"sec4h");
	$secs['sec4t'] = mysql_result($result,$i,"sec4t");

foreach($secs as $k => $v){
	$ex = explode(' ', $v);
	foreach($ex as $key => $value){
		if(ereg("^[^@]{1,64}@[^@]{1,255}$", $value)){
			$value = str_replace($value, '<a href="mailto:' . $value . '">' . $value . '</a>', $value);
		}elseif(ereg('^((http|https)://)?(((www\.)?[^ ]+\.([com|org|net|edu|gov|us]|[co\.uk]))|([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+))([^ ]+)?$', $value)){
				if(preg_match('(http|https)', $value)){
					$value = str_replace($value, '<a href="' . $value . '" target="_blank">' . $value . '</a>', $value);
				}else{
					$value = str_replace($value, '<a href="http://' . $value . '" target="_blank">' . $value . '</a>', $value);
				}
		}
		$text[] = $value;
	}
	$v = implode(" ", $text);

	print "<td colspan='2' align='left'><b>$sec1h</b><br>$sec1t<br><br></td>";
	print "</tr>";
	print "<tr>";
	print "<td colspan='2' align='left'><b>$sec2h</b><br>$sec2t<br><br></td>";
	print "</tr>";
	print "<tr>";
	print "<td colspan='2' align='left'><b>$sec3h</b><br>$sec3t<br><br></td>";
	print "</tr>";
	print "<tr>";
	print "<td colspan='2' align='left'><b>$sec4h</b><br>$sec4t<br><br></td>";
	print "</tr>";
}
$i++;
}

include 'closedb.php';
?>

 

 

And what do you mean by:

 

EDIT: that code is under the presumption that

Code:

$id = mysql_result($result,$i,"id");

$findate = mysql_result($result,$i,"findate");

$title = mysql_result($result,$i,"title");aren't meant to be checked...

 

What "checked" are you talking about?

 

btw, fyi, this is the only php on this page.

I meant that I didn't think you wanted them verified through the link and email check...

Link to comment
Share on other sites

it's probably a problem with your sql query then. You've not no error checking for it..

have a go at with this.. I've added in error checks to the code:

<?php
include 'config.php';
include 'opendb.php';

$query = "SELECT * ,DATE_FORMAT(indate, '%b %d %Y') AS findate FROM jobs ORDER BY indate DESC";
if(isset($_GET['sortby'])){
	$query .= " ORDER BY '" . $_GET['sortby'] . "'";
}
if($result = mysql_query($query)){
if(mysql_num_rows($result) > 0){
	$i = 0;
	while($row = mysql_fetch_assoc($result)){
		print "<tr>";
		print "<td width='450' colspan='2' align='left'><hr></td>";
		print "</tr>";
		print "<tr>";
		print "<td width='682' align='left' class='table-header'>$title<br><br></td><td width='120' align='left'>$findate</td>";
		print "</tr>";
		print "<tr>";

		$id = mysql_result($result,$i,"id");
		$findate = mysql_result($result,$i,"findate");
		$title = mysql_result($result,$i,"title");
			$secs['sec1h'] = mysql_result($result,$i,"sec1h");
			$secs['sec1t'] = mysql_result($result,$i,"sec1t");
			$secs['sec2h'] = mysql_result($result,$i,"sec2h");
			$secs['sec2t'] = mysql_result($result,$i,"sec2t");
			$secs['sec3h'] = mysql_result($result,$i,"sec3h");
			$secs['sec3t'] = mysql_result($result,$i,"sec3t");
			$secs['sec4h'] = mysql_result($result,$i,"sec4h");
			$secs['sec4t'] = mysql_result($result,$i,"sec4t");

		foreach($secs as $k => $v){
			$ex = explode(' ', $v);
				foreach($ex as $key => $value){
					if(ereg("^[^@]{1,64}@[^@]{1,255}$", $value)){
						$value = str_replace($value, '<a href="mailto:' . $value . '">' . $value . '</a>', $value);
					}elseif(ereg('^((http|https)://)?(((www\.)?[^ ]+\.([com|org|net|edu|gov|us]|[co\.uk]))|([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+))([^ ]+)?$', $value)){
						if(preg_match('(http|https)', $value)){
							$value = str_replace($value, '<a href="' . $value . '" target="_blank">' . $value . '</a>', $value);
						}else{
							$value = str_replace($value, '<a href="http://' . $value . '" target="_blank">' . $value . '</a>', $value);
						}
					}
					$text[] = $value;
				}
			$v = implode(" ", $text);

			print "<td colspan='2' align='left'><b>$sec1h</b><br>$sec1t<br><br></td>";
			print "</tr>";
			print "<tr>";
			print "<td colspan='2' align='left'><b>$sec2h</b><br>$sec2t<br><br></td>";
			print "</tr>";
			print "<tr>";
			print "<td colspan='2' align='left'><b>$sec3h</b><br>$sec3t<br><br></td>";
			print "</tr>";
			print "<tr>";
			print "<td colspan='2' align='left'><b>$sec4h</b><br>$sec4t<br><br></td>";
			print "</tr>";
		}
	$i++;
	}
    }else{
    	return 'Sorry, but no results were found';
    }
}else{
return 'Query failed<br />' . mysql_error() . '';
}

include 'closedb.php';
?>

Link to comment
Share on other sites

Sorry to report... no go.

It's definately the code though...

It shows the html portion of the page, but the php stuff is blank...as it did previously.

thanks for the help...this is definately over my head...the code looks good to me, I can't understand why it wouldn't work...

Link to comment
Share on other sites

it's a bit long winded, but it's one in the morning here and I can think of anything better at the moment.. This may not work either, but I'm too tired to check through it properly..

<?php
include 'config.php';
include 'opendb.php';

$query = "SELECT * ,DATE_FORMAT(indate, '%b %d %Y') AS findate FROM jobs ORDER BY indate DESC";
if(isset($_GET['sortby'])){
	$query .= " ORDER BY '" . $_GET['sortby'] . "'";
}
if($result = mysql_query($query)){
if(mysql_num_rows($result) > 0){
	$i = 0;
	while($row = mysql_fetch_assoc($result)){
		print "<tr>";
		print "<td width='450' colspan='2' align='left'><hr></td>";
		print "</tr>";
		print "<tr>";
		print "<td width='682' align='left' class='table-header'>$title<br><br></td><td width='120' align='left'>$findate</td>";
		print "</tr>";

		$id = mysql_result($result,$i,"id");
		$findate = mysql_result($result,$i,"findate");
		$title = mysql_result($result,$i,"title");
			$secsh['sec1h'] = mysql_result($result,$i,"sec1h");
			$secsh['sec2h'] = mysql_result($result,$i,"sec2h");
			$secsh['sec3h'] = mysql_result($result,$i,"sec3h");
			$secsh['sec4h'] = mysql_result($result,$i,"sec4h");

			$secst['sec1t'] = mysql_result($result,$i,"sec1t");
			$secst['sec2t'] = mysql_result($result,$i,"sec2t");
			$secst['sec3t'] = mysql_result($result,$i,"sec3t");
			$secst['sec4t'] = mysql_result($result,$i,"sec4t");

		foreach($secsh as $k => $v){
			$ex = explode(' ', $v);
				foreach($ex as $key => $value){
					if(ereg("^[^@]{1,64}@[^@]{1,255}$", $value)){
						$value = str_replace($value, '<a href="mailto:' . $value . '">' . $value . '</a>', $value);
					}elseif(ereg('^((http|https)://)?(((www\.)?[^ ]+\.([com|org|net|edu|gov|us]|[co\.uk]))|([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+))([^ ]+)?$', $value)){
						if(preg_match('(http|https)', $value)){
							$value = str_replace($value, '<a href="' . $value . '" target="_blank">' . $value . '</a>', $value);
						}else{
							$value = str_replace($value, '<a href="http://' . $value . '" target="_blank">' . $value . '</a>', $value);
						}
					}
					$text[] = $value;
				}
			$v['secsh'][] = implode(" ", $text);
		}
		foreach($secst as $k => $v){
			$ex = explode(' ', $v);
				foreach($ex as $key => $value){
					if(ereg("^[^@]{1,64}@[^@]{1,255}$", $value)){
						$value = str_replace($value, '<a href="mailto:' . $value . '">' . $value . '</a>', $value);
					}elseif(ereg('^((http|https)://)?(((www\.)?[^ ]+\.([com|org|net|edu|gov|us]|[co\.uk]))|([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+))([^ ]+)?$', $value)){
						if(preg_match('(http|https)', $value)){
							$value = str_replace($value, '<a href="' . $value . '" target="_blank">' . $value . '</a>', $value);
						}else{
							$value = str_replace($value, '<a href="http://' . $value . '" target="_blank">' . $value . '</a>', $value);
						}
					}
					$text[] = $value;
				}
			$v['secst'][] = implode(" ", $text);
		}
		$a = 0;
		foreach($v['secsh'] as $key => $value){
			print "<tr>";
			print "<td colspan='2' align='left'><b>" . $value . "</b><br>" . $vsecst[$a] . "<br><br></td>";
			print "</tr>";
			$a++;
		}

	$i++;
	}
    }else{
    	return 'Sorry, but no results were found';
    }
}else{
return 'Query failed<br />' . mysql_error() . '';
}

include 'closedb.php';
?>

if you still get nothing, check the html source to see if the

			print "<tr>";
			print "<td colspan='2' align='left'><b>" . $value . "</b><br>" . $vsecst[$a] . "<br><br></td>";
			print "</tr>";

section is actually being echoed, but for some reason the variables don't have values, or something.

Link to comment
Share on other sites

No go again...but got wierd results...

 

nothing showed except the headers of each section...8 times in a row...

...so...section 1 header listed 8 times in a row, then section 2 header showed 8 times in a row, ect, ect...

Link to comment
Share on other sites

okay... what do you get from this?

<?php
include 'config.php';
include 'opendb.php';

$query = "SELECT * ,DATE_FORMAT(indate, '%b %d %Y') AS findate FROM jobs ORDER BY indate DESC";
if(isset($_GET['sortby'])){
	$query .= " ORDER BY '" . $_GET['sortby'] . "'";
}
if($result = mysql_query($query)){
if(mysql_num_rows($result) > 0){
	$i = 0;

	print "<tr>";
	print "<td width='450' colspan='2' align='left'><hr></td>";
	print "</tr>";
	print "<tr>";
	print "<td width='682' align='left' class='table-header'>$title<br><br></td><td width='120' align='left'>$findate</td>";
	print "</tr>";

	while($row = mysql_fetch_assoc($result)){
		$id = mysql_result($result,$i,"id");
		$findate = mysql_result($result,$i,"findate");
		$title = mysql_result($result,$i,"title");
			$secsh['sec1h'] = mysql_result($result,$i,"sec1h");
			$secsh['sec2h'] = mysql_result($result,$i,"sec2h");
			$secsh['sec3h'] = mysql_result($result,$i,"sec3h");
			$secsh['sec4h'] = mysql_result($result,$i,"sec4h");

			$secst['sec1t'] = mysql_result($result,$i,"sec1t");
			$secst['sec2t'] = mysql_result($result,$i,"sec2t");
			$secst['sec3t'] = mysql_result($result,$i,"sec3t");
			$secst['sec4t'] = mysql_result($result,$i,"sec4t");

		foreach($secsh as $k => $v){
			$ex = explode(' ', $v);
				foreach($ex as $key => $value){
					if(ereg("^[^@]{1,64}@[^@]{1,255}$", $value)){
						$value = str_replace($value, '<a href="mailto:' . $value . '">' . $value . '</a>', $value);
					}elseif(ereg('^((http|https)://)?(((www\.)?[^ ]+\.([com|org|net|edu|gov|us]|[co\.uk]))|([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+))([^ ]+)?$', $value)){
						if(preg_match('(http|https)', $value)){
							$value = str_replace($value, '<a href="' . $value . '" target="_blank">' . $value . '</a>', $value);
						}else{
							$value = str_replace($value, '<a href="http://' . $value . '" target="_blank">' . $value . '</a>', $value);
						}
					}
					$text[] = $value;
				}
			$v['secsh'][] = implode(" ", $text);
		}
		foreach($secst as $k => $v){
			$ex = explode(' ', $v);
				foreach($ex as $key => $value){
					if(ereg("^[^@]{1,64}@[^@]{1,255}$", $value)){
						$value = str_replace($value, '<a href="mailto:' . $value . '">' . $value . '</a>', $value);
					}elseif(ereg('^((http|https)://)?(((www\.)?[^ ]+\.([com|org|net|edu|gov|us]|[co\.uk]))|([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+))([^ ]+)?$', $value)){
						if(preg_match('(http|https)', $value)){
							$value = str_replace($value, '<a href="' . $value . '" target="_blank">' . $value . '</a>', $value);
						}else{
							$value = str_replace($value, '<a href="http://' . $value . '" target="_blank">' . $value . '</a>', $value);
						}
					}
					$text[] = $value;
				}
			$v['secst'][] = implode(" ", $text);
		}
		$a = 0;
		foreach($v['secsh'] as $key => $value){
			print "<tr>";
			//print "<td colspan='2' align='left'><b>" . $value . "</b><br>" . $vsecst[$a] . "<br><br></td>";
			print "<td colspan='2' align='left'><b>I am a variable.. can you see me?</b></td>";
			print "</tr>";
			$a++;
		}

	$i++;
	}
    }else{
    	return 'Sorry, but no results were found';
    }
}else{
return 'Query failed<br />' . mysql_error() . '';
}

include 'closedb.php';
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.