vraag php script
hier een link naar de vraag paar mensen hadden al wat geporbeerd maar kwamen er ook niet echt uit.
hopelijk kan iemand mij hier helpen.
http://www.sitedeals.nl/scripting-php-asp-javascript/54341-vraag-php-script.html
mvg
justin
http://www.phphulp.nl/php/scripts/7/635/
^^ Dat script heb ik ooit eens geschreven, net even iets duidelijker.
^^ Dat script heb ik ooit eens geschreven, net even iets duidelijker.
o zou u mij dan misschien kunnen helpen met dat linksysteem erin te krijgen bij mij lukt het nog niet echt
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
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
<?php
session_start();
require("includes/vars.inc.php");
require("includes/functions.inc.php");
require("includes/templates.inc.php");
require("includes/apt_functions.inc.php");
$access_level=$access_matrix['battle_stats'][0];
db_connect();
check_login_member();
if(isset($_SESSION['user_id'])){
$myuser_id = $_SESSION['user_id'];}
else {$myuser_id = "";}
global $relative_path;
$tpl = new phemplate(_TPLPATH_,'remove_nonjs');
if (isset($_SESSION['topass']) && is_array($_SESSION['topass']) && !empty($_SESSION['topass'])) {
$topass=$_SESSION['topass'];
$_SESSION['topass']='';
unset($_SESSION['topass']);
$comment=$topass['comment'];
}
$message=((isset($topass['message'])) ? ($topass['message']) : (""));
$limitzoid= "10"; // -> change this
$table_cols= "5"; // -> change this
$offset = "0";
$set = "10";
if(isset($_GET['offset']) == ""){
$offset = "0";
}
if(isset($_GET['offset'])){
$offset = $_GET['offset'];
$offset2 = $offset;
}
$select = "SELECT * FROM partners ORDER by inhits DESC";
$query = mysql_query($select) or die (mysql_error());
$tippytop="<table width=\"100%\" cellpadding=\"0\" cellspacing=\"1\" align=\"center\" valign=\"top\">";
$tippytop.="</table><center><p><table border=0><tr><td align=left valign=middle><font color=\"#000066\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">
<table border='0' width='100%'>
<tr>
<td><b>Naam:</b></td>
<td><b>Inhits:</b></td>
<td><b>Uithits:</b></td>
</tr>
while ($list = mysql_fetch_object($query)) {
$sitenaam = $list->sitenaam;
$siteurl = $list->siteurl;
$sitenaam = htmlspecialchars('$sitenaam');
$siteurl = htmlspecialchars('$siteurl');
echo '
<tr>
<td><a href=\"uithits.php?action=tel&id=$list->id\" target=\"_blank\">$list->sitenaam</a></font> <br>
<td>$list->inhits</td>
<td>$list->uithits</td>
</tr>
';
}
</table>
</table></center>\n";
unset($x, $WinPercent);
$tpl->set_var('tippytopz',$tippytop);
$tpl->set_file('middlecontent','battletop.html');
$tpl->set_var('message',$message);
$tpl->set_var('sitename',_SITENAME_);
$middle_content=$tpl->process('out','middlecontent',0,1);
$title = "Top Photo Battle";
$tpl->set_file('frame','frame.html');
$tpl->set_var('baseurl',_BASEURL_);
$tpl->set_var('sitename',_SITENAME_);
$tpl->set_var('relative_path', $relative_path);
$tpl->set_var('middle_content',$middle_content);
include('block_main_frame.php');
?>
session_start();
require("includes/vars.inc.php");
require("includes/functions.inc.php");
require("includes/templates.inc.php");
require("includes/apt_functions.inc.php");
$access_level=$access_matrix['battle_stats'][0];
db_connect();
check_login_member();
if(isset($_SESSION['user_id'])){
$myuser_id = $_SESSION['user_id'];}
else {$myuser_id = "";}
global $relative_path;
$tpl = new phemplate(_TPLPATH_,'remove_nonjs');
if (isset($_SESSION['topass']) && is_array($_SESSION['topass']) && !empty($_SESSION['topass'])) {
$topass=$_SESSION['topass'];
$_SESSION['topass']='';
unset($_SESSION['topass']);
$comment=$topass['comment'];
}
$message=((isset($topass['message'])) ? ($topass['message']) : (""));
$limitzoid= "10"; // -> change this
$table_cols= "5"; // -> change this
$offset = "0";
$set = "10";
if(isset($_GET['offset']) == ""){
$offset = "0";
}
if(isset($_GET['offset'])){
$offset = $_GET['offset'];
$offset2 = $offset;
}
$select = "SELECT * FROM partners ORDER by inhits DESC";
$query = mysql_query($select) or die (mysql_error());
$tippytop="<table width=\"100%\" cellpadding=\"0\" cellspacing=\"1\" align=\"center\" valign=\"top\">";
$tippytop.="</table><center><p><table border=0><tr><td align=left valign=middle><font color=\"#000066\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">
<table border='0' width='100%'>
<tr>
<td><b>Naam:</b></td>
<td><b>Inhits:</b></td>
<td><b>Uithits:</b></td>
</tr>
while ($list = mysql_fetch_object($query)) {
$sitenaam = $list->sitenaam;
$siteurl = $list->siteurl;
$sitenaam = htmlspecialchars('$sitenaam');
$siteurl = htmlspecialchars('$siteurl');
echo '
<tr>
<td><a href=\"uithits.php?action=tel&id=$list->id\" target=\"_blank\">$list->sitenaam</a></font> <br>
<td>$list->inhits</td>
<td>$list->uithits</td>
</tr>
';
}
</table>
</table></center>\n";
unset($x, $WinPercent);
$tpl->set_var('tippytopz',$tippytop);
$tpl->set_file('middlecontent','battletop.html');
$tpl->set_var('message',$message);
$tpl->set_var('sitename',_SITENAME_);
$middle_content=$tpl->process('out','middlecontent',0,1);
$title = "Top Photo Battle";
$tpl->set_file('frame','frame.html');
$tpl->set_var('baseurl',_BASEURL_);
$tpl->set_var('sitename',_SITENAME_);
$tpl->set_var('relative_path', $relative_path);
$tpl->set_var('middle_content',$middle_content);
include('block_main_frame.php');
?>
mg
Gewijzigd op 01/01/1970 01:00:00 door justin
werkend voorbeeld niet werkend: http://www.iboobs.nl/alle_partners.php
voorbeeld wel werkend : http://iboobs.nl/Linkpartnersysteem/alle_partners.php
mvg
Hmm, dat gaat toch niet werken zo? Afgezien van het feit dat het enorm chaotisch is, hoe kan je echo's en whiles gebruiken binnen het defineren van een $var?
beide scripten appart.
oregineel script::
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
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
<?php
session_start();
require("includes/vars.inc.php");
require("includes/functions.inc.php");
require("includes/templates.inc.php");
require("includes/apt_functions.inc.php");
$access_level=$access_matrix['battle_stats'][0];
db_connect();
check_login_member();
if(isset($_SESSION['user_id'])){
$myuser_id = $_SESSION['user_id'];}
else {$myuser_id = "";}
global $relative_path;
$tpl = new phemplate(_TPLPATH_,'remove_nonjs');
if (isset($_SESSION['topass']) && is_array($_SESSION['topass']) && !empty($_SESSION['topass'])) {
$topass=$_SESSION['topass'];
$_SESSION['topass']='';
unset($_SESSION['topass']);
$comment=$topass['comment'];
}
$message=((isset($topass['message'])) ? ($topass['message']) : (""));
$limitzoid= "10"; // -> change this
$table_cols= "5"; // -> change this
$offset = "0";
$set = "10";
if(isset($_GET['offset']) == ""){
$offset = "0";
}
if(isset($_GET['offset'])){
$offset = $_GET['offset'];
$offset2 = $offset;
}
$tippytop="<table width=\"100%\" cellpadding=\"0\" cellspacing=\"1\" align=\"center\" valign=\"top\">";
}
$tippytop.="</table><center><p><table border=0><tr><td align=left valign=middle><font color=\"#000066\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">
</table></center>\n";
unset($x, $WinPercent);
$tpl->set_var('tippytopz',$tippytop);
$tpl->set_file('middlecontent','battletop.html');
$tpl->set_var('message',$message);
$tpl->set_var('sitename',_SITENAME_);
$middle_content=$tpl->process('out','middlecontent',0,1);
$title = "Top Photo Battle";
$tpl->set_file('frame','frame.html');
$tpl->set_var('baseurl',_BASEURL_);
$tpl->set_var('sitename',_SITENAME_);
$tpl->set_var('relative_path', $relative_path);
$tpl->set_var('middle_content',$middle_content);
include('block_main_frame.php');
?>
session_start();
require("includes/vars.inc.php");
require("includes/functions.inc.php");
require("includes/templates.inc.php");
require("includes/apt_functions.inc.php");
$access_level=$access_matrix['battle_stats'][0];
db_connect();
check_login_member();
if(isset($_SESSION['user_id'])){
$myuser_id = $_SESSION['user_id'];}
else {$myuser_id = "";}
global $relative_path;
$tpl = new phemplate(_TPLPATH_,'remove_nonjs');
if (isset($_SESSION['topass']) && is_array($_SESSION['topass']) && !empty($_SESSION['topass'])) {
$topass=$_SESSION['topass'];
$_SESSION['topass']='';
unset($_SESSION['topass']);
$comment=$topass['comment'];
}
$message=((isset($topass['message'])) ? ($topass['message']) : (""));
$limitzoid= "10"; // -> change this
$table_cols= "5"; // -> change this
$offset = "0";
$set = "10";
if(isset($_GET['offset']) == ""){
$offset = "0";
}
if(isset($_GET['offset'])){
$offset = $_GET['offset'];
$offset2 = $offset;
}
$tippytop="<table width=\"100%\" cellpadding=\"0\" cellspacing=\"1\" align=\"center\" valign=\"top\">";
}
$tippytop.="</table><center><p><table border=0><tr><td align=left valign=middle><font color=\"#000066\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">
</table></center>\n";
unset($x, $WinPercent);
$tpl->set_var('tippytopz',$tippytop);
$tpl->set_file('middlecontent','battletop.html');
$tpl->set_var('message',$message);
$tpl->set_var('sitename',_SITENAME_);
$middle_content=$tpl->process('out','middlecontent',0,1);
$title = "Top Photo Battle";
$tpl->set_file('frame','frame.html');
$tpl->set_var('baseurl',_BASEURL_);
$tpl->set_var('sitename',_SITENAME_);
$tpl->set_var('relative_path', $relative_path);
$tpl->set_var('middle_content',$middle_content);
include('block_main_frame.php');
?>
script dat ik erin wil bouwen zodat deze de waarde goed uit de databse haalt.
Gewijzigd op 01/01/1970 01:00:00 door justin
Code (php)
1
2
3
4
2
3
4
<?
$select = "SELECT * FROM partners ORDER by inhits DESC";
$query = mysql_query($select) or die (mysql_error());
?>
$select = "SELECT * FROM partners ORDER by inhits DESC";
$query = mysql_query($select) or die (mysql_error());
?>
<table border="0" width="100%">
<tr>
<td><b>Naam:</b></td>
<td><b>Inhits:</b></td>
<td><b>Uithits:</b></td>
</tr>
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?
while ($list = mysql_fetch_object($query)) {
$sitenaam = $list->sitenaam;
$siteurl = $list->siteurl;
$sitenaam = htmlspecialchars("$sitenaam");
$siteurl = htmlspecialchars("$siteurl");
echo "
<tr>
<td><a href=\"uithits.php?action=tel&id=$list->id\" target=\"_blank\">$list->sitenaam</a></font> <br>
<td>$list->inhits</td>
<td>$list->uithits</td>
</tr>
";
}
?>
while ($list = mysql_fetch_object($query)) {
$sitenaam = $list->sitenaam;
$siteurl = $list->siteurl;
$sitenaam = htmlspecialchars("$sitenaam");
$siteurl = htmlspecialchars("$siteurl");
echo "
<tr>
<td><a href=\"uithits.php?action=tel&id=$list->id\" target=\"_blank\">$list->sitenaam</a></font> <br>
<td>$list->inhits</td>
<td>$list->uithits</td>
</tr>
";
}
?>
</table>
Gewijzigd op 01/01/1970 01:00:00 door justin
echo's vervangen door $tippytop.= en de rest ongemoeid laten.
mvg
justin
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
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
<?php
session_start();
require("includes/vars.inc.php");
require("includes/functions.inc.php");
require("includes/templates.inc.php");
require("includes/apt_functions.inc.php");
$access_level=$access_matrix['battle_stats'][0];
db_connect();
check_login_member();
if(isset($_SESSION['user_id'])){
$myuser_id = $_SESSION['user_id'];}
else {$myuser_id = "";}
global $relative_path;
$tpl = new phemplate(_TPLPATH_,'remove_nonjs');
if (isset($_SESSION['topass']) && is_array($_SESSION['topass']) && !empty($_SESSION['topass'])) {
$topass=$_SESSION['topass'];
$_SESSION['topass']='';
unset($_SESSION['topass']);
$comment=$topass['comment'];
}
$message=((isset($topass['message'])) ? ($topass['message']) : (""));
$limitzoid= "10"; // -> change this
$table_cols= "5"; // -> change this
$offset = "0";
$set = "10";
if(isset($_GET['offset']) == ""){
$offset = "0";
}
if(isset($_GET['offset'])){
$offset = $_GET['offset'];
$offset2 = $offset;
}
$select = "SELECT * FROM partners ORDER by inhits DESC";
$query = mysql_query($select) or die (mysql_error());
$tippytop="<table width=\"100%\" cellpadding=\"0\" cellspacing=\"1\" align=\"center\" valign=\"top\">";
$tippytop.="</table><center><p><table border=0><tr><td align=left valign=middle><font color=\"#000066\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">
<table border='0' width='100%'>
<tr>
<td><b>Naam:</b></td>
<td><b>Inhits:</b></td>
<td><b>Uithits:</b></td>
</tr>
<?
while ($list = mysql_fetch_object($query)) {
$sitenaam = $list->sitenaam;
$siteurl = $list->siteurl;
$sitenaam = htmlspecialchars('$sitenaam');
$siteurl = htmlspecialchars('$siteurl')";
$tippytop.="<tr>
<td><a href=\"uithits.php?action=tel&id=$list->id\" target=\"_blank\">$list->sitenaam</a></font> <br>
<td>$list->inhits</td>
<td>$list->uithits</td>
</tr>";
?>
<?php
$tippytop.="</table></table></center>\n";
unset($x, $WinPercent);
$tpl->set_var('tippytopz',$tippytop);
$tpl->set_file('middlecontent','battletop.html');
$tpl->set_var('message',$message);
$tpl->set_var('sitename',_SITENAME_);
$middle_content=$tpl->process('out','middlecontent',0,1);
$title = "Top Photo Battle";
$tpl->set_file('frame','frame.html');
$tpl->set_var('baseurl',_BASEURL_);
$tpl->set_var('sitename',_SITENAME_);
$tpl->set_var('relative_path', $relative_path);
$tpl->set_var('middle_content',$middle_content);
include('block_main_frame.php');
?>
voorbeeld http://www.iboobs.nl/alle_partners.php
zoals je ziet haalt ie niet de waardes uit het script en laat ze ook niet zien
mvg
justin
session_start();
require("includes/vars.inc.php");
require("includes/functions.inc.php");
require("includes/templates.inc.php");
require("includes/apt_functions.inc.php");
$access_level=$access_matrix['battle_stats'][0];
db_connect();
check_login_member();
if(isset($_SESSION['user_id'])){
$myuser_id = $_SESSION['user_id'];}
else {$myuser_id = "";}
global $relative_path;
$tpl = new phemplate(_TPLPATH_,'remove_nonjs');
if (isset($_SESSION['topass']) && is_array($_SESSION['topass']) && !empty($_SESSION['topass'])) {
$topass=$_SESSION['topass'];
$_SESSION['topass']='';
unset($_SESSION['topass']);
$comment=$topass['comment'];
}
$message=((isset($topass['message'])) ? ($topass['message']) : (""));
$limitzoid= "10"; // -> change this
$table_cols= "5"; // -> change this
$offset = "0";
$set = "10";
if(isset($_GET['offset']) == ""){
$offset = "0";
}
if(isset($_GET['offset'])){
$offset = $_GET['offset'];
$offset2 = $offset;
}
$select = "SELECT * FROM partners ORDER by inhits DESC";
$query = mysql_query($select) or die (mysql_error());
$tippytop="<table width=\"100%\" cellpadding=\"0\" cellspacing=\"1\" align=\"center\" valign=\"top\">";
$tippytop.="</table><center><p><table border=0><tr><td align=left valign=middle><font color=\"#000066\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">
<table border='0' width='100%'>
<tr>
<td><b>Naam:</b></td>
<td><b>Inhits:</b></td>
<td><b>Uithits:</b></td>
</tr>
<?
while ($list = mysql_fetch_object($query)) {
$sitenaam = $list->sitenaam;
$siteurl = $list->siteurl;
$sitenaam = htmlspecialchars('$sitenaam');
$siteurl = htmlspecialchars('$siteurl')";
$tippytop.="<tr>
<td><a href=\"uithits.php?action=tel&id=$list->id\" target=\"_blank\">$list->sitenaam</a></font> <br>
<td>$list->inhits</td>
<td>$list->uithits</td>
</tr>";
?>
<?php
$tippytop.="</table></table></center>\n";
unset($x, $WinPercent);
$tpl->set_var('tippytopz',$tippytop);
$tpl->set_file('middlecontent','battletop.html');
$tpl->set_var('message',$message);
$tpl->set_var('sitename',_SITENAME_);
$middle_content=$tpl->process('out','middlecontent',0,1);
$title = "Top Photo Battle";
$tpl->set_file('frame','frame.html');
$tpl->set_var('baseurl',_BASEURL_);
$tpl->set_var('sitename',_SITENAME_);
$tpl->set_var('relative_path', $relative_path);
$tpl->set_var('middle_content',$middle_content);
include('block_main_frame.php');
?>
voorbeeld http://www.iboobs.nl/alle_partners.php
zoals je ziet haalt ie niet de waardes uit het script en laat ze ook niet zien
mvg
justin
Gewijzigd op 01/01/1970 01:00:00 door justin
Echo de query en gooi die in PHPMyAdmin
maar hoe ga ik dit exat doen ben niet zo'n erge pro in php en msql
mvg
justin
Ik neem aan dat je een database hebt aangemaakt? Met daarin de tabel partners?
mvg
mvg
justin