473,320 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1991
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

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

Similar topics

0
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ...
6
by: bojanraic | last post by:
Hi! I recently started playing with Python CGI, and I was happy that my basic input-name--print-hello-name CGI form example worked, so I thought I should advance to somew\hat more complicated...
4
by: dmiller23462 | last post by:
So here's my problem.....I need to set up different email distributions based on which option in the following Select form has been chosen....For instance if "Putaway" is chosen it needs to email...
88
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
4
by: web_design | last post by:
I put this together from some other scripts I am using on a site. I'm trying to make a better email hiding script. It isn't working. Also, it causes Internet Explorer 6 SP2 to block the script...
2
by: danielboendergaard | last post by:
Hey Im making a homepage in php. I use a html form to put data into mysql and i want to make some buttons which inserts user input values into a textarea. I have used a button like this: <input...
8
by: stirrell | last post by:
Hello, One problem that I had been having is stopping email injections on contact forms. I did some research, read up on it and felt like I had created a working solution. I hadn't gotten any...
8
by: cutlass | last post by:
Need you assistance to anyone who is willing to offer. I have been working on this script and can't get it to work. The issue I'm having is the statement: function validateSender($Address)...
1
by: creative1 | last post by:
When I test the application I get follwowing error: could not connect to smtp host: connection timeout error can someone please check if I have rigth settings? Where I am wrong here Is IP and...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.