Jump to content

Modernvox

Members
  • Posts

    412
  • Joined

  • Last visited

    Never

Everything posted by Modernvox

  1. Thanks Presimo that worked, but what is the reason for the / ?
  2. Hi Guyz, Where do I insert this target=”_blank”? echo "<a href=\"$url{$post[1]}\">{$post[2]}<font size=\"3\">{$post[3]}</font></a><br />"; print "<BR />\n"; Seems no matter where i try to place it it displays with the results? Thanks in advance.
  3. Open this link in a new window...Unfortunately this question was answered for me a while back, but can't get to the message. Trying to open this link in a new window? echo "<a href=\"$url{$post[1]}\">{$post[2]}<font size=\"3\">{$post[3]}</font></a><br />"; print "<BR />\n"; Thanks in advance.
  4. Hi again Guyz, I am trying to find out about using a search box on a remote site without manually typing in a keyword. SO, if i wanted to find a piano for sale on 3 different classified sites, what would be the best method? There's a name for this function, right? Just need to know what it's called so I may google and learn it. Thanks in advance!
  5. haha, I'm batting 0 this week. I seem to be second guessing myself. Your answer is what i needed, thanks again Premiso. Take Care until next time:-)
  6. Thank you premiso. I guess I asked the wrong question as I tried the mod but just realized i should be opening a new window from the drop down form correct? Like such: <form name="" action="search.php" target="windowName" method="post" onsubmit="window.open('', this.target, 'dialog,modal,scrollbars=no,resizable=no,width=450,height=600,left=362,top=284');"> Can I just open a entire window or do i need to input width, height etc...? Thanks again.
  7. Hi guyz. Just wandering how i would open these lkinks in a new window? echo "<a href=\"$url{$post[1]}\">{$post[2]}<font size=\"3\">{$post[3]}</a><br />"; print "<BR />\n"; Thanks in advance guyz
  8. Damn...I am really am dumb as shit!!!! Thanks Guyz! No problem! Just part of programming. I'd recommend you download an IDE for PHP (such as NetBeans), They're free and can list PHP errors, as well as highlight your code to show obvious syntax errors. Will do. TY
  9. Damn...I am really am dumb as shit!!!! Thanks Guyz!
  10. I tried all that already, it does nothing dude
  11. Note something's up with the brackets? .. Nah...No matter what I do the error exists.
  12. Hi Guyz, Can anyone see this error in the code? Cause I've been looking for a while now. <?php if(isset($_POST['submit'])) if(isset($_POST['name'])) if(isset($_POST['address'])) $email = ($_POST['email']; $name = ($_POST['name']; $details = ($_POST['comments']; $pattern = '/^[a-z0-9]{4,}+.?([a-z0-9]+)?@([a-z0-9]+\.)+[a-z]{3,4}$/i'; if (preg_match($pattern, $email)) { echo "message here"; } else { echo "You have entered an invalid email address"; return 1; } $to = 'myaddress'; $subject = 'You have an affiliate inquiry'; $msg = "$name $email $details"; mail($to, $subject, $msg, 'From:' . $email); ?>
  13. Thanks Joel(You were on the right track) and of course my good man Thorpe who has helped me on many a occasions. Much appreciated...believe me
  14. My Bad <?php $st = isset($_POST['submit']) ? $_POST['state'] : ''; $urls = array(); if ($st == "AL") { $urls = array("http://auburn.craigslist.org", "http://bham.craigslist.org"); } else if ($st == "AK") { $urls= array("http://anchorage.craigslist.org"); } foreach ($urls as $url) { $html = file_get_contents("$url/muc/"); preg_match_all('/<a href="([^"]+)">([^<]+)<\/a><font size="-1">([^"]+)<\/font>/s', $html,$posts,PREG_SET_ORDER); //echo "<pre>";print_r($posts); $i = 1; //set start point; $limit = 60; //set limit; foreach ($posts as $post) { //print $post[0]; //HTML $post[2] = str_ireplace($url,"",$post[2]); //remove domain echo "<a href=\"$url{$post[1]}\">{$post[2]}<font size=\"3\">{$post[3]}<br />"; print "<BR />\n"; if ($i == $limit) { break; } $i++; } } ?>
  15. $CL = "Craigslist"; I have my code all complete with one exception. After I select a State from the drop down box the script scrapes the appropriate data from CL and displays it on the page. That's Great, right? Right! But it also transforms all my buttons and images into a link which is the same link from the last results returned from the original request? If you go to http://dezi9er.net16.net/search.php and just press submit the first attempt will return the results the way it is suppose to, But Now it turns everything into a link? click on the bouncer image or any of the buttons and it will take you to a CL listing. This is crazy! What is going on here?
  16. Ok..What is happening is the code is turning ALL elements on my entire page into a link to the last returned link from the code?
  17. Also it seems all elements i.e. images, text, etc... is linking to the last link returned??
  18. I currently have a drop down form that allows users to select a state which display ads (Scraped from website). The problem is the form only works for the first use. Additional attempts will open a link from the previous process. In other words instead of displaying the new results it opens the last imported row from previous process? <?php $st = isset($_POST['submit']) ? $_POST['state'] : ''; $urls = array(); if ($st == "AL") { echo "Over 500 results detected! You may also search by city."; $urls = array("http://auburn.craigslist.org", "http://bham.craigslist.org"); } else if ($st == "AK") { $urls= array("http://anchorage.craigslist.org"); } else if ($st == "AZ") { $urls = array("http://anchorage.craigslist.org"); } foreach ($urls as $url) { $html = file_get_contents("$url/muc/"); preg_match_all('/<a href="([^"]+)">([^<]+)<\/a><font size="-1">([^"]+)<\/font>/s', $html,$posts,PREG_SET_ORDER); //echo "<pre>";print_r($posts); $i = 1; //set start point; $limit = 65; //set limit; foreach ($posts as $post) { //print $post[0]; //HTML $post[2] = str_ireplace($url,"",$post[2]); //remove domain echo "<a href=\"$url{$post[1]}\">{$post[2]}<font size=\"3\">{$post[3]}<br />"; print "<BR />\n"; if ($i == $limit) { break; } $i++; } } ?> Thanks in advance
  19. Thanks Marcus. Much appreciated.
  20. Can someone provide a yes or no to this? Thanks Guyz
  21. Can I limit the number of records returned from a scraping session? <?php $st = isset($_POST['submit']) ? $_POST['state'] : ''; $urls = array(); if ($st == "AL") { $urls = array("http://auburn.craigslist.org", "http://bham.craigslist.org"); } else if ($st == "AK") { $urls= array("http://anchorage.craigslist.org"); } else if ($st == "AZ") { $urls = array("http://anchorage.craigslist.org"); } foreach ($urls as $url) { $html = file_get_contents("$url/muc/"); preg_match_all('/<a href="([^"]+)">([^<]+)<\/a><font size="-1">([^"]+)<\/font>/s', $html,$posts,PREG_SET_ORDER); //echo "<pre>";print_r($posts); foreach ($posts as $post) { //print $post[0]; //HTML $post[2] = str_ireplace($url,"",$post[2]); //remove domain echo "<a href=\"$url{$post[1]}\">{$post[2]}<font size=\"3\">{$post[3]}<br />"; print "<BR />\n"; } } ?> Thanks in Advance
  22. I have scraped data that needs to be dispersed INTO it's appropriate rows. The problem is the data pertains to specific States & Cities so i am wondering if I can do the following instead of creating hundreds of DB fields: $urls = array(); $insert = array(); if ($st == "AL") \\if State is Alabama { $urls = array("http://auburn.craigslist.org", "http://bham.craigslist.org"); //This will be popular cities in Alabama $insert= array("auburn", "bham"); // This will need to be Inserted INTO proper DB row to match city selected above // SO if user selects auburn listings I need to extract data from $insert('auburn')?? } else if ($st == "AK") { $urls= array("http://anchorage.craigslist.org"); } else if ($st == "AZ") { $urls = array("http://anchorage.craigslist.org"); } foreach ($urls as $url) { $html = file_get_contents("$url/muc/"); preg_match_all('/<a href="([^"]+)">([^<]+)<\/a><font size="-1">([^"]+)<\/font>/s', $html,$posts,PREG_SET_ORDER); //echo "<pre>";print_r($posts); foreach ($posts as $post) { $dbx= mysql_connect("", "", ""); if (!$dbx) { die('Could not connect: ' . mysql_error()); } //print $post[0]; //HTML $post[2] = str_ireplace($url,"",$post[2]); //remove domain echo "<a href=\"$url{$post[1]}\">{$post[2]}<font size=\"3\">{$post[3]}<br />"; print "<BR />\n"; } } mysql_SELECT_db("db_name", $dbx); mysql_Query("INSERT INTO $insert // Need to choose the State VALUES ("Value1', 'Value2', 'Value3')"); //Need to choose the city mysql_close($dbx); ?> Essentially what I am trying to accomplish is> avoid having to manually create a field for each city as there are hundreds. I would like to have the States set up and then just auto add the data INTO appropriate cities. Thank You.
  23. I'm only linking back to CL. In the biggest cities the return should be between 50 and 10,000 links. If you again suggest using a DB I will. I was under the assumption I could just display 50 scraped links, open new page (if needed) display the next 50 so on and so forth maybe using a button stating next. Thanks again for your guidance.
×
×
  • 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.