Monday, August 02, 2004

Well here's what I learned from my first little experience with PHP & libcurl .....

base href="http://www.mctreas.org/"
// ACCESS DAYTON PUBLIC RECORDS SITE
$url = "http://www.mctreas.org/Message_IsProcessing.cfm";
$ch = curl_init(); // initialize curl handle
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
// allow redirects
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
// times out after 4s
curl_setopt($ch, CURLOPT_POST, 1); // set POST method
curl_setopt($ch, CURLOPT_POSTFIELDS,
"streetnbr=1673&streetname=
earlham%20&own1=&parid=&taxyr=2003");
// add post fields

$result = curl_exec($ch); // run the whole process
print_r(curl_getinfo($ch));
echo "\n\ncURL error number:" .curl_errno($ch);
echo "\n\ncURL error:" . curl_error($ch);

curl_close($ch);
print $result;
?>



This little code right here did a basic post to a website and printed out the results from it or really gave me the page that it redirects to. It's the first step along this road and its a very good one. Oh, and to display code in a blog just take out a "<" and replace it with & l t ; Just smush it back together when you do.


Thursday, July 29, 2004

I'll try to keep my more technical posts over here on TechLife & leave Mindstates for what's going on in my head. I think the first problem I need to try and tackle is with page scraping. I need to access this public records site but I need to fill out a form first to get the information I want. I know page scraping is the way to go, I just need to learn more about it. When I get through and get it working I'll post up any working code that I have.

Tuesday, June 03, 2003

In providing this blog the purpose stands to be to further any knowledge of technology a person might have that visits this place. I have a deep love of technology and I would like to do my best to show people that by showing them how it can work for them.
Now after that wonderful little intro I would like to say that I spend waaay too much time online (like 40+ hours), so I think that whatever I find I need to share with other people else I'm spending too much time on here for nothing. I run into a lot of info so whatever I find I'll be sure to bring back and share with all. So I'm gonna try not to talk straight "techy" speak, I want to find things that will get regular people involved without having them say "huh?" every other word. So until I bring back some stuff...I'm out.