vip.php
<?php include('template.class.php'); include('page_header.php'); $template = new Template(); $template->set_filenames(array( 'body_vip' => 'body_vip.tpl') ); if(isset($_POST['send'])){ $sms = '6'; $kod = $_GET['kod']; $apikey = 'cd518a15794b028ec87ac49a93fc0581'; $_apiAnswer = file_get_contents("http://api.zabijaka.pl/1.1/".$apikey."/sms/".$sms."/".$kod."/sms.json/add"); $answer = json_decode($_apiAnswer); if($answer->{'error'}) { echo $answer->{'txt'}; } else if ($answer->{'success'}) { echo 'Poprawny kod sms:'. $kod. ($answer->{'amount'}?' DoĹadowuje kwotÄ : '.$answer->{'amount'}:''); } } $template->pparse('body_vip'); include('page_footer.php'); ?>
Formularz
<form action="vip.php" method="post"> <table width="100%" border="1"> <tbody align="center"> <tr> <td>Nick:(na serwerze)</td> <td><input type="text" name="nick" maxlength="16" /></td> </tr> <tr> <td>Kod SMS:</td> <td><input type="text" name="kod" maxlength="16" /></td> </tr> <tr> <td>Kontakt GG:</td> <td><input type="text" name="kontakt" maxlength="16" /></td> </tr> <tr> <td><input type="submit" name="send" value="Zakup" /></td> </tr> </tbody> </table> </form>
Proszę o pomoc.