Dynadot — .com Transfer

PHP Help

SpaceshipSpaceship
Watch

freeflow

Established Member
Impact
13
Hi! Can you help me with a script for a simple submission form?
I would like to submit a link and a title to a database.

Thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Hi! Can you help me with a script for a simple submission form?
I would like to submit a link and a title to a database.

Thanks


PHP:
<?php
require('header.php');
if (empty($username)) {
	echo '
		<p>Please choose a username:</p>
		<form method="POST" action="submit.php">
		<input type="text" name="username">
		<input type="submit" value="Submit">
		</form>
	';
        require('footer.php');
	exit;
} else {
	$dbname = 'xxx'; // db name
	$dbuser = 'xxx'; // db username
	$dbpass = 'xxx'; // db password
	$dbhost = 'localhost'; 	// db host, localhost should suffice.
	$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error());
mysql_select_db($dbname, $conn) or die(mysql_error());
	$username = mysql_real_escape_string(htmlspecialchars(strip_tags($_POST['username'])));
	mysql_query('INSERT INTO `users` SET `username`="'.$username.'"') or die(mysql_error());
	echo '<p>All done! <a href="submit.php">Insert another?</a></p>';
        require('footer.php');
	exit;
}
?>
 
Last edited:
0
•••
thanks for your help .. i'm looking for this too and now i've found here .. thanks you so much
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer

We're social

Spaceship
Domain Recover
CatchDoms
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back