Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2011
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Post Newbie help needed

    Hello every1 i need some help in developing a script,please pardon me if i commit any mistake.
    I am trying to make a script and help me load a webpage in am iframe (html5 attributes ), i can make page manually too but if i ever want to change the link i will have to re-write the coding part.

    So i basically want is like this, i make a database table with columns ->s.no; linkcode; link;
    and i want a script, example point.php.
    such that when i enter a link like below
    http://www.mysite.com/point.php?hash=xxxxxx

    It reads the xxxxxx part and searches the database under linkcode column and then take the link of the same row and load it into the ifame.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,561
    Thanks
    80
    Thanked 4,494 Times in 4,458 Posts
    I don't use PHP, but it will be something along these lines:

    Code:
    $link = $_GET["hash"];
    $sql = "SELECT linkcode FROM tablename WHERE link = '$link'";
    $result = mysql_query($sql) or die();
    $row = mysql_fetch_array($result)
    echo '<iframe id="whatever" src="' . $row[0] . '"></iframe>';
    Last edited by Old Pedant; 10-17-2011 at 05:08 AM.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    silverblade7 (10-17-2011)

  • #3
    New to the CF scene
    Join Date
    Oct 2011
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks a lot bro,i only needed a skeleton to manipulate and this code is the best i can think of, i have not tested it yet but i am sure it will work.


    Thanks a very lot.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •