HTML Forms - Alert To Save Changes
Is there a way in PHP to prevent a user from moving away from a page with an HTML form on when they made changes and didn't click submit? I would like some alert box to confirm if they want to leave or if they want to save the changes. Is that at all possible? I've tried Javascript but with no luck.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Save Html-forms Data To Local Disk?
A question on html-forms: We have an application where users will get a CD with, among other things, some html-forms for them to fill in. When they click the submit-button, the data is transferred to a webserver php-script that will then process the info. The forms-definition looks something like this: <form action="http://www.ourdomain.com/receiver.php" method="post"> <p>Question 1: <p><textarea name="reply01" cols="40" rows="5"></textarea> <p>Question 2: <p><textarea name="reply02" cols="40" rows="5"></textarea> <p>Question 3: <p><textarea name="reply03" cols="40" rows="5"></textarea> ... etc ... <p><input type="submit" value="Submit answers!"> </form> Now, my concern is (since there might be quite a lot of data filled in), if e.g. the internet-connection for some reason is broken at the moment when the user clicks the submit-button, there is a risk they will lose all the text and would have to re-type it, which I would like to avoid, of course. How can I best solve this issue? Ideally, I would like to store the info on their local C: drive before submitting, and automatically retrieve the text if they later return to the page, but I guess that's not possible from an html doc, right? If so, any other suggestions how to resolve this issue?
Export Entire Site And Save As HTML
I feel as though I will be covering ground that others have posted, but I have searched and not found much at all. Basically, my site is in PHP/mysql, but before I go online I want to save 95% of the site's output as HTML (basically everything but the search pages). This will be around 4,000 pages. Is there a way I can get PHP to save the output that a scirpt generates as a separate HTML file? What I would like to do is build this feature into my admin menu. Thus, when I make a change to the database, I can pull up the individual record, and click on a button that says "rebuild html pages".
How Do I Send HTML And A File For 'Save-As' At The Same Time?
If you point your browser to this page, http://prdownloads.sourceforge.net/...?use_mirror=umn the server sends you the HTML page, and very soon afterwards, you are prompted to do a 'Save-As' for a file to download. How do they do that without the classic "Headers already sent" error?
How To Save And Retrieve HTML In Its Original Form
When i am saving the below shown html to a text file using php write function, the text file is not the same as the html source. Character " " changes to "Â" and ">" converts to ">".How can i save the below shown html as it is to the text file. Code:
Coding For Save HTML File In Folder?
my quesion: 1. how coding for save HTML file (website build use template like us build one blog use blogger.com) in different folder for any user? 2. how coding to make template so used by any user? 3. how coding drag and drop and then save that drag and drop?
Strip HTML Tags, And Save To A Seperate Array
I am trying to take a string, and seperate the HTML code from the string and put it into an array, and then take my string it into several strings of around 110 characters, and then put the HTML back in, does anyone think it can be done, and how?
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:
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:
HTML FORMS AND PHP
I've been studying some tutorials but I can't seem to wrap my mind around this... When I implement a menu (in my case a drop down menu) how can I tell the Action to do one thing if one menu item is chosen and another if another item is chosen? If I can't do it from the menu itself how do I process it in the page I call? I'm trying to writhe an "if" statment like this: If ($TChoice = "Dothisselection") How do I call a diffrent page?; I've read through a few tutorials and I can't seem to figure out how to call a diffrent page! I'm new to HTML and PHP so I'm sure it's painfully obvious.
HTML Forms
I've got a questionaire inwhich the each question has its own <FORM> defined. is there any way of submitting these all to a PHP page to be checked and processed. I tried just iteratively submitting all the forms but I just get the last form trieds variables past to the php. does that make any sense?
HTML Forms And PHP
As part of a group project I have been assigned to research how PHP can be used with HTML web forms. What I need to know is, is it possible to automatically fill in a web form using a PHP script? i.e. Fill in the text boxes, and such with information passed in to the PHP script.
Processing Html Forms
I am using php to insert values from an HTML <form> into a mySQL database. I am sending the data using method=post as some of the data may be quite large. Everything works 100% fine except for 1 thing values from the form that are hidden e.g. (<input name="auth" type="hidden" value="105"> ) are passed ok to the php script, but the mySQL insert query fails! I know this because an echo $auth; produces 105, but no data is entered into the mySQL table. If I change the form to: <input name="auth" value="105">, the mySQL insert query works fine! Data is inserted into the mySQL table! I have searched high and low to figure out what is going on. I am thinking that it is a fairly simple problem about how hidden values need to be passed, but I simply can't find the answer ;
PHP Or HTML Question On Forms
I have an html file that has a contact form at the bottom. I didn't write the html file, but it appears that I'm missing something to actually receive the email. I know of several scripts that are forms to email, but I'm not sure how to connect it to the form.. Here is my code:
HTML Forms In Email
I am sending information in a HTML form via emial, along with the information is a conformation button that the user can click if they wish to accept the job. On clicking this message i want another mil to be sent out, however the button that is integrated in the email isn't working. Is this possible? the code for the action of the form is blow.. <?php $headers .= "MIME-Version: 1.0"; $headers .= "Content-Type: text/html; charset=ISO-8859-1"; $message = "<html><body>"; $message .= "<h1> TEST </h1>"; $message .= "</body></html>"; mail(someone@local.co.uk, "Complete", "$textfield2, $message", $headers); ?>
PHP Not Getting Variables In HTML Forms
Just installed PHP, and Apache. Am having problems with the PHP to get form data from an HTML file. Specifically, I can not obtain the variable "tireqty" in a PHP file called by an HTML file. The files' contents are listed as follow: ----------------------------- The following is the HTML file ----------------------------- <form action="processorder.php" method=post> <table border=0> <tr bgcolor=#cccccc> <td width=150>Item</td> <td width=15>Quantity</td> </tr> <tr> <td>Tires</td> <td align=center><input type="text" name="tireqty" size=3 maxlength=3></td> </tr> <tr> <td colspan=2 align=center><input type=submit value="Submit Order"></td> </tr> </table> </form> ----------------------------- The following is the PHP file 'processorder.php' ----------------------------- <html> <head> <title>abcd</title> </head> <body> <? echo $tireqty." tires<br>"; ?> </body> </html> ----------------------------- I know PHP and Apache are working becasue I am able to to have an HTML page to load a PHP page to do a for loop and use the "echo" function to print the loop iterations. So I'm not sure why PHP can't access the variable "tireqty". Is there some settings in the PHP engine that I need to check for this?
Working With Html Forms
Let's say you have a html form that allows you to choose three options with radiobuttons (at this case). Well you select one option and click "Submit" to submit the form. Now when the action points to another URL where the actual PHP script is, how to call which option of the three available did the user choose so I can work with it? Code:
Php, Javascript, Html Forms
I've got a few forms with a href in it all on one page. When you click this href, you will go to the page with method='GET'. Later in the script, I use the if (isset ($_GET['name'])). and the user will get the page he asked for. I want to ask how to get these href's to work without using forms. The form I have at this time is: Code:
HTML/PHP Email Forms
I have recently had some trouble with recieving forms sent via html and php. I know that the code is correct, but I have heard that companies like aol and yahoo have problems recieving forms. Anyone know of any goo email companies that recieve html and php forms well?
PHP Validation Of HTML Forms
I am trying to create a php script that will validate the information entered in a HTML form. If the forms are empty, I would like the user to be given the same screen again, with the incorrect forms highlighted, like in red or something. When the user actually enters the correct information, I would like it then to call a different function that would write to a database. I don't know how to keep returning the page if the information is incorrect, however. Here is what I have for the initial form: Code:
Problem With HTML Forms And PHP/MySQL...
I hope its simple for you... Say a user enters "Mark's House" (without the double quotes) into a form field. The form is submitted, and the data is entered into the database. When a query is made on that record, it correctly returns "Mark's House" (without the double quotes) But when the data is inserted into a form field (so that the data can be edited) only "Mark" appears in the form, everything after the ' is ignored. What is the most elegant way to avoid this. I don't really want to have to make users escape these characters with . Is there another way?
Submitting Forms Through HTML E-mail
1. I want to e-mail an questionnaire to all my (50) clients. 2. They will fill up the form and click on Submit button. 3. I want to store the responses in the mysql table along with the respective e-mail addresses from which it was generated. I don't know how to start because I am too new to 1. HTML e-mail messages 2. Submitting data to MySql from e-mail client (and not from regular website) I want to avoid login, password based submission because the clients are too new to the web and they don't have much time. The whole process should be completed in a few clicks and in minimum time.
Submitting Data To HTML Forms?
Could someone please suggest the basic steps I need to take to automatically submit a set of data to an online form using PHP? These are basic HTML forms with text fields and option lists, and the form method is Post. I would like to automate the submission process. Do I need to set up a dummy form on a...
PHP Forms Sending To Multiple Html
action="action.php" method="POST"> Your name: <input type=text name=name> You age: <input type=text name=age> <input type=submit> Here is a simple form that sends to action.php How can I make this form send to more than one php or html file?
Passing Variables From HTML Forms
I'm using Apache 1.3.27 as a local host to develop my site offline, since I only have a 56k and cant be online all the time. The problem is that when I try to pass variables from a HTML form to a php file, it doesnt recognise the variable names here are the lines of code concerned: on the HTML form: <input type="text" size="16" maxlength="20" name="email"> in the php file: print ("Your email address is $email"); It works when hosted online, but not when offline i've turned global variables ON in php.ini, but that didnt help can anyone else suggest anything?
Strings, Escape And Html Forms...
I use PHP to handle some data entry and editing through html form's, all very simple/standard stuff. Fot the moment, I then store all my data in a file (using var_export), but I will switch this over to MySQL at some point soon. At least while I'm using my file storage at present, when a character in a string needs to be escaped (eg. single quote, becomes '), I find that the backslash character keeps getting re-escaped every time the string is edited, through a re-entry of the form. So it then become ', etc... What is the best way to stop this recursion ?
HTML Forms Sending Variables To PHP Scripts
I'm using some HTML script to post some variables (see attached HTML code) to a PHP script. When I click on the Submit button a 'File Download' window pops up and when I click on Ok it opens the php script that I'm calling in Notepad. I'm new to PHP and Apache so is there something in the php.ini file that I may need to change? Or is it my code that needs altering?
Use Of PHP To Generate (X)HTML Compliant Forms From XForms
I've been struggling for a long time with HTML_Quickform from PEAR. The concept is ideal, but, the implementation is (IMHO) a bit of a kludge. As a developer I want a quick and easy way to generate/validate/process forms without hand hacking HTML, however, I also want it to be easy to do! The HTML_Quickform method seems to require more work than it should and whenever you start getting really complicated forms, the hassle starts to outweigh the benefits. I know XForm is currently lacking client-side support, but, with the implemtation of decent XML parsing functions on PHP5 I'm suprised by the lack of uptake in this area. XForm would be an ideal way of managing the process, extremely lightweight XML that can be processed on the server-side and sent as standard HTML to the client. Once the client-side support picks up then you can just present the original XML and no-need to re-code your app. Are there some projects that perhaps I haven't found? I noticed they're working on HTML_Quickform2 to make up PHP5 compatibility, surely a better solution would be to push forward with Xforms? Or is it more policital, I know XForms have been around a while, is there something stopping them getting the support they need.
Prevent Access From External HTML Forms?
I've noticed that some of my scripts are vulnerable to external HTML forms, meaning someone can use my functions using his own form. This might cause a bit of a problem to me. Is there any way to prevent someone from accessing my scripts using such a form and limit the access to my own forms?
Accessing Dynamically Created HTML Forms
Basically I have a form dynamically created by results from a database. As such it's going to be different ever time it's used. For each row in the database I want to have a drop-down list. So my HTML form looks like this: Code:
Posting Multiple Variables To $_POST Using HTML Forms
This is my code : <FORM ACTION="php_steptwo001.php" METHOD="POST"> <INPUT TYPE="HIDDEN" NAME="duration" VALUE=3> <INPUT TYPE="HIDDEN" NAME="banner" VALUE="test"> <INPUT TYPE="SUBMIT" VALUE"3 DAYS"> </FORM> Only the 1st Variable 'duration' gets passed!
Alert Popup Box
I can't find a way to create an alert popup box for debugging, is this possible in php? I guess I'm thinking of visual basic where that was so easy, in php I normally use *print* for this but it can be hard to find.
Making An Alert With Php
i have this code that when the user click it will delete the record: echo' <td bgcolor="'.$color.'" width="40"><font face="Verdana" size="1"> <a href="del.php?id='.$id.'&dbf='.$dbf_new.'">delete</a></ font></td>' i wanted to do a little confirmation before commiting the action. how to do it?
Alert Messag
I have trouble to display an error message when user does not select anything from a drop down menu in the form. What makes my situation different is that the data in the drop down menu is generated from the database. Code:
Alert Function
Would somebody tell me how I use the onmouseover=alert('string') in a PHP script without using of JavaScript?
Alert Boxes
do u know the alert box in javascript? when u write alert("somthing"); well i need that in php what is the alternative function for that in php?
File Changed Alert
I have a Client Management system, and the client's plain text files financialplan.txt, contactinfo.txt, and projectdesc.txt. These text files are in the client folder (public_html/clients/george) and they are to be included onto one of the client management pages (not yet created). I need to know if there is a way to detect if a file has been edited, and alert a user if he or she has not yet viewed the changes. The client files might be edited by myself, and my partner to be alerted of these changes, so he may go view the changes. Then when he has viewed the changes the alert would go away, of course.
Alert By Clicking On A Link
Is it possible to set a javascript alert before executing a php script when a hyperlink is clicked. i.e. user clicks hyperlink "delete" to execute delete.php?task=del&id=2
Javascript Alert Question
I'm working on an e-mail form (btw many thanks to Philip Ronan for the very cool email address format tester function, best I've seen so far). I've been trying, with limited success, to produce a javascript alert box which shows the user a validation error message. The error message itself is dynamic, i.e., it's contained within a php variable. I seem to be running into two issues: 1. I can raise the alert box, but I can't pass the string contained in the $myerrormessage variable. Clearly I don't quite have the syntax just right. 2. When the alert box does appear, the content of the web page behind the alert box disappears, i.e., the page goes blank. When the user clicks the OK button on the alert box, the blank web page remains, and the user must click the Back button to return to the form. The html that generates the form is wrapped inside a php function (the file itself is php). The 'action' attribute of the form is "<?php echo $PHP_SELF ?>". The form also contains a hidden field called 'action' whose value is 'send_mail'. When the user clicks the submit button, the script calls itself recursively, and the $action variable's value, 'send_mail', is sent to a switch. The switch calls a send_mail function, which performs all the validation checks and generates an html error message if $myerrormessage is not empty. This script was based on models provided in this book: http://www.wrox.com/WileyCDA/WroxTi...0764557440.html Currently I'm rendering the error message via another php function which produces the html containing $myerrormessage. This works just fine, of course, but I'm afraid some wiseguy web developer out there will look at it and proceed to tell me all about how lame it is. Can I add an onclick attribute to the form, to call a javascript function inside the <body> tag of the html which renders the form?
Security Alert! The PHP CGI Cannot Be Accessed Directly.
I have installed php4.2.2 using the windows installer but i am having problem. I get the message: Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.
Empty Field Alert And Go Back
I would like to alert the user that leaves a blank field that it is obligatory. After that return him to the previous page... I tried this code but it doesn't work. I can either alert and continue to the next page, or simply return to the previous page without the alert.. Code:
PHP And Java Applet : Instant Alert Problem......
I have a web page entry and a java applet running at the "manager" office. I need to instantly send an alert to the "manager" once the customer had key in their transactions. I'm wondering how should I do this? by using php socket? to use another programming language to develop the server ? anyone with any experience before in doing this. I did manage to come out with something. Here's what I've come out with : a) a php socket server waiting for connection. b) load an applet to connect to the php socket server. c) the socket server will fetch from the database every 'n' seconds to send the latest data. it works.....but the php socket can only allow one connection at a time. And I am trying to make it as real time as possible because a few sec of delay can cause a very big impact.
How To Redirect After (header) After Sending An Alert Message
I have a php script that checks whether the user is allowed to perform an action. If he is not allowed; I display a warning; using the alert function. After clicking away this function, I want to redirect the user to the original page using the header function. However, I get the normal message " headers already sent"... I know what the problem is. But how do you normally deal with this situation? use a html/php for the warning instead of alert message? or is there another way?
Popup Alert Similar To Yahoo Messenger In PHP
I would like to create a pop up something similar to yahoo messenger popup which comes on the right pan of the status bar. This i planned to alert the users via popup when he gets the mail.
Save In .zip
How do I get PHP to generate a HTML file(which actually resides on the server, not a dynamic page, a real file) and then save it in a zip file(automatically) so that others can download it?
Save As .doc
I have a HTML page that is created from a database using MYSQL and PHP. I need a way for the user to be able to save this page as a formatted file like a .doc. Is this possible? If yes, can someone point me to a tutorial on this. What would be even better if they could click a button and it would open a word doc. and send the information on the page to the word doc.
Save As...
I use this code to download a file which is on the server to the user, and I need the Save As... dialog, but this code here isn't working corectly and I don't know why. Another example would be great PHP Code:
Save In UTF-8 Format
Did you succeed in solving the UTF-8 format problem regarding saving a text string in PHP for loading in Flash MX? What to do in the PHP file and do I have to do something in Flash MX?
Save As Box Question
My users can pull up some information from the database and view it. However, I want to give them the option to say "save" and so instead of displaying it on screen, the script should format the data into a CSV format and then pop up a box asking them to save it. Is this something hard to do?
|