Putting an email address in a textarea

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nagamalli26
    New Member
    • Jun 2007
    • 3

    Putting an email address in a textarea

    hai
    iam new php.
    i am creating admin side. i wrote this,
    phpcode:
    [code=php]
    <?php //include_once("c onfig.php");
    $con=mysql_conn ect("localhost" ,"root","");
    mysql_select_db ("happysalary") ;
    ?>



    <div class="menubar" >
    <table class="pathway_ toolbar white">
    <tbody><tr>
    <td class="mod_path way"><div class="pathway" >
    <a href="home.php" ><strong>HappyS alary.com</strong></a>Freshers</div></td>
    <td class="mod_tool bar" align="right">
    <?php $fun=$_REQUEST['fun'];
    if($fun=="send" )
    {
    ?></td></tr></tbody></table>
    <table class="adminfor m">

    <tbody><tr>
    <th width="20" colspan="3">Sen d New Fresher Jobs</th>

    </tr>
    <form name="fresher" method="post" enctype="multip art/form-data">


    <tr>
    <td>Header :</td> <td><input name="header" type="text" value="<? echo $header;?>" size="81"></td><td width="650">&nb sp;</td></tr>
    <tr><td>JobLink s :</td>
    <td>
    <textarea name="textarea" cols="78" rows="15"></textarea>

    </td>
    </tr>
    <tr><td ><input type="submit" name="send" value="Send" class="enter" ></td></tr>
    </form>
    </tbody>
    </table>

    <?php
    if($_POST['send'])
    {
    $headers=$_POST['header'];
    $subject=$_POST['textarea'];

    $email=$_REQUES T['email'];
    $mime_boundary = "==Multipart_Bo undary_x{$semi_ rand}x";

    $headers .= "\nMIME-Version: 1.0\n" .
    "Content-Type: multipart/mixed;\n" .
    " boundary=\"{$mi me_boundary}\"" ;

    $message .= "This is a multi-part message in MIME format.\n\n" .
    "--{$mime_boundary }\n" .
    "Content-Type:text/html; charset=\"iso-8859-1\"\n" .
    "Content-Transfer-Encoding: 7bit\n\n" ;


    if(!mail($email ,$subject,$mess age,$headers))
    {
    die ("".EMAIL_DIE." ");
    }

    mysql_query($sq l) or die(mysql_error ());
    }

    }else{
    $sql="select * from register";
    $result=mysql_q uery($sql);
    $i=mysql_num_ro ws($result);
    ?>

    <table id="toolbar" border="0" cellpadding="0" cellspacing="0" >
    <tbody><tr align="center" valign="middle" >
    <td>&nbsp;</td>
    <td><a class="toolbar" href="home.php? option=fresher& fun=send">
    <img src="/administrator/images/massemail.png" alt="New" name="new" title="New" align="middle" border="0"> <br>SendJobs</a>
    </td></tr></tbody></table></td>


    </td>

    </tr>
    </tbody></table>
    <div class="clr"></div>
    </div>
    <div id="inner" align="center">

    <table class="adminlis t">
    <tbody>
    <tr>
    <form name="adminForm " >
    <th width="20">#</th>
    <th width="20">
    <input name="toggle" onClick="checkA ll(<?php echo $i;?>);" type="checkbox" >
    </th>
    <th width="20%" class="title">
    UserName </th>
    <th nowrap="nowrap" width="20%">
    Email id </th>
    <th nowrap="nowrap" width="20%">
    Key Skills </th>
    <th nowrap="nowrap" width="20%">
    Experience (years) </th>
    <th nowrap="nowrap" >
    Date of Registered </th>




    <?
    $pageLimit = 15;
    $noPages = ceil($i / $pageLimit);
    $currentPage = 0;
    if(isset($_GET['pag']) && is_numeric($_GE T['pag']) && $_GET['pag'] > 0 && $_GET['pag'] < $noPages)
    {
    $currentPage = $_GET['pag'];
    }
    $start = $currentPage * $pageLimit;
    $val=0;
    $sql="select * from register where years='$val' LIMIT ".$start.",".$p ageLimit;

    $result=mysql_q uery($sql) or die("error");
    $a=0;
    while($list=mys ql_fetch_array( $result))
    {
    $a=$a+1;
    ?>
    <tr class="row0" height="30">
    <td align="right">< ?php echo $a ?></td>
    <td><input id="cb<? echo $a;?>" name="cid[]" value="<? echo $list['username'];?>" onClick="isChec ked(this.checke d);" type="checkbox" ></td>
    <td>
    <?php echo $list['username'];?>
    </td>
    <td align="center">
    <?php echo $list['email'];?>
    </td>
    <td align="center">
    <?php echo $list['keyskills'];?>
    </td>
    <td align="center">
    <?php echo $list['years'];?>
    </td>
    <td align="center">
    <?php echo $list['registerdate'];?>
    </td>
    </tr>
    <?php } ?>
    <?php $a=$a+1; } ?>
    <input name="checkedid " type="hidden">
    <input name="boxchecke d" type="hidden">
    <?
    echo "<tr align=\"center\ "> <th align=\"center\ " colspan=\"8\">P ages ";
    for($b = 0; $b < $noPages; $b++){
    if($currentPage == $b){
    echo($b+1);
    }else{
    echo '<a href="'.$_SERVE R['PHP_SELF'].'?option=fresh er&pag='.$b.'"> '.($b+1).'</a>';
    }
    if($b < $noPages - 1){
    echo '-';

    }
    }
    echo "</th></tr>";
    ?>


    </form>
    <?php


    mysql_connect(" localhost","roo t","");
    mysql_select_db ("happysalary") ;
    $result=mysql_q uery("select * from register");
    //echo $email;
    //$result=mysql_q uery("select title,heading,c ontent,date,id from news order by date ASC limit 0,20");
    while($list=mys ql_fetch_array( $result))
    ?>
    <a class="blacktex t10" href="administr ator/home.php?option =fresher&fun=se nd?id=<?php echo $list['id'];?>"><br /><? echo $list['email'];?></a>&nbsp;&nbsp;& nbsp;&nbsp;&nbs p;
    <?php


    //$date=$_REQUEST['date'];
    mysql_connect(" localhost","roo t","");
    mysql_select_db ("happysalary") ;
    $id1=$_REQUEST['id'];
    $result=mysql_q uery("select email from register where id='$id1'");
    //echo $result;
    while($list=mys ql_fetch_array( $result))
    {?>

    <? echo $list['email'];?>



    <?
    }
    ?><a href="administr ator/home.php?option =fresher?id=<? echo $list['id'];?>"><br /><table><tr><td ><? echo $list['email'];?></a></td></tr></table>




    </tbody>
    </table>[/code]

    [Please use CODE tags when posting source code. Thanks! --pbmods]

    actually i want joblinks(textar ea) is there know,i want email displayed on textarea(samepa ge is there in code)
    so please post the php code for how to emails to same page.[REMOVED. --pbmods]
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, nagamalli26.

    I award 2 points for creative use of phpcode. Unfortunately, I have to deduct 2 points for not using [CODE] tags, and I have to deduct an additional 14 points for specifying 'hi' as the title of your thread.

    Better luck next time.

    Also, please do not ask people to email or PM the solutions to you; that is not what TheScripts is all about. By posting solutions to the forum for everyone to see, we help build the *community* that brings developers together to share knowledge and experience.

    Comment

    Working...