+ Reply to Thread
Results 1 to 5 of 5

Thread: quick code i came up with

  1. #1
    Newbie heil is on a distinguished road
    Join Date
    Dec 2003
    Posts
    3

    quick code i came up with

    <?php

    if ($site=="rpp"){ $url = "http://www.aol.com";
    }
    else if ($site == "rpp") { $url = "http://yahoo.com";
    }
    ?>

    <HTML><HEAD>
    <TITLE>Title</TITLE></HEAD>
    <FRAMESET rows="100%,*" border=0 frameborder=0 framespacing=0>
    <FRAME SRC="<?php echo $url; ?>" NAME="frames" MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=auto noresize>
    </frameset></HTML>

  2. #2
    Full Member dzone is on a distinguished road
    Join Date
    Dec 2003
    Posts
    75
    Hi,

    You are most probably mistaken while typing your PHP into this post...

    PHP Code:
    <?php

    if ($site=="rpp"){ $url "http://www.aol.com";
    }
    else if (
    $site == "rpp") { $url "http://yahoo.com";
    }
    ?>
    does not make sense because if $site = "rpp", then the second condition will never be reached. If $site != "rpp" the second condition won't be reached as well and $url will be empty.

    Finally you might want to use $_GET['rpp'] or $_POST['rpp'] to make the script support new register_globals = off PHP style...

    Hope that helps,
    Z.
    ------------------------------------
    [URL=http://www.dedicatedzone.com]Managed Dedicated Servers[\URL]

  3. #3
    Moderator airnine is on a distinguished road
    Join Date
    Jan 2004
    Posts
    78
    I'm really not sure what you guys are up to

    Airnine
    -------------------------------
    Airnine is a developer @
    www.promomedium.com
    -------------------------------

  4. #4
    I'm guessing we're looking at some sort of redirect script here...

    The database would be named "links" and would contain four fields.

    Fields
    -------
    ID = Unique ID number (auto_increment)
    url = Full URL (inc http://)
    code = Three letter code for site
    sitename = Name of site.

    So one row would have:-
    1,http://www.rewiredmind.com ,RWM,RewiredMind.com

    Then your scripts would be like this...

    links.php
    [CODE]<?php
    $dbc = mysql_connect("yourhost","yourusername","yourpassw ord");
    $sql = "SELECT * FROM links ORDER BY code ASC";
    $result = mysql_query($sql,$dbc);
    ?>

    <HTML><HEAD>
    <TITLE>Title</TITLE></HEAD>
    <BODY>
    <? while($row = mysql_fetch_array($result)) {
    echo "<a href='http://www.yoursitename.com/out.php?site=".$row
    Code:
    ."'>"
    .$row[sitename]."</a><br>";
    }
    ?>
    </BODY></HTML>

    out.php
    Code:
    <?php
    $dbc = mysql_connect("yourhost","yourusername","yourpassword");
    $sql = "SELECT url FROM links WHERE code = '".$_POST["site"]."'";
    $result = mysql_query($sql,$dbc);
    $desturl = mysql_result($result, 0); 
    ?>
    
    <HTML><HEAD>
    <TITLE>Title</TITLE></HEAD>
    <FRAMESET rows="100%,*" border=0 frameborder=0 framespacing=0>
    
    <FRAME SRC="<?php echo $desturl; ?>" NAME="frames"
    MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=auto noresize>
    </frameset></HTML>
    ...should do the job.


    We'll call that script a donation to WebmasterLingo.com! Use it for whatever you like...hope it helps someone.
    Last edited by KMxRetro; January 20th, 2004 at 04:02 PM.

  5. #5
    Moderator airnine is on a distinguished road
    Join Date
    Jan 2004
    Posts
    78
    I realized they were after dynamic inclusions,

    just seemed a bit funky to me, that's all

    I support dynamic content big time, though

    good luck

    Airnine
    -------------------------------
    Airnine is a developer @
    www.promomedium.com
    -------------------------------

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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