Als ik gewoon getdata.php aanroep dan werkt het en schrijft hij de playlist weg in mijn database.
Maar ik gebruik een cronjob die php /home/sunreeze/public_html/am/getdata.php aanroept. Die wordt wel uitgevoerd maar toch werkt het niet, het lijkt alsof die cronjob een probleem heeft met die header die input.php aanroept?
getdata.php
Maar ik gebruik een cronjob die php /home/sunreeze/public_html/am/getdata.php aanroept. Die wordt wel uitgevoerd maar toch werkt het niet, het lijkt alsof die cronjob een probleem heeft met die header die input.php aanroept?
getdata.php
PHP:
input.php1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| <?php $rnd = rand(1, 9999999); $returned_content = get_data('http://www.cm-server.mine.nu/ajoinmusic/scripts/cm-onair.php?rand='.$rnd); header("Location: input.php?rand=".$rnd.$returned_content); function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $data = curl_exec($ch); curl_close($ch); return $data; } ?> |
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
| <?php $tijd4 = $_GET["tijd4"]; $artiest4 = $_GET["artiest4"]; $titel4 = $_GET["titel4"]; $tijd5 = $_GET["tijd5"]; $artiest5 = $_GET["artiest5"]; $titel5 = $_GET["titel5"]; $tijd6 = $_GET["tijd6"]; $artiest6 = $_GET["artiest6"]; $titel6 = $_GET["titel6"]; $con = mysql_connect("localhost","$$$$$","$$$$$$"); if (!$con) { die('Could not connect: ' . mysql_error()); echo "neen"; } mysql_select_db("sunreeze_carnaval", $con); if(!mysql_num_rows(mysql_query("SELECT id FROM ajoinmusic WHERE date = CURDATE() AND time ='$tijd4'"))){ mysql_query("INSERT INTO ajoinmusic (date, time, artist, track)VALUES (CURDATE(),'$tijd4', '$artiest4', '$titel4' )"); } if(!mysql_num_rows(mysql_query("SELECT id FROM ajoinmusic WHERE date = CURDATE() AND time ='$tijd5'"))){ mysql_query("INSERT INTO ajoinmusic (date, time, artist, track)VALUES (CURDATE(),'$tijd5', '$artiest5', '$titel5' )"); } if(!mysql_num_rows(mysql_query("SELECT id FROM ajoinmusic WHERE date = CURDATE() AND time ='$tijd6'"))){ mysql_query("INSERT INTO ajoinmusic (date, time, artist, track)VALUES (CURDATE(),'$tijd6', '$artiest6', '$titel6' )"); } mysql_close($con); ?> |