I need a little custom work done

I have a url shortener built in php (yourls.org code) at my own domain hosted at godaddy. It uses a mysql database in the backend.

I need someone to customize it so that it doesn’t just create a new shorter the url and redirect to the target url. I want it to pull the target url and into an iframe, so that I can have my own branding at the top of the page.

A friend of mine actually built this for me a couple of years ago and it worked great, but the db files got all screwed up, I have anew shorter domain, and I’ve downloaded a newer version of yourls onto it.

Does anyone out there want to give this a shot??

Well, a quick look at their site shows that the code is yours to download free.

To install it, you just copy the yourls folder to your site and run the configuration file in it thru your website’s
address. Then, it walks you thru the creation of a new MySQL table and you set your configuration file up
to point to your database. It looks extremely easy to use and install.

Here is the site and the install instructions: http://yourls.org/#Install

As far as loading your page into an iFrame, that is easy to do with XML or Javascript or even PHP.
You would just need to have the real URL pulled from your “yourls” database and change the “src=”
field inside of the iFrame load command. If you do not understand how to do that, ask us about it.

If you can not understand these steps, ask your questions and we can help…

Hi Ernie,

Thanks for he reply. You make it sound easy. I already have the yourls code installed on my domain and functioning fine. However, I was barely able to get that done myself… I am not a programmer!

I need someone to make it so that rather than it working as a url shortener/redirect… I want to actually render on the shortened url (example.com/a) and display an iframe to pull in the target url.

The previous programmer who built this for me has moved away and I lost touch with him. Would you be willing to tackle this? You make it sound easy…

Sure, I an maybe others can help. That is why we are here on this site. To spread PHP and other code practices and help programmers learn more.

I suggest you try to do this yourself so when you want to make a change in the future, you will understand what is needed. So, with all that said…

The system takes your URL and stores it in the database. It creates a short URL and saves that in the database.

I have not looked at the actual code yet as I am dealing with a very sick mother and her pool burst at 1:30 AM this morning… YUK! What a mess! I guessed about 85,000 pounds of water went into my neighbor’s driveway!

Anyway, the results is all you really need. There are only 3 or 4 things you would need to do to get this working. First, you need a connection to the database table so you can pull the URL’s from it. Without seeing your site, I will only guess that you have a listing of the links. These links show a short version and underneath there is most likely an HREF tag that points to the real address or a PHP program that calculates the real address. Next, you would have to create an iFrame. Simple Nothing hard in that. You might want to add “frameborder=0” to shut off the annoying border it uses by default.
Lastly, you would need some code to load the iFrame with the PHP file which would read the database and display the actual real website. I would suggest using Javascript for that as it is easy to use. The Javascript would actually be called on page load from the PHP program that is loaded. This Javascript would then load
the true website page into the iFrame.

Did that make sense to you? Hope so… Now, I am quite busy most of today and do have a little time tonight to help. If you want to show us your site as it is now, so we can peek at it to get a feel for what you already have, just post it. If you want to keep it private for some reason, send it to me in a private message. Since I will have to download the code and study it, it may take some time to help you. If you know how to pull the URL’s (short version and real one), then it would save a lot of time as you would only need help with loading the iFrame.

Got all that? Let us know…

Sponsor our Newsletter | Privacy Policy | Terms of Service