Forms, Froms, And More Forms
How do you do a post (like the webmasterworld's) that you can view what has been posted but keep what the person typed in, in the text area.
View Complete Forum Thread with Replies
Related Forum Messages:
PHP Forms
I have a forum with 1 text field and 1 drop down box on. Now the user can either click submit or preview. when doing preview it displays on the screen the 2 entries so that they can check before submitting it. Now, i know how to make sure the text field has the info in that they have just typed by using value="<?=$fieldname?>"> but how do you do the same on a drop down box. eg the box has the numbers 1, 2 and 3 as options to select. 1 is selected by default but the user has now selected 2 and clicked preview but I cant get the default to now be 2 as selected instead of 1.
View Replies !
PDF Forms And FDF
I have some PDF forms of varoius documents (invoices, ...) and I would like to populate them with data from MySQL with PHP (on win2k3) I tried fdf_* functions, the field filling works fine, but my mission is not yet complete: - Acrobat Reader can't save the complete document (form + PDF). Can I merge "FDF" and "PDF" at the server side using PHP ? How ? - It seems that Acrobat reader on Linux could not fill in forms. Many other non-acrobat reader can't. Anyone has tryed with Acrobat Reader for linux ? This problem will be solved if I could merge "FDF" and "PDF" at the server side. - In all my modules I need to replicate one or more pages. For example in a tipical invoice form I have only 10 lines available, so I must replicate the invoice form as many times as needed in the resulting PDF. How can I achieve it ? I found fdf_add_template() but it's totally undocumented ! Is it the right function for me ? Ho does it works ?
View Replies !
2 Forms
I was handed a voting form that the company has used in previous years, for updating. The first page is a form, asking for name, business name, title and email address(twice for verification). The form gets posted to a verfication PHP script that checks that the email addresses match and that the email address isn't already in the database. If there is a problem, it sends you back to the first form; if everything is okay it sends you on to the second form. The second form is the actual voting form. At the top of the screen, the customer's information is displayed for them, using PHP variables. So that name, business name, and title are at the top. Customer fills out the form and clicks submit. The form forwards to a PHP script for inserting the data into MySQL. This is where the problem comes in. Everything but the name, title and email address gets written to the database. I have checked my SQL query and it is find. My working theory right now is that the second form erases all variables from the first form, as for as the system is concerned. Here is a line of code from the second form: <form method="POST" action="check.php?email=<?php echo $email ?>"> It looks like the origional program was passing email in the URL which would explain why email works but the name, business name and title don't. I think the origional coder knew the issue. I am looking for confirmation of my belief that only one set of variables can exist at a time, from a form for any given method. If that is true, how do I pass multiple variables in the URL above? I tried seperating them with commas or ?.
View Replies !
Php/forms
I'm having trouble getting a variable($text) to be filled into a form field. I think its because of the form being outside the php tag but im not sure. Hope someone can help. Here is the code:
View Replies !
<br/> Forms
Below is my code for a page that searches my database and produces results. It is incomplete, but searches fine atm. The only problem i am having is on displaying the page i get "<br/>" in the form input boxes. Code:
View Replies !
Forms And PHP
What I want to do is have a "multipart" form on my web site. This form will allow users to select a text file from their computer. The text file being selected will be numerous lines of text in the following format: Code:
View Replies !
Web Forms To PDF
I've been trying to create a web form that the results paste themselves into a preconfigured .PDF document (Where the different sections of the form paste themselves into the right section on the .PDF) for the user to print off and then the .PDF file saves itself on the server for later use, I can't get my head around it! Anyone came across anything like this before?
View Replies !
PHP Help With Forms
Im trying to get a form to post to a php page it is all working but i need it to be easier eg <select style="width:100;font-weight : bold" name="city1" tabindex=14> <option value="Portsmouth">Portsmouth</option> <option value="Poole">Poole</option> <option value="Cherbourg">Cherbourg</option> </select> <select style="width:100;font-weight : bold" name="countryArr"tabindex=8> <option value="GBR">UK</option> <option value="FRA">FRANCE</option> </select> but i want it to be just one dropdown eg if you select poole or portsmouth it will automaticly select uk but if you select Cherbourg it will select france and the 2nd dropdown is hidden.
View Replies !
SSL And Forms
I'm trying to set up a form where someone can post their Name, Address and billing information on a secure site. Then when it is submitted, I can view it (either email, or some web interface.) Now, I know email is incredibly insecure, but is there an easy way to do it? I'm going to be using ixwebhosting's shared SSL for now....
View Replies !
More Than 2 Forms
What im looking to do is create a varied mail form on one page using php. What i mean by this is that i want to put a radio button list or drop down menu which has a number of different options (for example: 'general' (default), 'complaint' and 'add link' The General form (which is displayed by default) has 3 input boxes (name, email, comment). When the drop down menu or radio button is changed to (for example) 'add link' the form changes to display 4 input boxes with different names/inputs (name, email, url, comments). I'm really no good at php so could someone suggest help me sort this out? its simply so i dont have to have seperate pages for each individual form and dont have to put 2 or 3 different forms on the one page (hence making the page length rather long).
View Replies !
Using Various Forms
due to an assignment i need to make three forms and retrieve the information posted in each of them and display them in a new page: First Form ----> Second Form ----> Third Form ----> All the information posted I know how to retrieve the information of one form and then display it on a new page after pushing a submit button but i just don't know how to retrieve the information using three different forms.
View Replies !
Css And Forms
how i can manipulate the actuall box in a select form. i'd ultimately like to get rid of it in this case, but i might keep it and just style it to match the consistancy of the whole site.
View Replies !
Using Different Forms
I just have started learning php and due to an assignment i need to make thre different forms and then retrieve all the information posted among the 3 forms and display it on a new page. First Form ----> Second Form -----> Third Form -----> All the answers. I know how to retrieve the information directly from one form and then show it but how can i be able to do the retrieving among 3 forms?
View Replies !
Forms In Php
i just wnated to know how i can use php script for my form that i have created in html, basically the code is below, what i want to do is when a user selects metal then it should display metals from the database, if metalloids selected then again it should retrieve that info from database. Â Â Â Â <form name="input" action="type.php" method="get"> Â Â Â Â <select name=group> Â Â Â Â Â <option>Select Type</option> Â Â Â Â Â <option>Metals</option> Â Â Â Â Â <option>Metalloids</option> Â Â Â Â Â <option>Non-Metals</option> Â Â Â Â </select> Â Â Â Â <input name="search2" type="submit" value="search"> Â Â Â Â </form> post the actual script.
View Replies !
& Forms
I've been using php for email forms on a few of the sites I make. I was told the php code but not why/how it works. This is the code I have on my submit button inside of a Swishmax (.swf) file Code:
View Replies !
XML Forms?
I need to send some XML data to a server and I've been given the following specifications. Server: http://myserver.com/parseXML.jsp Request method: POST Form request data name: xmldata The XML structure is quite simple: Code:
View Replies !
Two Forms
I have two forms on one page. In Form A I have drop-down list (single selection). When I click a submit button in form B, I would like to pick up the value showing in the drop down list of Form A. Can this be done? The reason for separating the two forms is that Form A opens a new browser window with selection in that form, whereas Form B keeps it in the same browser window for its selections. The drop-down list value, however, is used in both and I would not want to repeat that list in Form B.
View Replies !
Php And Forms
I've created a online quiz using radio buttons and am using php to process it. I'm having problems scoring the quiz. I'm using if statements to compare the values of the radio buttons with the correct answers, then adding to a $score variable when the user gets the answer correct, but it stops adding to it after it gets to 3.
View Replies !
Forms
I have an bookingform where the dates of arrival and departure are in includes and separated by day and year-month, the form action is ACTION="/cgi-sys/FormMail.cgi. I have includes like this in the form: <p>Arrival: <?php include("includes/day.php");?><?php include("includes/month.php");?> and the selects like this one: <select name="day" size="1"> When the form is submitted on the e-mail we receive of course I get the value of the selects as an result like this: day: 31 month: 2006-05 day2: 07 month2: 2006-06 Is there a way to change the result of the e-mail I receive to do it arrival-date: 31-05-2006 or 2006-05-31?
View Replies !
Include Along With Forms
I have a problem using a form in a page that uses includes. All alone the form works great. When placed in an include file or in another page that has other includes in it things go to the dogs. It will show itself on the page ok but will not save to the table. Also what is strange is I can enter data in the fields only by starting at the top field and using the tab key. It will not jump to a field with a mouse click. Am I breaking some rule or is in my code somewhere?
View Replies !
Whitespacing In Forms
I have this script where, when you join and if you leave a space after the username/email address, in the verification email sent out it will also leave a space making the link not valid. Is there a way to stop whitespacing in form fields, so if they do leave a space it would remove the spaces automatically?
View Replies !
Handling Forms
Im trying to write a universal Formhandling function. IS there a variable as $formfields in Perl, that stores all the form fields in an array? In PHP as far as i got i have to write $name, $email and so on all the time and it takes a lotta work to costumize this for every form.
View Replies !
Search Forms
How do I make the form to search freely within the database? As of now, if a word is entered, it only displays results containing names that start with that word. This is how the form looks like.. [...] AND `entry` LIKE '$entry%' [...] *entry* being the field in the database. This isn't a search engine, but it displays results from a mysql database..
View Replies !
Validating Forms
I've read that you can use ereg, preg, eregi as a regular statement for identifying email addresses and all ZEND explanations aside, I still do not get it, not too mention that every bit of code looks different from website to website, and the ones that I've actually tried, had a variety of errors. Do I have to validate using the ACTION tag in the form? I'm asking because I already have a script that takes the information and emails it to recipients, is it best to put something like validate.php as the action, then after the validation is approved, if/else send it to the mail() script? If it's best to send it to a validation script, then to my mail() script Is it possible to send sessions through both steps, because I need to use sessions on my mail script.
View Replies !
Forms, Email And SQL
I'm the process of building a form to input data to a MySQL DB with php and also wanting to have the input fields be emailed to 2 different addresses.
View Replies !
2 Forms On One Page
I have two forms on one page. I need my page to beable to perform different functions when a certain form is used. So far, I have the following... but it only works for 1 form. So... how would I go about making this work for 2 forms? ----------------------------------------- if ($submit) { require "./needed.inc"; MYSQL_CONNECT($hostname, $username, $password); mysql_select_db("$db"); header ("location: clientdb/techview.php3"); $result=MYSQL_QUERY("INSERT INTO manu (name)". "VALUES('$manuname')"); $id= mysql_insert_id(); MYSQL_CLOSE(); } else {
View Replies !
PHP FORMS And $_SESSIONS
i have a 7 page form and many many many variables.. i cant figure out how to get the variables to move from each page and show after it is submitted. I can get the last page of the form to show on the action page but not any of the other pages before that. Should i be entering every single variable from each page into a $_SESSION['varname'] or is there an easy way to do it.. the script i am using on the action page is: <? foreach ($_POST as $_SESSION['field'] => $value) { echo "$field: $value<br>"; } ?> and that works for the last page of the form but not anyother?
View Replies !
HTML (forms) <->
I have made a PHP program which is able to encode and decode text. To show this to people I made a form in HTML which enables a user to paste text in a textarea, and then choose to either encode or decode this text. When I open a file directly from the PHP code and encode/decode it the ouput is fine, yet when I use the textarea as input and let the HTML form use the PHP function the output is somehow different. I first thought perhaps the textarea would add linebreaks and tested this with a simple PHP program[1] which confirmed this was not the case when I use the wrap="virtual" function from textarea. Somewhere there must be some sort of miscommunication between PHP or HTML, or perhaps I did not handle the input flexible enough... This is test.html which contains the form and which calls test.php to handle the text pasted in the textarea; PHP Code:
View Replies !
Arrays And Forms
I have two elements in a form , a text area (justification[]) and a hidden field (prodID[]) I have the following code as a test: foreach($_POST['justification'] as $reason) { echo $reason."<br>"; } foreach($_POST['prodID'] as $pID) { echo $pID."<br>"; } output item reason item reason 2 item reason 3 item reason 4 id1 id2 id3 id4 How can i edit the code as such so that the following out put is displayed: item reason - id item reason 2 - id2 item reason 3 - id3 item reason 4 - id4
View Replies !
Slashes In Forms
Ok. I have checked the magic quotes is on. I have a form on my web page. The input from this is sent (by POST) to the server. A PHP script processes it. If there any errors the input is urlencoded and returned to the webpage with the form in the URL. I am not using add or strip slashes in my script (except for the testing I did that is explained below). If the user inserts slashes or double quotes - when these are returned to the form they are slashed. If one backslash is inserted, 4 backslashes appear when the form is redisplayed. If I enter a double quote this is returned as 3 backslashes (the double quote disappears). If I stripslashes() before returning the input to the form, one backslash becomes 2 backslashes and a double quote is returned as 1 backslash (but again the double quote disappears).
View Replies !
Forms And URL Variables
I wanted to create a cool form processor for my site and I didn't want to use any JavaScript nor did I want to tell the user to use the back button! What I did is have my script validate required fields, and if one of them is proven empty or something the script redirects the user using this code: PRINT "<meta http-equiv='Refresh' content=Ɔ URL=$url'>"; Now the $URL contains the variables like form.php?name=myname&email=myemail etc... using name=$name etc.. But I used this code to replace spaces with a "+" or the URL will be cut short and loose data: $name = str_replace (" ", "+", "$name"); And now for the fields in my form I have these little codes: <? if (isset ($name)) print "$name";?> I also went a step further and highlighted the tables that the empty field was in by changing the table background color! with this code: IF (isset ($name) && ($name == "")) { $name_color = "#CC0000";} else { $name_color = "#FFFFFF";} And of course the <? echo $name_color; ?> in the html... This works very well, I tested it in NS and IE my only concern is, is this a smart way of doing this? I mean using the URL to fill out the form so the user won't have to retype everything? Maybe their is a way or a better command than REFRESH? Does anyone know of the limit of characters that can be in the URL? I've tried up to 568 so far (Just testing for the heck of it). Any input on this method of form validation would be appreaciated
View Replies !
Forms And MySQL
I'd like to make a form that submits the data to a database. It's to make a database of members of a community, where everyone has his "member file".
View Replies !
Manipulating Forms
Consider the following form <form method="get" action="http://domain.com/sample.php"> Enter first part of your email<input type="text" name="firstpart_email" value ="" size="20" /> <input type="submit" value="submit" /> </form> If a user inputs "joe124", what code do i add in order for the form to submit "joe123@user.mysite.com" I posted this problem in alt.html, but i was told i would get a better off posting it in a php group.
View Replies !
PHPMYSQL Forms
have been stumbling over my code for a couple days but I'm having a rough time understanding what Im doing wrong. Hopefully someone can help. I have created a very simple form which I would like to collect a user contact information. I then would just like to upload the data and store in a MYSQL database I have created. I receive no errors when I click submit and no data is entered. If anyone could help that would be great! Here is the FORM: <form action="insert_book.php" method="post"> <table border="0"> <tr> <td>Name</td> <td><input type="text" name="name" maxlength="25" size="25"><br /></td> </tr> <tr> <td>Address</td> <td> <input type="text" name="address" maxlength="60" size="60"><br /></td> </tr> <tr> <td>State</td> <td> <input type="text" name="state" maxlength="15" size="15"><br></td> </tr> <tr> <td>Zip</td> <td> <input type="text" name="zip" maxlength="15" size="15"><br></td> </tr> <tr> <td>e-mail</td> <td> <input type="text" name="email" maxlength="30" size="30"><br></td> </tr> <tr> <td colspan="2"><input type="submit" value="Submit"></td> </tr> </table> </form> Here is the php script: <?php // create short variable names $name=$HTTP_POST_VARS['name']; $address=$HTTP_POST_VARS['address']; $state=$HTTP_POST_VARS['state']; $zip=$HTTP_POST_VARS['zip']; $email=$HTTP_POST_VARS['email']; if (!$name || !$address || !$state || !$zip || !$email) { echo 'You have not entered all the required details.<br />' ..'Please go back and try again.' exit; } $name = addslashes($name); $address = addslashes($address); $state = addslashes($state); $zip = addslashes($zip); $email = addslashes($email); //Connection to DB $dbh=mysql_connect ("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error()); //database name mysql_select_db ("dogwoo44_phpwcms"); $query = "INSERT INTO petition VALUES ('','$name','$address','$state','$zip','$email')"; mysql_query($query); mysql_close(); echo mysql_error(); ?>
View Replies !
Validation On Forms
* When I don't fill in something in the first three fields, but only the last field. The script accepts it. (??) * I've made a simple function 'generateTextfield' which, well, generates a textfield. I did this 'cause i could avoid dreamweaver and typing a lot. What it doens't do though is: * Don't show variables, please check my code, I want to echo in the textfields the variables. <? echo $name ?> where $name is of course the variable given by the function. Code:
View Replies !
PHP Doesn't Allow Me To Manage Forms
I have installed PHP a number of times following tutorials from online and from a book. I have been able to process simple functions such at date() but when it comes to simply sending information from a HTML form to a PHP page to display it doesn't work. I know it isn't my programming as i have copied it word for word from a book, and even used one of their examples from the site. The code I have used in the PHP page is: <?php /* This page receives and handles the data generated by "form.htm".*/ print "Your first name is $FirstName.<BR>"; print "Your last name is $LastName.<BR>"; print "Your E-mail address is $email.<BR>"; print "This is what you had to say:<BR> $Comments<BR>"; ?> and all of those variables relate to a text field in the form on the HTML page (form.htm).
View Replies !
Forms To MySQL
how to get input from an html form and insert them into a MySQL database, something like a simply buy/sell ads.
View Replies !
2 Forms On The Same Page?
Im trying to upload images and then to pass the url details of the image to a form. Dont seem to be having too much fun with the posting in the second forms, doesnt want to exit the page and post to a new page.
View Replies !
Cookies And Forms
i am trying to use cookies and the only way that i can bake them is manuall the code that depends on the form does not work Code:
View Replies !
Using PHP In HTML Forms?
I have been working on getting sessions to show up on each page. I have a html form and at the top of the page i want to display the session for the users name, and i'm not sure where to put the session information? PHP Code:
View Replies !
How Do I Keep From Reprocessing Forms?
I want to submit a form to another page to process the data from said form. Then the person can go on to another part of the site or another site altogether. However If the person later clicks the <back button> enough times they will arrive back at the page that processed the data the first time and the same data will be processed again. How can I prevent this? My first thought was to use a cookie and set it on submit of the form but I have not been able to get that to work. Any suggestions?
View Replies !
Forms And Iframes
Ive got two thmes for a website and the variables are stored in theme.php Ive then got the website with all the varibles which works ok, the problem is tat the main page has got an iframe which is needed. To change the theme ive got a simple form with a drop down menu and the action is <? print $PHP_SELF; ?> this form works fine for 1 of the pages, the problem im having is trying to get it to change the other page as well i can get the page in the ifram to change but then the other page wont change and the same thing happens just the other way around if i put the form on the other page. I really need the form on the page in the iframe because the form dosent fit anywhere on the rest of the site Can someone help me on how to get the form to change both pages at once This is a copy of the form that i have at the moment Code:
View Replies !
Forms + Email()
it has been a while since integrating php and forms. So, I have two questions. Can you specifiy the SMTP that mail() uses? How do you send the values to the php file? IE mail.php?value=)
View Replies !
Php + XHTML Forms
I have made an xhtml form and i want to query a sql database with the entries to the fields using a php script. I can do this using html, what are the differences when using xhtml?
View Replies !
$_SESSION[] And Forms
I am trying to declare session variables on a database 'insert record' page so that they can be used on the redirect page (the page that loads after the records are sent to the database). Currently I have it working but I have found out that session_register() is deprecated, so I'm trying to use $_SESSION like i should. But I can't get it to work. I have tried everything I can think of, and spent about 10 hours searching for an example that i can understand. Several of them looked right, but didn't work for me. i make some vars from post values: PHP Code:
View Replies !
Forms And Checkboxes
I need some help with manipulating form vars, in particular checkboxes. I currently have a form setup that dynamically creates X number of checkboxes, all named "accept_check_X" where X is the index # of that record from the DB. When I submit I want to be able to check the status of each checkbox to see if it's set to on or off. Right now I'm using $_POST, but it doesn't seem to contain the checkboxes that were left unchecked. It just has the checkboxes that were checked and submitted. Is there anyway I can check the status of all the checkboxes from the previous page?
View Replies !
Submit Forms Via PHP
I'd like to be able to submit forms via PHP. (In other words, grab an HTML page w/ a form on it, parse it, and submit the form) then grab and parse the resulting HTML page. I'm going to assume, for my purposes, that submitting via GET (ie Query String) will not work the same as via POST. Moreover, I need to make sure that the referer HTTP variable is set correctly. Is there anyway to directly manipulate HTTP headers sent out by PHP??? If not, there should be.
View Replies !
Forms Getting Spammed HELP
I have a guestbook form that is getting spammed regularly(10 timeds a day) by a bot of some kind. I'm in the proccess of picking up PRO PHP Security from apress,(Which i need anyway) but I was wondering if anyone has a quick fix for this.or point me in the right direction.My client isnt
View Replies !
|