Jump to content

phoenixx

Members
  • Posts

    89
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

phoenixx's Achievements

Member

Member (2/5)

0

Reputation

  1. Solved with a little trial and error I simply changed preg_match('/<title">([^"]*)<\/title>/isu',$var2,$title); to preg_match('/<title">([^"]*.?)<\/title>/isu',$var2,$title);
  2. I am trying to extract between the <title> </title> tags from several different websites. The code below works perfectly unless there are non ascii characters in the result. But the weird thing is that while it doesn't produce an output if the string has odd characters - it doesn't produce an error either. The characters (and they won't always be the same characters) in the example that breaks are ➹➹➹➹➹ which produces the code below. I want the regex to pickup the characters (in this case ➹) and everything between the title tag. ➹➹➹➹➹ Carnival Cruise Departure Dates preg_match('/<title">([^"]*)<\/title>/isu',$var2,$title); $title=$title[1]; if (preg_last_error() == PREG_NO_ERROR) { echo "----------Title: ".$title."<br>"; } else if (preg_last_error() == PREG_INTERNAL_ERROR) { echo "----------Title: There is an internal error!"; } else if (preg_last_error() == PREG_BACKTRACK_LIMIT_ERROR) { echo "----------Title: Backtrack limit was exhausted!"; } else if (preg_last_error() == PREG_RECURSION_LIMIT_ERROR) { echo "----------Title: Recursion limit was exhausted!"; } else if (preg_last_error() == PREG_BAD_UTF8_ERROR) { echo "----------Title: Bad UTF8 error!"; } else if (preg_last_error() == PREG_BAD_UTF8_ERROR) { echo "----------Title: Bad UTF8 offset error!"; } Thanks in advance.
  3. No, I try posting the command in the windows+r run and it's perfect. It also does it when I call any shortcut from any program. I've tried it with several.
  4. I'm using a program called Do It Again which is a mouse recorder. I am trying to launch a shortcut to it from my php script. Seems all is okay when I run it as a stand alone program, and is not set to have to be run by the administrator - still when I launch it from my php page I get the windows popup saying the program has crashed. "DoItAgain.exe has encountered a problem and needs to close. We are sorry for the inconvenience." It's not the program, but something in my code: $command= 'C:\\xampp\htdocs\poster\dia\\Monty_20.dia'; exec($command); I also tried the following but get the windows popup error: "The Application Failed to Initiate Properly" $command= ('START C:\\xampp\\htdocs\\poster\\dia\\Monty_20.dia'); Any help would be greatly appreciated. I've been at it for 3 hours now and I'm pulling out what little hair I have left.
  5. Sorry, misunderstood the question. Try using a custom 404 page and use the following: $userid=explode ("/",$url); // requested URL echo $userid[1]; // or $userid[3] if using http://www.domain.com/id instead of just www file_get_contents("http://mydomain.com/404.php?id="); //to reflect the output of the requested user
  6. Just have it pull the username associated with the row id in the database.
  7. I ran across a dynamic cookie that needs to be passed on the Sears website (I have to scrape the hardware for a client). The cookie sample is: 132358103124371640736644174. Now I've figured out the first 10 digits are generated with date("U"), but I'm having trouble dissecting the rest. I've looked at common time strings with no luck. The cookie is always within 1 or 2 characters of each other when refreshing. I also know the server is on the west coast. Any thoughts?
  8. And, I might add is 100% Craigslist TOS Compliant. Again, we pay for our ads, we don't spam - I'll just figure it out - didn't come for criticism. That's why I don't frequent PF as much as I used to.
  9. We're writing an app for the housing industry. These are paid ads - not the freebie stuff - we're just trying to simplify the process.
  10. I'm trying to send a submission to the following Craigslist form that uses javascript to trigger an auto submit. The user selects "For Sale" on my form and it will pass the data in a hidden div to the proper selection on the craigslist page. Heres the page it would be passing to. I know I will have to pass it in the URL. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <base href="https://post.craigslist.org"> <title>houston craigslist | choose type</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <link type="text/css" rel="stylesheet" media="all" href="/styles/craigslist.css?v=9"> </head> <body id="pp"> <table width="100%" id="header" summary="header"> <tr valign="top"> <td><a href="http://houston.craigslist.org/"><b>houston craigslist</b></a> > choose type<br></td> <td width="10%" class="highlight" style="text-align: right; white-space: nowrap;"> <font size="2" face="sans-serif" color="#7a7a7a">[ logged in as <a href="https://accounts.craigslist.org/login"><b>kennymahaffey@gmail.com</b></a> ] [ <a href="https://accounts.craigslist.org/logout">logout</a> ]</font> <br></td> </tr> </table> <hr> <blockquote> <div class="highlight"> <i>Please post to a single geographic area and category only -- cross-posting to multiple cities or categories is not allowed</i> </div> <h4>What type of posting is this:</h4> <form action="https://post.craigslist.org/k/kInfxI4M4RGIA7PWTF5SWg/HjdlJ" method="POST"> <blockquote> <label> <input type="radio" name="id" value="jo" onclick="form.submit(); return false;">job offered </label> <br> <label> <input type="radio" name="id" value="jw" onclick="form.submit(); return false;">resume / job wanted </label> <br> <br> <label> <input type="radio" name="id" value="ho" onclick="form.submit(); return false;">housing offered </label> <br> <label> <input type="radio" name="id" value="hw" onclick="form.submit(); return false;">housing wanted </label> <br> <br> <label> <input type="radio" name="id" value="fs" onclick="form.submit(); return false;">for sale </label> <i>(please do not post prohibited <sup><a target="_blank" href="http://www.craigslist.org/about/prohibited.items">[?]</a></sup> or recalled <sup><a target="_blank" href="http://www.craigslist.org/about/recalled_items">[?]</a></sup> items)</i> <br> <label> <input type="radio" name="id" value="iw" onclick="form.submit(); return false;">item wanted </label> <br> <br> <label> <input type="radio" name="id" value="go" onclick="form.submit(); return false;">gig offered </label> <i>(I'm hiring for a short-term, small or odd job)</i> <br> <label> <input type="radio" name="id" value="so" onclick="form.submit(); return false;">service offered </label> <br> <br> <label> <input type="radio" name="id" value="p" onclick="form.submit(); return false;">personal / romance </label> <br> <br> <label> <input type="radio" name="id" value="c" onclick="form.submit(); return false;">community </label> <br> <label> <input type="radio" name="id" value="e" onclick="form.submit(); return false;">event </label> <br> <br> </blockquote> <input type="hidden" name="U2FsdGVkX:18yNDg2NDI0O:A8dZroeLa8K5Y677RwK4hzBe2OPdD3XxLUDb5lS9LllELhxNpMqXZIwAWDxJ.7Wo4A" value="U2FsdGVkX18yNDg2NDI0OFjS1qgWn_NKgmgnh5qCZ9aK2m7eOmS-uAAM_Pwu8VHN"> <button type="submit" name="go" value="Continue">Continue</button> </form> </blockquote>
  11. Try $data = ("urlYouAreScraping"); preg_match('/business_name type="string">([^"]*)<\/business_name>/is',$data,$out); // Getting the business name echo $out[1];
  12. I'm trying to increase the variables $schedulemonth, $scheduledate, $scheduleyear in each loop so that they look like $schedulemonth1, $schedulemonth2, $schedulemonth3, etc... for each of them. I've tried several options and know I'm on the right track, but no go. The customer will choose how many payments and the script below will loop that many times - I have that part working - but the calendar I'm using with the variables above is the issue. Here's the code I'm using. while ($balance > 0){ if ($balance>$monthlypayment){ $myCalendar = new tc_calendar("date" . $paymentnumber, true);$myCalendar->setIcon("images/iconCalendar.gif");$myCalendar->setDate($scheduledate, $schedulemonth, $scheduleyear); //output the calendar $myCalendar->writeScript(); echo " "; echo "<input type=\"text\" name=\"payment" . $monthlypayment . "\" value=\"" . $monthlypayment . "\">\n"; $paymenttotal=($monthlypayment+$paymenttotal); $balance=round(($invoicetotal-$paymenttotal),2); echo " Balance: $balance\n"; $schedulemonth++; if ($schedulemonth==13){ $schedulemonth=1; $scheduleyear=($scheduleyear+1); } echo "<br>\n"; } if ($balance<$monthlypayment||$balance==$monthlypayment){ $myCalendar = new tc_calendar("date" . $paymentnumber, true);$myCalendar->setIcon("images/iconCalendar.gif");$myCalendar->setDate($scheduledate, $schedulemonth, $scheduleyear); //output the calendar $myCalendar->writeScript(); echo " "; echo "<input type=\"text\" name=\"payment" . $paymentnumber . "\" value=\"" . $balance . "\">\n"; $paymenttotal=($balance+$paymenttotal); $balance=round(($invoicetotal-$paymenttotal),2); echo " Balance: $balance\n"; $schedulemonth++; if ($schedulemonth==13){ $schedulemonth=1; $scheduleyear=($scheduleyear+1); } echo "<br>\n"; } } Additionally it needs to pick up each of these variables on the next page the variables are part of hidden fields in an form later in the page. So my question is actually 3 fold. 1. How do I increase the variable count in the loop above. 2. How do I put the <input type="hidden".......> in the form so that it loops through and catches the increasing variables 3. How do I loop through on the insertion page after the form is submitted to catch how many inserts to the database are needed. This one has me bent over.
  13. The data needs to be worked into other aspects of the script in the page, and then finally will be inserted into the database. I'll work with it. NOT SOLVED BUT CLOSED.
  14. Okay, sorry - here is a better breakdown of the scenario. I have scraped data using the following code: preg_match_all('~<td\s+width="550">(.*?)</td>~', $data, $series_description); // Series Descriptions $d = array_merge($series_description[0]); foreach($d as $k=>$v){ echo $v . "||||"; } In this situation it spits out : The rich contemporary style of the "Theo" Counter Height Table combines faux marble and a warm finish to create dining room furniture that adds an exciting style to the decor of any home. The thick polyurethane coated faux marble table top perfectly accentuates the warm brown finish flowing over the straight-lined contemporary design of the apron and legs to help create an exceptional dining experience. With the beautiful stitching and button tufting details of the faux leather upholstered bar stools, the "Theo" Counter Height Table is a refreshing addition to any home.||||Table top made with polyurethane coated print marble. Aprons and legs made from select veneer and solids with a warm brown finish. Chair is upholstered in a brown PVC with accent top stitching. D158-233 bar stool dimension: 18"W x 21"D x 40"H.||||Click here for complete image download listing for series D158.|||| I need to separate each $v into it's own dynamically increasing variable so that it can be written to the database.
  15. I have the following code which has deliimiters of |||| and I need to break it apart into three strings and have a variable assigned to each string. I've tried exploding it but won't dynamically increase the variable. I know at one point about a year ago I used something like $var.=$foo and the $var would increase $var1, $var2, etc... Here's the string I need to break.j (And the string will be different every time, and some will have 2 string delimited some will have 20, and some inbetween. The rich contemporary style of the "Theo" Counter Height Table combines faux marble and a warm finish to create dining room furniture that adds an exciting style to the decor of any home. The thick polyurethane coated faux marble table top perfectly accentuates the warm brown finish flowing over the straight-lined contemporary design of the apron and legs to help create an exceptional dining experience. With the beautiful stitching and button tufting details of the faux leather upholstered bar stools, the "Theo" Counter Height Table is a refreshing addition to any home.||||Table top made with polyurethane coated print marble. Aprons and legs made from select veneer and solids with a warm brown finish. Chair is upholstered in a brown PVC with accent top stitching. D158-233 bar stool dimension: 18"W x 21"D x 40"H.||||Click here for complete image download listing for series D158. In a perfect world it would be: $desription1="The rich contemporary style of the "Theo" Counter Height Table combines faux marble and a warm finish to create dining room furniture that adds an exciting style to the decor of any home. The thick polyurethane coated faux marble table top perfectly accentuates the warm brown finish flowing over the straight-lined contemporary design of the apron and legs to help create an exceptional dining experience. With the beautiful stitching and button tufting details of the faux leather upholstered bar stools, the "Theo" Counter Height Table is a refreshing addition to any home."; $description2="Table top made with polyurethane coated print marble. Aprons and legs made from select veneer and solids with a warm brown finish. Chair is upholstered in a brown PVC with accent top stitching. D158-233 bar stool dimension: 18"W x 21"D x 40"H.": $description3="Click here for complete image download listing for series D158.";
×
×
  • 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.