Allows users to submit data/information onto your site?
Such as, "Add your own tips" kind of thing? Possible?

Allows users to submit data/information onto your site?
Such as, "Add your own tips" kind of thing? Possible?
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
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
No thanks, i know how to do that.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-
I want it to the user submits > adds to site.
Are you kidding?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-
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
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/
Think that should work, also..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( $string, ENT_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());
}
?>
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.
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:
Now here's the codes for each page: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
index.php
view.phpPHP 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>
add.phpPHP 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'];
?>
config.phpPHP 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>
I haven't actually ran the code on my server, so there may be some errors.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;
}
Last edited by wsg14; 29-07-2008 at 08:32 PM.
For a tiny script, 4 pages?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:
Now here's the codes for each page: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
index.php
view.phpPHP 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>
add.phpPHP 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'];
?>
config.phpPHP 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>
I haven't actually ran the code on my server, so there may be some errors.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;
}
You could have just used $_GET for view/add.
Want to hide these adverts? Register an account for free!