Go Back   Computer Forums > Web Design | Website Development > Web Programming
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 03-07-2006, 04:35 PM   #1
Solid State Member
Join Date: Dec 2005
Posts: 20
Default Making a TinyURL php script...

Hello guys, i dont know very much php but i know enough to follow directions.

Im trying to modify an already existing php script. The script is called phpFaber TinyLink and is available for free here.

I have uploaded it to the link below but i have not set up the mysql db yet.

Instead of a submit line i want to have a text box where i can post multiple URLs.

For example...i post one url on one line....the 2nd url on the 2nd line..and the 3rd url on the 3rd line....and so on.

Then i when the user clicks submit(make tinylink)...i want php to convert each line to its own Tinylink and store it in the database. Then for it to display the new tiny links in order.

This doesnt sound too hard, im just not sure where to start.


$smarty = new Smarty;
$smarty->template_dir = "$dir_ws/tiny_templates";
$smarty->compile_dir = "$dir_ws/tiny_templates_c";

$HTTP_SESSION_VARS['searchurl'] = '';
$randlink = '';

if($_SERVER['QUERY_STRING'] && !$fullurl && !preg_match('/[\W]/',$_SERVER['QUERY_STRING'])){
//loading index.php with query
if($res = checkQueryString($_SERVER['QUERY_STRING'])){
//query found
if($res['showsplash'] && $config['refreshrate']){
else js_redirect($res['fullurl']);
//query did not find

preg_match("/^((http:\/\/)*)(.*)/i", $fullurl, $matches1);
preg_match("/^(http:\/\/)*/i", $fullurl, $matches2);

if($matches1[1]==$matches2[1] and $matches1[3]) $u = parse_url($fullurl);
else $u['host'] = $fullurl;

$ip = gethostbyname($u['host']);

if($ip == $u['host']){
js_alert ('No such host!');
else $randlink = addLink($fullurl,$ip);

//loading index.php


w0lv3r1ne is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 10:14 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0