Make a switch page for an faucet

I am going to be working on a template and I am just wondering how I add all faucet code into a switch that then shows A login A captcha A Payout page on its own ?
Normally I place the full code in it and do my own edits for the template but this time I would like it to be in a switch panel so it will just show the page like login etc

the code

 <div class="row">
            <div class="col-xs-12 col-md-6 col-md-push-3 <?php echo $data["custom_main_box_bg"] . ' ' . $data["custom_main_box_tx"]; ?>">
                <?php if($data["page"] != 'user_page'): ?>
                <h1><?php echo $data["name"]; ?></h1>
                <h2><?php echo $data["short"]; ?></h2>
                <p class="alert alert-info">Balance: <?php echo $data["balance"]." ".$data["unit"]; ?></p>
                <p class="alert alert-success"><?php echo $data["rewards"]; ?> <?php echo $data['unit']; ?> every <?php echo $data["timer"]; ?> minutes.</p>
                <?php endif;    if($data["error"]) echo $data["error"]; ?>
                <?php if($data["safety_limits_end_time"]): ?>
                <p class="alert alert-warning">This faucet exceeded it's safety limits and may not payout now!</p>
                <?php endif; ?>
                <?php switch($data["page"]):
                        case "disabled": ?>
                    <p class="alert alert-danger">FAUCET DISABLED. Go to <a href="admin.php">admin page</a> and fill all required data!</p>
                <?php break; case "paid":
                        echo $data["paid"];
                        if($data["referral"]): ?>
                        Referral commission: <?php echo $data["referral"]; ?>%<br>
                        Reflink: <?php echo $data["reflink"]; ?>
                        <?php endif;
                      break; case "eligible": ?>
                    <form method="POST" class="form-horizontal" role="form">
                        <div class="form-group">
                            <input type="text" name="address" class="form-control" style="position: absolute; position: fixed; left: -99999px; top: -99999px; opacity: 0; width: 1px; height: 1px">
                            <input type="checkbox" name="honeypot" style="position: absolute; position: fixed; left: -99999px; top: -99999px; opacity: 0; width: 1px; height: 1px">
                            <label class="col-sm-4 col-md-offset-1 col-lg-3 control-label">Your address:</label>
                            <div class="col-sm-8 col-md-7" style="min-width: 270px;">
                            <input type="text" name="<?php echo $data["address_input_name"]; ?>" class="form-control" value="<?php echo $data["address"]; ?>">
                        <div class="form-group">
                            <?php echo $data["captcha"]; ?>
                            <div class="text-center">
                                if (count($data['captcha_info']['available']) > 1) {
                                    foreach ($data['captcha_info']['available'] as $c) {
                                        if ($c == $data['captcha_info']['selected']) {
                                            echo '<b>' .$c. '</b> ';
                                        } else {
                                            echo '<a href="?cc='.$c.'">'.$c.'</a> ';
                        <div class="form-group">
                            <div class="col-sm-offset-4 col-sm-4">
                                <input type="submit" class="btn btn-primary btn-lg claim-button" value="Get reward!">
                <?php if ($data["reflink"]): ?>
				<blockquote class="text-left">
						Reflink: <code><?php echo $data["reflink"]; ?></code>
					<footer>Share this link with your friends and earn <?php echo $data["referral"]; ?>% referral commission</footer>
                <?php endif; ?>
                <?php break; case "visit_later": ?>
                    <p class="alert alert-info">You have to wait <?php echo $data["time_left"]; ?></p>
                <?php break; case "user_page": ?>
                <?php echo $data["user_page"]["html"]; ?>
                <?php break; endswitch; ?>

A switch for a faucet? Sounds like poor plumbing to me. :joy:

Anyway… i’m… not sure what you’re asking here. Is there some sort of Javascript you’re trying to implement? Only thing i see in your post is PHP and HTML…

1 Like

hahah no a switch statement where it shows login and captcha and payout in a page on its own like an else statement

like this

Right… that’s a PHP function.

You realize you’ve posted this in the Javascript section, right?

Discussion continued at