Web Form Data To Database
I have a root access to a virtual server running UNIX and SQL.I would like to have data from a web form go to a database and perhaps be emailed to me also.Typically some one would complete a form and attach a file and that is emailed to me using a cgi script.
I would like to have this data populate a database.
where to start.If someone could give me a basic list of what needs to be done,I can tackle those and then fine tune my questions.
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
How Do I Put Form Data Into A Database?
I would like to take the form data submitted on a web page and put it into a database besides having the data emailed to me like is currently the case. I don't know where to start on this. I've never set up a database. Once in the database how do I get that data to my computer?
View Replies !
View Related
Help CHECKING FORM DATA AGAINST MYSQL TABLE DATA
PHP // See if relevant fields have been set. $submitted = IsSet($_REQUEST['Submit'])? TRUE : FALSE; $user= IsSet($_REQUEST['username']) ? cleanValue($_REQUEST['username']) : '' $pswd= IsSet($_REQUEST['password']) ? cleanValue($_REQUEST['password']) : '' if($submitted) {// Form submitted yet? if (empty($user) || empty($pswd)) {// Are Form fields empty? // Display error message when fields are not filled in. $message = 'Make sure you enter both a username and password.' } else { /* THIS IS MY HUMBLE EFFORT BELOWAND IT DONT WORK HELP */ //CONVERT PASSWORD FROM FORM INTO MD5 $pswd = md5($pswd); //CONNECT TO DATABASE $connection = mysql_pconnect("$dbhost","$dbusername","$dbpasswd") or die ("Couldn't connect to server."); $db = mysql_select_db("$database_name", $connection) or die("Couldn't select database."); //SELCT TABLE AND DATA $sql = @mysql_query("SELECT * FROM users WHERE username='$user' AND password='$pswd' AND activated=Ƈ' "); if (!$sql) { exit('<br /><br /><h3>Error retrieving Art members from database!<br />'. 'Error: ' . mysql_error() . '</h3><br /><hr /><br />'); } //MAKE VARIABLES FOR CHECKING FORM DATA AGAINSTIS THIS RIGHT!! while ($login_check = mysql_fetch_array($sql)) { $user = htmlspecialchars($login_check['username']); $pswd = $login_check['password']; //NOT SURE FROM HERE // ORIGINAL SCRIPT BELOW // Authenticate username and password (i.e. match against a database). // Start a session only after username and password have been verified. THIS IS THE EXAMPLE LOGIN CHECK THAT CAME WITH THE CLASS if ((!strcmp($user, 'empl')) &&// Does username match 'empl'? (!strcmp($pswd,'demo'))) {// Does password match 'demo'? $sess_param['new_sid'] = TRUE;// Create new session ID to be safe. $sess_param['security_level'] = 100;// Security level for Employees area $sess_param['gc_maxlifetime'] = 300;// Inactivity timeout of 300 seconds (5 minutes) $sess = new DB_eSession(&$sess_param);// session_start() done. $sess->setSessVar('authenticated', TRUE);// Set that authentication occurred. // Save the username for displaying and encrypt $sess->setSessVar('username', $user, ENCRYPT_VALUE, EXTRA_FIELD); $URI = $sess->setSessURI('employees.php');// Optional - pass session ID in URI. Not as safe. header("Location: $URI");// Go to members area. exit; } REGARDS Bill007
View Replies !
View Related
Retrieving Data Through A Form.
I'm setting up a database and I want to retrieve data from the db through a form. I currently have: $sql = "SELECT * FROM Tasks WHERE t_id = '$_POST[t_id]'"; $result = mysql_query($sql, $conn) or die(mysql_error()); while ($newArray = mysql_fetch_array($result)){ $id = $newArray['t_id']; echo "ID: $id <br>"; I don't think that the 'WHERE t_id = '$_POST...' part is correct, as the code seems to do what it is supposed to when I take that part out, it just doesn't do what I want it to do. So.. to clarify; I insert a task id (t_id) into the form, hit the submit button, and it is supposed to show the results (echo "ID: $id <br>";). I hope this makes sense to someone. Code:
View Replies !
View Related
How Do I Sort Data Fro A Bad Form Into Something Useful?
I made a bad form with a form creation app in a hurry. Now I have a table that is nearly useless. The form was meant to record teams for an upcoming volleyball tournament. I provided inputs for the school name, mascot, student, etc. The form app allows me to copy form elements, so I did. The table now shows about 120 student, and grade, position, sorted by a form id (one for each team) but they are sorted by the record id. Instead of: Team | Student | Grade | Position | etc..... I have: record | name | value | etc... I have tried some queries that just basically remove some superfluous column and GROUP BY record (that is the form id, so the third team to register has "3" under record. Can I salvage this data by a clever query or am I looking at making a page via php to display the results? Sample Data: student name1 Curtis Geurts student name1Tom Glasbergen student name1Bill Lammers student name1Marc Brouwer student name1Kurt fledderus student name1Nate Brink student name1James Brouwer student name1Scott Denbak student name1Dave Stares grade12 grade12 grade11 grade11 grade11 grade11 grade11 grade12 Player positionpower Player positionsetter Player positionmiddle Player positionmiddle Player positionpower Player positionoffside Player positionsetter Player positionsetter
View Replies !
View Related
Formatting Data From Input Form
I have a form on my website and it's imperative that regardless of the way users enter their information into the form, I need the data to be stored in the database in a certain way. For example: john smith needs to be displayed as John Smith JOHN SMITH needs to be displayed as John Smith Can I do this at the database level after the fact or do I have to do it via PHP at the form level?
View Replies !
View Related
Form->database->web
Looking for script (probably php) that takes form data, enters in database (mysql or flat file) and outputs data to web. The output to html table is what I'm unable to find in an existing script.
View Replies !
View Related
HTLM Form Link To Data In Mysql
I have a form that puts data into MySql and then in my website I have a table to display the Data. Everything works just fine at this point. The only thing left for me to do is that when the data is put into the table I want it so that one of the cells has a link, when the user clicks on it he can either see all the details from the data submited on the form in the same page or it is transfered to a new page with all the data submited in the form.
View Replies !
View Related
Import Data Form Txt Or Cvs File Format
I have a fully installed version of MySql Server 5.0 including MySql Administration, MIGRATION Tool, Query Browser and System Tray Monitor. I have lots of Data stored in a txt File. I do not want to type them all in. How do I import Data from a txt or cvs File format? They are standardizes.
View Replies !
View Related
Entering Form Data Into Multiple Tables
I've got a two tables in my database: "customers" and "orders." I want to insert information from a form into both of them - in some cases identical information will need to be inserted into both. The other twist is that I'd like to insert the automatically generated id customer 'id' value into the orders table. I've tried using joins. Something like: PHP Code: INSERT INTO orders,customers (customers.id, customers.first_name, orders.del_address .....)
View Replies !
View Related
Passing A Variable Form A Form To A Mysql Query In A Php Script
I have a form set up with a dropdown list of values for a field "Genre" in my database I can pass the variable to my php script. I know this because I use: $Genre = $_POST['Genre']; echo "<h1> Query result for Genre = ","$Genre", "</h1>"; And the page prints the appropriate value chosen from the form. I'm trying to use the $Genre variable in a mysql query to select records which match. My mysql query works when I use the following code:
View Replies !
View Related
Data Insertion/Update Form Different Tables Into On Table
I have 3 tables say Employees, Benefits, Employee_Benefit_Mapping. These tables are something like this: Employee: ======== Employee_Id Name Dept_Id . . Benefits: ========= Benefit_Id Benefit Name . . Employee_Benefit_Mapping: ========================= Mapping_Id Employee_Id Benefit_Id Its a many to many relation. Hence the mapping table. Now the situation and question is: ==================================== Every employee "In a certain Dept" is eligible for some benefits by default. How can add these records with one (or minimum) insert statement(s) rather than going employee by employee? Insert into Employee_Benefit_Mapping ((Select Employee_Id from Employee where Dept_Id = xx), (Select Benefits_Id from Benefits where Benefit_Id in(xx, yy))) Will this work to insert all the data into the mapping table?
View Replies !
View Related
Form Submission Info To Go Into A Database
I am a web designer, but have minimal training in database. I have several clients who have submission forms on their sites. I would not only like to have an email going to them with the submitted info, but be able to capture the info into a database at the same time. My webspaces are "mysql" ready. Can anyone give me step by step to create the above or tell me where I might go to obtain the information?
View Replies !
View Related
Php Form Verification With Mysql Database
I have created a php form to allow member login via username and password. I have also created a mysql database with a table that stores the username and passwords for the members as well as the member names and date entered. When the members try to login, none of the usernames and passwords appear to be validated, all return the error msg I formatted for unauthorized access in the php form. Any idea how to fix this?
View Replies !
View Related
Problem Updating Database From Form
I am trying to code a page that allows the user to edit the content that is drawn from the database. The fields show the correct data, drawn from the database, and you can type in the fields, but the database does not update when the "submit" button is clicked. It jumps to the events list page, as it should, but the information has not been changed. My code is as follows: Code:
View Replies !
View Related
Enctype=multipart/form-data Wont Pass File Name
when i add enctype="multipart/form-data" to the form i cant get the file name into the databass... but if i leave that part out of the form then the files dont upload into my upload folder. so its either one or the other. is there a way to upload the file to my uploads folder and pass the data (filename) to the databass at the same time? . . . <form action="insert.php" method="post" enctype="multipart/form-data"> .....
View Replies !
View Related
“best-practice” Approach For Storing Form Structures And Their Data
I’m looking for a “best-practice” approach to creating a db structure that will handle form creation and storage dynamically. FORM CREATION The idea is to allow the client to create forms for their products by specifying attributes and values that belong to a product category. The client will: 1.Enter a category # and name. 2.Enter the attributes available to the category. 3.Enter the values available for those attributes. The application will: 4.Deduce the form based on what the client enters. FORM STORAGE What’s the best approach for then storing the form attribute/value pairs? Is this a “wise” approach or is better to "hard-code" the forms with html and/or use a look-up table for the allowed attribute values of the fields? Do any of you have experience with this concept? Do you have any thoughts on it or a link to further reading?
View Replies !
View Related
Html Form For Editing Mysql Database
What I need is large text area boxes to appear on the page. The data I'm editing includes carriage returns and quotes here and there in the text. Besides the text appearing in a small box, the text ends at the first instance of a carriage a return. Code:
View Replies !
View Related
Form Contents Not Displaying Correctly In Database.
I have a webform that is submitting data that 1st gets sent to the database (using $_POST varibles) and then i build an email message and use the same $_POST varibles to create the body. The problem im having is that when some one copies, from another form, numbers that are colored and pastes it into my form it gets submitted to the database as a different number than what was pasted. To futher confuse you, the email message shows the correct number but the database does not.
View Replies !
View Related
Database Files Separated Form MySQL Version
I have a MySQL database on a remote box running win2003 server. The original instance of MySQL was ver 4.8. My server admin deleted 4.8 and installed 5.1 The database files are in the same location on d:/. The MySQL instance is running on c:/ How do I get 5.1 to start managing the database files. I have read the MySQL manual and see now that the proper procedure would have been to do a dumpfile first, but, this was not done.
View Replies !
View Related
How To Apply New Database Structure To An Existing Database, Without Overwriting Data?
I am writing a simple blog software application. We released a version of this software a while ago. It comes with a sql-tables.sql file, that you can just import into your mysql database and it will setup all the tables for you, for a fresh installation. We made the sql file by just doing an export I believe, without exporting the data that was in OUR database. Well, since then several people have downloaded and installed our software, and are using it. We are about to release a new version soon, however. Since it is all still under development, many things have changed in our database structure. We've added new tables, and modified or even removed fields from existing tables. So for the new release, we're going to include a new sql-tables.sql file obviously, so that for fresh installations they can still install it just like normal. However, the question is... how do you "upgrade" all the previous version's users's databases, without losing any of their data? Is there anyway to export just the structure of our current database... then somehow apply it so that it just goes through and changes another database to match the new structure? Or any ideas at all how to do this?
View Replies !
View Related
Extracting Data From Large SINGLE-table Database To MULT-table Relational Database
I have a very large single-table database of articles that I want to convert to a multi-table, relational database. The existing single-table database contains fields for article author, article source, and article category, where several 'author', 'source', and 'category' IDs repeat dozens of times for hundreds of different articles. I want to create seperate tables for author, source, and category and populate the new tables by extracting data from the original single-table database by unique ID field. I figured out how to use INSERT and SELECT to pull data in new tables, but can't figure out how to pull only a single instance of a unique author, source, and category to create master reference tables for author/source/category.
View Replies !
View Related
Help With Form
I created a contacts form. Uploaded the form, the database, and the connection page to the remote server. i tested everything out on my computer, win2000 localhost and everything worked but after uploading and trying it out the following happens. After filling in the form and clicking Submit I get ther following in a web page: Table 'contacts.contacts' doesn't exist I don't know what this means. I have a data base named "contacts" and a table named "contacts".
View Replies !
View Related
Dictionary In Sql Form
Does anyone know of any place where I can get what's basically a dictionary, in SQL form? Technically all I need is a list of words with the type of word (noun, verb, adjective, etc.) and synonyms, definitions aren't necessary.
View Replies !
View Related
Multiple Form Value
I am playing around with an address book mysql database I have put together but am having problems conceptualizing and putting down the search element. I want users to be able to search on more than one field (fields aren't all in 1 table, they're spread out over 5/6 tables) and match all or partially. My brain goes round and round when trying to get a feel for this and keeping the code light and clean. Has anyone had any experience with this and can point me in a useful direction? I have thought about having preset queries that users could select and then find the info they wanted, but it wouldn't allow users to select fields they wanted to search at will, it would be they would have to select a built-in query to run...it's not a bad system, but not flexible, very dependant on me writing the queries.
View Replies !
View Related
Refer To A Form
I'm using Access to view an SQL database and want to create a query that refers to a form in the criteria of one of it's fields. Usually in Access I would do this by: Forms![FormName]![FieldName] But this doesn't seem to work in the adp file. What I actually want to do is produce a single label for the current record in a form.
View Replies !
View Related
Repopulating A Form
Making a form where a patient will fill out check boxes and after submission would like to present their submitted form back if they choose the option and be able to edit the data entered. What I am wanting to do is repopulate the form, but the checkboxes will need a database with this information that will then go to a php script and take the values entered into the various checkboxes and check those values from the database that were entered origionally. So lets say the database haspid - int(5) auto_increment primary keypatient_first - varchar(30) first namepatient_last - varchar(50) last namearthritis - bool or what?copd - bool or what?tin ear -bool or what?What would be the best to check against to repopulate does a true false make sense or should it either be NULL or the actual condition (just kidding about the tin ear)?
View Replies !
View Related
Search Form Using AND
I've set up a search form that needs to search 2 fields, presumably using AND. This is the code that i'm using: <? $query_links = "SELECT dbfields FROM database WHERE search1<='$search1' AND search2<='$search2'"; If i replace the AND for OR, it works fine, in that it the 'search1' works. Basically, i need both search fields to be equal or less than the database field value.
View Replies !
View Related
Web Site Form
I want to have a form on my website, almost like a feedback form but not for feedback. It will be for getting info from customers. It will simply be about 30 fields that will need to post to a database. How hard is this with mysql? How would I do this on the web page? Is there a certain language I would need to use? Also is it possible to get an email everytime a record is added via the web form?
View Replies !
View Related
First Normal Form, Etc.
i am trying to set up a database, and the book I am following seems to stress the proper organization of the database. I am pretty much trying to create a gallery. With a certain number of users, who can create separate albums, and store cards in them. The way I see i the database breaks down into 3 tables, I have a users table (with an auto incrementing "user id" (primary key), email, password), a album table (with an album id number (primary key), album name, and a few other attributes specific to the table) and then a picture table (with a picture id (primary key), name of the picture, the image's path.) My issue is not so much with creating and accessing the databases as it is with the actual design. I fail to see how I link the databases, i.e. how do I keep track of the user, who may have 7 albums, and 500 pictures, without putting their "user_id" in the album table, and a album_id with the corresponding cards. If I do this, there seems to be redundancy which is not compliant with the normal forms (in particular the second)? For example, in my card table, there may be 500 card_ids for the same user number. Is this correct? I know this seems like it requires telling me how to design my whole database... I guess what I need is a more graphical display of how to break down the data to be entered into a database. Because words aren't really doing it.
View Replies !
View Related
Cc And Bcc Emails In Form
I have the following code in which I want the ability to blind copy in a selection of email addresses so when the user submits the form it sends the main email to me and also to the other emails that are in the bcc part, here's part of the code: $sender_name = removecrlf($sender_name); $sender_email = removecrlf($sender_email); $msg = "$sitename "; $msg .= ""._SENDERNAME.": $sender_name "; $msg .= ""._SENDEREMAIL.": $sender_email "; $msg .= ""._MESSAGE.": $message "; $to = "email@address.com"; $mailheaders = "From: $sender_name At the moment when the users hits the send button it sends it to the adress shown in the $to which is: email@address.com Now if I was to put all the email addresses that I want the form to be sent to in this $to part seperated by commas, it sends to all of them, however, it shows all the people who received the email who else it went to. I have searched the net and numerous forums for an answer but found nothing, I tried $bcc and $cc etc but to no avail.
View Replies !
View Related
Upload Form
I am trying to use this code to insert the file into my dba but am not sure if it works i get errors. I want to create a table, then put the file into the table using a web baised form. If anyone knows how i can create a form to do this or if anyone knows of documentation on how to do this i would be greatful. Below is my code <? if(isset($_POST['upload'])) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; $fp = fopen($tmpName, 'r+'); $content = fwrite($fp, $fileSize); $content = fread($fp, $fileSize); $content = addslashes($content); fclose($fp); if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); } include 'library/config.php'; include 'library/opendb.php'; // add a table to the selected database $result="CREATE TABLE userfile (fileName VARCHAR(25), fileSize VARCHAR(25), fileType VARCHAR(15), fileSize VARCHAR(2000))"; if (mysql_query($result)){ echo "success in table creation."; } else { echo "no table created."; } $query = "INSERT INTO upload (name, size, type, content ) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$content')"; mysql_query($query) or die('Error, query failed'); include 'library/closedb.php'; echo "<br>File $fileName uploaded<br>"; } ?> <form action="" method="post" enctype="multipart/form-data" name="uploadform"> <table width="350" border="0" cellpadding="1" cellspacing="1" class="box"> <tr> <td width="246"><input type="hidden" name="MAX_FILE_SIZE" value="2000000"><input name="userfile" type="file" class="box" id="userfile"> </td> <td width="80"><input name="upload" type="submit" class="box" id="upload" value=" Upload "></td> </tr> </table> </form>
View Replies !
View Related
Form Values Are Truncated
I'm building a member signup form. Fields that contain more than one word are being truncated when being inserted into the MySQL table. I'm using this code that I got from one of my PHP books. $as_addr1 = addslashes($_POST['addr1']);$tr_addr1 = trim($as_addr1); So, if I post "1122 Boogie St." it gets inserted as "1122". If I remove the "addslashes" portion, only using trim, I get the same result. Here's the query: $query = "INSERT INTO subscribers (email,password,fName,lName,addr1) VALUES ('$tr_email','$tr_pass','$tr_fName','$tr_lName','$ tr_addr1'"; echo $query; Here's the echo: INSERT INTO subscribers (email,password,fName,lName,addr1) VALUES('j@j.com','11111111','Jim','Johnson','78797 State') I have other fields in the table that are doing the same thing. All fields are varchars of varying length. Field "addr1" is varchar(50).
View Replies !
View Related
A Table Or A Form Field
If I have a db where people enter in their basic info...one of those things being the country they live in....Is it better to make a seperate table in the databases with the country names OR...just put the country names as options in the html form dropdown list?
View Replies !
View Related
Form One Server To Anouther
Im building a website which has a MYSQL backend. Im doing this on my laptop using XAMPP's PHPMyAdmin. I have webspace which also has phpMyAdmin. I have already started to build this databse on mylaptop and now i wish to uyplaod everything. Can someone please guide me through the proccess of transfering my MYSQL database on my laptop's webserver to my webspace using both PHPmyadmin
View Replies !
View Related
Email Contact Form
Basically I have been asked to develop a contact form that stores all the users input i.e. Name, Message, Email add, etc, etc within the relevant fields that I have set up in MySQL DB. My problem is that no user input is being inserted into the fields when I export the DB table to Excel or PDF, the fields are there but the rest of it is blank!!!??? I have two web pages that 'handle' the email contact form. The 1st page (contact.php) is the form that posts user input and calls to action the 2nd page (contact_form_handler.php) which inserts the data into the DB table. Here is the code for both pages. Code:
View Replies !
View Related
Returning Current Form
I have a table called `match` which holds details of games between teams. `match` has: `match_date` `home_team` `away_team` `home_score` `away_score` I want a query to return the last 6 games (Win/Draw/Lose) for each team. I am unsure if this can be done using my current table format.
View Replies !
View Related
Restrict Form Inputs
I have a site that uses a specific format for a username, how can I restrict or configure the input to a that format? format would be as follows [letter][letter][number][letter][letter] It would look like this - KE4IAP
View Replies !
View Related
Creating A Query From A Form
I'm struggling building a SQL query from the output of a form, i.e. the user inputs into a form which in turn decides the query. I have never done this before and was just wondering if anyone had any links tutorials of something like this!? I have searched but haven't found anything too useful yet. Basically all I want to do is for the user to pick from a drop down menu how they want a leaderboard displayed, i.e. top 50 results, bottom 50, 50 to 100 results, etc. Do I just tie a complete SQL statement with the corresponding LIMIT info inside to a variable. The variable being the value of the chosen item in the drop down menu. Pseudocode as follows:
View Replies !
View Related
Create Table With Form
I have an html form that I want to create a new table when submitted. Is there a way to use input fields in the form ($username, $email) and create a table with it: "CREATE TABLE ('username', 'email')( various values )";
View Replies !
View Related
Sql Based Contact Form
how would I create a contact form that would store the results in a sql databse, be able to see the results in a text file, and also would have a link to delete that result from the database in the results text file?
View Replies !
View Related
Multi Page Form
Currently I have a form where, when a user logs in, the user info is displayed. if it's a new user, the form is blank and a row in inserted into mysql upon submit. The user is then taken to a confirmation page, and the user can go back and edit the info. I'm guessing that to continue this trend, I need to create multiple php pages for the form: step1.php, step2.php, step3.php.... However, if I wanted to run these forms off of one php page, may be using arrays and a loop... say, if step 1 for ( i; i<lengthloop; i++) loop array [step1][i], I would have to create the row in the database upon login, rather than as an aftermath.
View Replies !
View Related
Form Default Date
I have a MYSql database with an ASP VB form. I set up a text field and set the default value as: <%=date()%> but when I click the button to insert the record it tells me to check the sql error and lists my date field. My MySQL date type is date, not datetime. I am using Dreamweaver MX. How do I set the default date so that it inserts correctly into mysql? Apparently I can't set the default value for the date field in the database structure because I link with an odbc driver.
View Replies !
View Related
Creating A Simple Form
I started this in the php section, but i think it needs to be here as well. I'm fairly certain i need mysql to do this, and my phpbb forums have mysql tables. To reiterate the main objective, i simply want to create a form on a php page that has a field that says "Counter-Strike Name:" and a text box to input, then a submit button. After a user submits, i'd like it to take them to another php page where it displays their name and other users names who have signed up (it;'s for a tournament). I'd like the names to be saved on this page.
View Replies !
View Related
|