xcali Posted April 25, 2008 Share Posted April 25, 2008 Hey guys I have a little problem im trying to solve I was following a "PHP and MYSQL for dynamic websites" book but without success What i am trying to do is after xxxxx results are displayed users get a table like below: what i would like, is for them to be able to click the email and the default mail client opens up and creates new email to the user so i got this: ... ... $anymatches=mysql_num_rows($data); if ($anymatches == 0){ echo "Sorry, but we can not find an entry to match your query<br><br>"; } else{ echo "<table align='center' cellspacing='25' cellpadding='1'>"; echo "<tr> <td align='left'><b>First Name</b></td> <td align='left'><b>Last Name</b></td> <td align='left'><b>Contact</b></td> <td align='left'><b>Age</b></td> <td align='left'><b>Ethnicity</b></td></tr> "; while ($result = mysql_fetch_array($data)) { echo "<tr><td align='left'>" . $result['first_name'] . "</td> <td align='left'>" . $result['last_name'] . "</td> <td align='left'><a href="mailto: . $result['email'] .">" . $result['email'] ."</a></td> <td align='left'>" . $result['age'] . "</td> <td align='left'>" . $result['ethnicity'] . "</td> "; } echo "</table>"; } } now my problem is somewhere in: <td align='left'><a href="mailto: . $result['username'] .">" . $result['username'] ."</a></td> cause i keep getting a blank page whenever i do this may i please get some pointers or suggestion on how to do this correctly? thank you Link to comment https://forums.phpfreaks.com/topic/102944-solved-please-help-with-form-results-gt-email/ Share on other sites More sharing options...
dptr1988 Posted April 25, 2008 Share Posted April 25, 2008 should be this <td align='left'><a href='mailto:" . $result['username'] . "'>" . $result['username'] . "</a></td> You were using double quotes in the href attribute when you should of been using single quotes or backslashing your double quotes. Also you forgot the end quote for the href attribute Link to comment https://forums.phpfreaks.com/topic/102944-solved-please-help-with-form-results-gt-email/#findComment-527373 Share on other sites More sharing options...
xcali Posted April 25, 2008 Author Share Posted April 25, 2008 duh works like a charm thank you very much ! Link to comment https://forums.phpfreaks.com/topic/102944-solved-please-help-with-form-results-gt-email/#findComment-527374 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.