Hi,
I'm not entirely sure which forum to post this question because I cannot determine whether it's a MySQL, Joomla, or PHP issue. But I will post it here, as some of you may know about this.
I am using a custom built "user" table in my MySQL database, and the email addresses are being stored in plain text as VARCHAR(60). However, when I retrieve an email address from a record, and then display it on my webpage, it appears as an "email link" and not as plain text.
This is the code I'm using to retrieve the email address from the MySQL database.
------------------------------------------------------
$check = mysql_query("SELECT * FROM users WHERE ID = '$userID'");
if ($info = mysql_fetch_array( $check ))
{
// Get db fields
$email = $info['email'];
}
echo $email;
------------------------------------------------------
The PHP code works fine, but the email address variable now contains the following javascript information only after it's been retrieved from the database...
<script language='JavaScript' type='text/javascript'> <!-- var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy22091 = 'mykiwifriend234' + '@'; addy22091 = addy22091 + 'hotmail' + '.' + 'com'; document.write( '<a ' + path + '\'' + prefix + ':' + addy22091 + '\'>' ); document.write( addy22091 ); document.write( '<\/a>' ); //-->\n </script> <script language='JavaScript' type='text/javascript'> <!-- document.write( '<span style=\'display: none;\'>' ); //--> </script>This e-mail address is being protected from spambots. You need JavaScript enabled to view it <script language='JavaScript' type='text/javascript'> <!-- document.write( '</' ); document.write( 'span>' ); //--> </script>
So, my question is... all I need is the "plain text" email address (as I need this to populate an editable text box on my webpage), but where is this additional javascript information coming from? ...and how can I strip this javascript data so I can obtain just the email address itself?
Thanks