Saving Form Variables Using A Java Function
I would like to know if it is possible to save a value from a php form in a session using a java function. What I am doing:
I have a php form. The form contains a textbox and 2 list menus (drop down box) The second drop down box relies on the selection made in the first.
within the reload() java function I save the value entered in the first list menu (using the onChange="reload(this.form)" ) I pass the variables in the url. The users selection loads values into the second list menu. Where the user can make a second selection. This value is passed using the same method.
What I would like to do is save the textbox (or all the entered values) values in a session using a java function. When the user changes the a value or enters one.
View Complete Forum Thread with Replies
Related Forum Messages:
Getting $_POST Variables From Form In A Function
I've loaded various thoughts I've collected into mysql. I want to write an app, all in one file, that has the following features: 1. On initial entry, selects and displays the thoughts ( might add pagination later - there aren't alot of records, for now.) 2. This main page includes separate forms near the top with submit buttons to search, add a thought, view all thoughts, etc. The action for each form is to call this same page. The submit buttons and thoughts are printed from a function. 3. In the main logic, I am trying to do a $_POST and if isset() on each submit button name and then call a corresponding function, do whatever it has to do, unset the form variable and continue back to the main display. The problem is that it's not calling any functions. The error log says that the name of each submit button in my $_POST[] statements in the main logic is an undefined index. I presume that they are undefined in the main logic because the forms were defined in a function. Is there anyway to access, in the same page, form variables that were declared in a function on that page?
View Replies !
Saving Variables
I have a menu made up of images where users can click an image to load the next page. I want each image to send a unique id number to the page the user loads. Based on this id number, the page that will be loaded will display something different. Since I'm not using a form to post data, I decided to save the id number as a session variable. The loaded page will read the variable when determining what to load. The problem I'm encountering is where to put the code to get the first page to save the id number (I know how to save and retrieve session variables, so that's not an issue).
View Replies !
Saving With Variables
I'm using php to save a webpage to the webserver. The saved file's name is supposed to be equal to the variable $uic I can't get it to display the value of $uic heres the code: $return = file_put_contents('../../../archives/docs/account_details/$uic.txt', $content); that saves the file called $uic.txt instead of printing: 7706869110330709208613965.txt.
View Replies !
Post Variables After Java Sort Are Lost
I have an HTML table that is being constructed from a MySQL table and displays a form that includes a check box on 1 of the fields on the form for each record. I have included in this PHP program a javascript routine called sorttable.js which is something I found on the internet for sorting tables and works quite well. The HTML table includes a check box on each record so the user can select certain records for passing to the next process. This works fine unless I sort the table on some column and then the POST variables are lost. When I run the following code there are no POST variables that will echo except the submit button. foreach ($_POST as $varName =$value){ echo ($varName . " = " . $value); } However, if I don't sort the table the POST variables will be echoed for every record in the table. I'm not sure why this is happening or how to go about solving it. When I check certain records on the form and then sort the table the checks themself don't disappear only the POST variables do. This prevents me from looping thru the ARRAY to determine the value of the POST check box for each record to see if it was checked. If I run the above code but don't sort it I will have several hundred POST variables (several for each record). Could someone give me an idea on how to solve this or offer some sort of work-around?
View Replies !
Saving Variables From Flash
I am currently setting up a flash site as a front end for a flat file database using .txt for the data storage as it is minimal. I have st up the flash to post the variables to the PHP file when an order is sent. I have used the following PHP to save the variables to a .txt file PHP Code:
View Replies !
Saving Formatting In Variables
I am writing a 'tell a friend' page for my www site. Essentially, the user opens the page, fills out a form, click submit, the text of the email that will be sent to their friend is presented on screen. If they like it, they press send, and an email is sent to their friend. The main body of the email is in a variable, which contains paragraph formatting etc. The problem I am having is that the paragraph formatting is not transmitted to the html page that they review, and that page looks messy. Of course, I tried putting in html formatting in the variable, but then this literally appears in the email. Does anyone know a way of solving this problem?
View Replies !
Saving POST Variables
I have a form which has an Iframe in it. The reason I have the Iframe is because I have a dependent drop down list which refreshes when some clicks a certain button. All of that works fine. but my problem is, now that I have the drop down in the Iframe refreshing with no problem. I can't get the value that's in the dropdown to pass when I click "submit form". I'm guessing I may have to use some type of javascript to get the value that's in the dropdown.
View Replies !
Sessions Variables Not Saving
Quick background: Developed on Windows (apache/mysql, no register globals or other nonsense) Moved everything to AIX and have the following problem: Nothing is saved in my session folder. Yes, I've created the directory. Yes, the apache/mysql/php user has write access to that directory.
View Replies !
String Parsing Function Like In Java
I am new to php, but is there a string parsing function like in java which allow you one big string in to many smaller stings. In java there are 2 ways tokens and string functions. Are there types of things in PhP.
View Replies !
Saving Form Results When Form Split Into Four
Im a trying to develop a form which is split into four parts because of its size. Up to now ive always designed my form with all the HTML fields n stuff and had a seperate formhandler which did the PHP stuff. I would like to be able to click a next/submit button after completing the first part, insert the 1st part of the form into the database then go onto the 2nd part of the form- but I would like to be able to click a previous button and have the 1st part of the form I submitted still there with my responses saved (obviously If I went on a previous page and hit next I would like to UPDATE, not insert the 1st part of the form and so on) Code:
View Replies !
Saving Variables As Text Files: Any Security Issues?
I've been reading all the posts about permissions but I'd still like some help! I'm building a site where I have user account folders containing photos and text files. At this stage I'm not allowing user uploads - I'll do that myself via FTP, but for simplicity I'd like to save the settings and variables for each account in simple text files rather than use mysql. In order for my scripts to change the values in these text files I need to change the permissions to allow writing - but I'm not sure exactly what secruity issues are involved?
View Replies !
Java Form Confirmation
I know how to do form validation with java, but how do I get a message to pop up asking: "Are you sure you want to submit?" with a "yes" and "no" button? I did some searching but only find form validation, and lots of other confusing Java script.
View Replies !
Mail Attachment Saving Function
here's a little function I threw together that can save attachments from messages retrieved via the IMAP library. Note that the function takes two arguments, the first being the mailbox opened by imap_open(), and the second the message number of the message you want to retrieve the attachments/body from. note that the function dosn't check the validity of a message of $mnum actually existing, as in the code I wrote it for, the message number was checked for validity before calling the function. The function returns a string containing the body of the message, as well. Oh yea, it also dosn't save attachments of type 0 (7-bit) and 5 (Other). still playing with that functionality.
View Replies !
Saving Result Of Function Without Being Echoed
I am trying to save the function "rand(1, 1000000)" in a variable but when I am for example trying: $randomnumber = rand(1, 1000000); it is executing it right ahead while when i try $randomnumber = "rand(1, 1000000)"; or $randomnumber = 'rand(1, 1000000)' It is saving rand(1, 1000000) as variable. But what I need is a variable saving the result of rand(1, 1000000) so the number does not change either. Any ideas how I would do this?
View Replies !
Saving Form
i want to break it up into 4 pages of 40 feilds. so here is the thing i need it so people click on "save and quit" and it saves everything then when you come back it brings you back to page 1 with all the feilds filled in. this is how i thought about doing it, have a database with all the feilds in it, then have a cookie that stores the id to that specific record. now i dont know how to accually call a cookie to tell the query how to pull the id, also i dont know how to check if the person already has a cookie or not, and if do do i tell it to update the database feild or insert into it. i was thinking if they have a cookie id it will bring it up and i will use an update to do it, (when you click save and quit it inserts what you have filled out into the database) but then i will need a different form to do the one if you dont have a cookie id already so then you need to insert into a new one, im trying to do this with out repeating to much...
View Replies !
Java And Ajax - Table In Form Brakes.
I have a problem with Ajax and PHP (weather it's down to PHP i'm starting to doubt) I have a <Table> in a <form> like this: O = radio thing |-------------------------------------------------| |Option Name: | O | O | O | |-------------------------------------------------| |Option Name: | O | O | O | |-------------------------------------------------| bla bla bla ...... The form eliments are like this: Code:
View Replies !
Saving The Output Of A Form To XML
I have some clients who want to do a bit of the maintenance of their homepages themselves and I would appreciate this because that will save me a lot of work. Is it possible to generate the output of a form into XML instead of generating it into a database or into an e-mail? I have already got a PHP script which converts the XML into HTML.
View Replies !
Saving Form Information
Say I have a webpage which takes in many user inputs through a form. Once i click the submit button in the bottom the information is sent to the server. I fill in the user inputs and would like to save the webpage with in input data filled before submitting. Is it possible to save the webpage with user inputs filled?
View Replies !
Saving A Filled PDF Form
I am trying to build some functionality where a user can fill out an editable PDF form and send it to my site. I realize I can just have them save and upload/email it, but if I could pull the fields out of the pdf and insert them into a database, I would really prefer that. I saw some ways to do this, but all were expensive commercial solutions which I can't afford. Important points are storage space, ease of use and security. I really want the forms to be as secure as possible when submitted. I also think having to save and upload the pdf might be too difficult/too much work for some users and I want it to go as easily as possible. Another idea I had was to have a link inside the pdf, which would save the form and send the user to the upload page, with the path already entered into the upload box? not sure how to even begin going about that though. I did some searching on the forum and it seems like it's not as common a problem as I thought. Most php/pdf stuff seems to be just creating pdfs dynamically.
View Replies !
Saving A Form To The Server
I want to submit it to the server and have it saved: 1. In a directory by the guides name which would be the variable 'describe11'. Create this directory if it does not already exist. 2. Create a special file name from the date and time submitted. This form will be filled out by a bunch that are not very computer literate, so I must automate everything for them. I've been searching/googling for 3 weeks now with little to no success.
View Replies !
Saving Form Values
I have set up a login script based on the one found in http://evolt.org/article/comment/17/60265/index.html but I have modified and extended it significantly. A problem I am having is if a field is incorrect or not filled out and the user is "<a href..."ed back to the original page all the inserted data is lost and needs to be filled out again. I have tried the following code to get the input data saved but it does not work in the script I am using; <?php ... $user = isset( $_POST['user'] ) ? $_POST['user'] : '' ... ?> <tr> <td>Username:</td> <td> <input type="text" name="user" value=<?php echo "$user" ?> maxlength="30"> </td> </tr>
View Replies !
Saving Form Data Without Submit?
I could need some advise on a form / form processor I am working on. Normaly I store all form data through php into a class variable for later use. I do this by submitting the form. However I would like to ease the usage of my form and would want each form field to store its' information "onChange". I did this before with "onChange=thisformSubmit()", but that's not acceptable in this case. Is there any other sensible method to save fields individually? maybe using Ajax? Maybe there's a good tutorial somewhere?
View Replies !
Saving A File Received By A Form
I am just another newbie programmer in PHP and web developping and in the three days I have been messing up with it I have been able to do all the things I wished except one. When I receive variables from a form, like a string with the name I can read them with $_POST["name"] without problem. But when the form sends to me a file, I haven't found how to save it into my system. I guess I can access to it with $_POST["file"], fopen it, and then do fread and fwrite in another file. But this seems to me like a too much unconfortable way of doing it, so I ask here what is the normal way of saving a file sent by a form.
View Replies !
Saving Form Information Into Mysql
I am looking at a way to store a list of ids from a form. What I have is a form in php that lists a group of devices that I need store in a table in a mysql database. This form is dynamic in length. ---- Sample Form ---- Device #1 Device #2 - SELECTED Device #4 Device #5 - SELECTED Device #6 Device #7 - SELECTED Device #8 - SELECTED --------------------- So I want to take 2, 5, 7, 8 and store it into a database so I can recall it later and make a report on the items selected in the form. Would an array work in this situation? What type of solution would work for this?
View Replies !
Saving A File With A Form Insert
I have a form that I use to insert info about items into a database. One of the fields is the item's image. I have a field of type 'File" where I can browse to the location of the image and select it. When I submit the form, it only gets the file-name part, not the path. I realize that the path on the local machine means nothing to the script running on the server. How can I modify the form or the script so that once the user selects a file name, I can copy it to a location on the server so the script can access it later?
View Replies !
Saving Off Form Values To Redisplay After Error Routine
I have a form with radio buttons that works to redisplay form values if an error is found: <? switch ($Quest01) { case "A" ?> <input type="Radio" name="Quest01" Value="A" Checked> <input type="Radio" name="Quest01" Value="B"> one for C and D There is a case also fo B,C,D Is there another way to do this?
View Replies !
Html Form Processing - Saving Data To A File...
ok.. basically, what I'm doing is setting up a very basic news script base on flatfile storage (mostly to teach myself PHP by doing, which is the best way I've found to learn). set up the php and the html templates first, and all that works fine. I set up the admin menu, and have a edit config script that works great (edits the config and file locations values via an admin form) now, am working on a script for the admin to edit those html template files directly from the admin panel. example template editing form:
View Replies !
Preserving/saving Form Values When Needed To Go Back
I am working on the script that will take you back to the input form if date is less than the required date. There are two scripts. One is to for input that is bascially a form. Second saves the value in the database. Second script checks if the date from the input script is less than 01/01/2000. If it is less then it takes the user back to the input form. Things go berfect till here. When I am redirected back to the input form then all values are gone...Is there any way to preserve those values? Code:
View Replies !
Functions Can Recognize My Global Variables Without Sending These Variables As Parameters In The Function Headers?
If I define a variable $var, and then define a function Func(), then I can't use the variable $var inside the function because the variable is defined outside the function. If I want to use the variable $var inside the function, then I have to send it as a parameter in the function header like this, Func($var). But the problem is that I have many global variables, and many function. I don't want to pass all these variables to all the functions! Isn't there a way that the functions can recognize my global variables without sending these variables as parameters in the function headers?
View Replies !
Function Inside A Class Function Dont Pass Variables...
Im using xajax class, and i just made a custom class called mantenimientos that use objects of this xajax class. Something like this: class mantenimiento { public $titulo; public $ajax_sRequestURL; function __construct($titulo,$ajax_url){ $this->titulo = $titulo; $this->ajax_sRequestURL = $ajax_url; } function exec_ajax(){ //Here i can use $this with no problem $xajax = new xajax($this->ajax_sRequestURL); $xajax->registerFunction("call_fun"); //I have to do this to have acces to the class itself when im inside a function global $mant ; $mant = $this; function call_fun(){ //next line give me access to the mantenimiento class properties. //I havent found other way of doing it. global $mant; $objResponse = new xajaxResponse(); $objResponse->addAlert('XAJAX CALLED:'.$mant->titulo); return $objResponse->getXML(); } $xajax->processRequests(); } My problem is that $mant->titulo lost it value when i im inside the funciton, but only when that value comes from other var. for example: if i do this: $mant = new mantenimiento('This is the title','index.php'); or $titulo = 'This is the title' $mant = new mantenimiento($titulo,'index.php'); When i execute the xajax_call_fun, it shows an alert box with the text "XAJAX CALLED:This is the title" but if i do something like this: $titulo = gettitulo_from_database(); or $titulo = $_POST['titulo']; The alert box show the mensaje with out the value of the $mant->titulo Im getting crazy with this....!
View Replies !
Form Processing - Get The Target Page To Process The Form Variables
I have a form embeded in a html page. The form comprises of 3 inputs (2 <select>, and a submit button). The action is set to a php page. What I am trying to achieve: I would like to be able to get the target page (php page) to process the form variables in 'if.. else' statements and direct the visitor to the relevant page which contains the information that has answers for their queries. Example: variable1=="small" (entered from a <select> input) Variable2=="truck" (entered from a <select> input) this info is submitted to process.php I would like 'process.php' to combine the 2 variables and send the visitor to a page called: small_trucks.htm or small_trcuks.php (either extension will do). Note that the final pages the visitor to be directed to are unique pages and need to be displayed in the form of pages and not IFrames. If you are familiar with this, would you kindly create a code for the above example..? and would you also be able to tell me where to insert that code in the php page..?
View Replies !
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.
View Replies !
Saving An Image From A "file" Form?
How do I recieve a picture from a form off a website and save it to a directory? I use the "file" form to allow the user to browse their local drive but how do I get the actual picture so I couild use it later?
View Replies !
How Do You Pass Variables From Form To Form?
I have a web page that is a guest book listing. I want to show 5 guestbok entires at a time. Then there is a Next button at the top of the page. There is an onclick() that goes to a javascript Next() function. The Javascript next function calculates the next five record pointers to pass back to this same web page by the get method. IE. If I am on entries 1 thru 5 then I need to pass 6 and 1o this screen and redisplay the next 5 entries. Code:
View Replies !
Using Variables In Two Function?
I have a page that has two functions on it, on load I check for posted value if exists I set some variables that I want to use in the functions but don't want to pass back and forth. Do I need to be using global variables in order to use this variable in each function? Are global variables only available to the page they are called correct? Never used them before but I'm not getting the values if I just set a $var at the top of the page.
View Replies !
Function Calls To Variables?
Ok I'm hoping you guys can help me out here. I have a function that prints out some information ( HTML and Query results ) that i need to call up. Sound simple enough right? Ok but here's the deal, i ereg_replace a query result with the function. For example heres the exact code i'm fighting with.
View Replies !
Using Function Variables Outside Functions
I have a function that gets a page based on the ID grabbed out of the URL (Called $choice). When the Page is set it pulls the correct URL and Title values out of an array and put's them into variables, but I can only use them inside the function, and not outside. Here is the complete index page:
View Replies !
Change Variables From Function
Subject: Change variables from function Currently im working on writing login/verification scripts and I understand that leaving files that may contain sensitive information in the Document Root is unadvisable, thus im working on breaking up my long scripts into files to be included from the main page through the <? required() ?> tag. So herein lies the question. how can i safely set/alter the same variables from across several different functions ? I kinda understand the use global vairables. If this is a syntax issue or you know of a site that might have indepth references to the php syntax, then feel free to reply that as well.
View Replies !
|