469,601 Members | 2,309 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,601 developers. It's quick & easy.

Putting an email address in a textarea

hai
iam new php.
i am creating admin side. i wrote this,
phpcode:
Expand|Select|Wrap|Line Numbers
  1. <?php //include_once("config.php");
  2. $con=mysql_connect("localhost","root","");
  3.  mysql_select_db("happysalary");
  4.  ?>
  5.  
  6.  
  7.  
  8. <div class="menubar">
  9.       <table class="pathway_toolbar white">
  10.         <tbody><tr>
  11.          <td class="mod_pathway"><div class="pathway">
  12.          <a href="home.php"><strong>HappySalary.com</strong></a>Freshers</div></td>
  13.           <td class="mod_toolbar" align="right">
  14.           <?php $fun=$_REQUEST['fun'];
  15.           if($fun=="send")
  16.           {
  17.           ?></td></tr></tbody></table>
  18.           <table class="adminform">
  19.  
  20.           <tbody><tr>
  21.           <th width="20" colspan="3">Send New Fresher Jobs</th>
  22.  
  23.             </tr>
  24.             <form name="fresher" method="post" enctype="multipart/form-data">
  25.  
  26.  
  27.             <tr>
  28.             <td>Header :</td> <td><input name="header" type="text" value="<? echo $header;?>" size="81"></td><td width="650">&nbsp;</td></tr>
  29.             <tr><td>JobLinks :</td> 
  30.               <td>
  31.                   <textarea name="textarea" cols="78" rows="15"></textarea>
  32.  
  33.               </td>
  34.             </tr>
  35.             <tr><td ><input type="submit" name="send" value="Send" class="enter" ></td></tr>
  36.             </form>
  37.             </tbody>
  38.   </table>
  39.  
  40.              <?php
  41.              if($_POST['send'])
  42.             {
  43.               $headers=$_POST['header'];
  44.               $subject=$_POST['textarea'];
  45.  
  46.               $email=$_REQUEST['email'];
  47.                 $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";  
  48.  
  49.                 $headers .= "\nMIME-Version: 1.0\n" .  
  50.                     "Content-Type: multipart/mixed;\n" .  
  51.                     " boundary=\"{$mime_boundary}\"";  
  52.  
  53.                 $message .= "This is a multi-part message in MIME format.\n\n" .  
  54.                             "--{$mime_boundary}\n" .  
  55.                             "Content-Type:text/html; charset=\"iso-8859-1\"\n" .  
  56.                                "Content-Transfer-Encoding: 7bit\n\n" ;  
  57.  
  58.  
  59.                 if(!mail($email,$subject,$message,$headers))
  60.                 {
  61.                      die ("".EMAIL_DIE."");
  62.                   }
  63.  
  64.                 mysql_query($sql) or die(mysql_error());
  65.                 }    
  66.  
  67.           }else{   
  68.           $sql="select * from register";
  69.             $result=mysql_query($sql);
  70.             $i=mysql_num_rows($result);
  71.           ?>
  72.  
  73.           <table id="toolbar" border="0" cellpadding="0" cellspacing="0">
  74.         <tbody><tr align="center" valign="middle">
  75.         <td>&nbsp;</td>
  76.         <td><a class="toolbar" href="home.php?option=fresher&fun=send">
  77.         <img src="/administrator/images/massemail.png" alt="New" name="new" title="New" align="middle" border="0">    <br>SendJobs</a>
  78.         </td></tr></tbody></table></td>
  79.  
  80.  
  81.           </td>
  82.  
  83.         </tr>
  84.       </tbody></table>
  85.       <div class="clr"></div>
  86. </div>
  87.    <div id="inner" align="center">
  88.  
  89. <table class="adminlist">
  90.         <tbody>
  91.         <tr>
  92.          <form name="adminForm"  >
  93.              <th width="20">#</th>
  94.             <th width="20">
  95.             <input name="toggle" onClick="checkAll(<?php echo $i;?>);" type="checkbox">
  96.           </th>
  97.             <th width="20%" class="title">
  98.             UserName            </th>
  99.             <th nowrap="nowrap" width="20%">
  100.             Email id            </th>
  101.             <th nowrap="nowrap" width="20%">
  102.             Key Skills            </th> 
  103.             <th nowrap="nowrap" width="20%"> 
  104.             Experience (years)         </th> 
  105.             <th nowrap="nowrap">
  106.             Date of Registered </th>        
  107.  
  108.  
  109.  
  110.  
  111.           <? 
  112.             $pageLimit = 15;
  113.             $noPages = ceil($i / $pageLimit);
  114.             $currentPage = 0;
  115.             if(isset($_GET['pag']) && is_numeric($_GET['pag']) && $_GET['pag'] > 0 && $_GET['pag'] < $noPages)
  116.             {
  117.             $currentPage = $_GET['pag'];
  118.             }
  119.             $start = $currentPage * $pageLimit;
  120.              $val=0;
  121.             $sql="select * from register where years='$val' LIMIT ".$start.",".$pageLimit;
  122.  
  123.             $result=mysql_query($sql) or die("error");
  124.             $a=0;
  125.             while($list=mysql_fetch_array($result))
  126.             {
  127.             $a=$a+1;
  128.             ?>
  129.             <tr class="row0" height="30">
  130.             <td align="right"><?php echo $a ?></td>
  131.             <td><input id="cb<? echo $a;?>" name="cid[]" value="<? echo $list['username'];?>" onClick="isChecked(this.checked);" type="checkbox"></td>
  132.             <td>            
  133.             <?php echo $list['username'];?>
  134.             </td>
  135.             <td align="center">
  136.             <?php echo $list['email'];?>
  137.             </td>
  138.             <td align="center">
  139.             <?php echo $list['keyskills'];?>
  140.             </td>
  141.             <td  align="center">
  142.             <?php echo $list['years'];?>
  143.             </td>
  144.             <td align="center">
  145.             <?php echo $list['registerdate'];?>
  146.             </td>
  147.             </tr>
  148.             <?php  } ?>
  149.             <?php $a=$a+1; } ?>
  150.             <input name="checkedid" type="hidden">
  151.             <input name="boxchecked" type="hidden">
  152.             <? 
  153.             echo "<tr align=\"center\"> <th align=\"center\" colspan=\"8\">Pages "; 
  154.             for($b = 0; $b < $noPages; $b++){
  155.             if($currentPage == $b){ 
  156.              echo($b+1);
  157.              }else{
  158.              echo '<a href="'.$_SERVER['PHP_SELF'].'?option=fresher&pag='.$b.'">'.($b+1).'</a>';
  159.              }
  160.              if($b < $noPages - 1){
  161.               echo '-';
  162.  
  163.               }
  164.               }
  165.             echo "</th></tr>";
  166.             ?>
  167.  
  168.  
  169.             </form>
  170.             <?php
  171.  
  172.  
  173.  mysql_connect("localhost","root","");
  174. mysql_select_db("happysalary");
  175. $result=mysql_query("select * from register");
  176. //echo $email;
  177. //$result=mysql_query("select title,heading,content,date,id from news order by date ASC limit 0,20");
  178. while($list=mysql_fetch_array($result))
  179.   ?>
  180. <a class="blacktext10" href="administrator/home.php?option=fresher&fun=send?id=<?php echo $list['id'];?>"><br /><? echo $list['email'];?></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  181. <?php
  182.  
  183.  
  184.     //$date=$_REQUEST['date'];
  185.  mysql_connect("localhost","root","");
  186. mysql_select_db("happysalary");
  187. $id1=$_REQUEST['id'];
  188. $result=mysql_query("select email from register where id='$id1'");
  189. //echo $result;
  190. while($list=mysql_fetch_array($result))
  191. {?>
  192.  
  193.                        <? echo $list['email'];?>
  194.  
  195.  
  196.  
  197.     <? 
  198.     }
  199. ?><a href="administrator/home.php?option=fresher?id=<? echo $list['id'];?>"><br /><table><tr><td><? echo $list['email'];?></a></td></tr></table>
  200.  
  201.  
  202.  
  203.  
  204.      </tbody>
  205. </table>
[Please use CODE tags when posting source code. Thanks! --pbmods]

actually i want joblinks(textarea) is there know,i want email displayed on textarea(samepage is there in code)
so please post the php code for how to emails to same page.[REMOVED. --pbmods]
Jun 26 '07 #1
1 1789
pbmods
5,821 Expert 4TB
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.
Jun 26 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by James Hong | last post: by
6 posts views Thread by bojanraic | last post: by
88 posts views Thread by Mike | last post: by
4 posts views Thread by web_design | last post: by
2 posts views Thread by danielboendergaard | last post: by
8 posts views Thread by stirrell | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.