Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,148,646 members, 7,801,883 topics. Date: Friday, 19 April 2024 at 03:38 AM

Submiting Forms To A File Not A Database - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Submiting Forms To A File Not A Database (617 Views)

I Need Steps To Creating A Database Using Wampserver / Save Facebook Comments Into A Database / Php/mysql. Does Every Php Script Need A Database? (2) (3) (4)

(1) (Reply) (Go Down)

Submiting Forms To A File Not A Database by pholusho(m): 1:19pm On Jan 05, 2012
Please am trying to use dreameaver 8 to create a form which i want to submit its information to a file not a database, please does anyone as an idea how to go about this. Thanks
Re: Submiting Forms To A File Not A Database by Nobody: 1:24pm On Jan 05, 2012
form_submit.php
<?php
//submission script
$data=serialize($_REQUEST); //or $_POST or $_GET
file_put_contents("myform.txt"wink; //finish
?>

To retrieve back
$data=unserialize(file_get_contents("myform.txt"wink);
then you can do stuffs like echo $data['username']; //or you can use var_dump($data); to test it

Any further info, send me an email - support @ . net
Re: Submiting Forms To A File Not A Database by yawatide(f): 1:27pm On Jan 05, 2012
Seems like it would make more sense (and perhaps more secure as well) to dump the contents of the form into a database. By so doing, you also get to compartmentalize (is this the right word?) the form data (name, phone, etc). Not to mention, assuming you intend to get submitted forms from more than a few submissions, sure you can parse out the respective content but again, I think this is a messy approach.

Why, might I ask, do you want to put the stuff in a file? Perhaps that is the very reason why a database is not needed and I would definitely stand to be corrected.
Re: Submiting Forms To A File Not A Database by Nobody: 1:37pm On Jan 05, 2012
^^^Mayhaps, he is trying to use a flat-file database. . . .
Re: Submiting Forms To A File Not A Database by yawatide(f): 3:53pm On Jan 05, 2012
Come on man! Isn't a database in essence a flat file? tongue

The advantage of the database, among others, is that things would be more modular, easier to search and depending on how you go about your code, more secure.
Re: Submiting Forms To A File Not A Database by Nobody: 4:26pm On Jan 05, 2012
A flat footed database actually. I think we should probe the guy.
Re: Submiting Forms To A File Not A Database by malikusman: 5:04pm On Jan 05, 2012
There are many kinds of databases, and you'd have to specify what kind of database you're talking about. I have experience with the MySQL Database, which is a fairly typical one, and very common. Most databases are like MySQL in that they operate in "transactions": steps that change or return information about the database, and which can be run one at a time. A few examples of transactions, as well as some information about databases:


______________________________
download full version games
Re: Submiting Forms To A File Not A Database by Nobody: 6:49pm On Jan 05, 2012
^^^So your point is?

(1) (Reply)

Submit Your Site Rss Feeds Here For My Members View / Web Developer? Come-in / Ecommerce Website

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 16
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.