I got problem verify the link from the email...now I can receive the email...
but the link pointing is a empty link...

$item_hash = md5($item_id);
	
	//Send the email user...
	$headers  = 'MIME-Version: 1.0' . "\r\n";
	$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
	$headers .= 'X-Mailer: PHP/' . phpversion();
	$subject = 'Test - '.$header;
	$mail_msg = "<html><head><title>$header</title></head>
	<body>
	<p>You have a new unpublished ad. Please click the link below to verify.</p>
	<p>&nbsp;</p>
	<p><a href=\"http://www.***.com/verify.php?ad=$item_hash\">http://www.***.com/verify.php?ad=$item_hash</a></p>
	<p>&nbsp;</p>
	</body></html>";
<?php
include 'config.php';
$c->debug = false;

if(isset($_GET['item'])){
	$item_id = $_GET['item'];
	
	$q = "select item_title, item_desc, item_price, datediff(now(), item_stamp), item_mode,
			item_yr, item_room, item_space, item_htitle,
			loc_id, sub_id, user_id, item_id, item_addr 
			from post_item where md5(item_id) = '$item_id' and item_publish != 2";
	$r = $c->Execute($q);
	
	$title = $r->fields[0];
	$desc = $r->fields[1];
	$price = $r->fields[2];
	$day = $r->fields[3];
	$mode = $r->fields[4];
	
	$yr = $r->fields[5];
	$room = $r->fields[6];
	$space = $r->fields[7];
	$htitle = $r->fields[8];
	
	$loc_id = $r->fields[9];
	$sub_id = $r->fields[10];
	$user_id = $r->fields[11];
	$item_id = $r->fields[12];
	$addr = $r->fields[13];
	
	$q = "select loc_name from location where loc_id = $loc_id";
	$r = $c->Execute($q);
	$location = $r->fields[0];
	
	$q = "select A.sub_name, B.cat_name from subcategory A, category B where A.cat_id = B.cat_id";
	$r = $c->Execute($q);
	$subcat = $r->fields[0];
	$cat = $r->fields[1];
	
	$q = "select user_name, user_email, user_phone from post_user where user_id = $user_id";
	$r = $c->Execute($q);
	$name = $r->fields[0];
	$email = $r->fields[1];
	$phone = $r->fields[2];
	
	if($mode == 1)
	{ $mode = 'Sell'; }
	if($mode == 2)
	{ $mode = 'Rent'; }
	if($mode == 3)
	{ $mode = 'Sell/Rent'; }
	
	if($day == 0){
		$day = 'Today';
	}
	else if($day == 1){
		$day = 'Yesterday';
	}
	else{
		$day = $day.' days ago';
	}
}
else
{ exit; }

//images...
$nofile = 0;
$file = array();
$q = "select img_path from images where item_id = $item_id order by img_id asc";
$r = $c->Execute($q);

while(!$r->EOF){
	array_push($file, $r->fields[0]);
	$nofile++;
	$r->MoveNext();
}

?>

please help..thanks!

On the SECOND block of code you posted you are initializing $item_id on line 6. You need to put the FIRST code of block AFTER line 6 of the second code of block.

thanks for your reply! but when I follow what you have said, it doesn't even send the email...hmmm

It sounds like it doesn't even make it into the if clause of your second block. Meaning there is no such thing as $_GET. If that is the case then $item_id has nothing in it either.

so what I can do now?

If what I said earlier is true, then you need to investigate why $_GET is missing/not set. I can't figure out why that would be based on the fragments you posted.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.