I am using curl to login to a webpage then goto mail section and I want to display only part of the returned page.. Just one table within the page..
here is the link to my script
http://www.socom.inh3.net/SOCOM3_HTML/new.php
here is the code for it
<html>
<head>
<title>Socom Stats</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK href="http://www.socom.inh3.net/SOCOM3_HTML/stylesheets/css/style.css" type="text/css" rel="stylesheet">
</head>
<div align="left">
<body bgcolor="black" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 text="#008000" background="http://www.socom.inh3.net/SOCOM3_HTML/IMAGES/bg_page.jpg">
<TABLE WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD align=center valign=top>
<table border="0" cellpadding="0" cellspacing="0">
</table>
</TD>
<?php
// Report all errors except E_NOTICE
//error_reporting(E_ALL ^ E_NOTICE);
//**** GetStats START
$socom_name = "username";
$socom_pass = "pass";
$cookielocation = "socomcookies.txt";
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookielocation);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookielocation);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$url = "https://socom3-prod.svo.pdonline.scea.com:10079/SOCOM3_HTML/account/Account_Login_Submit.jsp";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, "userName=" . $socom_name . "&passWord=" . $socom_pass);
$result = curl_exec($ch);
//print "<br>result=" . $result;
//$sql = "SELECT user_id, socomsn FROM $db_tabl WHERE socomsn != ''";
//$result = mysql_query($sql);
$ch = curl_init();
//$_GET['socom'];
//$socom = $_GET['socom'];
$cookielocation = "socomcookies.txt";
//echo $socom_name;
//curl_setopt($ch, CURLOPT_COOKIEJAR, $cookielocation);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookielocation);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$url = "http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/mail/Mail_Box.jsp";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$content = curl_exec($ch);
print $content;
curl_close($ch);
?>
The table within the page that I want to display is
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td class="text" align="left">
<table cellSpacing="0" cellPadding="0" width="95%" border="0">
<tr vAlign="top">
<td><br>
<table height="256" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
<tr>
<td colSpan="5">
<img height="3" alt="" src="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/images/box_01.gif" width="100%"></td>
</tr>
<tr>
<td width="10">
<img height="28" alt="" src="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/images/box_02.gif" width="10"></td>
<td width="300" bgColor="#1d3422"><span class="header">
MAILBOX</span></td>
<td width="73" bgColor="#122716">
<img height="28" alt="" src="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/images/box_04.jpg" width="72" align="absMiddle"></td>
<td width="132" bgColor="#122716">
<img height="28" alt="" src="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/images/spacer.gif" width="1"></td>
<td width="5">
<img height="28" alt="" src="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/images/box_06.jpg" width="5"></td>
</tr>
<tr vAlign="top">
<td background="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/images/box_07.jpg">
<img height="215" alt="" src="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/images/spacer.gif" width="10"></td>
<td class="text" width="100%" bgColor="#122716" colSpan="3">
<img height="10" alt="" src="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/images/spacer.gif" width="1"><br>
<table cellSpacing="0" cellPadding="4" width="100%">
<tr>
<td class="message" align="middle" colSpan="8">
Mail delete successful. </td>
</tr>
<tr class="titlebar">
<td class="font">FROM</td>
<td class="font">R</td>
<td class="font">F</td>
<td class="font">SUBJECT</td>
<td class="font">DATE</td>
<td class="font"> </td>
<td class="font"> </td>
<td class="font"> </td>
</tr>
<tr class="swap0">
<td class="message" align="middle" colSpan="8">
No Mail Currently in Mailbox.<br>
</td>
</tr>
<tr>
<td class="listBottom" colSpan="8" height="5">
</td>
</tr>
<tr>
<td colSpan="8"><br>
</td>
</tr>
<tr>
<td class="fontValue" align="middle" colSpan="8">
<a href="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/mail/Mail_Send.jsp">
Send Mail</a> </td>
</tr>
<tr>
<td class="fontValue" align="middle" colSpan="8">
<a href="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/mail/Mail_Clan_Send.jsp">
Mail Clan</a> </td>
</tr>
<tr>
<td class="fontValue" align="middle" colSpan="8">
<a href="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/mail/Mail_BlockUserList.jsp">
Blocked Users</a> </td>
</tr>
<tr>
<td colSpan="8"><br>
</td>
</tr>
</table>
</td>
<td background="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/images/box_09.jpg">
<img height="215" alt="" src="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/images/spacer.gif" width="5"></td>
</tr>
<tr>
<td>
<img height="10" alt="" src="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/images/box_10.gif" width="10"></td>
<td background="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/images/box_11.jpg" colSpan="3">
<img height="10" alt="" src="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/images/spacer.gif" width="505"></td>
<td>
<img height="10" alt="" src="http://socom3-prod.svo.pdonline.scea.com:10070/SOCOM3_HTML/images/box_12.jpg" width="5"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
if anyone could help me with this I would be very greatful..
thanks in advance..