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 9 of 9
  1. #1
    New Coder
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automatic link adding script..

    Hello,
    Can anyone please give me a script that can let the visitors automatically add links and stuff on my linkpage so that i don't have to add every link myself, and maybe logs the ip of users that post a link. (to prevent abuse).
    Cheers MPCODER

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Maybe http://www.hotscripts.com will help you? You still want to be able to check the links though, as for all you know someone on dial up could just reconnect after adding a link and ad another link each time.

  • #3
    New Coder
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I looked on Hotscripts... haven't found what i was looking for.
    Maybe someone could give me one that lets simply let users add links like this: http://www.codeonrequest.nl/freelinks.php, it says at the bottom of the page, "Nieuwe Link" which means New link, and you can add one by clicking on the button and the link automatically is added to the page.
    Please help me ,
    (BTW i wanted it to log ip adresses so people wont add links to sites that i DONT want links to such as hack sites, porn, and that kind of stuff)

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    London
    Posts
    220
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm a beginner with PHP myself, but thought I would give this a shot...of which some of it works but it does need improving (read: can one of CFnuts you help? )

    The script below will add the link someone enters, along with logging their IP.

    I am still figuring out how to get it to check that the link isn't already in the database (which shouldn't be too hard, but it is getting late and I'm sleepy).

    The other problem with the script is that is seems to add a row to the database whenever someone enters the page. As I say, it works, but it's scrappy and needs improving.

    Table = Links
    Fields = link_number, link, ip

    PHP Code:
     <?php
    // logs
    $IP getenv('REMOTE_ADDR');
    $yourlink $_POST['yourlink'];
     
    $insert"INSERT INTO links (link,ip) VALUES ('$yourlink','$IP') ";
      if ( @
    mysql_query($insert) ) { 
                    } 
                 else { 
     die(
    '<p>Error performing this update: ' mysql_error() . '</p>'); 
    }

    // Request the existing Links

     
    $links = @mysql_query("SELECT link FROM links WHERE link LIKE 'http://%.%'"); 

    if (!
    $links) { 
        die(
    "<p>Error performing query: " mysql_error() . "</p>"); 
    }
    while (
    $row mysql_fetch_array($links) ) { 
        
    $linklist $row['link'];
         echo 
    '<a href="'.$linklist.'">'.$linklist.'</a><BR>';

     
    ?>
      <br>

    <form action="riddles.php" method="post">
      <div align="center">your link: 
        <input name="yourlink" type="text" value="http://" />
        <input type="submit" value="GO" />
      </div>
    </form>

    Mxx
    Last edited by murphyz; 01-21-2004 at 04:34 PM.
    "Imagination is more important than knowledge" A. Einstein's 'Twin Paradox'

  • #5
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    The way to get around it adding empty rows is to check if the submit button has been pressed.

    PHP Code:
    <?php
    if(isset($submitbuttonname){
            
    php stuff here
    }else{
             
    html form heresubmitbuttonname not been used.
    }
    ?>

  • #6
    New Coder
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Damn...

    Murphyz.. your script uses MySQL, i dont have a MySQL database.... But i have something simmiliar now.

  • #7
    Regular Coder
    Join Date
    Jan 2004
    Location
    Georgia
    Posts
    306
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'll write one for you. Get in contact with me.


    E-mail: dodgerida67@aol.com
    AIM ID: dodgerida67
    ~Designer's Toolz~

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Posts
    271
    Thanks
    4
    Thanked 0 Times in 0 Posts

    links script

    you really need to have mysql for a links script

    Ask your provider I bet yuo have it and do not know it most servers have it and php on them.

    THe best for free is WSN LINKS BASIC You do not have to know php or anything else really

    If yuo need help on this email i will help you on this as I have it on all my sites

    STEVE

  • #9
    New Coder
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No i dont need MySQL for a script like that. I have a simmiliar script now that doesn't uses MySQL.


  •  

    Posting Permissions

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