can someone help me modifying this script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dimebag
Forum Newbie
Posts: 22
Joined: Fri Feb 13, 2009 4:13 pm

can someone help me modifying this script

Post by dimebag »

Moved by moderator to the appropriate Forum.

hi
i need a help about php script
i want to use link shortening script on my own host i found a good script for doing it too
i already installed and using it
but my problem is this script have ability that you can define tag for your created short url but i am not able to use some characters like _ or . or - and etc
in fact i don not know anything about php
is it possible to add those characters to the script so i would be able to use those characters too while chosing tag for the shortened url ?
plz help me
if needed iwill upload the script too
thanks friends
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: can someone help me modifying this script

Post by John Cartwright »

Yes you will need to post the relevant code.
dimebag
Forum Newbie
Posts: 22
Joined: Fri Feb 13, 2009 4:13 pm

Re: can someone help me modifying this script

Post by dimebag »

okay thanks
which codes should i put here ?

these are php files of the script
in the root
httaccess
config
contact
create_template
go
install
send
config-mail
create
frame
index.html
maile
and in the folder admin the files are
empty
common
index
login
logout
view
and some images
and in folder css there is a style file
and a folder img with some pics
so which codes should i put here ?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: can someone help me modifying this script

Post by John Cartwright »

I have no idea..I'm not familiar with your software. Whatever code generates the link.

..and please do not post a very long code snipplet. It is important to only post relevant code.
dimebag
Forum Newbie
Posts: 22
Joined: Fri Feb 13, 2009 4:13 pm

Re: can someone help me modifying this script

Post by dimebag »

hi
thanks so i think its better that i add the whole scipt
i thnik the code is defined in the create.php file
thnaks for your help
Attachments
Short_Url.rar
(99.66 KiB) Downloaded 3 times
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: can someone help me modifying this script

Post by Eran »

No offense, but you do really think any of us has the time to go over all your scripts and give you advice on how to install it? did you try anything it yourself? what problems did you encounter?

If you do not make the minimum effort to solve your problem yourself, how do you expect others to help you in their free time?
dimebag
Forum Newbie
Posts: 22
Joined: Fri Feb 13, 2009 4:13 pm

Re: can someone help me modifying this script

Post by dimebag »

hi
i did not want that someone goes through the script and modify it for me
i jsu asked what should i do to be able to use some characters like _ or . or - and etc when using tag defining ability of the script
and i said im not good in php
so i taught someone will help me how to add those characters to script so id be able to use them while defining tag for shortened url
thanks
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: can someone help me modifying this script

Post by John Cartwright »

You need to find and post the code responsible for the url generation. Simple as that. We cannot help you modify something we cannot see.
dimebag
Forum Newbie
Posts: 22
Joined: Fri Feb 13, 2009 4:13 pm

Re: can someone help me modifying this script

Post by dimebag »

thanks
so i think this is the php code need to be modifed as i think
i hope im right

Code: Select all

<?
/************************************************************************
 
 Persian Short Url  Free Edition
 Copyright(C), PersianScript.ir 2008
 
************************************************************************/
 
include("config.php");
if (strstr($_SERVER['HTTP_REFERER'], $root));
else { header ("Location: $rooturl"); }
 
$ip = $_SERVER['REMOTE_ADDR'];
$url = mysql_real_escape_string($_POST['url']);
 
if(preg_match('|^http(s)?://[a-z0-9-]+(\.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url)) {
    if (empty($_POST['tag'])) {
        $query = mysql_query("INSERT INTO $table (ip,url) VALUES ('$ip','$url')") or die('MySQL error: '.mysql_error());
        $qs = mysql_insert_id();
    } else {
        if (ereg('^[a-zA-Z0-9]+[a-zA-Z0-9]+$', $_POST['tag'])) {
            $tag = mysql_real_escape_string($_POST['tag']);
            $query = mysql_query("select * from $table where `tag` = '$tag';") or die('MySQL error: '.mysql_error());
            if (mysql_num_rows($query) != 0)
                die("??? ?? ??? ???? ???? ??? ???? ???? ??? ???.???? ??????? ? ?? ????? ?? ?????? ????");
            else {
                $query = mysql_query("insert $table (ip,url,tag) VALUES ('$ip','$url','$tag')") or die('MySQL error: '.mysql_error());
                $qs = $tag;
            }
        } else
            die('??? ?? ??? ???? ???? ??? ??? ???? ???.???? ?? ????? ???? ????');
    }
    $link = $destination . $qs;
    require 'create_template.php';
} else
    echo ' ?? ???? ???? http:// ????? ?? ???? ???? ??? ??? ???? ??????? ???.?? ?????? ???? ???? ???? ';
 
?>
Post Reply