Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

PHP Help

SpaceshipSpaceship
SpaceshipSpaceship
Spacemail by SpaceshipSpacemail by Spaceship
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
Close
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
Close
thanks for your help .. i'm looking for this too and now i've found here .. thanks you so much
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back