Need help with PHP creating shorturl on ref url.
2014-04-30, 02:21 AM,
#1
Hi,
i need a little help with this

PHP Code:
<td colspan="2"><div align="center">

      <
input type="text" id="postLink" name="postLink" size="100" onclick="this.focus(); this.select();" value="{refurl}" class="postLink" />

    </
div></td

..... now the output will be value of {refurl}
signupforgooddeals (dot) com/?id=5drwryrczl0zsruis5b4vy1mg08ha1

now instead of the above script showing " signupforgooddeals (dot) com/?id=5drwryrczl0zsruis5b4vy1mg08ha1" it would be awesome if it would use bit . ly API and create a short url for " signupforgooddeals (dot) com/?id=5drwryrczl0zsruis5b4vy1mg08ha1 "

when a new user visits the page the ?id=5drwryrczl0zsruis5b4vy1mg08ha1 part will be difference as it is unique for each visitor's to keep track of their progress.
Reply
2014-05-02, 08:15 AM,
#2
This is not php code. This is html. I can kinda understand what you are trying to do but not really since the code you posted doesnt output anything other than a text input box in a div in a table cell in html.
Reply
2014-05-02, 08:52 AM,
#3
As said, that is not PHP.

If you want to achieve this with PHP you need to use PHP and sessions.
Latest Thanks - View all

garciabogard(2014-05-06 01:34 AM) 
Reply
2014-05-04, 06:08 AM,
#4
sorry my bad that was the code from within templates editor which generates the output index page.
heres the php

PHP Code:
$SFind = array("{hitrule}""{refurl}");
$SReplace = array(
    
$HitRule,
    
$config['http_home_url'].'?id='.$IpId

this is the part where it sets value for {refurl} which is
PHP Code:
$config['http_home_url'].'?id='.$IpId

signupforgooddeals (dot) com/?id=5drwryrczl0zsruis5b4vy1mg08ha1

now instead of the above script showing " signupforgooddeals (dot) com/?id=5drwryrczl0zsruis5b4vy1mg08ha1" it would be awesome if it would use bit . ly API and create a short url for " signupforgooddeals (dot) com/?id=5drwryrczl0zsruis5b4vy1mg08ha1 "

and then puts that in {refurl} value.

i hope this time i have improved the question.
Reply
2014-05-05, 11:42 PM,
(This post was last modified: 2014-05-05, 11:48 PM by Mr. Tokyo.)
#5
You need this https://github.com/Falicon/BitlyPHP. Include that on top of the page to be able to use their API.

PHP Code:
include 'bitly.php'//or wherever you have stored the file

//replace "$config['http_home_url'].'?id='.$IpId" with
bitly_v3_shorten($config['http_home_url'].'?id='.$IpId'j.mp'

Note: I have not tested this.
Latest Thanks - View all

garciabogard(2014-05-06 12:47 AM) 
Reply
2014-05-06, 01:23 AM,
#6
i did exactly as you said. on my first try the page loaded up blank
then i put a comma at the end of bitly_v3.. line... then the page loaded up. but instead of showing bit.ly link it says "Array" without quotes.

(2014-05-05, 11:42 PM)ѕedoɴιc Wrote: You need this . Include that on top of the page to be able to use their API.

PHP Code:
include 'bitly.php'//or wherever you have stored the file

//replace "$config['http_home_url'].'?id='.$IpId" with
bitly_v3_shorten($config['http_home_url'].'?id='.$IpId'j.mp'

Note: I have not tested this.
Reply
2014-05-06, 01:39 AM,
(This post was last modified: 2014-05-06, 01:43 AM by Mr. Tokyo.)
#7
You must have a bit.ly account to make use of their API.

Open up the bitly.php file and you follow the instructions there (Line 16 and 21 (26 and 31 are optional)).

Also:
PHP Code:
//replace with the following if you want bit.ly urls and not j.mp urls. 
bitly_v3_shorten($config['http_home_url'].'?id='.$IpId
Latest Thanks - View all

garciabogard(2014-05-06 01:48 AM) 
Reply
2014-05-06, 01:48 AM,
#8
bitlyKey
bitlyLogin
client_id
client_secret

i have changed these to what is required by the script. registering at bitly was the first thing i did :)

if you are on skype maybe we can talk there. this will hardly take 5min
Reply
2014-05-06, 06:33 AM,
#9
@ѕedoɴιc just wanted to say thank you once again for helping me out. Just to let everyone else on the forum know he fixed the issue for me on skype.
everything is working in order just the way i wanted.
Latest Thanks - View all

Mr. Tokyo(2014-05-06 09:56 AM) 
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Premium URL Shortener - v4.2 - HOTFIX - CodeCanyon M!st3r XX 28 5,501 2017-08-19, 08:27 AM
Last Post: dikaFp
  [Help]CPAGrip custom URL Locker fieldy2012 5 1,563 2017-04-04, 12:54 PM
Last Post: budiman
  Help Needed CPAgrip php script takumi 4 797 2017-01-24, 04:47 AM
Last Post: takumi
  SOME DATA IS NOT BEING INSERTED TO MYSQL DATABASE WITH PHP QwertySon 2 1,138 2016-11-21, 02:52 PM
Last Post: QwertySon
  Cpagrip Url Locker Html Code ashu55 5 2,159 2016-10-30, 07:42 PM
Last Post: baxxx




About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top