473,791 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Putting an email address in a textarea

3 New Member
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(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]
Jun 26 '07 #1
1 2023
pbmods
5,821 Recognized Expert Expert
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
9876
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 ********************************** package Celcom.Client;
6
5401
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 scripts. I'm trying to write a basic Python email CGI script to send email through HTML email form. I've seen a lot of examples out there, but nothing I tried so far seemed to work. So I would like to know what I am doing wrong.
4
3020
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 User1@here.whatever and User4@here.whatever but if "Loaded" is chosen it needs to email User2@here.whatever and User3@here.whatever, etc, etc... I'm aware that the only thing that really needs to change is the "Mail.AddAddress" line (at least...
88
12563
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
5191
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 as "active content". :( The idea is that if the user doesn't have JavaScript enabled, they will see an image of the email address (that can't be read by email harvesting programs). If JavaScript is enabled, the image will be hidden and the...
2
9670
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 type="button" value="Add Quote" onclick="document.getElementById('nyhed').value+=''"> The button works fine and insterts into the textarea. Although I want to make a button which onclick asks the user for a
8
3881
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 suspicious bouncebacks in quite some time and got many custom alerts I had set up for notifying me of injection attempts. However, just the other day, I got a bounceback from an AOL address which leads me to believe that an injection attempt was...
8
1939
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) { if (strpos($Address, '@') !== FALSE && strpos($Address, '.') !== FALSE) { return true; } else if (validateSender($_GET) == false) {
1
1793
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 mail host setting ok or not? Contactus.jsp <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN//"> <html>
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5430
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.