Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Jul 2005
    Location
    Overrr the Rainbooooowwwww
    Posts
    1,083
    Tokens
    141

    Latest Awards:

    Default Is there a code or script that..

    Allows users to submit data/information onto your site?

    Such as, "Add your own tips" kind of thing? Possible?

  2. #2
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    Quote Originally Posted by Dudey! View Post
    Allows users to submit data/information onto your site?

    Such as, "Add your own tips" kind of thing? Possible?
    Of course

  3. #3
    Join Date
    Apr 2006
    Location
    UK
    Posts
    4,830
    Tokens
    0

    Latest Awards:

    Default

    Someone on this forum may make one for you because i dont think it will be that hard to make but what do i know .

    Need a domain but dont have paypal... not to worry. You can purchase a domain via text or home phone at XeoDomains.mobi.

    (X Moderator)
    AKA Cheekykarl

  4. #4
    Join Date
    Jul 2005
    Location
    Overrr the Rainbooooowwwww
    Posts
    1,083
    Tokens
    141

    Latest Awards:

    Default

    Quote Originally Posted by Cheekykarl View Post
    Someone on this forum may make one for you because i dont think it will be that hard to make but what do i know .
    Okay, you know anyone that could do it?

  5. #5
    Join Date
    Jul 2008
    Location
    England
    Posts
    86
    Tokens
    0

    Default

    do u just want a Form to put on your website where it sends an e-mail to u with what the user put in?

    if yes PM me and i could do - but not for free - well i could do for free but not to soon becuase im busy if u offer Paypal / Habbo (depends on what it is) I will put to top priority

    Thanx

    -terrior-
    Free Web Hosting
    350 MB of disk space
    100 GB of data transfer
    PHP and MySQL support with no restrictions
    cPanel control panel
    Website Builder
    Absolutely no advertising!
    Join now:
    http://www.000webhost.com/62339.html

    CHEAP HOSTING = http://www.speedhosting.co.uk/support/aff.php?aff=034

  6. #6
    Join Date
    Jul 2005
    Location
    Overrr the Rainbooooowwwww
    Posts
    1,083
    Tokens
    141

    Latest Awards:

    Default

    Quote Originally Posted by -terrior- View Post
    do u just want a Form to put on your website where it sends an e-mail to u with what the user put in?

    if yes PM me and i could do - but not for free - well i could do for free but not to soon becuase im busy if u offer Paypal / Habbo (depends on what it is) I will put to top priority

    Thanx

    -terrior-
    No thanks, i know how to do that.

    I want it to the user submits > adds to site.

  7. #7
    Join Date
    Jul 2008
    Posts
    119
    Tokens
    0

    Default

    Quote Originally Posted by -terrior- View Post
    do u just want a Form to put on your website where it sends an e-mail to u with what the user put in?

    if yes PM me and i could do - but not for free - well i could do for free but not to soon becuase im busy if u offer Paypal / Habbo (depends on what it is) I will put to top priority

    Thanx

    -terrior-
    Are you kidding?

    Something that takes less than 5 minutes to do and you are charging for it (if you do wan't one of those forms pm me and I will do it for free.)
    Signature Removed by Jamesy (Forum Super Moderator): Referal

  8. #8
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    The best way to do it, or the way I'd do it would be with php/mysql.

    PHP
    http://www.php.net/
    MySQL
    http://www.mysql.com/

    PHP Code:
    <?php
    mysql_connect
    ("host""username""password") or die(mysql_error());
    mysql_select_db("database") or die(mysql_error());

    function 
    silence($string
    {
            
    $string htmlspecialchars$stringENT_QUOTES );
            if( 
    get_magic_quotes_gpc(   ) ) {
        
                
    $string stripslashes$string );
                        
            }                

            
    $string mysql_real_escape_string$string );
            
        return 
    $string;  



    if(!
    $_POST["Submit"]) {

        echo 
    "<form action=\"\" method=\"post\">
        <input type=\"text\" name="
    tipsAuthor" />
        <input type=\"text\" name=\"tips\" />
        <input type=\"submit\" name=\"Submit\" />
        </form>"
    ;
        
    }
    else {
        
        
    $clean["author"] = silence($_POST["tipsAuthor"]);
        
    $clean["tip"] = silence($_POST["tips"]);
        
        
    mysql_query("INSERT INTO tips (author, tip) VALUES('$clean["author"]', '$clean["tip"]' ) ") or die(mysql_error());  

    }
    ?>
    Think that should work, also..

    http://www.cpanel.net/media/tutorials/mysqlwizard.htm (If you don't know how top set-up a database.

    Once you've done that, create a table called "tips" in phpMyAdmin.
    With the fields:

    "author" and "tip" without the quotation marks.

  9. #9
    Join Date
    Jul 2008
    Posts
    535
    Tokens
    75

    Default

    First create a database name tips, with whatever username and password you desire. (remember to edit the MySql details in config.php with your username and password). Then in that database, run the following query:
    Code:
     CREATE TABLE `tips` (
    `id` INT NOT NULL AUTO_INCREMENT ,
    `name` VARCHAR( 25 ) NOT NULL ,
    `author` VARCHAR( 35 ) NOT NULL ,
    `content` TEXT NOT NULL ,
    PRIMARY KEY ( `id` )
    ) ENGINE = MYISAM
    Now here's the codes for each page:

    index.php
    PHP Code:
    <?php
    require_once("config.php");
    ?>

    <a href="add.php">Add tips</a>

    <?php
    $query 
    mysql_query("SELECT * FROM `tips`");
    $display mysql_fetch_array($query);
    ?>

    <b>Tips</b><br />
    <a href="view.php?id=<?php echo $display['id']; ?>"><?php echo $display['name']; ?></a>
    view.php
    PHP Code:
    <?php
    require_once("config.php");

    $getid $_GET['id'];
    $query mysql_query("SELECT * FROM `tips` WHERE `id` = '".$getid."'");
    $display mysql_fetch_array($query);

    echo 
    $display['name'] . "by:" $display['author'] . "<br />" $display['content'];
    ?>
    add.php
    PHP Code:
    <?php
    require_once("config.php");

    if(
    $_GET["action"] == "submit"){
        
    $name clean($_POST['name']);
        
    $author clean($_POST['author']);
        
    $content clean($_POST['content']);
        
        if(
    $name == ""){
            echo 
    "You forgot a title";
        } 

        if(
    $author == ""){
            echo 
    "You forgot your name";
        }

        if(
    $content == ""){
            echo 
    "You forgot your content";
        } else { 
    ?>
        Thanks for adding your tip, you may view it <a href="view.php?id="<?php $display['id']; ?>">here</a>
        <?php
        
    }
    }
    ?>

    <form method="post" action="action?submit">
    Tip name:
    <input type="text" name="name">

    Author (your name):
    <input type="text" name="author">

    Content:
    <input type="text" name="content">
    </form>
    config.php
    PHP Code:
    $database = array();
     
    $database['host'] = 'localhost';
    $database['name'] = 'dbname'
    $database['user'] = 'dbuser'
    $database['pass'] = 'dbpw; 

    $mysql_connection = mysql_pconnect($database['
    host'], $database['user'], $database['pass']);

    mysql_select_db($database['
    name'], $mysql_connection);

    function clean($s){
        $s = addslashes($s);
        $s = htmlspecialchars($s,ENT_QUOTES);
        return $s;

    I haven't actually ran the code on my server, so there may be some errors.
    Last edited by wsg14; 29-07-2008 at 08:32 PM.

  10. #10
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by BOX! View Post
    First create a database name tips, with whatever username and password you desire. (remember to edit the MySql details in config.php with your username and password). Then in that database, run the following query:
    Code:
     CREATE TABLE `tips` (
    `id` INT NOT NULL AUTO_INCREMENT ,
    `name` VARCHAR( 25 ) NOT NULL ,
    `author` VARCHAR( 35 ) NOT NULL ,
    `content` TEXT NOT NULL ,
    PRIMARY KEY ( `id` )
    ) ENGINE = MYISAM
    Now here's the codes for each page:

    index.php
    PHP Code:
    <?php
    require_once("config.php");
    ?>

    <a href="add.php">Add tips</a>

    <?php
    $query 
    mysql_query("SELECT * FROM `tips`");
    $display mysql_fetch_array($query);
    ?>

    <b>Tips</b><br />
    <a href="view.php?id=<?php echo $display['id']; ?>"><?php echo $display['name']; ?></a>
    view.php
    PHP Code:
    <?php
    require_once("config.php");

    $getid $_GET['id'];
    $query mysql_query("SELECT * FROM `tips` WHERE `id` = '".$getid."'");
    $display mysql_fetch_array($query);

    echo 
    $display['name'] . "by:" $display['author'] . "<br />" $display['content'];
    ?>
    add.php
    PHP Code:
    <?php
    require_once("config.php");

    if(
    $_GET["action"] == "submit"){
        
    $name clean($_POST['name']);
        
    $author clean($_POST['author']);
        
    $content clean($_POST['content']);
        
        if(
    $name == ""){
            echo 
    "You forgot a title";
        } 

            if(
    $author == ""){
            echo 
    "You forgot your name";
        }

            if(
    $content == ""){
            echo 
    "You forgot your content";
        } else { 
    ?>
        Thanks for adding your tip, you may view it <a href="view.php?id="<?php $display['id']; ?>">here</a>
        <?php
        
    }
    }
    ?>

    <form method="post" action="action?submit">
    Tip name:
    <input type="text" name="name">

    Author (your name):
    <input type="text" name="author">

    Content:
    <input type="text" name="content">
    </form>
    config.php
    PHP Code:
    $database = array();
     
    $database['host'] = 'localhost';
    $database['name'] = 'kolzy_ws'
    $database['user'] = 'kolzy_w'
    $database['pass'] = 's'

    $mysql_connection mysql_pconnect($database['host'], $database['user'], $database['pass']);

    mysql_select_db($database['name'], $mysql_connection);

    function 
    clean($s){
        
    $s addslashes($s);
        
    $s htmlspecialchars($s,ENT_QUOTES);
        return 
    $s;

    I haven't actually ran the code on my server, so there may be some errors.
    For a tiny script, 4 pages?

    You could have just used $_GET for view/add.

Page 1 of 2 12 LastLast

Posting Permissions

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