NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page PHP Help

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Reply
 
LinkBack Thread Tools
Old 03-05-2010, 03:36 PM THREAD STARTER               #1 (permalink)
NamePros Regular
 
freeflow's Avatar
Join Date: Dec 2006
Posts: 236
freeflow is on a distinguished road
 



PHP Help


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
freeflow is offline   Reply With Quote
Old 03-05-2010, 06:00 PM   #2 (permalink)
Account Suspended
Join Date: Dec 2008
Location: Boston, Ma
Posts: 650
CrackFeed.Com is a name known to allCrackFeed.Com is a name known to allCrackFeed.Com is a name known to allCrackFeed.Com is a name known to allCrackFeed.Com is a name known to allCrackFeed.Com is a name known to all
 



Marrow Donor Program Animal Rescue Autism Autism
Originally Posted by freeflow View Post
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 Code:

<?php
require('header.php');
????: NamePros.com http://www.namepros.com/programming/643257-php-help.html
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());
????: NamePros.com http://www.namepros.com/showthread.php?t=643257
    
$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 by CrackFeed.Com; 03-05-2010 at 05:43 PM.
CrackFeed.Com is offline   Reply With Quote
Old 03-20-2010, 03:24 AM   #3 (permalink)
New Member
 
macfamous's Avatar
Join Date: Mar 2010
Location: Manchester
Posts: 4
macfamous is an unknown quantity at this point
 



thanks for your help .. i'm looking for this too and now i've found here .. thanks you so much
macfamous is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:36 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger