Editing Submitted Form Using Variables
I'm working an e-mail form for my web page. I want people to be able to fill out information and when the click submit, get a page that basically says, "Here is the information, is it correct?"
Then they can click either, "Yes" (and it sumbits), or "No", and it goes to another page set up like the form filled out the first time, and grabs the variables and places them in the "values". This is the code I have so far: Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Get The Name Of A Submitted Form
how can I check the name of a submitted form? I have several links using the get methos, but also a form using get and I want to be able to check if GET is set and it's been set by the form. I would usually use hidden inputs, but they obviously don't work for get forms.
How Do I Check If A Form Is Being Submitted?
I have a PHP code that checks if a form button has been clicked: if (isset($save)){... <input type="submit" name="save" value="Check the results..."> Upon clicking the button a PHP code runs that saves stuff to a MySQL db. The thing I'm doing is that I'm submitting the form with this code in a java script: aForm.submit(); This javascript is triggered by other user input and I do Not want to force the user to press any additional buttons to submit the form. How can I make the PHP code run when submitting a form instead of a button? = I want to submit the form but After I've run my PHP code and saved my data to the db.
Check If Form Is Submitted
I am using PHP to generate a form that submits to $PHP_SELF. The first time the script executes is should only create a data entry form based upon a MySQL "DESCRIBE table" statement. When submitted, the script will insert the form's data into a table using an INSERT INTO statement. I need a way to determine if the script should DESCRIBE and generate the form or instead INSERT the submitted data into a table. In the past I used a hidden field with name=submitted value=true and checked for that to determine if script should DESCRIBE or INSERT. However in this case I want to simply get the name/values from the HTTP header and INSERT them into the table. Form element names correspond to the desired table field names. Having the hidden field requires me to filter out the unwanted data. (I guess I need to submit the table name inorder to know which table to insert into, so there is atleast one required hidden field that is not part of the actual data to insert.)
Submitted Form Just Shows Itself
I have a form i will use to register new people and when I click the submit button, the form just shows itself. It is supposed to show a message showing field errors if you leave fields blank etc. so submitting the empty form should show error message in red , then show form, but all it does is show form. I checked the variable to make shore they ere ok and they are fine. i believe it is a logical error with my if else.... I eved modularized everything by using functions and the same results. if any one sees the logical error, let me know. Here the code: <?php function showmessage() { // Check to make sure they entered a valid email address. if (eregi("^([[:alnum:]]|_|.|-)+@([[:alnum:]]|.|-)+(.)([a-z]{2,4})$", $HTTP_POST_VARS['emailfield'])) { $d = TRUE; } else { $d = FALSE; $message1[] = "The email address you entered is not valid."; } return; } function checkfields(){ $year = $HTTP_POST_VARS['yearfield']; $month = $HTTP_POST_VARS['monthfield']; $day = $HTTP_POST_VARS['dayfield']; $dobfield = $year.$month.$day; // Check the last name. if (eregi ("^([[:alpha:]]|-|')+$", $HTTP_POST_VARS['usernamefield'])) { $a = TRUE; } else { $a = FALSE; $message1[] = "Please enter a correct username. I.e; EricDerouen that consists only of letters."; } // Check the first name. if (eregi ("^([[:alpha:]]|-|')+$", $HTTP_POST_VARS['firstnamefield'])) { $b = TRUE; } else { $b = FALSE; $message1[] = "Please enter a First Name that consists only of letters."; }
Using Isset To Run Some Php When Form Is Submitted.
I am trying to modify the login script one of the moderators here pointed me to. It looks like it is working for me but I need it to only run after someone submits the form. I tried adding isset, but when I did it just post back and does perform the query. Code:
User Submitted Form Into Array
Ok, here is my dilema. I have a very long form, and I want to take the submitted info and place it into an array for later use. The thing is, since I form is so long, I do not want to have to hard code all the textbox names and values into the script. Any ideas on how to process the form in a loop until done? I understand how loops work, but how would I process the form since the textbox names are all different?
Why Php Doesn't Transfer Variable Submitted By Web Form?
I had previously installed php-4.3.9 and apache-2.0.49 on my solaris9 server and written a php script for user login, it ran well until today... today for some reasons I upgraded php to php-5.1.2, complied as apache's DSO module, and I found the script couldn't work when being accessed by IE. I didn't know why...It seemed php script hadn't transfered variables submmitted by web form to itself...now the following is my script: <?php if ($queryflag == 1) { $ybn="admin"; $ybp="111"; $ybusername=$_POST["username"]; $ybuserpwd=$_POST["password"]; if ($ybusername==$ybn AND $ybuserpwd==$ybp){ session_start(); $_SESSION["admin"]=true; header("location: testtest.php"); } else { echo <<<EOM <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>login</title> <style type="text/css"> <!-- ..style5 {font-size: 24px} ..style6 { font-family: "Times New Roman", Times, serif; color: #FF0000; } ..style7 { font-size: 14px; color: #FF0000; } --> </style> </head>
Insert Processes Before Form Is Submitted
I am trying to stop using Macromedia as my crutch and you guys have been a big help. I need some assistance with submitting a form. I have a form on my page and need to do an insert. I have the action posting it back to the same page I am on versus sending it to an insert page. The problem I am having is it trys to do the insert as soon as I pull up the page instead of waiting till the form is submitted. I believe I need to do something with isset, but can't really find a tutorial that goes over it really well. Code:
Checking If A User Has Submitted A Form
I have a form that validates itself by putting "<?php $_SERVER['PHP_SELF'] ?>" as the form's action. I have now written some simple validation, shown below. $name = $_POST['name']; if (!isset($name) || empty($name)) { echo "Error, please fill in the name textbox"; } The problem is, this code shows up, even if the user has never submitted the form. How do I only show the error AFTER the user has pressed my submit button?
Include Date In Email From Submitted Form
I have a done a callback request form in PHP and I want to include the date in the email that the form sends...does any one know how to do it, or even better give me the source code.
How To Calculate Total Submitted Size Of HTML Form
I have a HTML form named "form1" and same as for form id if form as three element, elements can be Input->"text", File, Textarea, some buttons Now when i submit this form usinf submit button, I want to calculate total size of this form submitted using Javascript or any other way. How can i calculate total size of form in bytes / KB / MB.
Creating A Form That Once Submitted Displays A Tabled Output
I have a form that I am trying to create that ideally will present a desired output based on the selections of the form. The following is an example of the dataset I am pulling from: I am trying to: 1. Have a drop-down selectable to select a start date. 2. Have another drop-down selectable to select a stop date. 3. Have radio buttons to select which datas I wish to view for the range set by steps 1 and 2. Example is nodes_available, nodes busy, one, both, or all. 4. Have the ability to select the interval of minute, hour, or day. Once the form variables are selected, then it is submitted with the desired results displayed in a table on another page. Ideally this output will eventually find its output displayed in some type of graph form, but at the moment I am trying to atleast achieve the desired outcome.
Generate An Html Form, To Be Submitted For Insertion To A 3rd Table
1. display a form consisting of radio buttons and check boxes. multiple selection of check boxes per radio button basically. I got this part done, it displays the data in the form which is being pulled from two separate tables. 2. Insert for each check box a record into a third table of the check box and radio button. this is what i have thus far and I'm not really sure why it's not working from what i can see step by step it should be inserting the records, these arrays are the most terrible thing i can think of having to do. Code:
Send Data Submitted By User In Form To Address Bar
it's pretty self-explanatory but when I have a form in my PHP scripting I'm trying to figure out a way of sending what the user enters to the end of the address bar in the new page that opens when the form is submitted: echo '<form action="/search.php?result=$result" method="post">'; echo '<a href="/">Home[/url] | '; echo '<a href="/whatsnew.php?startrow=0">What's New[/url] | '; echo '<a href="/newsletter.php">Newsletter[/url] | '; echo 'Search: <input type="text" name="search">'; echo '<input type="submit" value="Go!">'; echo '</form>'; I need $result to equal what the user enters to use the GET_$result code on the search.php page.
Form Editing
I am trying to call information from a MySQL database in for form of an editable form. I want the info to be called into a box that can by typed in and so far that works. What I want to do next is to be able to change what is in those boxes and click an update button which updates what was called from the database to what I typed in the box. The code I wrote is below and almost works. I'm not sure what the problem is. Code:
Editing Mysql Db Using A Php Form
I am working on a Sig Request database. People submit their request using a form and it's posted into a databse and then displayed beneath the request form. This is working fine. I am having trouble however with my edit.php file. I want to be able to load a users information, which I have done using this code below. It displays in a form. I change 1 or 2 of the fields, such as the completed field and designer field and click update but it doesn't actually update the database. The page first lists all the requests. It lists their ID, Name and then it says "Edit this Request" which opens a page with their sig request details in. Here is my code below for the edit.php file. Code:
Editing HTML In A Form?
I want to build a very basic online text editor, to allow customers to modify their own sites' html content using a simple form with textarea element. I read the HTML file like so: <?PHP function EditText ($filepath) { if (!$file = file($filepath)) return false; foreach ($file as $line) { $value .= $line; // contains all text in file when done } $html = "<html><head><title>Editor</title></head> <body> <form method='post' action='processtext.php'> <textarea rows=ཤ' cols=ྌ' name='txt' value='$value'> <input type='submit'> </form> </body> </html>"; echo $html; return true; } EditText ('/sample/index.html'); ?> The problem comes when the parsed file containing html elements itself is echoed to the browser. In itself, PHP does what it's asked, but all browsers I tried choke on the contents of the TEXTAREA field. Best example may be: try parsing the file containing the script itself, it becomes a real mess. I tried htmlspecialchars, this did not fix it. I tried addslashes to only escape the quotes in the parsed file, also no success. I saw one example online where 'they' preg_replaced about every possible (x)html and php syntax element, resulting in an immensely large and slow script. Can't imagine that's the proper way forward. If at all possible I'd like to stay away from Javascript. Any idea if this is a realistic approach? Are there any useable scripts available? I searched google a lot, but I keep ending up at sites that offer html or php editors for local use, not in a browser.
Editing Text File With A PHP Form
I am trying to do something with PHP that i am sure is pretty easy. But not sure myself how to do it. I have a file that i want to pull into a simple HTML Form text field. From that field the person can just add in content or remove content.. Click "Update" .. And it will write the new content out.. Overwriting the old file if need be.
Displaying Data In A Editing Form
I have a form that has three checkboxes. A,B&C. Data from A & C has been entered into the database by serializing it.I now want to create a edit form where the user can view his choices ticked. <form action="postoDb.php"> A<input type="checkbox" name="Choice[]" value="A"> B<input type="checkbox" name="Choice[]" value="B"> C<input type="checkbox" name="Choice[]" value="C"> </form> //postodb.php $bn = serialize($Choice); sql ="insert into table (choice) values('$bn')";
Editing Datase Entries Via A Form
How would I go about editing a row in a database via a form? I know how to get the information in the text boxes. But what i would like to do is list all the rows in the database and then if i see that one of the rows needs editing or deleting i'll have 2 links under each entry (edit and delete)...and when i click "edit" it would open up a new page with a form with all the info in each text box so i can edit and then re-submit it...
Editing Text Files In Form Textareas?
I want to pull text files into a form text area and then edit them. to open the file I am using: $toEdit = fopen ("../content/concept.txt", "r+"); which does not work at all unless I change the path to c:xxxxxxxxxx but I dont want to do that. If I use the hard coded path I get permission denied, if I change the file to read only it seems ok - however, I want to load it into a form textarea? Cant work this out, then I want to save it. Its just to update a simple text schedule. there will be no special characters that need escaping etc. This is probably a pretty basic question but I have been asked to do this ASAP and my attempts so far have just confused me!
Page Expired After Going Back From Del. Pageto Form Page Where Comment Is Submitted..
i've made a submit comment form with php and mysql, the form has an action to itself with a hidden var like this: input type=hidden action=add When i delete a comment on the page i go to a page called delete.php3 and there is a link with a javaline which goes -1 back in my history.. When ive added a comment, the comments page contains action=add and when i delete a comment, i want to click on the link to go back to the comment page, but then, it doesnt work and it says: Page has expired. I wondered how to deal with this kind of problems........
Need Email Address From Submitted Html Email Form
I have an html email that contains a form with questions for the user to fill out. Without asking the user to re-input there email address into the form, is there a way for me to grab the email address its coming from when the user submits the form to the php processing program. I need a way to match the questions to the user when they submit the form.
Form Variables To Session Variables
I am writing a small script that consists of two pages: page one displays a bunch of values from a DB (ie. First Name, Last Name, Phone Number). On this page you will find a form that follows this format: <input type="text" name="edit_firstname" size="20" maxlength="35" value='Bob'> <input type="text" name="edit_lastname" size="20" maxlength="35" value='Smith'> <input type="text" name="edit_phone" size="20" maxlength="35" value='5552222'> So when you see the page there will already be a 'default' value in each line (which is information extracted from a DB). This works perfectly and has been tested thoroughly. On the second page I have the following code: $editfirstname = $_POST['edit_firstname']; $editlastname = $_POST['edit_lastname']; $editphone = $_POST['edit_phone']; What I am trying to do is this: the default value for edit_firstname from the form is 'Bob' by default, but the user can change this in the input field on the first page. This value, whether changed or unchanged, should then be stored as edit_firstname and by calling up the function $_POST[''] on the second page I want to transfer the value to the variable $editfirstname. However, it seems that $_POST['edit_firstname'] and the other fields do not return a value at all, hence $editfirstname = '' or $editfirstname = 'NULL'. I have never tried to do things this way before.
Not All Data Gets Submitted.
Just switched hosts and now another problem with PHP. Whenever I add a parasite, the last of 5 fields doesn't get added (removal instructions). I have to edit it multiple times before it will go in. The last problem I had, register_globals was off.. is that causing this too? Code:
Checking To See If Page Was Submitted
Simple question but it doesn't seem to be working with a form i'm creating. does this mean if in the GET vars there's a 'not-empty' variable called "submit", then do something?:
How To Check For Submitted Info Via Eregi?
Can somebody write the lines for me: 1. how to make sure that data from $_GET would be all numbers via eregi() www.domain.com?data=12345 So how do i check and make sure that the stuff passed into "data" is a set of numbers ranging from 1-99999999? .....
Following Up Form Variables
i've coded a website to take information from a user, and then output it to a printable page to send in. The site is actually for a non-profit org, and this is for a contribution form. I have a checkbox place to put into a variable called $bird[]. $bird[] prints out fine on the page directly after, but how do I keep the value of it and send that variable on to the next page? So on the next page I can also print out the value of $bird[]. On the second page, I used: PHP Code:
Form Variables
Wonder if there is any way to check all variables through a loop when a form is submitted. I have few checkboxes (chk1,chk2,chk3...) in a form and in a php file I wanted to go through a loop to check which checkbox is 'on' and then so something with that variable.
Using Variables From Form
I've just started learning php and I hope you guys could help me with this problem. I've found a useful pice of code from a book to make a form and I would like to use it. I would like to print the variables (input) on the screen , but I can't make it work. I think I have to do something with an array, but don't know what. I've tried $field = $_POST['field']; echo $field; and also $arr = $_POST['array']; print_r($arr); but it doesn't work. Could some one show me what I'm missing? ########################### code ################################### <?php // new function echo "<br><br><h4>second function</h4> "; function print_form($action="", $method="post") { if (empty($action)){return FALSE;} echo "<form action=$action method=$method> "; $numargs = func_num_args(); for($i = 2; $i < $numargs; $i++) { echo "$i <input type = text name =". func_get_args($i) . "> <br> "; } echo "<input type=submit>"; echo "</form>"; } print_form("autoform2.php", "", "field", "field2", "field3", "field4"); // testing if the variable exist...and it doesn't... if(isset($_POST['field'])){ echo "exist"; } else { echo "does not exist!"; } ?> ########################### end code ##################################
Submitted Long Text : Php Could Have Problem With Quotes
I've run into this problem a few time but just ignored but I can't ignore it anymore. On a few of my sites I have a "News" section and I've made a simple admin area for people to type in new stories, etc. They also get stories emailed to them to put up on the site. But I found that articles with quotes and lots of punctuality and if the article is long, wont submit to the DB. PHP Code:
Form Variables Without Submit
Is there a way to pass variables from a form to PHP without submitting the form? ie. retrieving a user's selection from a picklist or checkbox.
Can You _POST Variables In Php Without Using A <FORM>
The question I have, is it possible for a php script which is used to validate values submitted in a form, to then post these values onto another script/page or even back to the calling form? i.e. the application I have in question is a login.htm page with a verify.php script The login.htm has a Form which captures login_id and password which are posted to verify.php verify.php checks the id and password against the database. if the check succeeds I use $_SESSION to track the logged in user into the page. if the check fails, I use $_SESSION["error"] to set an error message and then jump to login.htm, but I've lost the userid. The only way I can see of transferring the userid (and some other data) is by calling header ("Location: login.htm?id=$uid"); and then have some php code in login.htm to $GET['uid'] and pop that into the user field on the form. Is there any easy way I can post this data back without using a <FORM> or at least a form that can be auto-submitted?
Find Form Variables
Is there a way to read the variable names passed by a form if you dont know their names. I have a site where the users can edit a form but I need to then process it.
Passing Variables From A Form
Well I am having some strange problems with a web-based form that is used for users to submit data. I have moved the form and accompanying PHP files across from a Redhat 7.3 install to a new Redhat 9 server running Apache 2.0.40-21, with php-4.2.2-17. So, it is stock standard. Everything was working ok on the Redhat 7.3 install. The troubles I have run into is when I try and pass a variable from a form such as below: Code:
Passing Form Variables To A Pop-up
I've searched the forums for this, but haven't seen any posts or solutions about this particular problem...I have a form in a php script that submits like this: Code:
Form Variables Gone Missing
hope I'm on-topic here - couldn't find any leads with a search so maybe someone has an idea. I've got a PHP form that is supposed to set some variables from its fields and then call itself by the POST method. Here is e.g. a minimal test version called "top.php":- #!/usr/bin/php Content-type: text/html <HTML> Welcome <?php echo $_POST["name"]; ?>.<br /> You are <?php echo $_POST["age"]; ?> years old! <br> Welcome <?php echo $name; ?>.<br /> You are <?php echo $age; ?> years old! <br> <form action="top.php" method="POST"> Enter your name: <input type="text" name="name" /> Enter your age: <input type="text" name="age" /> <input type="submit" /> </form> <? phpinfo(); ?> </HTML> When I enter data in the fields name or age, it just gets ignored, goes missing, thrown away by PHP. The first 4 lines that should output this info show that the variables are all blank. The phpinfo() call at the end shows me clearly that register_globals is on. The only way I've found so far is with the GET method - there the expected arrays and variables are also broken, but $_SERVER["REQUEST_URI"] is correctly set (yipee!) and so I can parse that myself - sort of defeats the point of PHP though. What could be the problem here? Is there some other setting I'm missing? This stuff all worked without a hitch in PHP3 - has something else been broken in the name of security?
Passing Variables Through A Form
I have a setup where I am displaying lots of information, all of it comes from contact forms and is stored in a database. Then can be viewed on one page, through the scripts. One feature is that you can click on an email address to send an email to that specific user. When you click their email, the form comes up fine, and I have been playing with this for awhile.. I am having trouble getting the variables passed through so that I can send the email and update the database. Code:
Passing Form Variables
I'm trying to make a page that will let you change the order in which some items are displayed. The problem I'm having is passing back the id value of the item that you want to move up or down in the display order. Here is the code:
Passing Form Variables
Is there a way to read the variable names passed by a form if you dont know their names. I have a site where the users can edit a form but I need to then process it.
Session Variables In A Form
i want to create a form that updates a users account details...is there a way that i can get the form to show the users current details in each text box? then the user clicks on that box to edit the deails? also how would i structure a query so that it only updates the edited fields? and keeps the rest the same? Code:
Input Submitted Email Address Into Reply-to Field
When a bride clicks "submit", the form at http://www.estesparkweddings.com/contactus.shtml generates an email to all association members. When a member receives the email, he wants to click "reply" and have the email reply to the email address submitted with the form (variable $confirmemail). Below is the code I'm using to try to do it. Currently, when an email is received and I click "reply" it generates an email to $confirmemail@box73.bluehost.com Code:
Form Variables And Text Characters
Well I´m having trouble with text formatting I think. You see I have a flash form, which sends variables via POST to a php file that looks like this:
Passing Variables Through FORM -> IMAGES
I have to say this is bugging me, I'm trying to pass a variable through a form, but instead of "select" then "submit" type of form, I am trying to use IMAGES instead... I am trying to pass the variable ($lang) , depending on the value of this variable, the page will look different (English or French ) I guess I am doing this the wrong way, I thought by giving both images the same name, but different values, it would work.... but it is not working. here is the HTML code of the form itself : Code: <!--LANGUAGE SELECTION --> <FORM NAME="pick_lang" METHOD="post" ACTION="<? echo "$PHP_SELF"; ?>"> <table border="0" cellpadding="0" cellspacing="0" width="165"> <tr> <td rowspan="2"><img name="shadow_drapeau_r1_c1" src="tble_img/shadow_drapeau_r1_c1.gif" width="102" height="21" border="0"></td> <td> <INPUT TYPE="image" BORDER="0" NAME="lang" value="en" SRC="tble_img/shadow_drapeau_r1_c2.gif" WIDTH="21" HEIGHT="14"> </td> <td rowspan="2"><img name="shadow_drapeau_r1_c3" src="tble_img/shadow_drapeau_r1_c3.gif" width="8" height="21" border="0"></td> <td> <INPUT TYPE="image" BORDER="0" NAME="lang" value="fr" SRC="tble_img/shadow_drapeau_r1_c4.gif" WIDTH="21" HEIGHT="14"> </td> <td rowspan="2"><img name="shadow_drapeau_r1_c5" src="tble_img/shadow_drapeau_r1_c5.gif" width="13" height="21" border="0"></td> </tr> <tr> <td><img name="shadow_drapeau_r2_c2" src="tble_img/shadow_drapeau_r2_c2.gif" width="21" height="7" border="0"></td> <td><img name="shadow_drapeau_r2_c4" src="tble_img/shadow_drapeau_r2_c4.gif" width="21" height="7" border="0"></td> </tr> </table> </FORM> <!--END LANGUAGE SELECTION --> I don't want to set images with links (<A HREF="$PHP_SELF?lang=$lang"> works, but I want the URL to remain clear of data)
Form Variables Not Printing In E-mail
This is my first attempt at a php-based form at work in order to personalize the form response with the submitter's name. When I submit the form, all that's returned to me via e-mail is the header information. I've been searching google but can't figure out what I've done wrong. The php to process the form is this:
How To Make PHP 'grab' Variables From A WML Form
I really can't get forms to pass data to my scripts. Now someone mentioned something about grabbing it and posted some code, but for the life of me I cannot find the email/post/whatever the hell it was, so can someone please tell me how a PHP script can be made to 'grab' a variable from a form.
Pass The Variables In The Form Of Sessions
If I have something like this how can i pass the variables in the form of sessions to another page, where i Can calculate based on the products selected, very much like a shopping cart! PHP Code:
Variables Not Passed From Url Or Form To Page
I use a Mac at home running OSX 10.2, and use the Apache PHP MySQL trio for developing and testing sites. I've had very good experiences with this setup and have had no major problems till now. I noticed recently that variables added to the end of the url (the get method, ...url/page.php?var=value) are not passed to the script within the page. Forms using either the get or post method have the same problem. For example, a page named "foobar.php" containing this: Code:
|