Belsysteem

Gestart doorLego17 reacties99 weergaven

18 berichten · pagina 2 van 2

Lego

Lid · Topicstarter

Berichten
160
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nou het was eerst van ringtoni.nl nu heb ik daar de target api in maar blijkbaar zit er van ringtonio nog deels in:

Uit code

[COLOR= #0000BB]<?php[/COLOR] 


  [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]_include-config.php[/COLOR][COLOR= #007700]);[/COLOR]


?>

<html>
<head>

  <body style="background: #808080; margin: 0px">
  <link rel="stylesheet" type="text/css" href="css-v1.css">

</head>

</font>

<table align=center width=100%>
  <tr><td class=mainTxt>
<font color="Red">Klik op Uitgeven  <a href="creditshop.php"><b> Uitgeven</b></a> om u Credits te gebruiken</font>
</table>
<table align=center width=100%>
  <tr><td class=subTitle><font color="#000000"><b>Belservice</b></font></td></tr>
  <tr><td class=mainTxt>
Welkom in de belservice. Hier kun je belcredits bestellen.<br>
&nbsp;<img border="0" src="nl.gif" width="18" height="12"> Bel naar <b>0909-8356</b>, 
en dan hoor je de 6cijferige pincode!&nbsp; (<font size="1">&#8364;1,30 per gesprek).
</font>
<br>
&nbsp;<img border="0" src="be.gif" width="18" height="12"> Bel naar <b>
0903-36062</b>, en dan hoor je de 6cijferige pincode!&nbsp; <font size="1">(&#8364; 
1,12 per minuut, +- 80 sec.). </font> 
<br>
Als je hier gebruik van maakt, vraag dan altijd toestemming aan de bezitter van 
de telefoon. <i>we zijn niet aansprakelijk voor welke schade dan ook.</i><br>
<br>
Het is handig dat je de pincode(s) opschrijft. Zodat je ze niet kunt vergeten!<br>
Een pincode is maar 1x te gebruiken<br>
<br>
<font color="#FF0000" size="1" face="Verdana">

<br>
<h5>
</tr>
</table>

<table align=center width=400>
  <tr><td class=mainTxt>

[COLOR= #0000BB]<?php[/COLOR]

    [COLOR= #007700]function[/COLOR] is_even [COLOR= #007700]([/COLOR] [COLOR= #0000BB]$getal[/COLOR] [COLOR= #007700])
    {[/COLOR]

        [URL="http://www.php.net/return"]return[/URL] [COLOR= #007700]([/COLOR] [COLOR= #0000BB]$getal[/COLOR] [COLOR= #007700]&[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700]) ?[/COLOR] false [COLOR= #007700]:[/COLOR] true[COLOR= #007700];
    }[/COLOR]

 

    [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR] is_even [COLOR= #007700]([/COLOR] [COLOR= #0000BB]$aantal[/COLOR] [COLOR= #007700]) )
    {[/COLOR]

        [COLOR= #0000BB]$rtlo[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]78355[/COLOR][COLOR= #007700];     
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]

        [COLOR= #0000BB]$rtlo[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]78355[/COLOR][COLOR= #007700];        

    }[/COLOR]

    [COLOR= #0000BB]$test[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR]        [COLOR= #FF8000]// Zet deze op false na het testen[/COLOR]

    [COLOR= #0000BB]$sent[/COLOR] [COLOR= #007700]= ([/COLOR][COLOR= #0000BB]$sent[/COLOR][COLOR= #007700]) ?[/COLOR] [COLOR= #0000BB]$sent[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"sent"[/COLOR][COLOR= #007700]];[/COLOR]
    [COLOR= #0000BB]$pincode[/COLOR] [COLOR= #007700]= ([/COLOR][COLOR= #0000BB]$pincode[/COLOR][COLOR= #007700]) ?[/COLOR] [COLOR= #0000BB]$pincode[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"pincode"[/COLOR][COLOR= #007700]];[/COLOR]
    [COLOR= #0000BB]$land[/COLOR] [COLOR= #007700]= ([/COLOR][COLOR= #0000BB]$land[/COLOR][COLOR= #007700]) ?[/COLOR] [COLOR= #0000BB]$land[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]"land"[/COLOR][COLOR= #007700]];[/COLOR]


?>

   <form method=post action="belservice.php">
        <tr><td class="mainTxt" width="100"><font face="Verdana" size="2"><b>Pincode:</b></td><td class="mainTxt">
        </font> <font color="#FFFFFF"> <input name="pincode" maxlength="6" size="6"></font></td></tr>
        <tr><td class="mainTxt"><b><font size="2" face="Verdana">Land: </font></b></td>
    <td class="mainTxt"><font color="#FFFFFF"><input type=radio name=land value="31"></font>Nederland
                        <font color="#FFFFFF">
                        <input type=radio name=land value="32"></font>Belgi</td></tr>
        <tr><td class="mainTxt" width="200"><font face="Verdana" size="2"><b>Product:</b></td><td class="mainTxt">
        </font> <b>150</b> Belcredits <font color=red><b>Mega Aktie</b></font></td></tr>
        <tr><td class="mainTxt" colspan="2" align="center">
            <font color="#FFFFFF"><input type="submit" name="sent" value=" Uitvoeren "></font></td></tr>
    </form>
[COLOR= #0000BB]<?php[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sent[/COLOR][COLOR= #007700]])){[/COLOR]

        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr><td class="mainTxt" colspan="2" align="center">[/COLOR][COLOR= #007700];[/COLOR]

        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$pincode[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000][/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]$land[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000][/COLOR] [COLOR= #007700])
        {[/COLOR]
            [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"U heeft geen Pincode opgegeven! Of geen land aangevinkt!."[/COLOR][COLOR= #007700]);
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]

            [COLOR= #0000BB]$code[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$pincode[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$co[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]land[/COLOR][COLOR= #007700]];[/COLOR]
            [COLOR= #0000BB]$url[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"http://www.ringtonio.nl/mp?test=$test&co=$co&rtlo=$rtlo&code="[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/urlencode"]urlencode[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$code[/COLOR][COLOR= #007700]);[/COLOR]

            [COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]= @[/COLOR][URL="http://www.php.net/implode"]implode[/URL] [COLOR= #007700]([/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700],[/COLOR] [URL="http://www.php.net/file"]file[/URL] [COLOR= #007700]([/COLOR] [COLOR= #0000BB]$url[/COLOR] [COLOR= #007700]) );[/COLOR]

            [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]( ![/COLOR][COLOR= #0000BB]$result[/COLOR] [COLOR= #007700])
            {[/COLOR]

                [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"Je betaalcode kan momenteel niet gecontroleerd worden, probeer het later nog eens."[/COLOR][COLOR= #007700]);

            }[/COLOR]
            [URL="http://www.php.net/else"]else[/URL]
            [COLOR= #007700]{[/COLOR]

                [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR] [URL="http://www.php.net/substr"]substr[/URL] [COLOR= #007700]([/COLOR] [COLOR= #0000BB]$result[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]2[/COLOR] [COLOR= #007700]) ==[/COLOR] [COLOR= #DD0000]"OK"[/COLOR] [COLOR= #007700])
                {[/COLOR]

                        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE `[users]` SET `credits`=`credits`+150 WHERE `login`="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]login[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" LIMIT 1"[/COLOR][COLOR= #007700]);[/COLOR]
                        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO `[BL]`(`user`,`email`,`wanneer`,`ip`,`soort`) values({$data->login},{$data->email},NOW(),{$_SERVER[REMOTE_ADDR]},Credits)"[/COLOR][COLOR= #007700]);[/COLOR]          
                       [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt 150 credits gekocht!<br> Veel Plezier ermee![/COLOR][COLOR= #007700];                  

                }[/COLOR]
                [URL="http://www.php.net/else"]else[/URL]
                [COLOR= #007700]{[/COLOR]

                    [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]);[/COLOR]    [COLOR= #FF8000]// Laat foutcode zien[/COLOR]

                [COLOR= #007700]}

            }

        }[/COLOR]

        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</td></tr>[/COLOR][COLOR= #007700];

    }[/COLOR]

?>
</table>
</td>
</td>
<table align=center width="160">
<BR>
  <tr><td class=subTitle colspan=2><b>Legenda</b></td></tr>
<tr>
        <td align="right" class=mainTxt width="109">
        <p align="left"><b>Nederland:</b></td>
        <td class=mainTxt width="41">
        <p align="center"><img border="0" src="nl.gif" width="18" height="12"></td>
    </tr>
<tr>
        <td align="right" class=mainTxt width="109">
        <p align="left"><b>Belgi:</b></td>
        <td class=mainTxt width="41">
        <p align="center"><img border="0" src="be.gif" width="18" height="12"></td>
    </tr>
    </table>
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Dit script kan wel op de schop, ik zie er al een hoop fouten in:

- if(isset($_POST[sent])){ Zo check je dus NIET of iets verstuurd is. Maar gebruik gewoon if($_SERVER[REQUEST_METHOD] =="POST")) {

- Waarom in vredesnaam nog steeds die() gebruiken. Een script hoort niet te sterven als er iets in fout gaat. Jij gaat toch ook niet dood als je iets fouts doet, dus dit script gaat ook niet dood. gebruik nette if-else foutafhandeling, en pleur die() op het kerkhof daar waar het thuishoort

- Waar is de foutafhandeling op je query. Vooral bij betaalsystemen is dit van belang. Wat als je query stuk loopt, dan schotel je nu wel de melding voor dat er betaald is, maar er wordt niks bijgeschreven. Laat de klachten maar komen...
Daarom dus fatsoenlijke foutafhandeling inbouwen

- Wat is het practisch nut van die blokhaken in je tabelnaam? Hernoem ze gewoon naar users en bl (wth is BL; niet echt duidelijk!)

- Verder zijn tabellen ook onnodig. We leven in de tijd dat CSS, HTML-elementen, en divjes overheersen, dus tabellen zou je ook kunnen afvoeren.

- Op lijn 108 sta je onnodig variabelen te kopieeren. Kost een paar bytes extra, maar het is onzinnig.

- Variabelen horen buiten quotes op lijn 109, maakt je script beter leesbaarder in de editor, en enkele mili-seconden sneller.

Dus tijd om de boel te te breken en opnieuw te bouwen.
0
Lego

Lid · Topicstarter

Berichten
160
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Zou iemand hier een belsysteem willen maken (werkend en liesft dan bellen paysafecard ideal sms en bank)
eventueel tegen punten..
of geld
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