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 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2002
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    "Uploading" Links?

    hey,
    i have been looking around for a while and wanted to know if there is a PHP script for people "uploading" links. like have them put there name, a description of the link and the link it's self in a nice organized table? or something to that effect. just wondering.. havent found anything.

    thanks
    mike.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quickly thrown together, but it'll do the job. You'll need to do some formatting.

    PHP Code:
    <?php

    $file 
    "links.htm";

    $usr $_POST['usr'];
    $lnk $_POST['lnk'];
    $dsc $_POST['dsc'];

    if ( 
    $usr && $lnk && $dsc ) {
      
    $fa fopen($file"a");
      
    $data "<tr>\n<td>$usr</td>\n<td><a href='$lnk'>$lnk</a></td>\n<td>$dsc</td>\n<tr>\n";
      
    fwrite($fa$data);
      
    fclose($fa);
    }

    if ( 
    file_exists ($file) ) {
      
    $fr fopen($file"r");
      
    $links fread($frfilesize($file));
      
    $links "<table>\n<tr>\n<td>Name:</td>\n<td>Link:</td>\n<td>Description:</td>\n</tr>\n$links</table>\n";
      
    fclose($fr);
    }

    ?>

    <form method="POST">
    Name: <input type="text" name="usr"><br>
    Link: <input type="text" name="lnk" value="http://"><br>
    Description: <input type="text" name="dsc"><br>
    <input type="submit" value="Add Link">
    </form>

    <br><br>

    View the links:

    <br><br>

    <?=$links?>

    <br><br>

    What do you think?<br>

  • #3
    New Coder
    Join Date
    Oct 2002
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts
    dang dude...lol. thanks.. going to try it out right now

  • #4
    New Coder
    Join Date
    Oct 2002
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts
    awesome work. 2 questions.

    how would i make ftp:// links work? http links work great but when i try an ftp link it just comes up http://. and when it posted how can i spread the name link and description apart alittle further? also any way to make the links not live (not clickable)?

    thanks again,
    mike
    Last edited by m7d7g7; 04-16-2003 at 03:09 AM.

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    <?php

    $file 
    "links.htm";

    $usr $_POST['usr'];
    $lnk $_POST['lnk'];
    $dsc $_POST['dsc'];

    if ( 
    $usr && $lnk && $dsc ) {
      
    $fa fopen($file"a");
      
    $data "<tr>\n<td>$usr</td>\n<td>$lnk</td>\n<td>$dsc</td>\n<tr>\n";
      
    fwrite($fa$data);
      
    fclose($fa);
    }

    if ( 
    file_exists ($file) ) {
      
    $fr fopen($file"r");
      
    $links fread($frfilesize($file));
      
    $links "<table width='100%'>\n<tr>\n<td>Name:</td>\n<td>Link:</td>\n<td>Description:</td>\n</tr>\n$links</table>\n";
      
    fclose($fr);
    }

    ?>

    <form method="POST">
    Name: <input type="text" name="usr"><br>
    Link: <input type="text" name="lnk"><br>
    Description: <input type="text" name="dsc"><br>
    <input type="submit" value="Add Link">
    </form>

    <br><br>

    View the links:

    <br><br>

    <?=$links?>

    <br><br>

    What do you think?<br>


  •  

    Posting Permissions

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