Looking for a simple PHP script ,could you help me ?

Discussion in 'PHP' started by JacobNix, May 6, 2007.

Thread Status:
Not open for further replies.
  1. #1
    hey


    im looking for a simple php script
    a Link Box
    i could put it on my website
    somebodey could suggest and put a link in there
    i had this before ,but deleted :D ( misstake)
     
    JacobNix, May 6, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    
    <?php
    
    if (isset($_POST['url']))
    {
        header('Location: '. $_POST['url']);
        exit();
    }
    
    $links = array(
        'Page 1' => 'http://www.page1.com',
        'Page 2' => 'http://www.page2.com',
        'Page 3' => 'http://www.page3.com',
        'Page 4' => 'http://www.page4.com'
    );
    
    ?>
    <form action="" method="post">
    <select name="url" onchange="this.form.submit();">
    <?php
    foreach ($links AS $name => $link)
    {
        echo '<option value="'. $link .'">'. $name ."</option>\n";
    }
    ?>
    </select>
    </form>
    
    PHP:
     
    nico_swd, May 6, 2007 IP
    NinjaNoodles and JacobNix like this.
  3. JacobNix

    JacobNix Peon

    Messages:
    2,081
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks
    Rep added
    im not at home now , would try this later
     
    JacobNix, May 6, 2007 IP
Thread Status:
Not open for further replies.