Jump to content

factoring2117

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

factoring2117's Achievements

Member

Member (2/5)

0

Reputation

  1. Hey guys, Here is the html code that I need to get data from: <tr> <td height=25 width=90 class=TB-header> Loan #</td> <td height=25 width=90 class=TB-header>Borrower Name</td> <td height=25 width=60 class=TB-header>Due Date</td> <td height=25 width=55 class=TB-header>Status</td> <td height=25 width=75 class=TB-header>Tracking No.</td> <td height=25 width=60 class=TB-header>Appt. Set</td> <td height=25 width=45 class=TB-header align=right>Fee</td> <td height=25 width=60 class=TB-header align=right>Payment</td> <td height=25 width=55 class=TB-header align=right>Balance </td> </tr> <tr> <td height=25 class="Pending"><a href="javascript:NotesWindow('Lxxx 4013')"; class="Loan_Pending">xxx 4013</a></td> <td height=25 class="Pending">Loxxxxx, Daniel </td> <td height=25 class="Pending">6/29/2010</td> <td height=25 class="Pending">PENDING</td> <td height=25 class="nav-black"> <a href="http://www.fedex.com/cgi-bin/tracking?action=track&language=english&last_action=alttrack&ascend_header=1&cntry_code=us&initial=x&mps=y&tracknumbers=" target="_blank"></a> </td> <td height=25> <input type="checkbox" checked value="ON"></td> <td height=25 class="nav-black" align=right>$0.00</td> <td height=25 class="nav-black" align=right></td> <td height=25 class="nav-black" align=right></td> </tr> <tr> <td height=25 class="nav-black" colspan=9><strong>Notary: </strong>Sxxxx, Julie </strong> 19061 E Powers Place, Aurora, CO 80015</td> </tr> <tr> <td colspan=9 bgcolor="DarkGray"><img src="images/clear.gif" width="1" height="1" alt="" border="0"></td> </tr> <tr> <td height=25 class="Canceled"><a href="javascript:NotesWindow('Mxxx 3677')"; class="Loan_Canceled">Mxxx 3677</a></td> <td height=25 class="Canceled">Mxxxx, Michael</td> <td height=25 class="Canceled">6/25/2011</td> <td height=25 class="Canceled">CANCELED</td> <td height=25 class="nav-black"> <a href="http://www.fedex.com/cgi-bin/tracking?action=track&language=english&last_action=alttrack&ascend_header=1&cntry_code=us&initial=x&mps=y&tracknumbers=" target="_blank"></a> </td> <td height=25> <input type="checkbox" value="ON"></td> <td height=25 class="nav-black" align=right></td> <td height=25 class="nav-black" align=right></td> <td height=25 class="nav-black" align=right></td> </tr> <tr> <td height=25 class="nav-black" colspan=9><strong>Notary: </strong>Cxxxx Helen-Mitchell </strong> 7646 S. Merrill Ave, Chicago, Il 60649</td> </tr> <tr> <td colspan=9 bgcolor="DarkGray"><img src="images/clear.gif" width="1" height="1" alt="" border="0"></td> </tr> I need to extract each one of these tr sections minus the top one because it is the header of the table. Any ideas?
  2. Hey guys, I have spent the last 36 hours trying to figure this out. I keep getting the following error: Fatal error: Call to a member function format() on a non-object in /var/www/vhosts/xxxxx.com/httpdocs/admin/defaults.php on line 51 The reason I am not using the standard date and strtotime functions is because some of my dates exceed 2038. What I have done is created an array with price and days from today within the array. You can see below where I am trying to get the timestamp for 14000 days from today. I then turn that into a date using the newdate function. I can see that this actually works on other pages on my server, I just can't figure out why it won't work here. BTW, I am using php 5.2.3. $csv .= "Payment,".newdate("m/d/Y",newstrtotime("+".$periodic[0][0]." days")).",".$row['amount'].",".count($periodic).",".$row['frequency'].",".newdate("m/d/Y",newstrtotime("+".$periodic[$perCt][0]." days"))."\n"; function newstrtotime($strtotime){ $datetime = date_create($strtotime); return $datetime->format("U"); } function newdate($format,$timestamp){ $datetime = date_create("@$timestamp"); return $datetime->format($format); } Let me know what you think.
  3. Ok, here is what I am trying to accomplish. I have a table with 1000 names in it and I need to display 50 names in each div. It should look something like this: <div id="some_div">name,name,name,ect...</div> // next div <div id="some_div"> name,name,name,ect....</div> So the code would be something like this: $sql = mysql_query("SELECT * FROM name_table"); echo '<div id="some_div">'; while($row = mysql_fetch_array($sql)) { echo $row['name'].','; } echo '<div>'; The issue is that this code will just put all the names into one div. I need the names divided into 20 divs with 50 names in each div. Any idea's?
  4. I need to find the percent who have converted. So I have grouped according to referral and ordered by total number of users and now I need to add the number who have converted and then divide by total number of prospects for that keyword. 1) Group keywords and number of prospects- Completed 2) Add number of conversions per keyword group- Need syntax 3) Complete math to make into percentage- Can do by php after retrieval Thanks
  5. The issue that I am running into now is that I need to count multiple rows and display them. Here is what my table looks like. id referral conversion 1 annuity 0 2 annuity 1 3 annuities 1 4 annuities 1 5 annuity 0 6 settlement 0 7 settlement 0 I want my table to look like this: keyword Number of Prospects Conversion % annuity 3 33% annuities 2 100% settlement 2 0% Here is the code that I have so far: $table = '<table>'; $table .= '<tr><th class="sortable">Keyword</th><th class="sortable">Number of Prospects</th><th>Conversion</th></tr>'; $select = mysql_query("select count(*) as count,referral from visitors group by referral order by count") or die(mysql_error()); while($row = mysql_fetch_array($select)) { $table .= '<tr><td>'.substr($row['referral'],0,35).'</td><td>'.$row['count'].'</td><td>'.$row['short'].'</td></tr>'; } $table .= '</table>'; Does anyone have any suggestions?
  6. Thanks for your help so far. The issue that I am running into now is that I need to count multiple rows and display them. Here is what my table looks like. id referral conversion 1 annuity 0 2 annuity 1 3 annuities 1 4 annuities 1 5 annuity 0 6 settlement 0 7 settlement 0 I want my table to look like this: keyword Number of Prospects Conversion % annuity 3 33% annuities 2 100% settlement 2 0% Here is the code that I have so far: $table = '<table>'; $table .= '<tr><th class="sortable">Keyword</th><th class="sortable">Number of Prospects</th><th>Conversion</th></tr>'; $select = mysql_query("select count(*) as count,referral from visitors group by referral order by count") or die(mysql_error()); while($row = mysql_fetch_array($select)) { $table .= '<tr><td>'.substr($row['referral'],0,35).'</td><td>'.$row['count'].'</td><td>'.$row['short'].'</td></tr>'; } $table .= '</table>'; Does anyone have any suggestions?
  7. Thank you. That seems to work like a charm. Here are some of the results. How would I sort these to get the keyword listed most at the top? Array ( [annuity] => Array ( [0] => 2 ) [annuities] => Array ( [0] => 7 ) [settlement] => Array ( [0] => 12 ) )
  8. Hi, I have a table in my database where I store the referral keywords from where my visitors came from. I am trying to fetch those results, count the number of time a user came from a keyword and enter these results into a table. Here is my code: $select = mysql_query("SELECT * FROM visitors"); while($row = mysql_fetch_array($select)) { $keyword = strtolower($row['referral']); $sel = mysql_query("SELECT * FROM visitors WHERE referral = '".$keyword."'"); $number = mysql_num_rows($sel); $array[$keyword] = $number; // also tried // $array[] = array($keyword => $number); print_r($array); I need remove the duplicate keywords and sort them by most occurrences, but the issue is that the function array_unique() and asort() are not working correctly. When I use array_unique() I get only 6 keywords when there are over 300 unique keyword combinations and the asort function is just not working. Is there something that I am doing wrong or does someone have a better solution? Thanks Andrew
  9. Hi, I don't know if this is simple or not, but I need a script that would convert a number like this 1230000 to 1.23M or 1.23B for 1230000000. Thanks for your help.
  10. I would but there is other html involved in the string that I didn't input into the string listed above. I can keep trying to work with it, but that may be the best option. Anyone else have any better scenario?
  11. Hi, I have been working at this for days and can't seem to output the right info. Here is the string I am working with. $str = "<land><id>0</id><image_url>http://example.com</image_url><num_owned>0</num_owned><cost>4500</cost><name>Vacant Lot</name><income>$100</income></land> <land><id>1</id><image_url>http://www.example.com</image_url><num_owned>0</num_owned><cost>45000</cost><name>Empty Storefront</name><income>$300</income></land> <land><id>2</id>http://www.example.com</image_url><num_owned>0</num_owned><cost>900000</cost><name>Plaza</name><income>$2,000</income></land>"; I need to extract id, image_url, num_owned, cost, name, and income for each of these three. Here is my code so far: $preg = "#<land><id>(.*?)</id><image_url>(.*?)</image_url><num_owned>(.*?)</num_owned><cost>(.*?)</cost><name>(.*?)</name><income>(.*?)</income></land>#i"; if(preg_match_all($preg,$str,$match)) { foreach($match as $val) { echo $val[1]; } } I get the following when I run the script (inside the source code): <land><id>1</id><image_url>http://www.example.com</image_url><num_owned>0</num_owned><cost>45000</cost><name>Empty Storefront</name><income>$300</income></land>1http://www.example.com045000Empty Storefront$300 Here are the problems that I am having. 1) I need to be able to use the image, income, cost, name, for each one of the 3 land strings. I understand that if I make the $val[1] variable $val[2] I will output the second land string, but I need to use each one of the image, income, cost, name and income variables. How do I do this? 2) There are more than just 3 land strings so I need a regex string that will satisfy that demand. My ultimate goal would be to create a calculator to calculate which land is the best value to purchase. So in this particular case I need to take the cost/income= best_value I appreciate all your help before hand.
  12. I need to preg match multiple values, but my code only seems to want to grab the first value then it stops. Here is an example HTML Code: <Td><a href="list.php?a=add&id=274619213&g=1">me</a></td> <Td ><a href="list.php?a=add&id=463335839&g=1">me</a></td> <Td><a href="list.php?a=add&id=106690164&g=1">me</a></td> I need to extract the id number from every line on the page, but there are hundreds on the page. This is the code I have so for. I believe I need a for statement but I don't know how to set it up. if (preg_match('#&id=(.+)&g=1#', $html, $matches)) { $id = $matches[1]; } Please help me figure this out. Thank you.
  13. Here is my situation. I have successfully logged into Myspace with Curl and am running into a problem once inside an application. In order for me to move on in my script I need to be able to grab data from the header. I need to get the session id which is not anywhere in the page except for the header. I use Live Http headers to see the session id, but I need to automate the process. Is there anyway to pull up the header data and then preg match it?
  14. I don't understand what you mean by adding all the keys into one strong. So I should still use the while function? This is what I tried below, but the array only shows the last keyword in the list. Please help. <?php include('config.php'); $target_url = "http://www.example.com/1"; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); curl_setopt($ch, CURLOPT_URL,$target_url); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_TIMEOUT, 20); $html = curl_exec($ch); $select = mysql_query("SELECT * FROM newBan"); while($row = mysql_fetch_assoc($select)) { $key = array($row['keyword']); $key1 = $key[0]; $key2 = $key[1]; } echo "$key1<br /> $key2"; if(preg_match("/".$key."/i", $html)) { echo "<p>Sorry you cannot add this profile.</p>"; } else { echo "The rest of the script continues."; } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.