Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 1, 2026.

PHP Help

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
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.
GoDaddyGoDaddy
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
•••
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back