Hi. I want to put two fields on my website for the user to input their name and their e-mail address. When they click Submit I want the data they entered to be captured by the database (MSAccess or Mysql?) - and listed like so: Name E-mail John Simon Ben Does anyone know if any open source script does this, or can somebody create this for me - I don't mind paying, let me know your rate. The input fields will be on a html page and the database can be of any type as long as it runs on a Linux server. Thanks
Thanks Unfortunately the system I use for my website is all html files. I have no choice whatsoever - it has to be html. I cannot change the pages to php or asp. Is it not possible to do this using HTML and a database?
For example - a MySQL table could look like this: CREATE TABLE clients ( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, PRIMARY KEY (id) ) ENGINE = MYISAM; Code (markup): And PHP: if (isset($_POST['your_form_name'])) { // name $name = $_POST['name']; // email $email = $_POST['email']; try { // username $username = 'root'; // password $password = 'password'; $dbh = new PDO("mysql:host=localhost;dbname=dbname", $username, $password); $sth = $dbh->prepare('INSERT INTO clients (name, email) VALUES (?, ?)'); $sth->execute(array($name, $email)); $count = $sth->rowCount(); } catch(PDOException $e) { echo $e->getMessage(); } } PHP: Of course there is almost no validation above, so you should add some before using it.
Well, I don't know if that's possible, probably not You certainly need something server side to insert the values into the database, at least CGI or something.
Are there any special reasons you are using flat html files? The easiest solution would be to change that - just rename all html files to php and install PHP interpreter on your server. You could also probably configure PHP to work with files with html extensions as if they were PHP but you will still need to have the PHP installed on your server.
A) Because the site ranks very highly in search engines and turns over £1m a year - we cannot afford to change file extentions and risk losing the search engine rankings. B) I have a dedicated server with php installed - but my site is HTML and I cannot change this. C) My site uses a combination of html and cgi (perl scripts) - what can be done with html/cgi/perl?
I am not expert with cgi/perl so you whould wait for someone with more experience to reply. However, regarding SEO reason - this can be achieved by rewriting URLs. All your files can be php/asp anything but they would be rewritten on fly by web server so they would appear as plain html files to search engines. That way you shouldn't loose rankings. http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
Sounds very 'on the edge' to me, I would rather wait and see if somebody could provide a cgi/perl integration. Thanks for your help!
This can be done and I have done it multiple times. What you do is create a form in an .html page that submits to a .php file, the .php file does everything it needs to then redirects the user to another .html file. The user, nor any search engine spiders ever see the .php file. If all you are capturing is email address I can have this up and running in 48 hours for between $50-$100. That includes database creation, an admin page to retrieve data and setting up the .html form to submit properly and the .php file to process it all. The price range reflects various options about the admin area and redirection pages.
This can be done and I have done it multiple times. What you do is create a form in an .html page that submits to a .php file, the .php file does everything it needs to then redirects the user to another .html file. The user, nor any search engine spiders ever see the .php file. If all you are capturing is email address I can have this up and running in 48 hours for between $50-$100. That includes database creation, an admin page to retrieve data and setting up the .html form to submit properly and the .php file to process it all. The price range reflects various options about the admin area and redirection pages.