Hi!

I have basic input form, which right now saves what i input into a txt file
Now, i want to save/add that into a table (not mysql one, just a table on a page that anyone can see) so, i was wondering if there is any example code, or someone knows how this could be done

If you know PHP and mysql it will help. If you are new, you may read some example scripts on database management from hotscripts.com and simlar sites exists
on web. You may also find a php coder to do this job.

In this state, i could write the add part as below on page test.php form action being same as test.php.

page name : test.php

<?php
mysql_connect('localhost','username','password');
mysql_select_db($mydbname);

if(isset($_POST) && $_POST!=''){
$email = $_POST;
mysql_query("insert into mytable(email) values('$email')");
print 'Successfully added';
}
?>
<form action="test.php" method="post">
Email<input type="text" name="email" value="">
<input type="submit" name="save" value="save">
</form>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.