Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 05-10-2010, 07:30 AM Frame into code
Junior Talker

Posts: 4
Name: JJ
Trades: 0
Hi everyone,

I have some code here off a script I have.

PHP Code:
<?php
    
include 'inc/lib/dbconnection.php';

    
$short_url "http://$domain/".$_GET['id'];
    
    
$checkdomain mysql_query("SELECT * FROM `short_urls` WHERE `short` = '".$short_url."'");         
    if(
mysql_num_rows($checkdomain) == 1) {
    
        
$geturl mysql_query("SELECT * FROM `short_urls` WHERE `short` = '".$short_url."'");
        
$reet mysql_fetch_array($geturl);
        
        
## REDIRECT TO NEW URL
        
header ('Location: '.$reet['url'].'');    
    } else {
        
header ("Location: http://$domain/");
    }
    
?>
I want to add a frame to this code so when this script opens a frame at the top will open and I can insert whatever I want into the frame,
AdSense
, My own adverts etc

How would I do this?

thanks in advance
JJUK is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-10-2010, 07:48 AM Re: Frame into code
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You can't, if you send ANY output before the header(), PHP will throw an error.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-10-2010, 07:55 AM Re: Frame into code
Junior Talker

Posts: 4
Name: JJ
Trades: 0
Thanks for your reply,
is there any other way I could do this then?

JJ
JJUK is offline
Reply With Quote
View Public Profile
 
Old 05-10-2010, 08:17 AM Re: Frame into code
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Dunno, what exactly are you trying to do?


Though I'll hazard a guess at framing external pages while showing ads in a top frame (Google image search style).

Which would of course be against the Adsense ToS.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-10-2010, 08:23 AM Re: Frame into code
Junior Talker

Posts: 4
Name: JJ
Trades: 0
Yes I want to do that but not for Google Adsense, As I have a Ad rotator script which I run myself.

I have purchased a URL Shortner script. I was hoping to display an advert in a frame at the top saying something along the lines of a 468x60 banner with an advert for the site.
JJUK is offline
Reply With Quote
View Public Profile
 
Old 05-10-2010, 08:32 AM Re: Frame into code
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
The idea of a "URL shortener" is that the visitor will never see the site/page that handles the "shortening".
A link is clicked on page A and site B silently and invisibly redirects to page C.

Your only opportunity to show adverts is to the person who visits your site to get a short URL to paste into their links.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-10-2010, 08:47 AM Re: Frame into code
Junior Talker

Posts: 4
Name: JJ
Trades: 0
http://unikscripts.com/iny/

If you go the link above, create a link and then click the link you just created, they have some been able to create a frame with ads.
JJUK is offline
Reply With Quote
View Public Profile
 
Old 05-10-2010, 09:17 AM Re: Frame into code
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
So exactly as I said here then:
Quote:
Originally Posted by chrishirst View Post
Though I'll hazard a guess at framing external pages while showing ads in a top frame (Google image search style).
So your script needs to build a frame set (or an iframe) and open the external page in the bottom frame, NOT redirect.

It's a very old trick that went out of "fashion" a very long time ago BTW.

If you view the source of the output you'll get all the code you need.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?

Last edited by chrishirst; 05-10-2010 at 09:20 AM..
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Frame into code
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26781 seconds with 12 queries