• 03-08-2007, 13:09:52
    #1
    Bir tür url kısaltma scripti üzerinde çalışıyorum.

    Scriptin demosu burda var: Free Short Url Redirection | Zeak.Net

    Sormak istediğim, bu yazılımda link tek bir satırdan çekilip sonrada onun kısa halini veriyor.

    Benim yapmak istediğim ise çoklu yazı kısmından bir çok satırdan link çekip hepsini çevirdikten sonra hepsini kullanıcıya göstermesi.

    Anlatım biraz karışık oldu sanırım.. Kısaca yapmak istediğim bir sefered alınan bağlantı sayısını arttırmak.

    Free Short Url Redirection | Zeak.Net burdakini
    Örnek olarak bu şekilde yapmak: RapidShare Protection Links


    index.html
    <html>
      <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <title>Free Short Url Redirection | Zeak.Net</title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    </head>
    <body>
    <div class="header"><p><img src="img/logo.gif" alt="Help Im Stuck In This Image!" /></p></div>
    <div id="content">
    <h1>Short Url Redirection | Make A Long Url Short.</h1>
    <div class="spacer"><span></span></div>
          <form method="post" action="create.php">
    <p>
              <label title="Enter Long Url Here | http:// To Make It Work">
                <input type="text" name="url" size="40" value="http://"  /></label><br />
              <label title="Submit URL To Make A Tinyurl">
    <input type="submit" name="send" value="Make It Short!" class="submit" /></label></p>
    <div class="spacer"><span></span></div>
          </form>
        </div>
    <div class="centered"><table> 
     <tr>
      <td class="width"><div class="subcontent">
    <ul>
    <li><h2><strong>Redirection to any page.</strong></h2></li>
    <li><h2><strong>Its easy to remember.</strong></h2></li>
    </ul></div>
    </td>
    <td class="width"><div class="storycontent">
    <ul>
    <li><h2><strong>Friendly Link for SMS.</strong></h2></li>
    <li><h2><strong>Just make it short.</strong></h2></li>
    </ul></div>
    </td>
    </tr>
    </table> 
    </div>
    <!-- Read license.txt if you wish to remove the link -->
    <div id="copy">Powered by <a href="http://www.zeak.net/" target=_blank>PHP ZLink</a> | Copyright &copy; S.A - Zeak.Net</div>
    </body>
    </html>
    create.php
    <?
    /************************************************************************
    
     PHP ZLink Free Edition
     Copyright(C), Zeak.Net, 2006.
    
     PHP ZLink is protected by International copyright laws.
     Unauthorized use or distribution of PHP ZLink is strictly prohibited, 
     To obtain a commercial license for using PHP ZLink, Or to remove the
     links/branding of the script.
     please go to PHP ZLink home page at http://www.zeak.net/
    
     Author: S.A (http://www.zeak.net)
     
     09/03 - 2006.
    
    ************************************************************************/
    
    include("config.php");
    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';
    
    }
    ?>
  • 03-08-2007, 13:27:22
    #2
    index.html yi böle yap yedek al ama
    <html>
      <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <title>Free Short Url Redirection | Zeak.Net</title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    </head>
    <body>
    <div class="header"><p><img src="img/logo.gif" alt="Help Im Stuck In This Image!" /></p></div>
    <div id="content">
    <h1>Short Url Redirection | Make A Long Url Short.</h1>
    <div class="spacer"><span></span></div>
          <form method="post" action="create.php">
    <p>
              <label title="Enter Long Url Here | http:// To Make It Work">
                <input type="text" name="url" size="40" value="http://"  /><br>
    			<br>
                <input type="text" name="url2" size="40" value="http://"  /><br>
    			<br>
                <input type="text" name="url3" size="40" value="http://"  /><br>
    			<br>
                <input type="text" name="url4" size="40" value="http://"  /></label><br />
              <label title="Submit URL To Make A Tinyurl">
    <input type="submit" name="send" value="Make It Short!" class="submit" /></label></p>
    <div class="spacer"><span></span></div>
          </form>
        </div>
    <div class="centered"><table> 
     <tr>
      <td class="width"><div class="subcontent">
    <ul>
    <li><h2><strong>Redirection to any page.</strong></h2></li>
    <li><h2><strong>Its easy to remember.</strong></h2></li>
    </ul></div>
    </td>
    <td class="width"><div class="storycontent">
    <ul>
    <li><h2><strong>Friendly Link for SMS.</strong></h2></li>
    <li><h2><strong>Just make it short.</strong></h2></li>
    </ul></div>
    </td>
    </tr>
    </table> 
    </div>
    <!-- Read license.txt if you wish to remove the link -->
    <div id="copy">Powered by <a href="http://www.zeak.net/" target=_blank>PHP ZLink</a> 
    	| Copyright © S.A - Zeak.Net</div>
    </body>
    </html>
    create.php ise
       <?
    include("config.php");
    if (strstr($_SERVER['HTTP_REFERER'], $root));
    else { header ("Location: $rooturl"); }
    $ip = $_SERVER['REMOTE_ADDR'];
    $url = $_POST['url'];
    $url2 = $_POST['url2'];
    $url3 = $_POST['url3'];
    $url4 = $_POST['url4'];
    if(preg_match('|^http(s)?://[a-z0-9-]+(\.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url, $url2, $url3, $url4))
    {
    $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';
    }
    ?>
    mysql da ise url2 url 3 url 4 die tablo olması gerekli php ye yeni geçtim mysql ile aram iyi değil

    edit: mysql uda ekle buraya yardımcı olayım
  • 03-08-2007, 13:36:13
    #3
    Yardımın için teşekkür ederim fakat tam olarak yapmak istediğim bu değil. Yapmak istediğim mesela 30 tane bağlantıyı kopyalıcak kullanıcı sonra metin kısmına yapıştırcak çevir dedikten sonra 30 bağlantı da çevrilmiş olarak karşısına gelecek.

    Örnek: RapidShare Protection Links
  • 03-08-2007, 13:38:15
    #4
    php yeni öğreniyorum biraz araştırayım dönerim eğer yapamadıysan
  • 03-08-2007, 18:35:35
    #5
    Üyeliği durduruldu
    <html>
      <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <title>Free Short Url Redirection | Zeak.Net</title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    </head>
    <body>
    <div class="header"><p><img src="img/logo.gif" alt="Help Im Stuck In This Image!" /></p></div>
    <div id="content">
    <h1>Short Url Redirection | Make A Long Url Short.</h1>
    <div class="spacer"><span></span></div>
          <form method="post" action="create.php">
    <p>
              <label title="Enter Long Url Here | http:// To Make It Work">
               <textarea name="url" rows="50" cols="50"></textarea></label><br />
              <label title="Submit URL To Make A Tinyurl">
    <input type="submit" name="send" value="Make It Short!" class="submit" /></label></p>
    <div class="spacer"><span></span></div>
          </form>
        </div>
    <div class="centered"><table> 
     <tr>
      <td class="width"><div class="subcontent">
    <ul>
    <li><h2><strong>Redirection to any page.</strong></h2></li>
    <li><h2><strong>Its easy to remember.</strong></h2></li>
    </ul></div>
    </td>
    <td class="width"><div class="storycontent">
    <ul>
    <li><h2><strong>Friendly Link for SMS.</strong></h2></li>
    <li><h2><strong>Just make it short.</strong></h2></li>
    </ul></div>
    </td>
    </tr>
    </table> 
    </div>
    <!-- Read license.txt if you wish to remove the link -->
    <div id="copy">Powered by <a href="http://www.zeak.net/" target=_blank>PHP ZLink</a> | Copyright &copy; S.A - Zeak.Net</div>
    </body>
    </html>
       <?
    
    
    include("config.php");
    if (strstr($_SERVER['HTTP_REFERER'], $root));
    else { header ("Location: $rooturl"); }
    
    $ip = $_SERVER['REMOTE_ADDR'];
    $urlto = split('\n',$_POST['url']);
    foreach($urlto as $key => $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';
    
    }
    }
    ?>
  • 03-08-2007, 20:25:53
    #6
    @Lisans
    Senin kodlarınla denedim fakat çalışmadı.
    Şu an senin kodların var: Free Short Url Redirection | Zeak.Net
  • 03-08-2007, 21:46:57
    #7
    Üyeliği durduruldu
    create_template.php
    Şunun içeriği yolla onuda düzenleyelim

        <?
    
    
    include("config.php");
    if (strstr($_SERVER['HTTP_REFERER'], $root));
    else { header ("Location: $rooturl"); }
    
    $ip = $_SERVER['REMOTE_ADDR'];
    $urlto = split(' ',trim($_POST['url']));
    foreach($urlto as $key => $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';
    
    }
    }
    ?>
    Bunuda böyle tekrar düzenle
  • 03-08-2007, 22:53:08
    #8
    create_template.php

    <?
    /************************************************************************
    
     PHP ZLink Free Edition
     Copyright(C), Zeak.Net, 2006.
    
     PHP ZLink is protected by International copyright laws.
     Unauthorized use or distribution of PHP ZLink is strictly prohibited, 
     To obtain a commercial license for using PHP ZLink, Or to remove the
     links/branding of the script.
     please go to PHP ZLink home page at http://www.zeak.net/
    
     Author: S.A (http://www.zeak.net)
     
     09/03 - 2006.
    
    ************************************************************************/
    ?>
    
    <head>
    <title>Free Short Url Redirection | Zeak.Net</title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    </head>
    <body>
    <div class="header"><p><img src="img/logo.gif" alt="Help Im Stuck In This Image!" /></p></div>
    <?
    echo "<center>Your New Short ZLink: <a href=$rooturl" . $qs . " target=_blank>$rooturl" . $qs . "</a></center><br />";
    ?>
    <div id="content">
    <h1>Short Url Redirection | Make A Long Url Short.</h1>
    <div class="spacer"><span></span></div>
          <form method="post" action="create.php">
    <p>
              <label title="Enter Long Url Here | http:// To Make It Work">
                <input type="text" name="url" size="60" value="http://"  /></label><br />
              <label title="Submit URL To Make A Tinyurl">
    <input type="submit" name="send" value="Make It Short!" class="submit" /></label></p>
    <div class="spacer"><span></span></div>
          </form>
        </div>
    <div class="centered"><table> 
     <tr>
      <td class="width"><div class="subcontent">
    <ul>
    <li><h2><strong>Redirection to any page.</strong></h2></li>
    <li><h2><strong>Its easy to remember.</strong></h2></li>
    </ul></div>
    </td>
    <td class="width"><div class="storycontent">
    <ul>
    <li><h2><strong>Friendly Link for SMS.</strong></h2></li>
    <li><h2><strong>Just make it short.</strong></h2></li>
    </ul></div>
    </td>
    </tr>
    </table> 
    </div>
    <!-- Read license.txt if you wish to remove the link -->
    <div id="copy">Powered by <a href="http://www.zeak.net/" target=_blank>PHP ZLink</a> | Copyright &copy; S.A - Zeak.Net</div>
    </body>
    </html>
  • 03-08-2007, 23:31:43
    #9
    Üyeliği durduruldu
         <?
    
    
    include("config.php");
    if (strstr($_SERVER['HTTP_REFERER'], $root));
    else { header ("Location: $rooturl"); }
    
    $ip = $_SERVER['REMOTE_ADDR'];
    $urlto = split(' ',trim($_POST['url']));
    foreach($urlto as $key => $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;
    $veri[] = $qs;
    require 'create_template.php';
    
    } else {
    echo 'Your URL is invalid';
    
    }
    }
    ?>
    <?
    /************************************************************************
     PHP ZLink Free Edition
     Copyright(C), Zeak.Net, 2006.
     PHP ZLink is protected by International copyright laws.
     Unauthorized use or distribution of PHP ZLink is strictly prohibited, 
     To obtain a commercial license for using PHP ZLink, Or to remove the
     links/branding of the script.
     please go to PHP ZLink home page at http://www.zeak.net/
     Author: S.A (http://www.zeak.net)
     09/03 - 2006.
    ************************************************************************/
    ?>
    <head>
    <title>Free Short Url Redirection | Zeak.Net</title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    </head>
    <body>
    <div class="header"><p><img src="img/logo.gif" alt="Help Im Stuck In This Image!" /></p></div>
    <?
    foreach($veri as $key => $value){
    echo "<center>Your New Short ZLink: <a href=$rooturl" . $value. " target=_blank>$rooturl" . $value . "</a></center><br />";
    }
    ?>
    <div id="content">
    <h1>Short Url Redirection | Make A Long Url Short.</h1>
    <div class="spacer"><span></span></div>
          <form method="post" action="create.php">
    <p>
              <label title="Enter Long Url Here | http:// To Make It Work">
                <input type="text" name="url" size="60" value="http://"  /></label><br />
              <label title="Submit URL To Make A Tinyurl">
    <input type="submit" name="send" value="Make It Short!" class="submit" /></label></p>
    <div class="spacer"><span></span></div>
          </form>
        </div>
    <div class="centered"><table> 
     <tr>
      <td class="width"><div class="subcontent">
    <ul>
    <li><h2><strong>Redirection to any page.</strong></h2></li>
    <li><h2><strong>Its easy to remember.</strong></h2></li>
    </ul></div>
    </td>
    <td class="width"><div class="storycontent">
    <ul>
    <li><h2><strong>Friendly Link for SMS.</strong></h2></li>
    <li><h2><strong>Just make it short.</strong></h2></li>
    </ul></div>
    </td>
    </tr>
    </table> 
    </div>
    <!-- Read license.txt if you wish to remove the link -->
    <div id="copy">Powered by <a rel="nofollow" href="http://www.zeak.net/" target=_blank>PHP ZLink</a> | Copyright &copy; S.A - Zeak.Net</div>
    <br /><div style="z-index:3" class="smallfont" align="center">LinkBacks Enabled by vBSEO 3.0.0 &copy; 2007, Crawlability, Inc.</div></body>
    </html>