How To Create iFrames or Frames like StumbleUpon and Linkedin

Discussion in 'JavaScript' started by freakadmins, Nov 15, 2011.

  1. #1
    Hello Everyone,

    I am developing my site. I am using TheStyle Wordpress theme in it. My every post is redirected to some other websites. And as they are redirecting I am loosing visitors to other site, I want to keep visitors on my site by in such a way that the external url opens in my site url.

    Eg: stumbleupon - http://www.stumbleupon.com/su/1J1krv...com/gag/207886

    Linkedin: http://www.linkedin.com/news?actionB...1eZ7X_46a_NkY1

    I want to add same top heading bar like this sites do. Please can anyone help on this?
     
    freakadmins, Nov 15, 2011 IP
  2. pcsgroups

    pcsgroups Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i think you can use i frame for this. make a php page which will catch all your external urls.over there you fetch the url structure and then you can call an iframe within the page which will call that fetched url.

    In this way you can show any external url or site within you own site.
     
    pcsgroups, Nov 16, 2011 IP
  3. freakadmins

    freakadmins Greenhorn

    Messages:
    63
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    Thanks pcsgroups for your reply. Actually I am newbie in programming and coding. As I m using wordperss those pHP files are blowing my mind. If you want i'll paste some codes over here. Can you just suggest me the changes on that? My website name is http://www.freaksnap.com/
     
    freakadmins, Nov 17, 2011 IP
  4. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #4
    I would use php

    your links would be something like this

    http://yoursite.com/showpage.php?url=http://someothersite.com/that/you/want/to/show/in/iframe
    Code (markup):
    Then in the php file showpage.php I would do something like this

    
    <?php
    $url = $_GET['url'];
    ?>
    <iframe src="<?php echo $url; ?>" width="100%" height="600px">
    
    PHP:
    Haven't tested it but that should give you a basic idea ;)
     
    Anveto, Nov 17, 2011 IP
  5. freakadmins

    freakadmins Greenhorn

    Messages:
    63
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #5
    Thanks alot mate... It gave me an Idea that how will it work. But where to put this code? In Index.php or somewhere else?
     
    freakadmins, Nov 17, 2011 IP
  6. JohnnySchultz

    JohnnySchultz Peon

    Messages:
    277
    Likes Received:
    4
    Best Answers:
    7
    Trophy Points:
    0
    #6
    you need to create a separate page for it..
     
    JohnnySchultz, Nov 18, 2011 IP
  7. freakadmins

    freakadmins Greenhorn

    Messages:
    63
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #7
    Hey Johnny, THanks mate. My website name is http://www(dot)freaksnap(dot)com. In which I am using 1 wordpress theme. I have installed 1 quick page/post redirect plugin also. to redirect all my posts to some other site. i have used your code but i am not getting that where should i put this code. can you guide me little more
     
    freakadmins, Nov 18, 2011 IP
  8. freakadmins

    freakadmins Greenhorn

    Messages:
    63
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #8
    I hope so .. that your code will work. i m trying to edit that plugin now
     
    Last edited: Nov 18, 2011
    freakadmins, Nov 18, 2011 IP