Advertisement

12.30.2007 at 05:10PM PST, ID: 23050165
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

CURL Suddently Stopped Working! URGENT!

Asked by magnumiq in PHP Scripting Language

Tags:

Hello I have the following code below with private information removed.  The problem is this was working perfectly and suddenly it just stopped.  Any reason why this might happen?

The process was running for a really long time so could have something happened on my server or something?  Anyways here's the code...it uses CURL to access a site with a different id each time and I'm able to pull out some data...anyways here's the code and I appreciate any assistance...this is extremely urgent.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
<?
set_time_limit(0);
if($_GET['code'] == "xxxxxxxxxx") {
for($i=12942; $i<=100000; $i++) {
if(checkthesite($i) == 1) {
get_info($i);
}
//echo("this<br>");
}
} else {
echo("You don't have permission to be at this page");
}
 
function checkthesite($id) {
$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'http://www.xxxxxxx.net/'.$id.'');
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl_handle,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($curl_handle,CURLOPT_COOKIESESSION,true);
curl_setopt($curl_handle, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($curl_handle, CURLOPT_COOKIEFILE, 'cookie.txt');
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
 
if(strstr($buffer,"Page Not Found") ) {
$existing = "0";
$existing_text = "NON EXISTING";
}
 
if(!strstr($buffer,"Page Not Found") ) {
$existing = "1";
$existing_text = "EXISTING";
}
 
echo("ID#: ".$id." Is -- ".$existing_text."<BR>");
 
return $existing;
}
 
function get_info($id) {
$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'http://www.xxx.net/xxxx');
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl_handle,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($curl_handle, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($curl_handle, CURLOPT_COOKIEFILE, 'cookie.txt');
 
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
preg_match('/(?<=Independent Representative:).*?\r\n\s+(.*?)\s(.*?)\s{2,}.*?\r\n\s+ID:<span class="style4">\r\n\s+(.*?)\r\n\s*<\/span>\s*<\/font><\/font>\s*<font color="#666666" size="2">\s*<label>\s*(.*?)\s*<\/label>/',$buffer,$resultarray);
$fname = $resultarray[1];
$lname = $resultarray[2];
$email = $resultarray[4];
if(!empty($email_address) ) {
if(check_email($email) == 1) {
add_record($fname,$lname,$email_address,$id);
}
 
}
//echo $buffer;
//echo '<pre>', print_r($resultarray, true), '</pre>'; 
}
 
function add_record($fname,$lname,$email,$id) {
include("xxxxs/xxxx.php");
mysql_select_db($database_xxxx, $xxxx);
$success = mysql_query("INSERT INTO `xxxx` (fname,lname,email,xxx) VALUES ('$fname','$lname','$email','$id')");
}
 
function check_email($email) {
include("xxxxxxx.php");
$xxxx = mysql_pconnect($hostname_xxxx, $username_xxx, $password_xxxx) or die(mysql_error());
mysql_select_db($database_xxxxxx, $xxxxxx);
$query_emailaddy = "SELECT email FROM xxxxxx WHERE email= '$email'";
$emailaddy = mysql_query($query_emailaddy, $xxxxxx) or die(mysql_error());
$row_emailaddy = mysql_fetch_assoc($emailaddy);
$totalRows_emailaddy= mysql_num_rows($emailaddy); 
if($totalRows_emailaddy >=1) {
$addit = 0;
} else {
$addit = 1;
}
return $addit;
}
?>
[+][-]12.31.2007 at 01:23AM PST, ID: 20553900

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Tags: PHP
Sign Up Now!
Solution Provided By: us111
Participating Experts: 2
Solution Grade: A
 
 
[+][-]12.31.2007 at 02:03AM PST, ID: 20553969

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]10.06.2008 at 07:18AM PDT, ID: 22650247

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]10.06.2008 at 07:21AM PDT, ID: 22650273

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.10.2008 at 07:08PM PDT, ID: 22692186

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628