iam new php.
i am creating admin side. i wrote this,
phpcode:
Expand|Select|Wrap|Line Numbers
- <?php //include_once("config.php");
- $con=mysql_connect("localhost","root","");
- mysql_select_db("happysalary");
- ?>
- <div class="menubar">
- <table class="pathway_toolbar white">
- <tbody><tr>
- <td class="mod_pathway"><div class="pathway">
- <a href="home.php"><strong>HappySalary.com</strong></a>Freshers</div></td>
- <td class="mod_toolbar" align="right">
- <?php $fun=$_REQUEST['fun'];
- if($fun=="send")
- {
- ?></td></tr></tbody></table>
- <table class="adminform">
- <tbody><tr>
- <th width="20" colspan="3">Send New Fresher Jobs</th>
- </tr>
- <form name="fresher" method="post" enctype="multipart/form-data">
- <tr>
- <td>Header :</td> <td><input name="header" type="text" value="<? echo $header;?>" size="81"></td><td width="650"> </td></tr>
- <tr><td>JobLinks :</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=$_REQUEST['email'];
- $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
- $headers .= "\nMIME-Version: 1.0\n" .
- "Content-Type: multipart/mixed;\n" .
- " boundary=\"{$mime_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,$message,$headers))
- {
- die ("".EMAIL_DIE."");
- }
- mysql_query($sql) or die(mysql_error());
- }
- }else{
- $sql="select * from register";
- $result=mysql_query($sql);
- $i=mysql_num_rows($result);
- ?>
- <table id="toolbar" border="0" cellpadding="0" cellspacing="0">
- <tbody><tr align="center" valign="middle">
- <td> </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="adminlist">
- <tbody>
- <tr>
- <form name="adminForm" >
- <th width="20">#</th>
- <th width="20">
- <input name="toggle" onClick="checkAll(<?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($_GET['pag']) && $_GET['pag'] > 0 && $_GET['pag'] < $noPages)
- {
- $currentPage = $_GET['pag'];
- }
- $start = $currentPage * $pageLimit;
- $val=0;
- $sql="select * from register where years='$val' LIMIT ".$start.",".$pageLimit;
- $result=mysql_query($sql) or die("error");
- $a=0;
- while($list=mysql_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="isChecked(this.checked);" 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="boxchecked" type="hidden">
- <?
- echo "<tr align=\"center\"> <th align=\"center\" colspan=\"8\">Pages ";
- for($b = 0; $b < $noPages; $b++){
- if($currentPage == $b){
- echo($b+1);
- }else{
- echo '<a href="'.$_SERVER['PHP_SELF'].'?option=fresher&pag='.$b.'">'.($b+1).'</a>';
- }
- if($b < $noPages - 1){
- echo '-';
- }
- }
- echo "</th></tr>";
- ?>
- </form>
- <?php
- mysql_connect("localhost","root","");
- mysql_select_db("happysalary");
- $result=mysql_query("select * from register");
- //echo $email;
- //$result=mysql_query("select title,heading,content,date,id from news order by date ASC limit 0,20");
- while($list=mysql_fetch_array($result))
- ?>
- <a class="blacktext10" href="administrator/home.php?option=fresher&fun=send?id=<?php echo $list['id'];?>"><br /><? echo $list['email'];?></a>
- <?php
- //$date=$_REQUEST['date'];
- mysql_connect("localhost","root","");
- mysql_select_db("happysalary");
- $id1=$_REQUEST['id'];
- $result=mysql_query("select email from register where id='$id1'");
- //echo $result;
- while($list=mysql_fetch_array($result))
- {?>
- <? echo $list['email'];?>
- <?
- }
- ?><a href="administrator/home.php?option=fresher?id=<? echo $list['id'];?>"><br /><table><tr><td><? echo $list['email'];?></a></td></tr></table>
- </tbody>
- </table>
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]