Help ,

Gestart doorOne2xs11 reacties54 weergaven

12 berichten · pagina 1 van 1

One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Hee, ik heb een scriptje waarmee je punten kan verdienen via klikmissies.
Als je dan bijvoorbeeld 200 punten hebt, kan je een script downloaden...
Daarvoor heb ik de code:

[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE `users` SET saldo=saldo-200 WHERE `id` = $memberid"[/COLOR][COLOR= #007700]);[/COLOR]
?>


Maar als ik dan hem koop met 0 punten kan ik hem nog steeds downloaden en worden mijn punten ineens van 0 naar 4000 gedaan... Wat kan ik hier tegen doen?
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE users SET saldo=saldo - 200 WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$memberid[/COLOR][COLOR= #007700]);[/COLOR]


saldo is gewoon een int en niet unsigned?
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Nee, dat werkt niet...
Ik kan nog steeds de download link zien...
Ik wil dat als niet genoeg credits hebben, de download link niet kunnen zien...
Maar dat lukt me nu niet.... cry
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Dat moet je regelen op de plek waar je die downloadlink weergeeft, niet hierzo.
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Lennard schreef:
Dat moet je regelen op de plek waar je die downloadlink weergeeft, niet hierzo.
Dat lukt me dus niet....
Ik heb dit scriptje:

[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]layout/header.php[/COLOR][COLOR= #007700]);[/COLOR] 
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]memberid[/COLOR][COLOR= #007700]])){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"<meta http-equiv="refresh" content="0;URL=index.php">"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700];
}[/COLOR]
?>
    <p>Hier kun je spullen voor je site downloaden met je gespaarde credits<br />
    </p>
    <form name="form1" id="form1" method="post" action="">
      <p class="fontstyle">U heeft succesvol fsk ledenscript gekocht.<br />
        <a href="http://www.klik.fskproductie.nl/files/877762leden8812462Askduj1sLks.rar" target="_blank">Klik hier om te downloaden</a></p>
</form>
[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]layout/footer.php[/COLOR][COLOR= #007700]);[/COLOR] 

?>
</html>


Hoe kan ik er voor zorgen dat die alleen de download link laat zien als die genoeg credits heeft?
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Select het aantal credits, kijk of dat aantal boven de x credits ligt. Zoja: haal x credits van account af smile
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
En hoe doe ik dat?
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM leden WHERE saldo=200"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
?>


Ofzoiets.
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Nee het lukt niet ;(
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
En als die 100 credits heeft en hij koopt het script, staat ie -100
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
    $select[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT saldo FROM leden WHERE id="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$memberid[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
    [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/COLOR][COLOR= #007700])) {[/COLOR]
        [COLOR= #0000BB]$fetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]saldo[/COLOR][COLOR= #007700]] >=[/COLOR] [COLOR= #0000BB]200[/COLOR][COLOR= #007700]) {[/COLOR]
            [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE leden SET saldo=saldo-200 WHERE id="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$memberid[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]LINK[/COLOR][COLOR= #007700];
        }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt niet genoeg saldo om dit te doen[/COLOR][COLOR= #007700];
        }
    }[/COLOR]
?>
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Pchooligan:

[COLOR= #0000BB]<?php
    $select[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT saldo FROM leden WHERE id="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$memberid[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
    [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/COLOR][COLOR= #007700])) {[/COLOR]
        [COLOR= #0000BB]$fetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]saldo[/COLOR][COLOR= #007700]] >=[/COLOR] [COLOR= #0000BB]200[/COLOR][COLOR= #007700]) {[/COLOR]
            [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE leden SET saldo=saldo-200 WHERE id="[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$memberid[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]LINK[/COLOR][COLOR= #007700];
        }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt niet genoeg saldo om dit te doen[/COLOR][COLOR= #007700];
        }
    }[/COLOR]
?>


duizendmaal bedankt smile
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren