The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
Mailto and website link
Discuss Mailto and website link in the PHP Development forum on Dev Shed. Mailto and website link PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

March 12th, 2013, 01:20 PM
|
|
Registered User
|
|
Join Date: Mar 2013
Posts: 2
Time spent in forums: 1 h 37 m 11 sec
Reputation Power: 0
|
|
|
Mailto and website link
I am developing an online job portal in PHP for freelancer Translators where clients will post their jobs and translators will bid on these jobs. The problem is when the jobs are displayed on the website email addresses and website links do not show as hyperlink. I can make links on a static text, but, since the clients can enter their email ids and website link any where in the Job description area. I am unable to create mailto(opens outlook) and websites as links.
Below is the code for the page where clients will enter their Job description and other fields.
PHP Code:
<?php
ob_start();
session_start();
include("includes/dbconfig.php");
include("classes/user.class.php");
include("classes/postjob.class.php");
$db=new db();
$user1=new user();
$jobpost = new postjob();
$countrylist = $user1->getcountrylist();
asort($countrylist);
$catlist = $user1->cateogryList();
$langlist = $user1->getLanguageList();
$submatterlist = $user1->getSubMatterList();
$ureg = $user1->fethDataOfCurrUser($_SESSION['uid']);
//if($_SERVER['REQUEST_METHOD'] =='POST'){
if($_POST['save'] == 'Submit'){
$jobpost->setJPostValue($_POST,$_FILES);
//$insresult = $jobpost->insertPostJobValue();
$Job_id_last=$insresult;
/*Collect User to send mail*/
$ColectObj=new postjob(); // Object created
$MYMailUserData=$ColectObj->CheckNotificUser($_POST['txtSLang'],$_POST['txtTLang'],$_SESSION['uid'],2,3);
if(count($MYMailUserData['fre'])>=1) // Send to free
{
$F_obj=new user();
$emailarr = array();
foreach($MYMailUserData['fre'] as $f_agn){
$abc1=$F_obj->getEmailByUserId($f_agn);
$emailarr[]=$abc1;
}
$Edata1 = implode(",", $emailarr);
$jobpost->sendEmailJobNotification($Edata1,2,$Job_id_last);
}
if(count($MYMailUserData['agn'])>=1) // Send to agency
{
$E_obj=new user();
$emailarr1 = array();
foreach($MYMailUserData['agn'] as $E_agn){
$abc=$E_obj->getEmailByUserId($E_agn);
$emailarr1[]=$abc;
}
echo $Edata = implode(",", $emailarr1);
$jobpost->sendEmailJobNotification($Edata,3,$Job_id_last);
}
/*End collect user to send mail*/
if($insresult){
header("Location:post-job-thanks.php");
}
}
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Translators Globe</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="img/calendar.css">
<script type="text/javascript" src="js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
elements :"txtDescription",
theme : "advanced",
plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,medi a,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreakin g,xhtmlxtras,template,wordcount,advlist,autosave,autolink",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_buttons1: "bold,italic,underline,|,justifyleft,justifycenter,justifyright,|,forecolor,backcolor,|,bullist,numli st,|,hr,blockquote",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
});
<!-- /TinyMCE -->
</script>
<script language="javascript">
function validatePost()
{
if(document.getElementById('txtjobtitle').value.trim()==''){
alert("Please enter job title");
document.getElementById('txtjobtitle').focus();
return false;
}
if(document.getElementById('txtcateogry').value.trim()=='') {
alert("Please select a Job type");
document.getElementById('txtcateogry').focus();
return false;
}
if(document.getElementById('txtSLang1').value.trim()=='') {
alert("Please select a source language");
document.getElementById('txtSLang1').focus();
return false;
}
if(document.getElementById('txtTLang').value.trim()=='') {
alert("Please select a target language");
document.getElementById('txtTLang').focus();
return false;
}
if(document.getElementById('subjectmatter').value.trim()=='') {
alert("Please select Subject matter");
document.getElementById('subjectmatter').focus();
return false;
}
if(document.getElementById('txtdedquote_date').value.trim()=='') {
alert("Please set a quoting deadline");
document.getElementById('txtdedquote_date').focus();
return false;
}
if(document.getElementById('txtDescription').value.trim()=='') {
alert("Please enter job description");
document.getElementById('txtDescription').focus();
return false;
}
return true;
}
</script>
<script language="JavaScript" src="img/calendar_us.js"></script>
</head>
<body>
<div class="wrapper">
<div class="topHeader">
<div class="topLeftBanner"><img src="images/logo.png" /></div>
</div>
<div class=" menu_new">
<!-- <div id="menu">
<ul>
<li><a href="index.html" style="background-color:#FFA82A;"> Home </a></li>
<li><a href="post_job.html"> Post Job</a></li>
<li> <a href="find_job.html">Find Job</a></li>
<li><a href="translator.html"> Translator</a></li>
<li><a href="agencies.html">Agencies</a></li>
</ul>
</div>-->
<?php include("header.php")?>
</div>
</div>
<div class="container"></div><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="19%" valign="top"><div class="Left_panel">
<?php include("left.php")?>
</div></td>
<td width="1%"> </td>
<td width="80%" valign="top"><div class="right_panel">
<?php if($_SESSION['uid']!=''){
?>
<table width="950" cellspacing="0">
<thead>
<tr class="sectiontableheader">
<th width="21%" height="24" class="register_user"> </th>
<th width="36%"> </th>
<th width="11%"> </th>
<th width="18%"> </th>
<th width="14%"> </th>
</tr>
<tr >
<td valign="top"> </td>
<td valign="top"> </td>
<td valign="top"> </td>
<td valign="top"> </td>
<td valign="top"> </td>
</tr>
</thead>
<form enctype="multipart/form-data" id="rAuctionForm" name="rAuctionForm" method="post" onsubmit="return validatePost()">
<table width="100%" cellspacing="2" cellpadding="3" style="border:solid 1px #DDDDDD; border-top:none; " id="rbid_details">
<tbody>
<tr>
<td align="right"><label class="username">Job Poster</label></td>
<td class="auction_dbk_c"><?php echo ucfirst($ureg['first_name'].' '.$ureg['last_name']); ?></td>
</tr>
<tr>
<td align="right" class="auction_dbk_c"><label class="username">Job Title:</label>
<span style="color:#F00">*</span></td>
<td><input type="text" name="txtjobtitle" id="txtjobtitle" class="input_type" style="width:530px; height:25px;" /></td>
</tr>
<tr>
<td></td>
<td> (Example: "Brochure Translation, 1200 words, Trados", "Technical Translation") </td>
</tr>
<tr>
<td align="right"><label class="username">Job Type:</label>
<span style="color:#F00">*</span></td>
<td class="auction_dbk_c"><select class="input_type" id="txtcateogry" name="txtcateogry" style="width:auto;">
<option value="">--Select--</option>
<?php foreach($catlist as $values){ ?>
<option value="<?php echo $values['id']; ?>"><?php echo $values['cateogry_name']; ?></option>
<?php } ?>
</select></td>
</tr>
<tr>
<td align="right"><label class="username">Language:</label>
<span style="color:#F00">*</span></td>
<td><select class="input_type" id="txtSLang1" name="txtSLang" style="width:auto;">
<option value="">---Source Language---</option>
<?php foreach($langlist as $values) { ?>
<option value="<?php echo $values['id']?>"><?php echo $values['lang_name']?></option>
<?php } ?>
</select>
<select name="txtTLang" id="txtTLang" class="input_type" style="width:auto;">
<option value="">---Target Language---</option>
<?php foreach($langlist as $values){ ?>
<option value="<?php echo $values['id']; ?>"><?php echo $values['lang_name']; ?></option>
<?php } ?>
</select></td>
</tr>
<tr id="search_subjectmatter">
<td align="right"><label class="username"> Subject Matter:</label>
<span style="color:#F00">*</span></td>
<td><select class="input_type" id="subjectmatter" name="txtSubMatter" style="width:auto;">
<option selected="selected" value="">--Select--</option>
<?php foreach($submatterlist as $values) { ?>
<option value="<?php echo $values['id']; ?>"><?php echo $values['sub_matter_name']; ?></option>
<?php } ?>
</select></td>
</tr>
<tr id="search_software">
<td align="right"><label class="username">Required Software:</label></td>
<td><input type="text" value="" class="input_type" size="30" id="software" name="txtReqSoftware" />
<span>(Optional)</span></td>
</tr>
<tr id="search_catfld">
<td align="right"><label class="username">Required CAT Tool:</label></td>
<td><input type="text" value="" class="input_type" size="30" id="catfld" name="txtReqCTool" />
<span>(Optional)</span></td>
</tr>
<tr id="search_catfld">
<td align="right"><label class="username">Quoting Deadline:</label>
<span style="color:#F00">*</span></td>
<td><input name="txtdedquote_date" type="text" class="input_type" id="txtdedquote_date" />
<script language="JavaScript" type="text/javascript">
new tcal ({
// form name
'formname': 'rAuctionForm',
// input name
'controlname': 'txtdedquote_date'
});
</script></td>
</tr>
<tr>
<td align="right"><label class="username">Job description:</label>
<span style="color:#F00">*</span></td>
<td><textarea name="txtDescription" id="txtDescription" class="input_type" style="height:250px; width:450px;"></textarea></td>
<td> </td>
</tr>
<?php /*?><tr>
<td align="right" style="width:20%; height:30px" class="username"><b>Attachement: </b> <br>
<small style="color: #808080;">maximum file size 1024 kB</small> <br>
<small style="color: #808080;">Allowed attachement extensions: zip,rar,exe,txt</small></td>
<td class="auction_dbk"><input type="file" class="inputbox " name="txtAttachment"></td>
</tr><?php */?>
<tr>
<td align="center"></td>
<td align="left"><input type="submit" class="button validate" value="Submit" name="save" style=" margin-left:195px;" /></td>
</tr>
</tbody>
</table>
</form>
</table>
<?php } ?>
<?php if ($_SESSION['uid']=='') {?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4%"> </td>
<td width="1%"> </td>
<td width="95%"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td class="login">Home > Post Job</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr> You must be logged in to post a job. </tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<?php } ?>
</div></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table>
<?php include("footer.php") ?>
</div>
</body>
</html>
below is the code which will display this job
PHP Code:
<?php
ob_start();
session_start();
include("includes/dbconfig.php");
include("classes/user.class.php");
include("classes/postjob.class.php");
$db=new db();
$user1=new user();
$jobpost = new postjob();
$result = @$jobpost->getPostJobList();
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Translators Globe</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="img/calendar.css">
</head>
<script language="javascript">
function PopupWindowCenter(URL, title,w,h)
{var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var newWin = window.open (URL, title, 'toolbar=no, location=no,directories=no, status=no, menubar=no, scrollbars=no, resizable=no,copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
function ViewBid(URL, title,w,h)
{var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var newWin = window.open (URL, title, 'toolbar=no, location=no,directories=no, status=no, menubar=no, scrollbars=no, resizable=no,copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
</script>
<script language="JavaScript" src="img/calendar_us.js">
</script>
<body>
<div class="wrapper">
<div class="topHeader">
<div class="topLeftBanner"><img src="images/logo.png" /></div>
</div>
<div class=" menu_new">
<!-- <div id="menu">
<ul>
<li><a href="index.html" style="background-color:#FFA82A;"> Home </a></li>
<li><a href="post_job.html"> Post Job</a></li>
<li> <a href="find_job.html">Find Job</a></li>
<li><a href="translator.html"> Translator</a></li>
<li><a href="agencies.html">Agencies</a></li>
</ul>
</div>-->
<?php include("header.php")?>
</div>
</div>
<div class="container"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%" valign="top"><div class="Left_panel">
<?php include("left.php")?>
</div></td>
<td width="1%"> </td>
<td width="79%" valign="top"><div class="right_panel">
<table width="950" border="0" cellspacing="0" cellpadding="0">
<?php
$upid = $_GET['posid'];
$jplist = $jobpost->getCurrPostJobDetails($upid);
$cnt = $jobpost->getCountNofBids($upid);
/* echo "<pre>";
print_r($cnt);
echo "</pre>";
*/
$ureg = $user1->fethDataOfCurrUser($upid);
?>
<tr>
<td width="1%"> </td>
<td width="1%"> </td>
<td width="98%" align="right" valign="top" class="register_user_name"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left"> </td>
<td> </td>
<td> </td>
<td align="left"> </td>
<td align="left"></td>
<td align="left" class="register_user_new"> </td>
</tr>
<tr>
<td width="10" align="left"> </td>
<?php if($_SESSION['uid']!= '' && $jobpost->getCurJPostId($upid)== true && $jobpost->CheckCurDateStatus($upid)== true) {?>
<td width="120"><a href="post-job-edit.php?posid=<?php echo $jplist['id']; ?>" class="submit_bottone" style="text-decoration:none"> Edit this Job</a></td>
<td width="120"><a href="close-job.php?posid=<?php echo $jplist['id']; ?>" class="submit_bottone" style="text-decoration:none" onclick="return confirm('Are you sure you want to Close this job?')">Close this Job</a></td>
<td width="98" align="left"></td>
<?php } ?>
<td width="13" align="left"> </td>
<td width="98" align="left"></td>
<td width="400" align="left" class="register_user_new"><?php echo $jplist['who_can_aapply']; ?></td>
</tr>
<tr>
<td align="left"> </td>
<td> </td>
<td> </td>
<td align="left"></td>
<td align="left"> </td>
<td align="left"></td>
<td align="left" class="register_user_new"> </td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
</tr>
<tr>
<td height="306" valign="top"><table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="#F1F1F1" class="box1"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="22" align="center" class="new_design_text"><strong class="login1"><?php echo $jplist['job_title']; ?></strong></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="28%" height="198" valign="top" class="box"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><label class="register_user_new">Posted By:</label>
<span class="new_design"> <a href="user-details-listing.php?uid=<?php echo $jplist['user_id']?>" style="text-decoration:none">
<?php $un = $jplist['user_id']; echo ucfirst($user1->getNameById($un)); ?>
</a></span></td>
</tr>
<tr>
<td><label class="register_user"><span class="register_user_new">Category:</span></label>
<span class="new_design"><?php echo $jobpost->getCateogryNameById($jplist['cateogry']); ?></span></td>
</tr>
<tr>
<td class="register_user_new">Language: <span class="new_design"><?php echo $jobpost->getLanguageNameById($jplist['language']); ?>><?php echo $jobpost->getLanguageNameById($jplist['tar_language']); ?></td>
</tr>
<tr>
<td><b class="register_user_new">Subject Matter:</b> <span class="new_design"> <?php echo $user1->getSubMatNameById($jplist['sub_matters']); ?></span></td>
</tr>
<tr>
<td><b class="register_user_new">Software: <span class="new_design"><?php echo $jplist['req_soft']; ?></span></b></td>
</tr>
<tr>
<td><b class="register_user_new">CAT Tool: <span class="new_design"><?php echo $jplist['req_tool']; ?></span></b></td>
</tr>
</table></td>
<td align="center" valign="top" class="box" width="380px"><div align="left" style="width:380px;overflow:visible;" class=" new_text"> <?php echo $jplist['description']; ?></div></td>
<td width="26%" valign="top" class="box"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><span class="register_user_new">Start date:</span> <span class="new_design"><?php echo date("M d, Y", strtotime($jplist['start_date'])); ?></span></td>
</tr>
<tr>
<td><label class="register_user_new">Quoting deadline:</label>
<span class="new_design"><?php echo date("M d, Y", strtotime($jplist['end_date'])); ?></span></td>
</tr>
<tr>
<?php foreach($cnt as $val) { ?>
<td><span class="register_user_new">No. of bidders: <?php echo $val['by_bid_user_id'];?></span>
<?php } ?>
<?php if($_SESSION['uid']!= '' && $jobpost->getCurJPostId($upid)) { ?>
<span class="new_design"> <a href="javascript:void(0);" onclick="ViewBid('view-bids.php?bid=<?php echo $jplist['id'];?>','ViewBid',800,650)" class="forget">View Bidder(s)</a></span>
<?php } ?></td>
<td></td>
</tr>
<!-- <tr>
<td><span class="register_user_new">Hits:</span> <span class="new_design">40</span></td>
</tr>
<tr>
-->
<tr>
<td> </td>
</tr>
</table></td>
<td width="2%"> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<?php if($jobpost->getCurJPostId($upid)== false && $jobpost->CheckCurDateStatus($upid)== true) {?>
<td><?php if($_SESSION['uid']!='') { ?>
<a href="javascript:void(0);" onclick="PopupWindowCenter('send-bids.php?upid=<?php echo $jplist['user_id']?>&posid=<?php echo $jplist['id']; ?>','PopupWindowCenter',700,600);" class="submit_bottone" style="text-decoration:none">Send Bid</a>
<?php } ?></td>
<?php } ?>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</div></td>
</tr>
</table>
</div><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<?php include("footer.php") ?>
</div>
</body>
</html>
|

March 12th, 2013, 01:23 PM
|
 |
Likely to be eaten by a grue.
|
|
Join Date: Oct 2006
Location: Pennsylvania, USA
|
|
|
In order to have properly formatted code, paste your code into the large white box, then highlight it, THEN click the white {php} button. If you click the button first your code ends up all on one line, as you see here.
__________________
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
|

March 12th, 2013, 02:11 PM
|
|
Registered User
|
|
Join Date: Mar 2013
Posts: 2
Time spent in forums: 1 h 37 m 11 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by ManiacDan In order to have properly formatted code, paste your code into the large white box, then highlight it, THEN click the white {php} button. If you click the button first your code ends up all on one line, as you see here. |
it does not allow me to edit the post. it says "We are sorry, new user accounts are not permitted to create posts containing URLs." I am just trying to do what you told me.
|

March 12th, 2013, 02:45 PM
|
 |
Likely to be eaten by a grue.
|
|
Join Date: Oct 2006
Location: Pennsylvania, USA
|
|
|
Remove the URLs (in your XML doctype declarations) from the post and just post it as a reply or edit. You're running up against an antiquated anti-spam tool.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|