Form To Txt
I would like to have data typed in a html form that when submitted the values are presented within a designed html page you know with graphics and all that. The basic intent is to have a form filled out and then allowing the user to print out the values on the following html page. I don't want the form data saved in a txt file or sent via email.
Not sure now if I should use cgi or php or what after the info I have read. Any help would be greatfull.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Server-Side Form Submission - Form Submits To Form, Which Autosubmits. BAD!
I have a php form from which the user fills out their name and address and clicks "Submit". The form goes to a page that stores the data in a mySQL database, then, using hidden fields, populates another form and actives with a javascript onLoad=submit() to send the information on to the final destination. I cannot control or edit the final destinations web page, which is why the interim page is needed. What I would like is for the user to fill out the form, and upon submission have the data recorded into the database and have the data passed on in a "form like way" on to the final destination BY THE SERVER, not by the use of a hidden form page that auto submits. Any suggestions? Here is the interim page's code below: <? $link = @mysql_connect($db_host_name, $db_name, $the_decoded_password) or die; @mysql_select_db($db_name) or die; $query = "INSERT INTO web_link VALUES ('', '$a', '$b', '$c','$d', '$e', '$f', '$g', '$h')"; $result = @mysql_query($query) or die; ?> <html> <head> </head> <body onLoad="document.contactme.submit();"> <form name="contactme" method="post" action="http://www.test.com/cgi/storethisdata" > print "<input type="hidden" name="first_name" value="$first_name"><br>"; print "<input type="hidden" name="last_name" value="$last_name"><br>"; print "<input type="hidden" name="email" value="$email"><p>"; print "<input type="hidden" name="phone" value="$phone"><p>"; ?> </form> </body> </html>
Add Form Field Values Into Php Seesion Variable Before Submitting The Form
I have php page which is basically a simple html form containing some text fields.The user will type in values in it and submit it .Now what i want is that just at the time of submittion i want to assign the form field values in session variables. I nwwd this b'coz the form is being submitted into a cgi script which has been given to me.Now the cgi script is an executable one and i am unable to view or change its content,Its functionability is to change a password for a linux user account .Now the cgi script after completing the job is redirected to another html page.What i have to do is that i need to trap the user input and update the values in a mysql database .Now if i can assign the values in a session variable then i can do the updatation from some later pages.
CURL Form Posting To Self Referencing Form Action
I've successfully used CURL to maneuver around and through sites but a new site I've been trying to work with has got me stumped. To retrieve the data I'm trying to get a login is required. If you go to any page in the "member" area without logging in you get directed to a https connection and hit login.php (ie: you end up at https://www.domain.com/login.php). The problem, I believe, lies in the fact that the form on that page references itself in the form action tag. The action tag in the form is "/login.php" and nothing I've tried has been successful in getting CURL to actually submit the data and get me logged in. Not surprising really since you'd normally point CURL to the action target to pass form data. The things I've tried so far without luck are: * Hit the main site page to pick up the session cookie then go to one of the "member" only pages * Gone directly to one of the "member" pages to get redirected to login.php Both attempts end up simply returning me the contents of the login.php page which, obviously, doesn't help or do any good. What isn't clear from the CURL documentation with PHP is whether or not the CURLOPT_POSTFIELDS get passed to pages after a redirect takes place. I suspect they are but the fact that login.php refers back to itself seems to be the real problem. If anyone has any ideas on how to convince CURL to get me past login.php or any other suggestions on things I could try I would very much appreciate it.
Form Submission Fills Form Values With Garbage
I'm attempting to do some form processing on a server that has register_globals off, however, I've run into a confusing situation and need some help. Basically, the form is a multi-part/form-data form as I have it upload a file in addition to submit a number of other fields, but the error I have occurs even when no upload is done. When I submit the form, all my input field variables get filled with garbage. Here's the html before submission for one of the fields: Code:
Dynamic Form Fields/multiple Page Form?
It is for a friends out of print booksite, where visitors can request multiple books to be searched by adding one at a time to a cart (javascript), then once all added they submit to another form where they enter their personal details and all is sent through. The problem is at the moment they cannot change whats in the cart without refreshing the browser window and losing everything. 1) present for asking how many books they want to search for 2) display multiple rows of the same input fields depending on how many books they say they want to have searched for?i.e title|author|publisher|etc title|author|publisher|etc title|author|publisher|etc 3) when these are submitted they could see these above the next part of the form where they enter their details with the option to go back and delete/amend. 4) send all the info to my colleague. if so has anyone seen a similar script that I could take a look @ to see if I can hack it to suit my needs?
Variable Extracted Out Of One Form Not There Anymore After Submitting Another Form
in short what I'm trying to do: pass a variable from a form that's posted to a certain page, to the same page. The variable is extracted with $_REQUEST. Next, another form in the same page is submitted, again to the same page. Following that, I have code depending on the submission of the latter form. In that code, I try to do something with the variable that has been submitted with the first form, but it's not there anymore. I tried passing it to another variable beforehand, making it a session variable, making the $_REQUEST conditional, etc etc. But nomatter what I do, it remains empty. What's the correct way to go about this?
Integrate Client Form With Third Party Form
Anyway, here's the deal. The client wants a certain form to have its input send to a third party. The form is *only* an email address - that's it. Looks like this: <? if ($action == "sendmail"){ if ($error == "") { echo "<span class="error2"><b>Thank You!</b> You're now signed up for the Company Newsletter, the foremost authority on developing quality requirements specifications. Watch for it in your inbox!</span>"; }} ?> <?php if ($error == "1") { echo "<span class="error2">"; } if ($emailerror == "1") { echo "The e-mail you entered was invalid. Please check it and try again."; } if ($error == "1") { echo "</span>"; } ?> Sign up for our FREE newsletter on <b>developing quality requirements specifications.</b><br /> <form method="post" name="newsletter" action="<? echo $PHP_SELF?>"> <input type="hidden" name="recname" value="Company Name" /> <input type="hidden" name="subject" value="Newsletter Email Submission" /> <b <? if ($emailerror!= "")?> >Email:</b></span> <input class="input" type="text" name="email" size="20" value="<? echo $email?>" /> <input type="hidden" name="action" value="sendmail" /> <input class="button" type="submit" value="Send It" /> </form> See? Simple. One field. If the end user does not input an email address, or inputs an invalid string as an email address, it returns the error. The PHP code is as such: <? isset($_POST['action'])? $action = $_POST['action'] : $action = '' isset($_POST['email'])? $email = $_POST['email'] : $email = '' if($action!="sendmail"){ include ("home.shtml"); exit;} if ($action == "sendmail") { if (!ereg('^[-!#$%&'*+./0-9=?A-Z^_`a-z{¦}~]+' .'@'.'[-!#$%&'*+/0-9=?A-Z^_`a-z{¦}~]+.' .'[-!#$%&'*+./0-9=?A-Z^_`a-z{¦}~]+$', $email) ¦¦ ereg("'", $email)) { $emailerror = "1"; $send = "no";} if ($send == "no") { $error = "1"; include ("home.shtml"); exit;} $to = "email@company.com"; $message = nl2br("Please add my e-mail to your newsletter mailing list. e-Mail address: $email"); $mailheader = "From: <$email> Content-Type: text/html"; mail($to, $subject, $message, $mailheader); } { include ("home.shtml"); exit; } ?> More simplicity. Gotta love it. Now I find out I need to make it work with this third party service. Unfortunately, the only code they provide is for HTML based foms *only*. (Yes, I actually called them on the phone to ask for assistance, and they basically told me to figure it out for myself, because they don't provide support for anything but generating HTML code. Nice.) So, here's their code that somehow needs to be integrated into mine (I'm changing some stuff, because I don't know what it does - but I mean like the numbers they make me input for things - I don't know if they're client-specific or not): <META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"> -------------------> <form action="3rdParyURL/servlet.WebToLead?encoding=UTF-8" method="POST"> <!------------------ This HTML is defaulted to DEBUG mode so that your web master can test the online Web-to-Lead page from the desktop. Once your web master has finished testing please remember to remove the entire "debug" and debugEmail" lines of code prior to adding this HTML to your website. -------------------> <input type="hidden" name="debug" value=1> <input type="hidden" name="debugEmail" value="me@myemail.com"> <input type=hidden name="oid" value="123456789065432"> <input type=hidden name="retURL" value="http://www.companysite.com"> Email: <input name="email" id="email" type="text" size=20 maxlength=80><br> newsletter request: <input type="checkbox" name="56A987123J5489P" value="1" id="752D58963G1247W"><br> <input type="submit" name="submit"> </form> Now, you will notice that they have a checkbox for adding someone to the newsletter - but the client just wants the sender sending the e-mail the only thing they need to do to get this going. I have *no* clue how to integrate this into my PHP. I can only have the e-mail area, and I don't know what to do about the action - if I replace my <? echo $PHP_SELF?> with their action - it negates my page. not completely, though - but for the most part....
PHP Contact Form--blank Subject When Form Is Sent
I have a contact form, which has a subject field (the subject of the email that is sent to me), and when the form is submitted, the subject is not being sent. Instead, I just get a blank subject. Code:
Getting Multipart Form To Move To The Next Form
Having trouble getting a multipart series of forms to move to the next form. The problem line is: <form method="post" enctype="multipart/form-data" action="Data_Form1.php"> If the "action" parameter is set to the current form (Data_Form1.php) then the data posts to the table correctly, but it does not move to the next form If the "action" parameter is set to the next form in the series then by clicking "submit" it moves to the next form, but the data does not post to the table.....
Pass Infomation Form One Form To Another
I created a post html page where the user fills out a form and it sends it to my PHP script using the $POST method. I have validated froms checking for input if non is given it prints an error message. Now here is my question how can I reload the form with the information that the vistor entered on the previous one. My HTML code is stored in a varible $htmlcode here is the code for it is below. This comes from the original html document that passed the value to PHP from the form. I tried to set the values of the input text box to strings; however that did not work. Here is what I used <input type="text" name="db_fax" value="$db_fax" size="25">. For some reason the scipt didnt read the value of the string and put it as its value. It just filled the input text boxes with the name of the string($db_fax). To output the data is used print "$htmlcode"; method. If some one could tell me what Im doing that would be awesome. Code:
Getting A Form Value Without Submitting A Form
I have a complicated system I need to work around. One I don't care to explain too much, but essentially I would like to grab a form (I know how to do this) and then have php copy the value in a field to a variable. Is this possible?
Posting Form Data And Also Allow To Download Form Data
i have a client that whats to post form data to a database but he also wants users of the script to download it aswell how will i got about doing this i thought about it that i could make it save it into a txt file then echo the download link is there any ideas? because to post it to a txt file it would be posting 2 places is there a way to do this? Code:
Form To Fax
Can anyone please give me or tell me where I can get a script that will send form that is inputed into a form to a fax machine.
Form
I need to create a form that contains multiple lines for the same data....an array looks like the answer. My form: Date Name Title Phone ==================================== _____ ________ _________ ________ My first though was to have variables: date, name, title, phone, date1, name1, title1, date1, date2,name2,title2,phone2,date3,name3,title3,date3 etc so that I can have 10 "lines" for the user to enter this data into. Some will enter 1 line, others all 10. So far, my clunky methods work....however trying to decide how many lines they have filled out led me to thinking "perhaps I should use an array instead". This data is submitted to a database (mysql on linux) and I am not sure if even that will work. My question is HOW can I build a form that contains 4 fields that could be repeated across numerous lines....then put it all into a db for retrieval later?
Web Form
Im doing this web form, but because its fairly long to go on 1 page I was wondering how I would go about doing it on multiple pages. The only way I can think of doing this, is by registering sessions after each page, and then calling all sessions and put them in the MySQL INSERT statement. (data from form needs to be entered into mysql database)
Getting The Form Id
If you set the id attribute of a form, how do you access the id's value from the script handling the post submission?
Php $ GET From A Form
I am working on a system that logs IP addresses, I posted earlier about pagination, which I now have sorted however I am now attempting to implement a search feature that will display the results and also offer the pagination. The paghination is working like this mysite.com/logs.php?limit=10&page=1 I have introduced a new file called search.php that has the following URI, mysite.com/search.php?ip=192.168.0.1&limit=10&page=1 my problem is getting the IP address or value typed into the search text box (the search text box appears at the top of the search.php file), How do i get the value from the search text box into the URI, and also how do i make it so that once it is in a variable that variable will never change, even if the page is reloaded (session variables?) so I suppose its more of how do i get the search text into a session variable, and then get the session variable into the URI for the ip attribute? any help here would be appreciated, if you need to see code snippets just ask, I didn't want to post the entire code as its long and also incase the solution didn't need it.
Form Value To DB
I've tried many many different approaches to this question, and have come up empty every single time... very irratating. This is the question: I'm creating an upload script, and would like the admin to be able to add extensions that he/she would allow user's to upload. I created a form text field, and just want them to be able to simply add the extensions, with a comma seperating them... example: gif,jpg,jpeg,png,bmp Then, the value gets stored into the sql DB, and is drawn from the upload script. Again, I've tried several things to get the array to work properly... the current one I have is this: I pull the $file_ext from the DB, and try to put it into an array like so... $file_ext = array($file_ext); Then, I have it the uploader check for file exensions, to see if they are allowed from the array: if(!in_array(strtolower(substr($_FILES['file']['name'],-3)),$file_ext)) { But it will disallow all entries, no matter what I do... I just want to be able to pull the info from the DB, and be able to check the extensions for permission to upload them... Can someone help me with this problem? I've very stumped... or could anyone come up with a better method?? I would like to keep the original admin form field, where they can just add extensions sperated by commas, if possible. I just need to able to put those fields into a working array that I could use with the upload script. I've checked EVERYWHERE for some snippets, but have found nothing useful.
Pdf Form
Is there any possible to create a pdf file at runtime with textboxes and checkboxes . The output pdf form looks like a application form and the user can fill the text box and check boxes and can printout the form. look like Name -------------------- Gender checkbox checkbox address ------------------------------------
Get Form Name / Id ?
I have a form <form name="jim" id="jim" .......... > ......... </form> How do I get either the name or id from the form in PHP ?
Form Within A Form
I've got a form that posts to another page that saves the changes made to a record. Is there a way that I can imbed another form in that form that posts the information to a different page that'll print it in a pdf file. Code:
Form
I want to have a form like: <form action=blah method=post> <input type="text" name="id"> <input type="submit"> </form> and whatever number is entered into the id input will come up in a link like: rawr.php?id=$_POST['id'] but I don't know how to do it unless I have a page after it which does some checks and then forwards which would just be a waste of time as I'm sure it would be quite simple.
Web Form
i have completed my web form,connection works fine (thanks guys ) i am now in validation , but i have a question, when i click send and i return to my web form (back) all data is gone from the from how do i make the data editable until the browser is closed? by using cookies? i am not familiar with that is there other way to make a web form data stored until a session ends. i do not use any logon to id the user i just want the form saved .
PHP Form
On the action page, I check certain fields to make sure they are only digits. If not, it returns false. What I'd like to do is show the form again with the responses the user entered, but leaving the incorrect fields blank. Is that possible?
PHP Form
I'm doing up a little form which emails the information to an account. Everything seems to be going great and submitting properly, however when the information is submitted it comes up looking like this: "addressphoneposition" I'm curious if there is a way that I can manipulate that code to put a page break between the values. It's probably something extremely simple, but I'm really so new to this that I don't even know where to begin. Code:
Form
I'm trying to create a basic form. The user fills in the information and submits. If all the required info is submitted, it gives a thank you message. If not, it gives an error stating what info needs to be submitted. I uploaded the php file to my web server. When trying to view the url via the web, it just give a blank white screen. Here's the Code:
Web Form
My buddy sent me a php script to extract MD5 hashes from a text file. I can see the references for hashes.txt however I am unsure how to submit. Ideally I would like to use an HTML forum to submit txt file. Code:
Form
I am trying to find something simple I can carry around. I want to ahve a form, that they can specify everything on the server, and upload files anywhere they want. Sort of like a file browser/directory lister or somethign that allows them to choose a folder and upload files to it. I can put it on a server, and have it have that access via a form. Anyone know of one, that's built using PHP?
Form
I have a form where by you input a number and then it inserts that number to the table but it just wont insert ! I have a seperate process page which recieves the input using _POST Code:
PHP Form
I have a question about form handling with PHP. Let's say I have a page named "questionnaire.php" and on that page I have a form. The form tag looks something like this: <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>"> Some one submits the form and if it is successful, they go to another page, say "thankYou.php". Now here is my question. If that person hits the "Back" button in their browser (to go from thankYou.php back to questionnaire.php) they get the standard "you are trying to resubmit the form" warning. Is there any way to avoid this happening? Is there a way to not have the form try to re-submit when you hit the "Back" button?
Form
I've coded a form in HTML and I use PHP to process the info. What I'd like to know is how I can make to where the form can only be submitted once. I have a problem at the moment with the form being submitted by users hitting the back button and the refresh button.
Form
I have done some research and I've noted that it is not possible to run two actions with one form. Here's the problem...I really need too. When users register for my site I would also like a seperate script that I have to run also (it creates an E-Mail account for them on my site). So my question is what are some alternatives or get-arounds for this problem?
PHP Form
I want the PHP to check if the space has words or something and if doesn't I want the PHP script to tell people they need to fill every space I have 2 pages that do this work of sending the info to the database the first one is contactus.html wich has just the form here's the code:
Email Form..
I have set up a cart and at the moment when you checkout all the products go to final page where you fill in your details and then press send, this is then supposed to email off to the customer and shop owner, My question is, is there a way to get all the information in the previous page to email off using a simple form, but instead of defining every input field and the products table, have everything done automatically?
Form Handling In PHP
Is there anyway to send an entire form without having to specify the $fieldname? Would you have to do this with a regular expression?
Form Names And PHP
Does PHP handle form names? Suppose I have two forms on one page, named form1 and form2. I pass them to the same php script via the same method. Can PHP distinguish which form was used? How?
Form Validation...
you would need to use Javascript for form validation, since the form is client side, PHP doesn't have the capabilities for validating forms to the extremes you'd need. it isn't all that difficult really, how well do you know Javascript?. if not well enough, contact me and i'll see what i can do.
Form Redirect
I just got a new web host and all they support is PHP. I am going to learn PHP, but I need a quick script to help me with something and was wondering if one of you could help me out. What I want to do is submit a form to a php script and simply redirect the contents of that form to another page to acutally handle the data that is sent through the form post. Example: abc.htm ----> redirect.php ----> SomeSite SomeSite will actually process the form data for me and I have no control over the script on that site. I know what data I have to send to the script on SomeSite, but I want the form post to pass through redirect.php Now in the IIS/ASP world I would be able to use server.transfer to do this. How would I do this in PHP?
PHP Identify Which Form You Are On
I have a dynamic script which will basically echo 1 of 3 forms based on the submit value. The question is since I eventually end up storing this all into cookies and users may need to go back to other forms, I want to write the cookies back into the forms. I know how to do this, but the issue is how can you identify what form you are actually displaying to know which cookies should be used? eg. the problem occurs here. Say form 1 has a submit button called "Form1" My script decides which form to display based on that, and I was trying to also use that to determine what cookies should be used. It doesn't work because you could have clicked Submit on Form1 and the Submit value it is "Form1" so the cookies would be called as we are on Form 1 but really we are on Form 2. Anyone have an idea on how to set up variables or some way to uniquely identify each form so we can figure out which cookies to use?
Problem With A Form
Ok in my old html form I had two selection boxes. One box had all the selections, and you could move the ones you wanted over to the right box. On submit, the form executed this command: <INPUT onclick=selectAll(document.combo_box.right box) name=rbox; type=submit value=Submit name=submit_button> It had to basically select all the values in the right box in order for the formmail script to mail me the values. I want to use the same selection process in my PHP form but can't for the life of me figure out how to do the same thing.
How To Pass SID From A Form?
Just trying to figure out how to pass SID once a form is submitted. I am assuming that I could append it to the action (<form method=get action=nextpage.php?<?=SID?>>), but all I get is a nextpage.php? without the SID attached. I have my global variables turned on.
Form Not Working
My form Is not doing what it is supposed to do. It just keep recycling itself everytime i push the submit button. PHP Code:
Form Validation
Rather than individually access all the $_POST vars individually, I want to try and create a smart script, thats loops through all the fields and performs the neccesary checks. The problems being, depending on what var is being checked there will be different procedures, for example email username password etc etc Also, not all fields may be required, but some will be. How would you do this with a loop? Would you use a reg exp on the name of the var to determine what check to perform? So if it contained 'email' perform email check. If it contained 'pass' do the password check. If it contained 'numbers and letters' do the relevant check.
Form Self Submission
I have a form which I am trying to have submit to itself, but change 1 var so that it changes what is printed. how can i do this so it works? Code:
Using PHP To Output A Form
I have a login system that gives registered users unique userIDs and stores their registration info in a MySQL DB. Now the tricky part: I need a PHP that outputs a simple HTML form with a list of all the members (and their name and email) in the DB, with a checkbox next to each. This form must be specific to whomever is logged on, such that the data (s)he enters only goes into the relevant row, column or table of the individual whose checkbox was checked. Summing up: I need a way for (1) a form to display all the listed members in a MySQL DB and (2) to have the info selected in the form entered into the relevant row, table, or column of the individual selected.
Two Actions One Form
When a user submits the form he/she gets redirected to another server with some inputs as parametres (form has to use POST ,not GET). When the transaction is done he/she gets redirected back to my server. However, in the form there's a few input that I'd like to add to a database, before the user gets redirected. Example: <form method="post" name="frm" action="http://not.my.server/process.php"> <input type="hidden" name="firstname" value="alpha"> <input type="hidden" name="lastname" value="beta"> <input type="hidden" name="company" value="gamma"> <input type="hidden" name="currency" value="usd"> </form> I'd like to add the input "company" to the database, before the user gets redirected.
Form Security
I've been trying to come up with a way to ensure user input is coming from the form on my site, and not auto-submitted from elsewhere, and I don't want to use the "enter the code shown in the image" method. I know the $_SERVER['HTTP_REFERER'] contents can be spoofed, so I thought of doing something similar to this:
Redirection From A Form
I'm creating a form where users are directed to a page depending on what options the choose on the form. I've tried this with Javascript and although it works the information in the form is not passing on to the next page. The information the user inputs will eventually be mailed. Here is simplified diagram:- form--> name_____ email______ option-->a.htm -->b.htm -->c.htm submit page a.htm, b.htm or c.htm--> this page displays information on option a b or c. then the page is emailed.
|