1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bulk redirection modifying

Discussion in 'PHP & Perl' started by amberlamps, Oct 5, 2010.

  1. amberlamps

    amberlamps BANNED BANNED

    Joined:
    Jun 24, 2010
    Messages:
    331
    Likes Received:
    142
    okay i need help i got this redirection script that i modify to do bulk.
    site can be seen here http://ihide.me/red1/bulk.php

    i need it to do bulk and keep its title for example like this

    Title Of link
    Http://actual-link.com

    and when i generate the new redirected link for it to stay the same example

    Title Of link
    Http://Redirected-link.com

    -----

    i have no idea how to do this, i paid some guy from dp to do it and he only did half of what i wanted the bulk part of it works but it doesnt keep the tittle of the link. and thats the main part i wanted. someone help

    these are the two files i had to modify

    ihide.me/red1/bulk.php

    Code:
    <center><body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 text=#cdcdcd bgcolor=#2b3239>
    <?
    
    ###set url to single-script
    $url="http://$_SERVER[HTTP_HOST]$_SERVER[SCRIPT_NAME]/../create.php";
    
    
    if($_POST[urls]==""){
    
    echo"
    <form method=post><textarea style=border:100px;width:100%;height:80%; name=urls></textarea><br><input type=submit value=\"Bulk shorten URLS\">";
    
    }
    else
    {
    echo"<small>Your short URLs:<br><br>";
    $split=explode("\n",$_POST[urls]);foreach($split as $urlx) { $urlx=urlencode(eregi_replace("\r","",$urlx));$curl_handle = 
    curl_init();curl_setopt($curl_handle, CURLOPT_URL, "$url");curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 
    1);curl_setopt($curl_handle, CURLOPT_POST, 1);curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "url=$urlx");$buffer = 
    curl_exec($curl_handle);curl_close($curl_handle);$buffer=strip_tags($buffer);
    $xnew=explode("Url: ",$buffer);$xnew=explode(" ",$xnew[1]);
    
    echo "$xnew[0]<br>";
    }
    
    
    }
    
    
    ?>
    
    
    
    



    ihide.me/red1/create.php

    Code:
    <?php
    
    include("config.php");
    if (strstr($_SERVER['HTTP_REFERER'], $root));
    else { header ("Location: $rooturl"); }
    
    $ip = $_SERVER['REMOTE_ADDR'];
    if($_POST['links'])
    {
    $link = array();
    $today=date('Y-m-d');
    
    $str= nl2br($_POST['links']);
    
    $ex=explode('<br />',$str);
    
    foreach($ex as $url)
    
    {
    $url = trim($url);
    if(preg_match('|^http(s)?://[a-z0-9-]+(\.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url))
    {
    $query = "INSERT INTO $table (ip,url) VALUES ('$ip','$url')" or die('MySQL error: '.mysql_error());
    mysql_query($query);
    $qs = mysql_insert_id();
    $link[] = $destination . $qs;
    } else {
    $link[] = "invalid";
    }
    }
    
    require 'create_template.php';
    }
    else
    {
    if (strstr($_SERVER['HTTP_REFERER'], $root));
    else { header ("Location: $rooturl"); }
    
    $ip = $_SERVER['REMOTE_ADDR'];
    $url = $_POST['url'];
    
    if(preg_match('|^http(s)?://[a-z0-9-]+(\.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url))
    {
    
    $query = "INSERT INTO $table (ip,url) VALUES ('$ip','$url')" or die('MySQL error: '.mysql_error());
    mysql_query($query);
    $qs = mysql_insert_id();
    $link = $destination . $qs;
    require 'create_template.php';
    
    } else {
    echo 'Your URL is invalid';
    
    }
    }
    ?>