I have the following view (home_view.php)
<?php $this->load->helper('url');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>diluks eCommerce - Home</title>
<link href="<?php echo base_url();?>Public/scripts/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form action="<?php echo base_url();?>index.php/welcome_controller" method="post">
<div class="container">
<?php
$userpermission = $this->session->userdata('userpermission');
if($userpermission==1){
include 'header-admin.php';
}
else if($userpermission==2){
include 'header-user.php';
}
else{
include 'header-guest.php';}
?>
<div class="level3 clearfix">
<?php include 'shopping-sidebar.php'; ?>
<div class="body-content">
<div class="image-slider">
<img src="<?php echo base_url();?>Public/img/main-img.png" width="785" height="220" />
</div>
<div class="seperate-space">
<div class="separate-title"><a class="bold-captions">Latest Picks</a>
</div>
</div>
<div class="items">
<div class="item-holder">
<table align="center" width="256px" cellpadding="0px" cellspacing="0px">
<tr>
<td class="item-info" align="center" height="34px">Item name</td>
</tr>
<tr>
<td class="item-info" align="center" height="230px">
<img src="<?php echo base_url();?>Public/img/sunflowers.png" width="256" height="230" />
</td>
</tr>
<tr>
<td class="item-info" align="center" height="34px">$30</td>
</tr>
<tr>
<td class="item-info" align="center" height="35px"><input name="btn_read" class="readbtn" value="Read More" /></td>
</tr>
</table>
</div>
<div class="item-holder">
<table align="center" width="256px" cellpadding="0px" cellspacing="0px">
<tr>
<td class="item-info" align="center" height="34px">Item name</td>
</tr>
<tr>
<td class="item-info" align="center" height="230px">
<img src="<?php echo base_url();?>Public/img/treecard.png" width="256" height="230" />
</td>
</tr>
<tr>
<td class="item-info" align="center" height="34px">$30</td>
</tr>
<tr>
<td class="item-info" align="center" height="35px"><input name="btn_read" class="readbtn" value="Read More" /></td>
</tr>
</table>
</div>
<div class="item-holder">
<table align="center" width="256px" cellpadding="0px" cellspacing="0px">
<tr>
<td class="item-info" align="center" height="34px">Item name</td>
</tr>
<tr>
<td class="item-info" align="center" height="230px">
<img src="<?php echo base_url();?>Public/img/3-flowers.png" width="256" height="230" />
</td>
</tr>
<tr>
<td class="item-info" align="center" height="34px">$30</td>
</tr>
<tr>
<td class="item-info" align="center" height="35px"><input name="btn_read" class="readbtn" value="Read More" /></td>
</tr>
</table>
</div>
<div class="item-holder">
<table align="center" width="256px" cellpadding="0px" cellspacing="0px">
<tr>
<td class="item-info" align="center" height="34px">Item name</td>
</tr>
<tr>
<td class="item-info" align="center" height="230px">
<img src="<?php echo base_url();?>Public/img/sunflowers.png" width="256" height="230" />
</td>
</tr>
<tr>
<td class="item-info" align="center" height="34px">$30</td>
</tr>
<tr>
<td class="item-info" align="center" height="35px"><input name="btn_read" class="readbtn" value="Read More" /></td>
</tr>
</table>
</div>
<div class="item-holder">
<table align="center" width="256px" cellpadding="0px" cellspacing="0px">
<tr>
<td class="item-info" align="center" height="34px">Item name</td>
</tr>
<tr>
<td class="item-info" align="center" height="230px">
<img src="<?php echo base_url();?>Public/img/treecard.png" width="256" height="230" />
</td>
</tr>
<tr>
<td class="item-info" align="center" height="34px">$30</td>
</tr>
<tr>
<td class="item-info" align="center" height="35px"><input name="btn_read" class="readbtn" value="Read More" /></td>
</tr>
</table>
</div>
<div class="item-holder">
<table align="center" width="256px" cellpadding="0px" cellspacing="0px">
<tr>
<td class="item-info" align="center" height="34px">Item name</td>
</tr>
<tr>
<td class="item-info" align="center" height="230px">
<img src="<?php echo base_url();?>Public/img/3-flowers.png" width="256" height="230" />
</td>
</tr>
<tr>
<td class="item-info" align="center" height="34px">$30</td>
</tr>
<tr>
<td class="item-info" align="center" height="35px"><input name="btn_read" class="readbtn" value="Read More" /></td>
</tr>
</table>
</div>
<div class="item-holder">
<table align="center" width="256px" cellpadding="0px" cellspacing="0px">
<tr>
<td class="item-info" align="center" height="34px">Item name</td>
</tr>
<tr>
<td class="item-info" align="center" height="230px">
<img src="<?php echo base_url();?>Public/img/sunflowers.png" width="256" height="230" />
</td>
</tr>
<tr>
<td class="item-info" align="center" height="34px">$30</td>
</tr>
<tr>
<td class="item-info" align="center" height="35px"><input name="btn_read" class="readbtn" value="Read More" /></td>
</tr>
</table>
</div>
<div class="item-holder">
<table align="center" width="256px" cellpadding="0px" cellspacing="0px">
<tr>
<td class="item-info" align="center" height="34px">Item name</td>
</tr>
<tr>
<td class="item-info" align="center" height="230px">
<img src="<?php echo base_url();?>Public/img/treecard.png" width="256" height="230" />
</td>
</tr>
<tr>
<td class="item-info" align="center" height="34px">$30</td>
</tr>
<tr>
<td class="item-info" align="center" height="35px"><input name="btn_read" class="readbtn" value="Read More" /></td>
</tr>
</table>
</div>
<div class="item-holder">
<table align="center" width="256px" cellpadding="0px" cellspacing="0px">
<tr>
<td class="item-info" align="center" height="34px">Item name</td>
</tr>
<tr>
<td class="item-info" align="center" height="230px">
<img src="<?php echo base_url();?>Public/img/3-flowers.png" width="256" height="230" />
</td>
</tr>
<tr>
<td class="item-info" align="center" height="34px">$30</td>
</tr>
<tr>
<td class="item-info" align="center" height="35px"><input name="btn_read" class="readbtn" value="Read More" /></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div style="clear:both"></div>
<div class="level4">
<div class="footer-area">
<div class="lined-space"></div>
<div class="site-map" align="left">
<table>
<tr>
<td class="footer-text">About Us</td>
<td class="footer-text">Facebook</td>
</tr>
<tr>
<td class="footer-text">Contact Us</td>
<td class="footer-text">Twitter</td>
</tr>
<tr>
<td class="footer-text">FAQs</td>
<td class="footer-text">Terms & Conditions</td>
</tr>
<tr>
<td class="footer-text">Help</td>
</tr>
</table>
</div>
<div class="developer-info">
<a class="developers-text">Designed & Developed By Diluks Software Solutions.</a>
</div>
</div>
</div>
</div>
</form>
</body>
</html>
And the controller for that (welcome_controller) is the following,
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome_controller extends CI_Controller {
function __construct(){
parent::__construct();
}
public function index()
{
if(isset($_POST["btn_login"])){
$data = array();
$this->load->model('category_model');
$data['categories'] = $this->category_model->getCategories();
$this->load->view('login_view', $data);
}
else if(isset($_POST["btn_adminpanel"])){
$this->load->view('adminpanel_view');
}
else if(isset($_POST["btn_logout"])){
$this->session->sess_destroy();
$data = array();
$this->load->model('category_model');
$data['categories'] = $this->category_model->getCategories();
$this->load->view('home_view', $data);
}
else if(isset($_POST["btn_read"])){
$this->load->view('readmore_view');
}
}
}
Now I need to redirect the page to readmore_view onClick of the button named 'btn_read', But it doesn't respond. (Note : There are 9 buttons with the same name, and I have tested changing one of them and give the particular name in controller, it didn't work either.) Please suggest me a solution.
<input name="btn_read" class="readbtn" value="Read More" /> There is no input type. You have to mention the type of input.
<input type="submit" name="btn_read" class="readbtn" value="Read More" />
Related
I have web page look like this
<td valign="top">
<table width="100%" border="0" cellspacing="2" cellpadding="1" class="main_tb3">
<tr>
<td colspan="2">
<div align="center">
<a href="/title/name.php" target="_blank">
<img src="./movie/image.jpg" alt="TitleName" border="0" height="100" width="225" />
</a>
</div>
</td>
</tr>
<tr>
<td colspan="2"><h1 align="center">Title - secondname</h1></td>
</tr>
<tr>
<td><span class="style10">Cat1 :</span></td>
<td>1st name</td>
</tr>
<tr>
<td width="32%"><span class="style10">Cat2 :</span></td>
<td width="68%"><b><i>secondname</i></b></td>
</tr>
<tr>
<td><span class="style10">cat4 :</span></td>
<td>Bla bla</td>
</tr>
<tr>
<td><span class="style10">Cat3 :</span></td>
<td>thirdName2</td>
</tr>
</table>
</td>
<td valign="top">
<table width="100%" border="0" cellspacing="2" cellpadding="1" class="main_tb3">
<tr>
<td colspan="2">
<div align="center">
<a href="/title/name.php" target="_blank">
<img src="./movie/image.jpg" alt="TitleName" border="0" height="100" width="225" />
</a>
</div>
</td>
</tr>
<tr>
<td colspan="2"><h1 align="center">Title - secondname</h1></td>
</tr>
<tr>
<td><span class="style10">Cat1 :</span></td>
<td>1st name</td>
</tr>
<tr>
<td width="32%"><span class="style10">Cat2 :</span></td>
<td width="68%"><b><i>secondname</i></b></td>
</tr>
<tr>
<td><span class="style10">cat4 :</span></td>
<td>Bla bla</td>
</tr>
<tr>
<td><span class="style10">Cat3 :</span></td>
<td>thirdName2</td>
</tr>
</table>
</td>
I would like to get certain values from this site using python regex.
After <div align="center"> I like to get href value: "/title/name.php" and img src: "./movie/image.jpg" and Title - secondname from <h1 align="center">Title - secondname</h1>
i have tried this:
regex = 'class="main_tb3"*\n<a href="(.+?)" target="_blank">\n<img src="(.+?)"'
please help me
you can use below regex
For href value: <a href="(.*?)"
For Image src: <img src="(.*?)"
For Title: titleid=12">(.*?)<
You will find it a lot simpler to install something like BeautifulSoup to do this:
from bs4 import BeautifulSoup
html = """
<td valign="top">
<table width="100%" border="0" cellspacing="2" cellpadding="1" class="main_tb3">
<tr>
<td colspan="2">
<div align="center">
<a href="/title/name.php" target="_blank">
<img src="./movie/image.jpg" alt="TitleName" border="0" height="100" width="225" />
</a>
</div>
</td>
</tr>
<tr>
<td colspan="2"><h1 align="center">Title - secondname</h1></td>
</tr>
<tr>
<td><span class="style10">Cat1 :</span></td>
<td>1st name</td>
</tr>
<tr>
<td width="32%"><span class="style10">Cat2 :</span></td>
<td width="68%"><b><i>secondname</i></b></td>
</tr>
<tr>
<td><span class="style10">cat4 :</span></td>
<td>Bla bla</td>
</tr>
<tr>
<td><span class="style10">Cat3 :</span></td>
<td>thirdName2</td>
</tr>
</table>
</td>
<td valign="top">
<table width="100%" border="0" cellspacing="2" cellpadding="1" class="main_tb3">
<tr>
<td colspan="2">
<div align="center">
<a href="/title/name.php" target="_blank">
<img src="./movie/image.jpg" alt="TitleName" border="0" height="100" width="225" />
</a>
</div>
</td>
</tr>
<tr>
<td colspan="2"><h1 align="center">Title - secondname</h1></td>
</tr>
<tr>
<td><span class="style10">Cat1 :</span></td>
<td>1st name</td>
</tr>
<tr>
<td width="32%"><span class="style10">Cat2 :</span></td>
<td width="68%"><b><i>secondname</i></b></td>
</tr>
<tr>
<td><span class="style10">cat4 :</span></td>
<td>Bla bla</td>
</tr>
<tr>
<td><span class="style10">Cat3 :</span></td>
<td>thirdName2</td>
</tr>
</table>
</td>"""
soup = BeautifulSoup(html)
for table in soup.find_all("table", class_="main_tb3"):
print table.find('a').get('href')
print table.find('h1').text
For the HTML you have given, this will print the following:
/title/name.php
Title - secondname
/title/name.php
Title - secondname
I am getting this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/renta142/public_html/includes/connection_prop.php:14) in /home/renta142/public_html/login.php on line 31
My PHP Code is:
<?php
session_start();
if($_SESSION['user']['id']!=""){
header("location:index.php");
exit();
}
$login_email=$_POST[email];
$username=$_POST[username1];
$name=$_POST[name];
$er=$_POST[er];
if(trim($_POST["SignIn"])=="Sign In"){
include("includes/connection_user.php");
$user_=$_POST["username"];
$pass=$_POST["pass"];
$query=mysql_query("select * from user_registration where UserID='".$user_."' and Password='".$pass."' and Display='1'");
$result=mysql_fetch_array($query);
if(!strcmp($result[Password],$pass)){
$_SESSION['user']['id'] = $result[AID];
$_SESSION['user']['password'] = $result[Password];
$_SESSION['user']['username'] = $result[UserID];
$_SESSION['user']['name']=$result[Name];
$ref=$_SESSION["refer_url"];
if($_REQUEST['ref']=="sell"){
header("Location:postproperty_sell.php");
exit();
}
else if($ref==""){
header("Location:postproperty.php");
exit();
}
else{
header("Location:$ref");
exit();
}
}else{
$errsg="Invalid Username and Password !";
}
mysql_close();
}
include("config.php");
$sitename=ucfirst($thirdsite)." - Property in ".ucfirst($addresscity);
$keys="property in ".ucfirst($addresscity);
$desc="Real estate agents offers - property in ".ucfirst($addresscity);
include("includes/header.php");
include("includes/left.php");
?>
<script language='javascript' src="images/script.js"></script>
<script type="text/javascript">
function popUp_file(URL){
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=0,width=900,height=600');");
}
<?php if($_REQUEST[fcode]=='wrong'){?>
window.onload=function(){document.getElementById('fpass').style.display='block';}
<?php }?>
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<td valign="top" align="center" colspan="2">
<table width="794" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" align="right" valign="bottom"><img src="images/11.jpg" width="10" height="10" alt="" /></td>
<td width="97%" style="background:url(images/12.jpg) repeat-x bottom;"> </td>
<td width="2%" align="left" valign="bottom"><img src="images/13.jpg" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" class="green"> </td>
<td> </td>
</tr>
<tr>
<td align="left" valign="middle" class="green"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="5%"><img src="images/customer_login.gif" alt="CUSTOMER LOGIN" width="24" height="23" /></td>
<td width="92%">PROPERTY OWNER LOGIN </td>
</tr>
</table></td>
<td align="left" class="green"><table width="100%" border="0" cellpadding="00" cellspacing="0">
<tr>
<td width="5%"><img src="images/mbenifites.gif" alt="MEMBERSHIP BENEFITS" width="16" height="17" /></td>
<td width="92%"> FREE MEMBERSHIP BENEFITS</td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"> </td>
<td valign="top"> </td>
</tr>
<tr>
<td width="50%" valign="top"><?php if($errsg){ echo "<br /><div class='alert' align='center'>".$errsg."</div><br />"; } ?>
<table width="100%" cellpadding="4" cellspacing="1" class="heading" valign="top">
<form action="login.php?ref=<?php echo $_REQUEST['ref']; ?>" method="post" name="signin" id="signin" onsubmit="return loginform();">
<tr>
<td class="txt">Username<font color="red">*</font></td>
<td width="1" align="left"><strong>:</strong></td>
<td align="left"><input name="username" type="text" id="username" onfocus="if(this.value=='Username') this.value='';" onblur="if(this.value=='') this.value='Username';" value="Username" /></td>
</tr>
<tr>
<td class="txt">Password<font color="red">*</font></td>
<td align="left"><strong>:</strong></td>
<td align="left"><input type="password" name="pass" onfocus="if(this.value=='**********') this.value='';" onblur="if(this.value=='') this.value='**********'" value="**********" /></td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td align="left"><input type="submit" name="SignIn" value="Sign In" class="button" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td align="left"><font color="#333333" size="2" face="Arial, Helvetica, sans-serif"> <img src="images/nuser.gif" alt="New User registration" width="19" height="21" alt="" /> New User ?</font><a href="login.php#reg"><font color="#0000FF" size="2" face="Arial, Helvetica, sans-serif">Register First</font><br />
</a> <font color="#0000FF" size="2" face="Arial, Helvetica, sans-serif">Forgot Password </font></td>
</tr>
</form>
</table></td>
<td width="50%" valign="top" style="background:url(images/login_page.jpg) no-repeat right; height:200px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="11%" align="center" valign="top" style="padding-top:8px;"><img src="images/bullet-cir1.jpg" width="8" height="8" alt="" /></td>
<td width="89%" valign="top"><font size="2" face="Arial, Helvetica, sans-serif">Advertise your properties for Sale/Rent/PG </font></td>
</tr>
<tr>
<td align="center" valign="top" style="padding-top:8px;"><img src="images/bullet-cir1.jpg" width="8" height="8" alt="" /></td>
<td valign="top"><font size="2" face="Arial, Helvetica, sans-serif">Get Special offers and freebies</font></td>
</tr>
<tr>
<td align="center" valign="top" style="padding-top:8px;"><img src="images/bullet-cir1.jpg" width="8" height="8" alt="" /></td>
<td valign="top"><font size="2" face="Arial, Helvetica, sans-serif">Get updates on our new products</font></td>
</tr>
<tr>
<td align="center" valign="top" style="padding-top:8px;"><img src="images/bullet-cir1.jpg" width="8" height="8" alt="" /></td>
<td valign="top"><font size="2" face="Arial, Helvetica, sans-serif">Response through mail, phone</font></td>
</tr>
</table> </td>
</tr>
</table></td></tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" ><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="border:#3399FF 1px solid;">
<tr>
<td align="left" bgcolor="#E1F1F4" style="padding-left:3px; padding-right:3px;"> <strong><font size="2" face="Arial, Helvetica, sans-serif"><img src="images/note.gif" alt="<?php echo $thirdsite ?>is commited your information is strictly confidential, unless you want to expose it." width="19" height="18" /> Note:</font></strong></td>
</tr>
<tr>
<td align="center" bgcolor="#E1F1F4" style="padding-left:3px; padding-right:3px;"><div align="justify" style="padding-left:3px; padding-right:3px;"><font color="#666666" size="2" face="Arial, Helvetica, sans-serif"> <?php echo ucfirst($thirdsite); ?> is commited your information is strictly confidential, unless you want to expose it.</font></div></td>
</tr>
<tr>
<td align="center" bgcolor="#E1F1F4"> </td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td align="right" valign="top"><img src="images/31.jpg" width="10" height="10" alt="" /></td>
<td style="background:url(images/32.jpg) repeat-x top;"> </td>
<td align="left" valign="top"><img src="images/33.jpg" width="10" height="10" alt="" /></td>
</tr>
</table></td>
</tr>
<tr>
<td></td>
</tr>
</table>
<a name="fp"></a>
<div id="fpass" style="display:none;">
<table width="794" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" align="right" valign="bottom"><img src="images/11.jpg" width="10" height="10" alt="" /></td>
<td width="97%" style="background:url(images/12.jpg) repeat-x bottom;"> </td>
<td width="2%" align="left" valign="bottom"><img src="images/13.jpg" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"> </td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"><table width="100%" border="0" cellpadding="00" cellspacing="0">
<tr>
<td width="3%"><span class="green"><img src="images/forget_pass.gif" alt="FORGOT PASSWORD" width="20" height="19" /></span></td>
<td width="97%"><span class="green"> FORGOT PASSWORD</span></td>
</tr>
</table></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td><table width="100%" border="0" align="right" cellpadding="2" cellspacing="0">
<form action="forget_password_submit.php" method="post" name="forget_password" id="forget_password">
<input type="hidden" name="chk" value="2" />
<?php if($_GET[fcode]) echo ' <tr>
<td class="alert" align="center" colspan="3">Your EmailID or UserName Is Not Found In Our Database, Please Try Again!!!</td></tr>';?>
<tr >
<td width="20%" align="right" valign="top" class="txt"> Username</td>
<td width="2%" valign="top"><b>:</b></td>
<td width="78%" align="left" valign="top"><input type="text" name="username1" /></td>
</tr>
<tr>
<td colspan="2" align="right" class="heading"> OR</td>
<td class="heading" align="left"> </td>
</tr>
<tr>
<td align="right" valign="top" class="txt"> Email-ID</td>
<td valign="top"><b>:</b></td>
<td align="left" valign="top"><input type="text" name="email1" /></td>
</tr>
<tr>
<td colspan="3" align="right" height="8"></td>
</tr>
<tr>
<td align="right"> </td>
<td align="center"> </td>
<td align="left"><input name="submit" type="submit" onclick="return ForgetpassForm();" value="Submit" class="button" /></td>
</tr>
<tr>
<td align="right"> </td>
<td align="right"> </td>
<td align="left"><font color="#333333" size="2" face="Arial, Helvetica, sans-serif"><img src="images/login.gif" alt="Existin user login" width="19" height="21" /></font> <font color="#0000FF" size="2" face="Arial, Helvetica, sans-serif"><strong>Login</strong></font></td>
</tr>
<tr>
<td align="right" colspan="4" height="8"></td>
</tr>
<tr>
<td colspan="3" align="right"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="border:#3399FF 1px solid;">
<tr>
<td align="left" bgcolor="#E1F1F4" style="padding-left:3px; padding-right:3px;"> <strong><font size="2" face="Arial, Helvetica, sans-serif"><img src="images/note.gif" alt="Enter Your UserName or Email-ID which you had entered in registration form and get your password through eMail." width="19" height="18" /></font></strong><strong><font size="2" face="Arial, Helvetica, sans-serif"> Note:</font></strong></td>
</tr>
<tr>
<td align="center" bgcolor="#E1F1F4" style="padding-left:3px; padding-right:3px;"><div align="justify" style="padding-left:3px; padding-right:3px;"><span class="text"> Enter Your UserName or Email-ID which you had entered in registration form and get your password through eMail. </span></div></td>
</tr>
<tr>
<td align="center" bgcolor="#E1F1F4"> </td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3" align="center" height="7"></td>
</tr>
</form>
</table></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td align="right" valign="top"><img src="images/31.jpg" width="10" height="10" alt="" /></td>
<td style="background:url(images/32.jpg) repeat-x top;"> </td>
<td align="left" valign="top"><img src="images/33.jpg" width="10" height="10" alt="" /></td>
</tr>
</table></td>
</tr>
</table>
</div>
<?php //if($errsg=="Invalid Username and Password !"){?>
<a name="reg"></a>
<table width="794" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" align="right" valign="bottom"><img src="images/11.jpg" width="10" height="10" alt="" /></td>
<td width="97%" style="background:url(images/12.jpg) repeat-x bottom;"> </td>
<td width="2%" align="left" valign="bottom"><img src="images/13.jpg" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"> </td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left" class="heading"><table width="100%" border="0" cellpadding="00" cellspacing="0">
<tr>
<td width="3%"><img src="images/if_you_do.gif" alt="If you do not have an existing Customer Account with us fill in the form below" width="19" height="19" /></td>
<td width="97%"> If you do not have an existing User Account with us fill in the form below. </td>
</tr>
</table></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"> </td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td align="right" valign="top"><img src="images/31.jpg" width="10" height="10" alt="" /></td>
<td style="background:url(images/32.jpg) repeat-x top;"> </td>
<td align="left" valign="top"><img src="images/33.jpg" width="10" height="10" alt="" /></td>
</tr>
</table></td>
</tr>
</table>
<table width="794" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" align="right" valign="bottom"><img src="images/11.jpg" width="10" height="10" alt="" /></td>
<td width="97%" style="background:url(images/12.jpg) repeat-x bottom;"> </td>
<td width="2%" align="left" valign="bottom"><img src="images/13.jpg" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left" class="green"><table width="100%" border="0" cellpadding="00" cellspacing="0">
<tr>
<td width="5%"><img src="images/NEW-USER-REGISTER-FORM.gif" alt="NEW USER REGISTER FORM " width="26" height="27" /></td>
<td width="97%"> NEW USER REGISTER FORM </td>
</tr>
</table></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"> </td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"><form name="register" method="POST" action="registration_submit.php?ref=<?php echo $_REQUEST['ref']; ?>" onsubmit="return registerForm();">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" valign="top" style="border:#CCCCCC 1px solid;">
<table width="100%" cellpadding="4" cellspacing="0">
<tr>
<td bgcolor="#EEEEEE"><font size="2" face="Arial, Helvetica, sans-serif">User Login Information</font></td>
<td bgcolor="#EEEEEE"> </td>
<td align="right" bgcolor="#EEEEEE"><span class="alert">* Mandatory Fields</span></td>
</tr>
<tr>
<td width="39%" class="tdspace txt"><font color="red">*</font>Username</td>
<td width="3%">:</td>
<td width="58%"><input name="username" type="text" id="username" size="25" /></td>
</tr>
<tr>
<td class="tdspace txt"><font color="red">*</font>Password</td>
<td>:</td>
<td><input type="password" name="password" size="25" /></td>
</tr>
<tr>
<td class="tdspace txt"><font color="red">*</font>Confirm Password</td>
<td>:</td>
<td><input type="password" name="rpassword" size="25" /></td>
</tr>
<tr>
<td class="tdspace txt"><font color="red">*</font>Email-ID</td>
<td>:</td>
<td><input type="text" name="email" size="25" /></td>
</tr>
<tr>
<td colspan="3" bgcolor="#EEEEEE"><font size="2" face="Arial, Helvetica, sans-serif">Contact Information</font></td>
</tr>
<tr>
<td class="tdspace txt"><font color="red">*</font>Name</td>
<td>:</td>
<td><input type="text" name="name" size="25" /></td>
</tr>
<tr>
<td class="tdspace txt"><font color="red">*</font>Verification Code</td>
<td>:</td>
<td><input name="verify_code" type="text" size="15" />
<img src="verificationimage.php" alt="verification image, type it in the box" width="60" height="30" align="absbottom"/></td>
</tr>
<tr>
<td colspan="3" class="text"><input type="checkbox" name="term" />
I have read <font color="red">Terms and Conditions</font> and I accept these conditions.</td>
</tr>
<tr>
<td align="center"> </td>
<td align="center"> </td>
<td align="left"><input name="submit2" type="submit" value="Submit" class="button" />
<input name="reset" type="reset" value="Reset" class="button" />
<input name="flg" type="hidden" id="flg" value="1" /></td>
</tr>
</table></td>
<td width="1%" > </td>
<td width="49%" valign="top"><img src="images/register.jpg" alt="For Free registration on <?php echo ucfirst($thirdsite); ?>, Advertise your properties for Sale/Rent/PG, Get Special offers and freebies, Get updates on our new products, Response through mail, phone" width="380" height="380" /></td>
</tr>
</table>
</form></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td align="right" valign="top"><img src="images/31.jpg" width="10" height="10" alt="" /></td>
<td style="background:url(images/32.jpg) repeat-x top;"> </td>
<td align="left" valign="top"><img src="images/33.jpg" width="10" height="10" alt="" /></td>
</tr>
</table></td>
</tr>
</table>
<?php //}?>
</td>
<script language='javascript'>signin.username.focus();</script>
<?php
//include("includes/right.php");
include("includes/footer.php");
?>
public_html/includes/connection_prop.php:14 is probably outputting some blank spaces. Check that file and other includes for whitespace around tags.
You cannot send headers if any text has already been output
I am trying to load a view from constructor with parameter $data. Earlier it was working fine and now suddenly it stopped working. Below is the code:
permissionerror View
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="6" align="left" valign="top" background="<?php echo base_url();?>images/bg/topbg.gif"><img src="<?php echo base_url();?>images/bg/top-left.gif" width="5" height="34" /></td>
<td height="34" align="left" valign="middle" background="<?php echo base_url();?>images/bg/topbg.gif" class="heading">Access Forbidden</td>
<td width="6" align="right" valign="top" background="<?php echo base_url();?>images/bg/topbg.gif"><img src="<?php echo base_url();?>images/bg/top-right.gif" width="5" height="34" /></td>
</tr>
<tr>
<td align="left" valign="top" background="<?php echo base_url();?>images/bg/main-content-bg-left.gif"> </td>
<td height="165" valign="top" bgcolor="#FFFFFF" class="leftredheading"><div style="margin:30px auto;padding-left:15px"><? if(isset($sn_error)) echo $sn_error;?></div></td>
<td align="right" valign="top" background="<?php echo base_url();?>images/bg/main-content-bg-right.gif"> </td>
</tr>
<tr>
<td align="left" valign="bottom" background="<?php echo base_url();?>images/bg/bottom-bg.gif"><img src="<?php echo base_url();?>images/bg/bottom-left-corner.gif" width="5" height="5" /></td>
<td valign="top" background="<?php echo base_url();?>images/bg/bottom-bg.gif"></td>
<td align="right" valign="bottom" background="<?php echo base_url();?>images/bg/bottom-bg.gif"><img src="<?php echo base_url();?>images/bg/bottom-right-corner.gif" width="5" height="5" /></td>
</tr>
</table>
Template code:
<?php $this->load->view('includes/login/header'); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#e7e7de">
<tr>
<td width="18"><img src="<?php echo base_url();?>images/bg/zero.gif" width="18" height="1" /></td>
<td width="191"><img src="<?php echo base_url();?>images/bg/zero.gif" width="191" height="1" /></td>
<td width="18"><img src="<?php echo base_url();?>images/bg/zero.gif" width="18" height="1" /></td>
<td width="100%"> </td>
<td width="161"><img src="<?php echo base_url();?>images/bg/zero.gif" width="18" height="1" /></td>
<td width="191"><img src="<?php echo base_url();?>images/bg/zero.gif" width="191" height="1" /></td>
<td width="18"><img src="<?php echo base_url();?>images/bg/zero.gif" width="18" height="1" /></td>
</tr>
<tr>
<td> </td>
<td align="left" valign="top"><table width="191" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="<?php echo base_url();?>images/bg/left-menu-white-bg.gif"> <?php $this->load->view('includes/login/top_right'); ?> </td>
</tr>
<tr>
<td height="50" background="<?php echo base_url();?>images/bg/left-menu-white-bg.gif"> </td>
</tr>
<tr>
<td background="<?php echo base_url();?>images/bg/left-menu-white-bg.gif"><table width="166" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top"><img src="<?php echo base_url();?>images/bg/needhelp-top.gif" width="166" height="7" /></td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#F8F7EC"> <?php $this->load->view('includes/login/bottom_right'); ?>
<br /></td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#F8F7EC"><img src="<?php echo base_url();?>images/bg/needhelp-bottom.gif" width="166" height="7" /></td>
</tr>
</table>
<br /></td>
</tr>
<tr>
<td background="<?php echo base_url();?>images/bg/left-menu-white-bg.gif"><table width="191" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="6" align="left" valign="top"><img src="<?php echo base_url();?>images/bg/left-bttom.gif" width="6" height="6" /></td>
<td width="100%" background="<?php echo base_url();?>images/bg/leftbottom.gif"></td>
<td height="6" align="right" valign="top"><img src="<?php echo base_url();?>images/bg/right-bttom.gif" width="6" height="6" /></td>
</tr>
</table></td>
</tr>
</table>
<br /></td><td> </td>
<td valign="top" <? if($main_content != 'dashboard' || $main_content == 'publisher_dashboard') { ?> colspan="3" <? } ?>><?php $this->load->view($main_content); ?></td>
<td> </td>
<? if($main_content == 'dashboard' || $main_content == 'publisher_dashboard') { ?>
<td align="right" valign="top"> <?php $this->load->view('includes/login/left'); ?>
</td>
<? } ?>
<td> </td>
</tr>
</table>
<?php $this->load->view('includes/login/footer'); ?>
Here in the above code i am checking whether logged in user is having permission for access then do else part otherwise through the error from if case block.
In IF case it loads the error template.
Please somebody help me to fix the above issue ASAP!
Call parent::__construct(), not parent::Controller().
Edit:
After it was made clear that CodeIgniter 1.7.1 is used and after the view itself was shown, this is your issue:
Your view tries to echo $error instead of $sn_error. If you don't pass $data to the view, then $sn_error (which is checked for) isn't set and that error doesn't occur - that's why the view gets loaded in that case.
Below is a contact us script in php, when I click submit at www.mydomain.com.au/contact.html it looks as though it works because I end up at ww.mydomain.com.au/thanks.html.
However the specified email account is not receiving contact emails.
Here is the code for the contact us script found at includes/contact_mail.php
<?php
if(isset($_POST['enter']) && $_POST['enter']==1)
{
$_SESSION['email']=$_POST['email'];
$to="name#domains.com";
$subject='Contact Us Details';
$message="<style>
.textstyle{
font-family:Tahoma;
font-size:11px;
color:#156E00;
text-align:left;
margin-left:10px;
text-decoration:none;
}
</style>";
$message.="<table width=400 border=0>
<tr><td class=textstyle>First Name: </td> <td class=textstyle>".$_POST['fname']."</td></tr>
<tr><td class=textstyle>Last Name: </td> <td class=textstyle>".$_POST['lname']."</td></tr>
<tr><td class=textstyle>E-mail: </td> <td class=textstyle>".$_POST['email']."</td></tr>
<tr><td class=textstyle>Phone Number: </td> <td class=textstyle>".$_POST['tel']."</td></tr>
<tr><td class=textstyle>Comments: </td> <td class=textstyle>".$_POST['que']."</td></tr>
</table>";
$mail_from = "From:".$_POST['email'];
$mail_from .="\r\nContent-type: text/html";
#mail($to,$subject,$message,$mail_from);
header("location: ../thankyou.html");
exit();
}
?>
Here is the code at ww.mydomain.com.au/contact.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="GENERATOR" content="Macromedia Dreamweaver CS3" />
<meta name="author" content="Relyon security" />
<meta name="keywords" content="Camera Surveillance,Spy Cameras,Remote Viewing,Audio recording,Relyon security" />
<meta name="description" content="" />
<meta http-equiv="EXPIRES" content="-1" />
<title>Relyon Security: About Relyon Security</title>
<link rel="stylesheet" type="text/css" href="css/stylesheet.css" />
<script language="JavaScript" type="text/javascript">
function fullcheck()
{
var str=document.contact.email.value;
//alert(str);
if (document.contact.fname.value=="")
{
alert ("Blank space not allowed. Please type your First Name.");
document.contact.fname.select();
return false;
}
if (document.contact.lname.value=="")
{
alert ("Blank space not allowed. Please type your Last Name.");
document.contact.lname.select();
return false;
}
if ((document.contact.email.value).indexOf(" ")>=0)
{
alert ("Blank space not allowed inside email!");
document.contact.email.select();
return false;
}
if (document.contact.email.value.indexOf("#",1) == -1)
{
alert("Invalid E-Mail address");
document.contact.email.focus();
document.contact.email.select();
return(false);
}
if (document.contact.email.value.indexOf("#") == 0)
{
alert("Invalid E-Mail address");
document.contact.email.focus();
document.contact.email.select();
return(false);
}
if (document.contact.email.value.indexOf(".",5) == -1)
{
alert("Invalid E-Mail address");
document.contact.email.focus();
document.contact.email.select();
return(false);
}
if (document.contact.email.value.indexOf(".") == 0)
{
alert("Invalid E-Mail address");
document.contact.email.focus();
document.contact.email.select();
return(false);
}
if ((document.contact.email.value.lastIndexOf(".")) -(document.contact.email.value.indexOf("#"))<4 )
{
alert("Invalid E-Mail address");
document.contact.email.focus();
document.contact.email.select();
return(false);
}
if (document.contact.tel.value=="")
{
alert ("Blank space not allowed. Please type your Telephone Number.");
document.contact.tel.select();
return false;
}
if (document.contact.que.value=="")
{
alert ("Blank space not allowed. Please enter your question or comment.");
document.contact.que.select();
return false;
}
}
//-->
</script>
</head>
<body>
<table width="1000" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="top" align="left" width="110" height="186"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
<td width="780" rowspan="2" align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td height="161" valign="top"><img src="images/spacer.gif" alt="" /></td>
</tr>
<tr>
<td valign="top" align="left" class="btn">
<table width="780" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td width="10" valign="top"><img src="images/btn-left.jpg" alt="" width="10" height="49" /></td>
<td align="center" valign="middle">
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="154" align="center" valign="top">Home Page</td>
<td width="180" align="center" valign="top">Our Services</td>
<td width="244" align="center" valign="top">About relyon security</td>
<td width="182" align="center" valign="top"><span class="navg_contact_activated">Contact Us</span></td>
</tr>
</table>
</td>
<td width="10" valign="top" align="right"><img src="images/btn-right.jpg" alt="" width="10" height="49" /></td>
</tr>
<tr>
<td colspan="3" height="1" bgcolor="#FFFFFF"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td width="10"><img src="images/left-bot.jpg" alt="" width="10" height="42" /></td>
<td class="shadow"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
<td><img src="images/rgh-bot.jpg" alt="" width="10" height="42" /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td valign="top" align="left" width="110"><img src="images/spacer.gif" alt="" /></td>
</tr>
<tr>
<td valign="top" align="left" width="110" bgcolor="#FFFFFF" height="66"><img src="images/spacer.gif" alt="" /></td>
<td valign="top" align="left" width="110" bgcolor="#FFFFFF"><img src="images/spacer.gif" alt="" /></td>
</tr>
</table>
<table width="1000" border="0" cellspacing="0" cellpadding="0" align="center" class="white">
<tr>
<td valign="top" align="left"><table width="780" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="top" class="inner_text"><span class="head-blue">Contact Us</span><br /><br />
Email address: relyonsecurity#live.com.au
<br />
Phone: 0422 663 489<br />
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="1000" border="0" cellspacing="0" cellpadding="0" align="center" class="blue">
<tr>
<td valign="top" align="left"><table width="780" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="top">
<form name="contact" method="post" action="includes/contact_mail.php" onsubmit="return fullcheck()">
<table width="90%" border="0" cellpadding="0" cellspacing="3" >
<tr>
<td width="7%"> </td>
<td height="30" colspan="2" align="left" valign="middle"><span class="mandatory">*</span>Required fields</td>
</tr>
<tr>
<td> </td>
<td width="22%" class="form_text"><span class="mandatory">*</span>First Name :</td>
<td width="71%"><input name="fname" type="text" id="fname" size="35" class="inputbox"></td>
</tr>
<tr>
<td> </td>
<td width="22%" class="form_text"><span class="mandatory">*</span>Last Name :</td>
<td width="71%"><input name="lname" type="text" id="lname" size="35" class="inputbox"></td>
</tr>
<tr>
<td> </td>
<td class="form_text"><span class="mandatory">*</span>Email Address :</td>
<td><input name="email" type="text" class="inputbox" id="email" size="35"></td>
</tr>
<tr>
<td width="7%"> </td>
<td class="form_text"><span class="mandatory">*</span>Telephone Number:</td>
<td><input name="tel" type="text" class="inputbox" id="tel" size="35"></td>
</tr>
<tr>
<td> </td>
<td class="form_text"><span class="mandatory">*</span>Please enter your question or comment :</td>
<td><textarea name="que" cols="33" rows="8" id="que" class="inputbox"></textarea></td>
</tr>
<tr>
<td colspan="3" height="5" valign="top"><input name="enter" type="hidden" value="1" /></td>
</tr>
<tr>
<td> </td>
<td class="form_text"> </td>
<td><input type="submit" name="Submit" value="Submit" class="inputbox">
<input type="reset" name="Submit2" value="Reset" class="inputbox"></td>
</tr>
<tr>
<td colspan="3" height="30" valign="top"></td>
</tr>
</table>
</form>
<table width="780" border="0" cellspacing="0" cellpadding="0" align="center" class="footer" height="41">
<tr>
<td valign="top" width="12" height="8"><img src="images/foo-l-top.gif" alt="" width="12" height="8" /></td>
<td><img src="images/spacer.gif" alt="" /></td>
<td align="right" valign="top" width="9" height="8"><img src="images/foo-r-top.gif" alt="" width="9" height="8" /></td>
</tr>
<tr>
<td><img src="images/spacer.gif" alt="" /></td>
<td align="center" valign="middle">©2009 Relyon Security.com All Rights Reserved</td>
<td><img src="images/spacer.gif" alt="" /></td>
</tr>
<tr>
<td valign="bottom" height="8"><img src="images/foo-l-bot.gif" alt="" width="12" height="8" /></td>
<td><img src="images/spacer.gif" alt="" /></td>
<td valign="bottom"><img src="images/foo-r-bot.gif" alt="" width="9" height="8" /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Second attempt at script?
<?php
error_reporting(E_ALL)
if(isset($_POST['enter']) && $_POST['enter']==1)
{
$_SESSION['email']=$_POST['email'];
$to="name#domains.com";
$subject='Contact Us Details';
$message="<style>
.textstyle{
font-family:Tahoma;
font-size:11px;
color:#156E00;
text-align:left;
margin-left:10px;
text-decoration:none;
}
</style>";
$message.="<table width=400 border=0>
<tr><td class=textstyle>First Name: </td> <td class=textstyle>".$_POST['fname']."</td></tr>
<tr><td class=textstyle>Last Name: </td> <td class=textstyle>".$_POST['lname']."</td></tr>
<tr><td class=textstyle>E-mail: </td> <td class=textstyle>".$_POST['email']."</td></tr>
<tr><td class=textstyle>Phone Number: </td> <td class=textstyle>".$_POST['tel']."</td></tr>
<tr><td class=textstyle>Comments: </td> <td class=textstyle>".$_POST['que']."</td></tr>
</table>";
$mail_from = "From:".$_POST['email'];
$mail_from .="\r\nContent-type: text/html";
mail($to,$subject,$message,$mail_from);
// header("location: ../thankyou.html");
exit();
}
?>
put error_reporting(E_ALL) at the top of the script, remove # from mail() call and comment string with header() and THEN look for errors
I have the following site and I want with regular expressions to get the text between the following tags
<td colspan="2" align="left" valign="top" bgcolor="#FBFAF4"> ..... </td>
I am trying with the following however it returns an empty array of $matches.
preg_match_all("/<td(.*) bgcolor=\"#FBFAF4\"\>(.*)\<\/td>/",$old_filecontents,$matches);
Which is the correct pattern for this?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Exotiq - Ðñïúüíôá</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7"> <link href="Styles.css" rel="stylesheet" type="text/css"> <link href="stylesheets/Styles.css" rel="stylesheet" type="text/css"> <script src="scripts/PopBox.js" type="text/javascript"></script> <script type="text/javascript"> popBoxWaitImage.src = "images/spinner40.gif"; popBoxRevertImage = "images/magminus.gif"; popBoxPopImage = "images/magplus.gif"; </script> <script type="text/javascript"> AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/ cabs/flash/swflash.cab#version=9,0,28,0', 'width','675','height','445','title','Morpork', 'src','assets/flash/morepork','loop', 'false','quality','high','pluginspage', 'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash', 'wmode','transparent','movie','assets/flash/morepork'); </script> </head> <body background="images/fonto2.jpg" topmargin="0"> <table width="948" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="948" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="24"> </td> <td height="150" colspan="3"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="900" height="150"> <param name="movie" value="flash/top02.swf"> <param name="quality" value="high"> <param name="wmode" value="transparent"> <embed src="flash/top02.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="900" height="150"></embed></object></td> <td width="24" height="150"> </td> </tr> <tr> <td height="31" colspan="5" valign="middle"> <div align="center"> <script src="menu/xaramenu.js"></script> <script Webstyle4 src="menu/menu_.js"></script> </div></td> </tr> <tr> <td width="24"> </td> <td width="200" valign="top" background="images/GreenFasa.jpg"> <br> <table width="180" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td height="25" class="styles"> Makuti<br> <hr> </td> </tr> <tr> <td height="25" class="styles"> Fun Palm<br> <hr> </td> </tr> <tr> <td height="25" class="styles"> Alang-Alang<br> <hr> </td> </tr> <tr> <td height="25" class="styles"> Thatch<br> <hr> </td> </tr> <tr> <td height="25" class="styles"> <strong>Abaca</strong><br> <hr> </td> </tr> <tr> <td height="25" class="styles"> </td> </tr> </table></td> <td colspan="2" align="left" valign="top" bgcolor="#FBFAF4"> <div align="left"> <table width="680" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="600" height="40" class="titles">ÊáôáóêåõÝò - ÏìðñÝëåò - Abaca</td> <td width="50" align="right" valign="middle" class="titles"> <div align="right"><img src="images/uk-flag.jpg" width="30" height="17" border="0"></div></td> </tr> <tr> <td colspan="2" class="body"><p>Ç ïìðñÝëá <strong>Abaca</strong> Ýñ÷åôáé ùò Üîéïò áíôéêáôáóôÜôçò ôçò ïìðñÝëáò Rattan ðïõ åðß 15 ÷ñüíéá óôïëßæåé ôéò åëëçíéêÝò ðáñáëßåò. Ôï <strong>Abaca</strong> åßíáé Ýíá öõóéêü õëéêü ðéï <strong>áíèåêôéêü</strong> êáé ðéï üìïñöï áðü ôï Rattan. <br> Ðáñáäßäåôáé ìå <strong>îýëéíï êïñìü åìðïôéóìïý</strong> Ö8åê.<br> <br> </p> <table width="680" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="340" height="150" valign="middle"> <div align="left"><img src="images/Manufactures/Umbrelas/Abaca/AbacaUmbrela.jpg" width="328" height="500"></div></td> <td width="340" height="150" valign="bottom" class="body"> <table width="340" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="170" height="130"> <div align="center"><img src="images/Manufactures/Umbrelas/Abaca/1_Abaca02_s.jpg" width="152" height="101" class="PopBoxImageSmall" onclick="Pop (this,50,'PopBoxImageLarge');" title="ÌåãÝèõíóç" pbsrc="images/Manufactures/Umbrelas/Abaca/1_Abaca02.jpg" pbCaption="Abaca - ÏìðñÝëá ðáñáëßáò" popBoxCaptionBelow="true" /></div></td> <td width="170" height="130"> <div align="center"><img src="images/Manufactures/Umbrelas/Abaca/2_Abaca03_s.jpg" width="150" height="112" class="PopBoxImageSmall" onclick="Pop (this,50,'PopBoxImageLarge');" title="ÌåãÝèõíóç" pbsrc="images/Manufactures/Umbrelas/Abaca/2_Abaca03.jpg" pbCaption="Abaca - ÏìðñÝëá ðáñáëßáò" popBoxCaptionBelow="true" /></div></td> </tr> <tr> <td width="170" height="130"> <div align="center"><img src="images/Manufactures/Umbrelas/Abaca/3_Abaca01_s.jpg" width="150" height="112" class="PopBoxImageSmall" onclick="Pop (this,50,'PopBoxImageLarge');" title="ÌåãÝèõíóç" pbsrc="images/Manufactures/Umbrelas/Abaca/3_Abaca01.jpg" pbCaption="Abaca - ÏìðñÝëá ðáñáëßáò" popBoxCaptionBelow="true" /></div></td> <td width="170" height="130"> <div align="center"></div></td> </tr> <tr> <td width="170" height="130"> <div align="center"></div></td> <td width="170" height="130"> <div align="center"></div></td> </tr> <tr> <td width="170" height="130"> <div align="center"></div></td> <td width="170" height="130"> <div align="center"></div></td> </tr> </table></td> </tr> <tr> <td width="340" height="50" valign="top"> <p align="center"> </p></td> <td width="340" height="50" valign="top"> <div align="center" class="perigrafes">ÊëéêÜñåôáé ðÜíù óôéò öùôïãñáößåò ãéá ìåãÝèõíóç</div></td> </tr> <tr> <td width="340" valign="bottom"> <div align="center"> </div></td> <td width="340" valign="bottom"> <p align="center"> </p></td> </tr> <tr> <td width="340" valign="top"> <div align="center"></div></td> <td width="340" valign="top"> <p align="center"> </p></td> </tr> <tr> <td height="20" colspan="2" valign="top"> </td> </tr> </table></td> </tr> </table> <font color="#FFFFFF"></font></div></td> <td width="24" height="420"> </td> </tr> <tr> <td width="24"> </td> <td width="200"> </td> <td width="600"> </td> <td width="100"> </td> <td width="24"> </td> </tr> </table></td> </tr> <tr> <td height="22"><table width="900" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#007F3E"> <tr> <td height="25"> <div align="center" class="styles">All rights reserved ® Designed by CONTINENTAL ADVERTISING </div></td> </tr> </table></td> </tr> </table> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-12742174-1"); pageTracker._trackPageview(); } catch(err) {}</script> </body> </html>
Given that the cell you're talking about contains HTML, another table in fact, you can't do traditional termination checking ... or you'll get the content between the cell opening and the first </td> you find. Plus '.' isn't multi-line friendly, so unless your cell opens and terminates on the same line, you'll get no matches.
I'd say don't use regular expressions for this. Try an XML parser.
If you were just getting plain text, that'd be fine, but because you're returning HTML which contains your terminator, you'll need to use a parser with some kind of DOM depth awareness ... ... or find a way to count terminators in regex.