thestudio Posted February 6, 2008 Share Posted February 6, 2008 hi guys i am noob to scripting and PHP, i have managed to create my database in phpmyadmin and setup acess on dreamweaver but i would like to connect my form to the database so it can store information the table is structured as follows ID (i would like for each visitor to have their Id generated) Name Email the form with have two input fields Name and email now comes the important bit; how can i set-up the form to take the information and store it on my database and then give a generated unique ID to different users many thanks thestudio Quote Link to comment https://forums.phpfreaks.com/topic/89651-complete-noob-looking-for-help-with-php-subscribe-form/ Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 You probably wont find a lot of help here as this forum is for helping people who are having problems with code they are writing, not for teaching someone how to write code. There are plenty of beginners php tutorials on the net, googling for some of them is probably your best bet. Quote Link to comment https://forums.phpfreaks.com/topic/89651-complete-noob-looking-for-help-with-php-subscribe-form/#findComment-459357 Share on other sites More sharing options...
phorcon3 Posted February 6, 2008 Share Posted February 6, 2008 well, if ur using phpmyadmin, just click on SQL and insert the followin code CREATE TABLE `users` ( `id` int(11) NOT NULL auto_increment, `username` varchar(25) NOT NULL default '', `time` int(11) NOT NULL default '0', `ip` varchar(20) NOT NULL default '', PRIMARY KEY (`id`) ) TYPE=MyISAM AUTO_INCREMENT=1; `id` int(11) NOT NULL auto_increment this will automatically create an unique ID signup.php <?php if(isset($_POST['submit'])) { mysql_query("INSERT INTO `users` (`username`, `time`, `ip`) VALUES ('$_POST[username]', '".time()."', '".$_SERVER['REMOTE_ADDR']."')"); } echo '<table width="100%" cellspacing="0" cellpadding="5" border="0"> <form method="post" action="/signup.php"><input type="hidden" name="submit" value="1" /> <tr><td>username:</td><td><input type="text" name="username" size="30" /></td></tr> <tr><td> </td><td><input type="submit" value="Signup" /></td></tr> </form> </table>'; ?> i hope this helps.. Quote Link to comment https://forums.phpfreaks.com/topic/89651-complete-noob-looking-for-help-with-php-subscribe-form/#findComment-459370 Share on other sites More sharing options...
phorcon3 Posted February 6, 2008 Share Posted February 6, 2008 goddamn it ..i always click on quote! Quote Link to comment https://forums.phpfreaks.com/topic/89651-complete-noob-looking-for-help-with-php-subscribe-form/#findComment-459372 Share on other sites More sharing options...
thestudio Posted February 6, 2008 Author Share Posted February 6, 2008 Guys many thanks for all your input, phorcon3 you are the best sorry for the noob questions, as i develop my PHP i hope to contribute the forum many thanks once again the studio, BTW if any ione needs helps with graphics give me a shout, Quote Link to comment https://forums.phpfreaks.com/topic/89651-complete-noob-looking-for-help-with-php-subscribe-form/#findComment-459627 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.