I've made a simple page in wich a title, url, name and e-mail can be sumbitted with a form. The values are stored in a database.
I've managed to convert a found e-mail address into a clickable link.
The problem is, this address is placed on top of the table, and I want it in the e-mail column.
can anyone help me with this?
This is the code that needs to be altered
Code:
<?php session_start(); ?>
<?php /* no security */ ?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php include ("db.php") ?>
<?php include ("function.php") ?>
<?php
$displayRecs = 20;
$recRange = 10;
// Get table name
$tablename = "`titles`";
$dbwhere = "";
$a_search = "";
$b_search = "";
?>
<?php
// Get search criteria for basic search
$pSearch = @$HTTP_GET_VARS["psearch"];
if ($pSearch != "")
{
$pSearch = (!get_magic_quotes_gpc()) ? addslashes($pSearch) : $pSearch;
$b_search .= "`title` LIKE '%".$pSearch."%' OR ";
$b_search .= "`url` LIKE '%".$pSearch."%' OR ";
$b_search .= "`name_author` LIKE '%".$pSearch."%' OR ";
$b_search .= "`e-mail` LIKE '%".$pSearch."%' OR ";
}
if (strlen($b_search) > 4)
{
$b_search = substr($b_search, 0, strlen($b_search)-4);
$b_search = "(".$b_search.")";
}
?>
<?php
//Build search criteria
if ($a_search != "")
{
$dbwhere .= $a_search; //advance search
} elseif ($b_search!="") {
$dbwhere .= $b_search; //basic search
}
// Next link
if ($totalRecs >= $startRec + $displayRecs)
{
$NextStart = $startRec + $displayRecs;
$isMore = true;
?>
<strong><a href="titleslist.php?start=<?php echo $NextStart; ?>"><font size="-1">[Next >>]</font></a></strong>
<?php
} else {
$isMore=false;
}
?>
<hr size="1" noshade>
<?php
if ($stopRec > $recCount)
{
$stopRec = $recCount;
}
?>
<font size="-1">Records <?php echo $startRec; ?> to <?php echo $stopRec; ?> of <?php echo $totalRecs; ?></font>
<?php
} else {
?>
<br><br>
<font size="-1">No records found!</font>
<br><br>
<?php
}
?>
<?php include ("footer.php") ?>
Also, I would like an extra field that displays the time and date of an added item.
cheers,
Tjendol
Tjendol Sergeant
Joined: Dec 15, 2003
Posts: 77
Posted:
Fri Dec 19, 2003 5:38 am
Ok, I got the e-mail code working.
Now I want the same thing for urls. Which parts do I have to change?
Zhen-Xjell Nuke Cops Founder
Joined: Nov 14, 2002
Posts: 5939
Posted:
Fri Dec 19, 2003 6:23 am
Do you have this available on the net to view?
_________________ Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
Tjendol Sergeant
Joined: Dec 15, 2003
Posts: 77
Posted:
Fri Dec 19, 2003 6:53 am
I sent you an e-mail with the link.
Tjendol Sergeant
Joined: Dec 15, 2003
Posts: 77
Posted:
Fri Dec 19, 2003 8:24 am
I fixed it! thnx anyway
free69 Captain
Joined: Jan 18, 2003
Posts: 333
Location: Sniper Mobile Command
Posted:
Fri Dec 26, 2003 4:11 am
Dear Zhen-Xjell,
Regarding above scripts for gmtime(), I use similar one at the coppermine e-card, which sends very incorrect date(time is correct) to receiver, i.e. 2003-01-12, .... instead of actual date 2003-12-26,....
My PWS server is win2k/apache2/nuke7.0/coppermine1.2.1rc5.
Coppermine said that it should be my server problem.
And I checked my machine date is correct.
What should be wrong, Doctor.
_________________
Tjendol Sergeant
Joined: Dec 15, 2003
Posts: 77
Posted:
Sun Dec 28, 2003 7:40 am
I still have a question too. It seems that only filling in "<a href"-works because that's just html.
But i want to covert http:// links into clickable links as well...what code do I need for this and where do I put it?
Tjendol Sergeant
Joined: Dec 15, 2003
Posts: 77
Posted:
Sun Dec 28, 2003 7:43 am
Lol...i want the thing that happens to the http:// text in my post above on my website
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum