| | |
| Stránka: 1 z 1
| [ Príspevkov: 10 ] | |
Autor | Správa |
---|
Registrovaný: 31.07.07 Prihlásený: 09.01.19 Príspevky: 327 Témy: 85 Bydlisko: Humenné |
Ahojte všetci už som úplne zúfaly robím projekt a mam tento skript, ktorý ma robiť tie jednoduché vecí:
1.) Ma zistiť, či je user prihlasený ak áno má vybrať z tabulky tb_advertisers reklamy, kde je status=play a kliknute<=clicks
2.) Potom ma vybrať z table ad_clicks , kde je user=id prihlaseného usera
3.) Potom ak už je v tabulke ad_clicks aktuálny dátum a ak je a ak je typ účtu standard tak vyberie všetky reklamy kde je status=play ,kliknute<=clicks a category=standard a typ účtu premium tak category=all_users
Kód: <?php session_start(); include('data.php'); require('inc/config.php'); global $loggedin,$r; require('inc/functions.php'); if(isset($_COOKIE["usNick"]) && isset($_COOKIE["usPass"])) { expire_upgrade(); expire_pay_upgrade(); $user = $_COOKIE['usNick'];
$sql = mysql_query("SELECT * FROM tb_users WHERE username='$user'"); $row = mysql_fetch_array($sql); $type_account = $row['type_account'];
$query = mysql_query("SELECT * FROM tb_advertisers WHERE status='play' and kliknute<=clicks"); $rowx = mysql_fetch_array($query);
$checkvisit = mysql_query("SELECT COUNT(*) AS cnt FROM ad_clicks WHERE user='{$r['id']}' AND ad='{$rowx['id_advertisers']}'") or die(mysql_error()); $checkvisit = mysql_fetch_array($checkvisit); $checkvisit = $checkvisit["cnt"];
include('header.php'); ?>
View Ads </div><img style="float:right" src="img/005-3.png"></div> <br><br> <div style="width:532px"> <br> <table width="100%"> <tr> <td><span style="margin-left: 3px;"><div class="text">REKLAMA</div></span></td> <td><span style="margin-left: 3px;"><div class="text">Klinute</div></span></td> <td><span style="margin-left: 3px;"><div class="text">Ostava</div></span></td> <td><span style="margin-left: 3px;"><div class="text">Total</div></span></td> </tr>
<?php
$da = date("j");
$queryxx = mysql_query("SELECT * FROM ad_clicks WHERE user='{$r['id']}'"); $rowxx = mysql_fetch_array($queryxx);
if($checkvisit > 0 and $type_account=="standard") { $queryx = mysql_query("SELECT * FROM tb_advertisers WHERE status='play' and kliknute<=clicks and category='standard'"); while($rowxx = mysql_fetch_array($queryx)) { echo ' <tr> <td style="FONT-FAMILY: Verdana; FONT-SIZE: 11px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-top:none;"><span style="margin-left: 3px; text-decoration:none; color: #787878;"><font color=#660000><div class=text><strike>'.$rowxx['description'].'</strike></div></font></span></td> <td style="FONT-FAMILY: Verdana;FONT-SIZE: 13px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-left:none; border-top:none;"><div class=text style="margin-left: 3px;">'.$rowxx['kliknute'].'</div></td> <td style="FONT-FAMILY: Verdana;FONT-SIZE: 13px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-left:none; border-top:none;"><div class=text style="margin-left: 3px;">'.$rowxx['clicks'].'</div></td> <td style="FONT-FAMILY: Verdana;FONT-SIZE: 13px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-left:none; border-top:none;"><div class=text style="margin-left: 3px;">'.($rowxx['kliknute']+$rowxx['clicks']).'</div></td> </tr>'; } }
if($checkvisit < 0 and $type_account=="standard") { $queryxy = mysql_query("SELECT * FROM tb_advertisers WHERE status='play' and kliknute<=clicks and category='standard'"); while($rowxxy = mysql_fetch_array($queryxy)) { echo ' <tr> <td style="FONT-FAMILY: Verdana; FONT-SIZE: 11px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-top:none;"><span style="margin-left: 3px; text-decoration:none; color: #787878;"><div class=text><a href=view.php?ad='.$rowxxy['id_advertisers'].' target=_blank style="text-decoration:none; color: #787878;">'.$rowxxy['description'].'</a></div></span></td> <td style="FONT-FAMILY: Verdana;FONT-SIZE: 13px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-left:none; border-top:none;"><div class=text style="margin-left: 3px;">'.$rowxxy['kliknute'].'</div></td> <td style="FONT-FAMILY: Verdana;FONT-SIZE: 13px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-left:none; border-top:none;"><div class=text style="margin-left: 3px;">'.$rowxxy['clicks'].'</div></td> <td style="FONT-FAMILY: Verdana;FONT-SIZE: 13px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-left:none; border-top:none;"><div class=text style="margin-left: 3px;">'.($rowxxy['kliknute']+$rowxxy['clicks']).'</div></td> </tr>'; } }
if($checkvisit > 0 and $type_account=="premium") { $queryx2 = mysql_query("SELECT * FROM tb_advertisers WHERE status='play' and kliknute<=clicks and category='all_users'"); while($rowxx2 = mysql_fetch_array($queryx2)) { echo ' <tr> <td style="FONT-FAMILY: Verdana; FONT-SIZE: 11px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-top:none;"><span style="margin-left: 3px; text-decoration:none; color: #787878;"><font color=#660000><div class=text><strike>'.$rowxx2['description'].'</strike></div></font></span></td> <td style="FONT-FAMILY: Verdana;FONT-SIZE: 13px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-left:none; border-top:none;"><div class=text style="margin-left: 3px;">'.$rowxx2['kliknute'].'</div></td> <td style="FONT-FAMILY: Verdana;FONT-SIZE: 13px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-left:none; border-top:none;"><div class=text style="margin-left: 3px;">'.$rowxx2['clicks'].'</div></td> <td style="FONT-FAMILY: Verdana;FONT-SIZE: 13px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-left:none; border-top:none;"><div class=text style="margin-left: 3px;">'.($rowxx2['kliknute']+$rowxx2['clicks']).'</div></td> </tr>'; } }
if($checkvisit < 0 and $type_account=="premium") { $queryxy2 = mysql_query("SELECT * FROM tb_advertisers WHERE status='play' and kliknute<=clicks and category='all_users'"); while($rowxxy2 = mysql_fetch_array($queryxy2)) { echo ' <tr> <td><span style="margin-left: 3px; text-decoration:none; color: #787878;"><div class=text><a href=view.php?ad='.$rowxxy2['id_advertisers'].' target=_blank style="text-decoration:none; color: #787878;">'.$rowxxy2['description'].'</a></div></span></td> <td><div class=text style="margin-left: 3px;">'.$rowxxy2['kliknute'].'</div></td> <td><div class=text style="margin-left: 3px;">'.$rowxxy2['clicks'].'</div></td> <td><div class=text style="margin-left: 3px;">'.($rowxxy2['kliknute']+$rowxxy2['clicks']).'</div></td> </tr>'; } }
/*else {
print ' <tr> <td style="FONT-FAMILY: Verdana; FONT-SIZE: 11px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-top:none;"><span style="margin-left: 3px; text-decoration:none; color: #787878;"> <div class=text><a href=view.php?ad='.$rowy['id_advertisers'].' target=_blank style="text-decoration:none; color: #787878;">'.$rowy['description'].'</a></div> </span></td> <td style="FONT-FAMILY: Verdana;FONT-SIZE: 13px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-left:none; border-top:none;"><div class=text style="margin-left: 3px;"> '.$rowy['kliknute'].'</div></td> <td style="FONT-FAMILY: Verdana;FONT-SIZE: 13px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-left:none; border-top:none;"><div class=text style="margin-left: 3px;"> '.$rowy['clicks'].'</div></td>
<td style="FONT-FAMILY: Verdana;FONT-SIZE: 13px; BACKGROUND-COLOR: #ffffff; border:solid 1px #999999; border-left:none; border-top:none;"><div class=text style="margin-left: 3px;"> '.($rowy['kliknute']+$rowy['clicks']).'</div></td> </tr> '; }*/
?> </table>
</div><div id="pend"><img src="img/pend2.png"></div> </div>
<?include('panel3.php');?> <?include('news.php');?> <?include('reklama.php');?>
<div id="pend"><img src="img/pend.png"></div> </div>
</div>
<?include('footer.php');?>
<?}?>
|
|
Registrovaný: 26.07.06 Prihlásený: 20.03.16 Príspevky: 1378 Témy: 90 Bydlisko: Slovakia-Ko... | Napísal kmsa: 03.08.2008 16:30 | |
|
ok a kde je problem?
vyhadzuje niekde chybu?
nefunguje nieco spravne?
objasni problem
Len tak som si presiel scrip a nieviem ci je dobry napad davat heslo do cookies priamim systemom
ak som spravne pochopil spravne ten tvoj coocies
_________________ CPU: Intel E7200 momentalne default + freezer 7 pro | MB: Gigabyte GA-P35-DS3 rev. 2.0 F14 | RAM: A-DATA 4x1GB EE Vitesta | VGA: ATI Radeon HD4850 Sapphire Dual Slot | Monitor: BenQ E2200HD+17CTX | HDD: WD 3200AAKS + Maxtor 6Y080M0 80GB SATAII + 120GB ATA Barracuda | PSU: Corsair VX450W | Windows 7 Ultimate Sk | REPRO: Logitech X-210
+
IPhone 3GS JB 3.1.3 (new BR)
múdry sa postara o seba ale ešte múdrejši sa postara aj o druhých |
|
Registrovaný: 31.07.07 Prihlásený: 09.01.19 Príspevky: 327 Témy: 85 Bydlisko: Humenné |
No problem je vtom , že mi to nič nezobrazí žiadne reklamy
|
|
Registrovaný: 31.07.07 Prihlásený: 09.01.19 Príspevky: 327 Témy: 85 Bydlisko: Humenné |
Lenže ked som dal to $checkvisit > 0 $checkvist < 0 tak to išlo ok lenže toto tam musí byť
|
|
Registrovaný: 31.07.07 Prihlásený: 09.01.19 Príspevky: 327 Témy: 85 Bydlisko: Humenné |
No zistil som , že $checkvisit = 0 preto to nezobrazuje ale nwem ako to opravit pls pomožte
|
|
Registrovaný: 30.05.06 Prihlásený: 08.10.14 Príspevky: 1756 Témy: 35 Bydlisko: BA - WESTSIDE | Napísal p360t: 03.08.2008 18:02 | |
|
A keby tam boli neostré nerovnosti: <= a >= ??
_________________
A. S. Tanenbaum píše: The terms LF, MF, and HF refer to low, medium, and high frequency, respectively. Clearly, when the names were assigned, nobody expected to go above 10 MHz, so the higher bands were later named the Very, Ultra, Super, Extremely, and Tremendously High Frequency bands. Beyond that there are no names, but Incredibly, Astonishingly, and Prodigiously high frequency (IHF, AHF, and PHF) would sound nice. |
|
Registrovaný: 31.07.07 Prihlásený: 09.01.19 Príspevky: 327 Témy: 85 Bydlisko: Humenné |
No toto som už vyriešil mam teraz new kod:
Kód: <?php session_start(); include('data.php'); require('inc/config.php'); global $loggedin,$r; require('inc/functions.php');
if(isset($_COOKIE["usNick"]) && isset($_COOKIE["usPass"])) { expire_upgrade(); expire_pay_upgrade(); $user = $_COOKIE['usNick'];
$sql = mysql_query("SELECT * FROM tb_users WHERE username='$user'"); $row = mysql_fetch_array($sql); $type_account = $row['type_account'];
$query = mysql_query("SELECT * FROM tb_advertisers WHERE status='play' and kliknute<=clicks"); $rowx = mysql_fetch_array($query);
$da = date("j");
$queryxx = mysql_query("SELECT * FROM ad_clicks WHERE user='{$r['id']}'"); $rowxx = mysql_fetch_array($queryxx);
$checkvisit = mysql_query("SELECT COUNT(*) AS cnt FROM ad_clicks WHERE user='".$r['id']."' AND ad='".$rowx['id_advertisers']."'") or die(mysql_error()); $checkvisit = mysql_num_rows($checkvisit);
include('header.php'); ?>
View Ads </div><img style="float:right" src="img/005-3.png"></div> <br><br> <div style="width:532px"> <br> <table width="100%"> <tr> <td><span style="margin-left: 3px;"><div class="text">REKLAMA</div></span></td> <td><span style="margin-left: 3px;"><div class="text">Klinute</div></span></td> <td><span style="margin-left: 3px;"><div class="text">Ostava</div></span></td> <td><span style="margin-left: 3px;"><div class="text">Total</div></span></td> </tr> <?php
if($type_account=="standard" && $checkvisit < 0) { $queryx = mysql_query("SELECT * FROM tb_advertisers WHERE status='play' and kliknute<=clicks and category='standard'"); while($rowxx = mysql_fetch_array($queryx)) { echo ' <tr> <td><span style="margin-left: 3px; text-decoration:none; color: #787878;"><font color=#660000><div class=text><strike>'.$rowxx['description'].'</strike></div></font></span></td> <td><div class=text style="margin-left: 3px;">'.$rowxx['kliknute'].'</div></td> <td><div class=text style="margin-left: 3px;">'.$rowxx['clicks'].'</div></td> <td><div class=text style="margin-left: 3px;">'.($rowxx['kliknute']+$rowxx['clicks']).'</div></td> </tr>'; } }
if($type_account=="standard" && $checkvisit > 0) { $queryxy = mysql_query("SELECT * FROM tb_advertisers WHERE status='play' and kliknute<=clicks and category='standard'"); while($rowxxy = mysql_fetch_array($queryxy)) { echo ' <tr> <td><div class=text><a href=view.php?ad='.$rowxxy['id_advertisers'].' target=_blank style="text-decoration:none; color: #787878;">'.$rowxxy['description'].'</a></div></span></td> <td><div class=text style="margin-left: 3px;">'.$rowxxy['kliknute'].'</div></td> <td><div class=text style="margin-left: 3px;">'.$rowxxy['clicks'].'</div></td> <td><div class=text style="margin-left: 3px;">'.($rowxxy['kliknute']+$rowxxy['clicks']).'</div></td> </tr>'; } }
if($type_account=="premium" && $checkvisit < 0) { $queryx2 = mysql_query("SELECT * FROM tb_advertisers WHERE status='play' and kliknute<=clicks and category='all_users'"); while($rowxx2 = mysql_fetch_array($queryx2)) { echo ' <tr> <td><span style="margin-left: 3px; text-decoration:none; color: #787878;"><font color=#660000><div class=text><strike>'.$rowxx2['description'].'</strike></div></font></span></td> <td><div class=text style="margin-left: 3px;">'.$rowxx2['kliknute'].'</div></td> <td><div class=text style="margin-left: 3px;">'.$rowxx2['clicks'].'</div></td> <td><div class=text style="margin-left: 3px;">'.($rowxx2['kliknute']+$rowxx2['clicks']).'</div></td> </tr>'; } }
if($type_account=="premium" && $checkvisit > 0) { $queryxy2 = mysql_query("SELECT * FROM tb_advertisers WHERE status='play' and kliknute<=clicks and category='all_users'"); while($rowxxy2 = mysql_fetch_array($queryxy2)) { echo ' <tr> <td><span style="margin-left: 3px; text-decoration:none; color: #787878;"><div class=text><a href=view.php?ad='.$rowxxy2['id_advertisers'].' target=_blank style="text-decoration:none; color: #787878;">'.$rowxxy2['description'].'</a></div></span></td> <td><div class=text style="margin-left: 3px;">'.$rowxxy2['kliknute'].'</div></td> <td><div class=text style="margin-left: 3px;">'.$rowxxy2['clicks'].'</div></td> <td><div class=text style="margin-left: 3px;">'.($rowxxy2['kliknute']+$rowxxy2['clicks']).'</div></td> </tr>'; } } ?> </table>
</div><div id="pend"><img src="img/pend2.png"></div> </div>
<?include('panel3.php');?> <?include('news.php');?> <?include('reklama.php');?>
<div id="pend"><img src="img/pend.png"></div> </div>
</div>
<?include('footer.php');?> <?}?>
A problem je teraz vtom, že aj ked už tu danu reklamu odklikam vždy ju zobrazi ako odkaz nie preškrtnuté nwm prečo
|
|
Registrovaný: 16.07.07 Prihlásený: 31.07.22 Príspevky: 1225 Témy: 92 | Napísal sedlák: 09.08.2008 15:25 | |
|
nechcem zakladat novu temu, a tiez mam problem so scriptom
Kód: $c = "0"; $query = MySQL_Query("SELECT * FROM `$tabulka` ORDER BY b DESC, vyhra DESC, plus DESC, prehra ASC, minus ASC") or die (mysql_error()); echo "<table cellpadding='4' cellspacing='1'>"; echo " <tr>
<td><b> <u>hráč</u></b> </td> <td><b><u>Záp </u></b></td> <td><b><u>Výh </u></b></td> <td><b><u>Rem </u></b></td> <td><b><u>Pre </u></b></td> <td><b><u>G+ </u></b></td> <td><b><u>G- </u></b></td> <td><b><u>Body</u></b></td> </tr> "; while($h = mysql_fetch_array($query)){
$c++; if ($c==8){ $ciara="<hr>";} echo " <tr> <td>$c. <a href='index.php?page=player_info&nick=".$h['nick']."'>".$h['nick']."</a></td> <td>".$h['z']."</td> <td>".$h['vyhra']."</td> <td>".$h['remiza']."</td> <td>".$h['prehra']."</td> <td>".$h['plus']."</td> <td>".$h['minus']."</td> <td><b>".$h['b']."</b></td> </tr> "; }
echo "</table>"; ?>
robim tabulku, a chcem docielit toho aby pod poradovym cislom 8 bolo ciara hr, no neviem to tam spravne "zadelit"
pls ako sa to da vyriesit?
|
|
Registrovaný: 30.05.06 Prihlásený: 08.10.14 Príspevky: 1756 Témy: 35 Bydlisko: BA - WESTSIDE | Napísal p360t: 09.08.2008 15:50 | |
|
Keďže to máš celé v tabuľke, aj tu číaru do nej vpíš (alebo ešte môžeš ukončiť prvú tabuľku, nakresliť čiaru a začať kresliť ďalšiu tabuľku, ale tie tabuľky potom s najväčšou pravdepodobnosťou budú mať inú šírku stĺpcov, ak ju pevne nenastavíš).
Kód: $c = "0"; $query = MySQL_Query("SELECT * FROM `$tabulka` ORDER BY b DESC, vyhra DESC, plus DESC, prehra ASC, minus ASC") or die (mysql_error()); echo "<table cellpadding='4' cellspacing='1'>"; echo " <tr>
<td><b> <u>hráč</u></b> </td> <td><b><u>Záp </u></b></td> <td><b><u>Výh </u></b></td> <td><b><u>Rem </u></b></td> <td><b><u>Pre </u></b></td> <td><b><u>G+ </u></b></td> <td><b><u>G- </u></b></td> <td><b><u>Body</u></b></td> </tr> "; while($h = mysql_fetch_array($query)){
$c++; if ($c==8){ $ciara="<tr><td colspan='8'><hr></td></tr>";} echo " <tr> <td>$c. <a href='index.php?page=player_info&nick=".$h['nick']."'>".$h['nick']."</a></td> <td>".$h['z']."</td> <td>".$h['vyhra']."</td> <td>".$h['remiza']."</td> <td>".$h['prehra']."</td> <td>".$h['plus']."</td> <td>".$h['minus']."</td> <td><b>".$h['b']."</b></td> </tr> "; echo $ciara; }
echo "</table>"; ?>
_________________
A. S. Tanenbaum píše: The terms LF, MF, and HF refer to low, medium, and high frequency, respectively. Clearly, when the names were assigned, nobody expected to go above 10 MHz, so the higher bands were later named the Very, Ultra, Super, Extremely, and Tremendously High Frequency bands. Beyond that there are no names, but Incredibly, Astonishingly, and Prodigiously high frequency (IHF, AHF, and PHF) would sound nice. |
|
Registrovaný: 16.07.07 Prihlásený: 31.07.22 Príspevky: 1225 Témy: 92 | Napísal sedlák: 09.08.2008 17:08 | |
|
dik, ešte male osetrenie a ide to
|
|
| Stránka: 1 z 1
| [ Príspevkov: 10 ] | |
Podobné témy | Témy | Odpovede | Zobrazenia | Posledný príspevok |
---|
| problem s jednym skriptom v PHP, ASP | 2 | 528 | 26.09.2007 22:13 15miki15 | | Mail formular - problem so skriptom v PHP, ASP | 2 | 487 | 13.07.2008 11:28 bluecorer | | Problem vo Windows 7 Ultimate so skriptom v Ostatné | 2 | 275 | 15.09.2013 21:20 Deco2508 | | Manipulacia so skriptom v HTML, XHTML, XML, CSS | 2 | 520 | 08.10.2007 11:52 Feko | | Pomoc so skriptom v Sociálne siete | 0 | 290 | 04.03.2014 11:46 alik | | pomoc so skriptom na preratanie eura v JavaScript, VBScript, Ajax | 2 | 473 | 22.08.2008 9:07 Broko71 | | Je mozne skriptom jazyka perl spustat *.bat subory? v Perl, Python, Ruby, CGI | 4 | 2118 | 21.04.2008 21:00 Lucao | | M Firefox problém so sťahovaním a GCH problém s updatom v Sieťové a internetové programy | 0 | 1362 | 23.01.2015 16:06 Stary | | Problém so zobrazovaním www stránok, problém užívateľa v Operačné systémy Microsoft | 17 | 2137 | 23.03.2009 10:41 FERDA23 | | Záhadný problém s PC... problém procesora? [ Choď na stránku: 1, 2 ] v AMD - Advanced Micro Devices | 45 | 4737 | 26.04.2012 11:14 netpeter77 | | Battlefield 3 SKIDROW problem + win7 problem v Počítačové hry | 1 | 1580 | 22.09.2012 23:51 walther | | Problém s MB ASUS P5K - problém s Realtek v Ovládače | 4 | 2305 | 14.06.2008 10:36 $ph!nX | | Problém s HDD / Problém s bootovaním v Pevné disky a radiče | 4 | 1465 | 22.02.2013 14:08 lucifer666x | | problem ! v Operačné systémy Microsoft | 3 | 597 | 27.06.2008 13:50 Andres28791 | | Problem v Ostatné grafické karty | 4 | 530 | 30.10.2013 14:12 PanMod | | problem v Audio programy | 0 | 670 | 26.01.2009 13:09 strna |
| Nemôžete zakladať nové témy v tomto fóre Nemôžete odpovedať na témy v tomto fóre Nemôžete upravovať svoje príspevky v tomto fóre Nemôžete mazať svoje príspevky v tomto fóre
|
|