conjob werkt niet meer....
Mijn cronjob werkt momenteel niet meer. Ik ben wezen 'prutsen' met het script. Dacht dat ik een update had gemaakt, maar blijkbaar niet.... Ik weet dat je beter met een query kan werken, maar zou het wel prettig vinden wanneer dit weer gaat werken.
Volgens mij moet hier ergens de fout in staan? Mochten jullie nog meer gegevens nodig hebben dan hoor ik het wel.
dit staat in het bestand cron.php
Code (php)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
include"config.php";
include"db.php";
include"functions.php";
include"top.php";
$opslaan = '<div class="leftmenu">
<img src="http://www.lastminuteskien.nl/dagtop5.gif">';
$query = "SELECT * FROM winterreizen order by rand() limit 5";
$result = mysql_query($query) or die("FOUT : " . mysql_error());
echo mysql_num_rows($result);
while(list($uid, $aanbieder, $id, $title, $link, $description, $price, $country, $area, $start_date,
$end_date, $departure_date, $length, $transportation_type, $accomodation_type, $holiday_type, $location,
$thumb, $triptype, $region, $minimumpax, $image) = mysql_fetch_row($result))
{
$vlag = vlag($country, $root);
$country = land($country);
$country2 = urlencode(strtolower(str_replace(" ", "_", $country)));
$area2 = urlencode(strtolower(str_replace(" ", "_", $area)));
$location2 = urlencode(strtolower(str_replace(" ", "_", $location)));
$title2 = urlencode(strtolower(str_replace(" ", "_", $title)));
$region2 = urlencode(strtolower(str_replace(" ", "_", $region)));
if($aanbieder=='snowexpres'){
$title = htmlentities($title);
$area = htmlentities($area);
$description = htmlentities($description);
}
$land = strtolower(land($country));
$opslaan .= "
<div class='dagtopbg'>
<div class='dag'>
<b>$vlag <a href='$root/reis/$uid/$country2/$area2/$title2.html'>$area</a></b><br>
<a href='$root/reis/$uid/$country2/$area2/$title2.html'><img style='float:left' src=\"$root/phpthumb/phpThumb.php?src=$thumb&w=100&h=45&zc=1\" class='borderimg' align=\"left\" border=\"0\"></a>
$length dagen
<br><div class='prijs'>€$price</div>
</div>
</div>";
}
$opslaan .= "</div>
<div class='leftbottom'></div><!-- Mm: cron gedraaid op ". date("D d-M-Y H:i") ." -->";
//echo "Huidige directory: ~~~".realpath(".")."~~~\n";
// pad wanneer vanuit cron gedraaid is anders dan vanuit browser!
// browser: /usr/home/~~accountnaam~~/domains/~~domeinnaam~~/public_html
// cron: /usr/home/~~accountnaam~~ (document_root is leeg)
/*
echo "PHP_SELF: ~~~".$_SERVER['PHP_SELF']."~~~\n";
echo "DOCUMENT_ROOT: ~~~".$_SERVER['DOCUMENT_ROOT']."~~~\n";
echo "SCRIPT_FILENAME: ~~~".$_SERVER['SCRIPT_FILENAME']."~~~\n";
echo "PATH_TRANSLATED: ~~~".$_SERVER['PATH_TRANSLATED']."~~~\n";
echo "SCRIPT_NAME: ~~~".$_SERVER['SCRIPT_NAME']."~~~\n";
*/
$file2 = dirname($_SERVER['SCRIPT_FILENAME'])."/day/dagtop10.php";
$fopen = fopen($file2, "w+");
fwrite($fopen, $opslaan);
fclose($fopen);
?>
<?php
include'day/dagtop10.php';
/* ?>
<div class='leftmenu'>
<img src='<?php echo"$root"; ?>/dagtop5.gif'>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg'></div>
</div>
<div class='leftbottom'></div>
include"config.php";
include"db.php";
include"functions.php";
include"top.php";
$opslaan = '<div class="leftmenu">
<img src="http://www.lastminuteskien.nl/dagtop5.gif">';
$query = "SELECT * FROM winterreizen order by rand() limit 5";
$result = mysql_query($query) or die("FOUT : " . mysql_error());
echo mysql_num_rows($result);
while(list($uid, $aanbieder, $id, $title, $link, $description, $price, $country, $area, $start_date,
$end_date, $departure_date, $length, $transportation_type, $accomodation_type, $holiday_type, $location,
$thumb, $triptype, $region, $minimumpax, $image) = mysql_fetch_row($result))
{
$vlag = vlag($country, $root);
$country = land($country);
$country2 = urlencode(strtolower(str_replace(" ", "_", $country)));
$area2 = urlencode(strtolower(str_replace(" ", "_", $area)));
$location2 = urlencode(strtolower(str_replace(" ", "_", $location)));
$title2 = urlencode(strtolower(str_replace(" ", "_", $title)));
$region2 = urlencode(strtolower(str_replace(" ", "_", $region)));
if($aanbieder=='snowexpres'){
$title = htmlentities($title);
$area = htmlentities($area);
$description = htmlentities($description);
}
$land = strtolower(land($country));
$opslaan .= "
<div class='dagtopbg'>
<div class='dag'>
<b>$vlag <a href='$root/reis/$uid/$country2/$area2/$title2.html'>$area</a></b><br>
<a href='$root/reis/$uid/$country2/$area2/$title2.html'><img style='float:left' src=\"$root/phpthumb/phpThumb.php?src=$thumb&w=100&h=45&zc=1\" class='borderimg' align=\"left\" border=\"0\"></a>
$length dagen
<br><div class='prijs'>€$price</div>
</div>
</div>";
}
$opslaan .= "</div>
<div class='leftbottom'></div><!-- Mm: cron gedraaid op ". date("D d-M-Y H:i") ." -->";
//echo "Huidige directory: ~~~".realpath(".")."~~~\n";
// pad wanneer vanuit cron gedraaid is anders dan vanuit browser!
// browser: /usr/home/~~accountnaam~~/domains/~~domeinnaam~~/public_html
// cron: /usr/home/~~accountnaam~~ (document_root is leeg)
/*
echo "PHP_SELF: ~~~".$_SERVER['PHP_SELF']."~~~\n";
echo "DOCUMENT_ROOT: ~~~".$_SERVER['DOCUMENT_ROOT']."~~~\n";
echo "SCRIPT_FILENAME: ~~~".$_SERVER['SCRIPT_FILENAME']."~~~\n";
echo "PATH_TRANSLATED: ~~~".$_SERVER['PATH_TRANSLATED']."~~~\n";
echo "SCRIPT_NAME: ~~~".$_SERVER['SCRIPT_NAME']."~~~\n";
*/
$file2 = dirname($_SERVER['SCRIPT_FILENAME'])."/day/dagtop10.php";
$fopen = fopen($file2, "w+");
fwrite($fopen, $opslaan);
fclose($fopen);
?>
<?php
include'day/dagtop10.php';
/* ?>
<div class='leftmenu'>
<img src='<?php echo"$root"; ?>/dagtop5.gif'>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg'></div>
</div>
<div class='leftbottom'></div>
onderstaand in top.php
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
include'day/dagtop10.php';
/* ?>
<div class='leftmenu'>
<img src='<?php echo"$root"; ?>/dagtop5.gif'>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg'></div>
</div>
<div class='leftbottom'></div>
>
include'day/dagtop10.php';
/* ?>
<div class='leftmenu'>
<img src='<?php echo"$root"; ?>/dagtop5.gif'>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg' style='margin-top:5px;'></div>
<div class='dagtopbg'></div>
</div>
<div class='leftbottom'></div>
>
Gebruik code-tags voor het overzichtelijk weergeven van je code[/modedit]
Gewijzigd op 08/10/2010 21:58:19 door Joren de Wit
ik had gezegd, dat ik me er verder in zou verdiepen. Het is voor mij (nu) te complex om daar mee te werken. Of je moet zeggen ik help je wel ;)
Zet error_reporting aan en laat de cron deze output naar een file schrijven.
bedankt voor je reactie. Ik heb alles nog een keer geuploaded en het een en ander aangepast. En tot mijn verbazing werkt het weer. Iig bedankt.