Text Form

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Text Form

    I want to add text in Link Protector. I want to add "paste text form" in script link protector. I have created 2nd form with the name title2, submit2, information2 but how to add option for the text? In this script it has paste link option. It means If I paste link in the box it creates a protected url in which my pasted links stored. but I want to add 2nd option in which I can paste normal text.
    Here is the index.php in
    In which I have added menu main1, here I want to add text option.
    Attached Files
    Last edited by omshankar; 10.05.18, 15:42.

  • #2
    Mysql if you added a other row of text you can copy the code from other one change it target your new row ..

    Code:
     
     <form> First name: <input type="text" name="firstName" value="<?php echo $firstname; ?>" /><br /> Last name: <input type="text" name="lastName" value="<?php echo $lastname; ?>" /><br /> <input type="submit" value="Submit" /> </form>
    PHP Code:
     Firstconnect to the database.    $link mysql_connect('localhost''mysql_user''mysql_password'); if (!$link) {     die('Could not connect: ' mysql_error()); } 
    Then query the database with an SQL query.
    ​​​​​​​
    PHP Code:
     $result mysql_query($query); ​​​​​​​ 
    Then pull out the individual data items and echo them where you need.
    PHP Code:
      while ($row mysql_fetch_assoc($result)) { echo $row['firstname']; echo $row['lastname']; echo $row['address']; echo $row['age'];    } 

    Comment


    • #3
      There is no mysql in this script. It is link protector script. It has only index.php. It stores .dlp file after submitting a link. You may check
      It has two option one for link pasting and one for text pasting.
      Last edited by omshankar; 10.05.18, 15:42.

      Comment


      • #4
        Code:
        <?php
        
        include('header.php');
        if ($_POST['submit'] != "") {
            $title      = $_POST['title'];
            $postedinfo = $_POST['information'];
            $textToggle =  isset($_POST['text']) ? 1 : 0;
            if($textToggle==0)
            {
                if (!strpos($postedinfo, "://"))
                    $postedinfo = "http://" . $postedinfo;
            }
            $postedtitle = $_POST['title'];
        
            $postedtitle = str_replace("'", '', "$postedtitle");
            $postedtitle = str_replace("&", '', "$postedtitle");
            $postedtitle = str_replace("|", '%20', "$postedtitle");
            $postedtitle = stripslashes("$postedtitle");
            $radiotop20  = $_POST['R1'];
            $radiopass   = $_POST['R2'];
            $userip      = $_SERVER['REMOTE_ADDR'];
            $todaydate   = getdate();
            if ($postedinfo == "" or $postedtitle == "") {
                echo "<div class=\"error\"><img src=\"./img/error.png\">Please fill in all the fields below:</div>";
            } else {
                $fancyurl = rand(0, 999) . $title;
                $rand2    = ("$fancyurl");
                $filename = "./files/" . $rand2 . ".dlp";
                if (file_exists($filename)) {
                    die("An unusual error occured. Please navigate BACK using your browser and re-submit your links again.");
                } else {
                    $filelist   = fopen("./files/" . $rand2 . ".dlp", "w");
                    $fileconfig = fopen("./config/" . $rand2 . ".dlp", "w");
        
                    if ($radiopass == "V3") {
                        $radiopass = "Yes";
                    } else {
                        $radiopass = "No";
                    }
                    $time = time();
                    fwrite($filelist, $postedinfo . "\n");
                    fwrite($fileconfig, $time . "|" . $radiopass . "|" . md5($_POST['pass']) . "|" . $userip . "|0" . "|" . $textToggle);
                    $me = $shorturl;
                    if ($me == true)
                        $short = "";
                    else
                        $short = "index.php?ID=";
        
        ?>
        <div class="success"><img src="./img/success.png">Your new URL is <a href="<?
                    echo $scripturl . $short . $rand2;
        ?>"><?
                    echo $scripturl . $short . $rand2;
        ?></a></div>
        <?
                }
            }
        }
        if ($_GET['ID'] == "") {
            if (isset($_POST['submit'])) {
            } else {
        ?>
        
        <!--<center><div class="notice"><img src="./img/note.png"><?php
                echo $sitetitle;
        ?> is a free service, that allows you to protect your link(s) and prevents any of your link(s) from being found/indexed from search engine spiders.</div></center>-->
        <?php
            }
        ?>
        <ul class="nav nav-tabs">
          <li class="col-xs-4 active"><a data-toggle="tab" href="#home" class="btn btn-info">Paste Link</a></li>
          <li class="col-xs-4"><a data-toggle="tab" href="#menu1" class="btn btn-info">Plain Text</a></li>
        </ul>
        <div class="tab-content">
          <div id="home" class="tab-pane fade in active">
        <FORM ACTION="<?= $PHP_SELF ?>" METHOD="POST" NAME="newsentry">
        <fieldset> 
        <p align="center">
        <div class="col-sm-10 col-sm-offset-1">
        <b><label>Title:</label></b>
        <input type="title" name="title" size="20" class="form-control">
        </p></p>
        <p align="center"><br>
        <div class="col-sm-10 col-sm-offset-1">
        <b><label>Links</label></b><br>
        <TEXTAREA NAME="information" COLS="40" ROWS="5" class="form-control"></TEXTAREA><br>
        <div id="email">
              <p align="center"><label><b>Password</b><br>
                </label>
              <input name="pass" type="password" size="20" class="form-control" />
            </div>
        <!--<p align="center">
        <BR>Password Protected Links?* Yes <input onclick="javascript: $('#email').show('slow');" type="radio" name="R2" value="V3" />  No
        <input onclick="javascript: $('#email').hide('slow');" type="radio" name="R2" value="V4" checked /><br>-->
        <br>
        <p align="center">
            <div class="col-sm-10 col-sm-offset-1">
        <INPUT TYPE="submit" NAME="submit" VALUE="Protecte Me!" class="btn btn-lg btn-success"><BR>
        </p>
        </fieldset> 
        <label><br />*If a password isn't inputted, a captcha will be displayed before showing the 
        links to prevent the links from being spidered.<BR></label>
        </p></FORM></div>
        <div id="menu1" class="tab-pane fade">
        <FORM ACTION="<?= $PHP_SELF ?>" METHOD="POST" NAME="newsentry">
        <fieldset> 
        <p align="center">
        <div class="col-sm-10 col-sm-offset-1">
        <b><label>Title:</label></b>
        <input type="title" name="title" size="20" class="form-control">
        </p></p>
        <p align="center"><br>
        <div class="col-sm-10 col-sm-offset-1">
        <b><label>Links</label></b><br>
        <TEXTAREA NAME="information" COLS="40" ROWS="5" class="form-control"></TEXTAREA><br>
        <div id="email">
              <p align="center"><label><b>Password</b><br>
                </label>
              <input name="pass" type="password" size="20" class="form-control" />
            </div>
        <!--<p align="center">
        <BR>Password Protected Links?* Yes <input onclick="javascript: $('#email').show('slow');" type="radio" name="R2" value="V3" />  No
        <input onclick="javascript: $('#email').hide('slow');" type="radio" name="R2" value="V4" checked /><br>-->
        <br>
        <p align="center">
            <div class="col-sm-10 col-sm-offset-1">
            <input type="hidden" name="text" value="1"/>
        <INPUT TYPE="submit" NAME="submit" VALUE="Protecte My Text!" class="btn btn-lg btn-success"><BR>
        </p>
        </fieldset> 
        <label><br />*If a password isn't inputted, a captcha will be displayed before showing the 
        links to prevent the links from being spidered.<BR></label>
        </p></FORM>
        </div></div>
        <?
        } else {
        ?>
        <?
            $IDFile = "./files/" . $_GET["ID"] . ".dlp";
            if (file_exists($IDFile)) {
                $fop     = fopen("./config/" . $_GET["ID"] . ".dlp", "r");
                $content = fread($fop, '999');
                fclose($fop);
                $content = explode("|", $content);
                if (isset($_POST['Submit0'])) {
                    if (in_array(md5($_POST['Pass1']), $content)) {
                        $passplus = "allow";
                    }
                }
                if ($content[1] == "Yes" && $passplus == "") {
                    if (isset($_POST['Submit0'])) {
        ?>
        <div class="error"><img src="./img/error.png">You have entered an incorrect password. Please make sure you are authorized to view these links and try again later.</div>
        <?
                    } else {
                    }
        ?>
        </FORM><p align="center">Password Protected Link(s):<BR>
            &nbsp;</p>
        <form method="POST" action="<?php
                    echo $_SERVER['php_SELF'];
        ?>">
            <p align="center"><input type="password" name="Pass1" size="20"></p>
            <p align="center"><input type="submit" value="Submit" name="Submit0"></p>
        </form>
        <p align="center"><BR><BR>
            </p>
        <?
                } elseif ($content[1] == "No") {
        ?>
        
        <?
        
                        // Insert you code for processing the form here, e.g emailing the submission, entering it into a database. 
                        if (isset($_SESSION['views']) && $_SESSION['views'] == $_GET['ID']) {
                        } else {
                            $fileconfig = fopen("./config/" . $_GET['ID'] . ".dlp", "w");
                            //$content[5]  toggle for links (0) / normal text (1)
                            fwrite($fileconfig, $content[0] . "|" . $content[1] . "|" . $content[2] . "|" . $content[3] . "|" . ($content[4] + 1) . "|" . $content[5]); 
                            fclose($fileconfig);
                            $_SESSION['views'] = $_GET['ID'];
                            $views             = $content[4] + 1;
                        }
        ?>
        <center>
        <p>Hidden Links:<BR>
           <?php
                        $fop   = fopen('./files/' . $_GET['ID'] . '.dlp', 'r');
                        $links = fread($fop, filesize('./files/' . $_GET['ID'] . '.dlp'));
                        fclose($fop);
                        if($content[5] == 0) { 
                            $links   = explode("\n", $links);
        
                            $arrayNo = count($links);
                            $i       = 0;
                            while ($links[$arrayNo] <> $links[$i]) {
            ?>
            <p><a href="<?php
                                echo $links[$i];
            ?>"><?php
                                echo $links[$i];
            ?></a></p>
            <?php
                                $i++;
                            }
                        } else { 
                            echo nl2br($links); 
                        } 
        ?>
        </center></p>
        <?php
                        if (isset($views)) {
        ?>
        <p align="center">Views: <?php
                            echo $views;
        ?></p>
        <?php
                        } else {
        ?>
        <p align="center">Views: <?php
                            echo $content[4];
        ?></p>
        
        <?
                    }
                } elseif ($passplus == "allow") {
                    if (isset($_SESSION['views']) && $_SESSION['views'] == $_GET['ID']) {
                    } else {
                        $fileconfig = fopen("./config/" . $_GET['ID'] . ".dlp", "w");
                        fwrite($fileconfig, $content[0] . "|" . $content[1] . "|" . $content[2] . "|" . $content[3] . "|" . ($content[4] + 1) . "|" . $content[5]); 
                        fclose($fileconfig);
                        $_SESSION['views'] = $_GET['ID'];
                        $views             = $content[4] + 1;
                    }
        ?>
        <center>
        <p>Hidden Links:<BR>
           <?php
                    $fop   = fopen('./files/' . $_GET['ID'] . '.dlp', 'r');
                    $links = fread($fop, filesize('./files/' . $_GET['ID'] . '.dlp'));
                    fclose($fop);
                    if($content[5]==0)
                    {
                        $links   = explode("\n", $links);
                        $arrayNo = count($links);
                        $i       = 0;
                        while ($links[$arrayNo] <> $links[$i]) {
            ?>
            <p><a href="<?php
                            echo $links[$i];
            ?>"><?php
                            echo $links[$i];
            ?></a></p>
            <?php
                            $i++;
                        }
                    } else {
                        echo nl2br($links) . "</p>";
                    }
        ?>
        </center></p>
        <?php
                    if (isset($views)) {
        ?>
        <p align="center">Views: <?php
                        echo $views;
        ?></p>
        <?php
                    } else {
        ?>
        <p align="center">Views: <?php
                        echo $content[4];
        ?></p>
        <?
                    }
                }
            } else {
                echo "<div class=\"error\"><img src=\"./img/error.png\">The ID was not found, please double check your ID. However, the ID may have been deleted as per request from the uploader.</div>";
        ?>
        
        
        <?
            }
        }
        include('footer.php');
        ?>
        Note: It has a lot of html errors

        Comment

        Working...
        X