Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple mailto concat to html

Status
Not open for further replies.

StuartBombay

Programmer
Feb 11, 2008
56
US
I don't get an error with this, but I don't get a mailto link either. I'm happy I'm no longer getting parse errors though!
caveat: this is an intranet form that will never travel outside the department. Everyone has the same email client, so using a mailto *shouldn't* get me into any trouble.

Code:
		if (mysqli_num_rows($get_admin_rs) > 0) {
 
		while ($admin_info = mysqli_fetch_array($get_admin_rs)) {
			$user = stripslashes($admin_info['username']);
			$name = stripslashes($admin_info['principal']);

			$display_block .="<li>Principal: $name";
			$display_block .="<a href='mailto:".$user."@soemwhere.com'>";
			}
			$display_block .="</ul>";
		}

Thanks, If not for this forum I would have run screaming ages ago.
 
Doh, didn't close the mailto. All of the lines after the Principal were disguised as the mailto.

Code:
			$display_block .="<li>Principal: $name";
			$display_block .="<a href='mailto:";
			$display_block .=$user;
			$display_block .="@somewhere.com'>Email $name</a>";
 
Considering you are missing half of the link tag I'm not surprised.

Code:
 $display_block .="<a href='mailto:".$user."@soemwhere.com'>[red]>>missing closing tag goes here<<[/red]";

so:

Code:
 $display_block .="<a href='mailto:".$user."@soemwhere.com'>[red]some text </a>[/red]";


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
oops took to long.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Yup, that happens. I appreciate the response anyway. I didn't realized my error until I looked at the source in the browser. Once it worked I got brave enough to put it all on one line too.
Looking at the source is an easy debugger, but I often forget to use it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top