Not Catching The Post Variables
For some reason my PHP script is not catching the post variables that should be being sent by this form. Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Catching Variables
I have a bunch of vars like tipo1, tipo2, tipo3, tipo4 sent via POST... The number may vary depending on user choice. I would like to recover the vars in an array, but the way I'm trying is not working: for($i=0;$i<$numberoftipos;$i++) { $tipo2=array($tipo[$i]); echo $tipo2[$i]."<br>";} It echoes nothing...Any hints? Changing var names is not possible, I can't rename them like tipo[] because they come from multiple radio buttons, so they need differente names or only 1 will be able to be checked in a big list !!!
Can't See My Post Variables
I work on an application which runs on our Intranet network, so security it's not a big issue, and my phpinfo() get me register_globals on (php 4.1.2 on a Debian system). The problems is that I can't see my post variables (only with $_POST) and I don't get it . Is there another setting wich overrides php.ini and stop my register_globals ->on to behave properly ?
With Variables And POST
On my online order form, I need to send a few variables to my credit-card processor. These variables are for non-secure customer comments, and will be sent through the usual metod, i.e., <form action="https://orderpage.ic3.com/hop/orderform.jsp" method="post"> However, one variable is a text-area box for a detailed customer comment, and this variable can get pretty long. But my credit-card processor has a 256 byte maximum length limit for all POSTed variables. However, I can add as many of these 256-byte variables as I like. So how can I accomplish this in the most simple, efficient, and elegant manner? How can I break up the text-area vaiable into 256-byte pieces and then send these variables via POST along with all of the other form variables which will be POSTed through the usual HTML means?
POST/GET Into Variables
how does this look? should this by me calling ... myforms = new forms(); work by turning all key/value pairs for both get and post into variable names of the same name as the get/post key, and the variable values as the values from the post/get? class forms { // Some stuff var $MyPosts; var $MyGets;...
Post Cookie Variables
I have a page that include on the top the result of a cookie (i come form a previous page with some inputs) in the second part of the page a form with name surname email etc etc On submit all the information (cookie + form) are sent by email... my problem is this: in the email doesn't appear the cookie values i try to create in the form tab a hidden fiel d with this value <input name="NewEoc" type="hidden" value="<?php echo $COOKIE['NewEoc'] ?>">
Variables Past By Get And Post
I'd like a generic include that goes at the top of all pages that mysql escapes the variables past to the script. Is there a way to refer to the each of the variables past, for example (in pseudo code): for(each $XX in (list of get/post variables)) { $$XX = mysql_escape_string($$XX); }
Empty Variables And 4.21 (POST/GET)
With global variables set to on, I always had the following in my script to make sure variables had a default value: if (empty($var)) { $var = 1;} Now with 4.21, I changed it to: if (empty($_GET['var'])) { $var = 1;} The problem is sometimes I use GET and sometimes I use POST. With global variables on it didn't matter. Now it does. Is there a way to do this? When I try if (empty($_GET['var']) || empty($_POST['var'])), it doesn't work because one or the other will always be empty at any one time.
Processing GET And POST Variables
Below is a function adapted from one found in phpMyEdit.class.php http://platon.sk/projects/release_l...hp?project_id=5 phpMyEdit is a form generator for PHP/MySQL. I think this function works great, especially for forms where data is redisplayed due to failed validation of user input. I wonder what the opinion of other PHP users would be. function get_cgi_var($name, $default_value = null) { // From the phpMyEdit project // Usage: $name = get_cgi_var('name'); static $magic_quotes_gpc = null; if ($magic_quotes_gpc === null) { $magic_quotes_gpc = get_magic_quotes_gpc(); } global $HTTP_GET_VARS; $var = @$HTTP_GET_VARS[$name]; if (! isset($var)) { global $HTTP_POST_VARS; $var = @$HTTP_POST_VARS[$name]; } if (isset($var)) { if ($magic_quotes_gpc) { if (is_array($var)) { foreach (array_keys($var) as $key) { $var[$key] = stripslashes(trim(strip_tags($var[$key]))); } return $var; } else { $var = stripslashes(trim(strip_tags($var))); } } } else { $var = @$default_value; } return $var; // If data is displayed/posted using htmlspecialchars($var) // return @$HTTP_POST_VARS ? html_entity_decode($var, ENT_QUOTES) : $var; }; $name = get_cgi_var('name');
POST Variables And Sockets...
I have a server that uses Cpanel, and my mail server is Cpanel's cppop. I am trying to create an email address. With an older version of Cpanel, you could use this command line through sockets. GET /frontend/x2/mail/doaddpop.html?email=emailaddress&domain=mysite.ca&password=emailpassword"a=10 HTTP/1.0 Authorization: Basic $pass That worked just fine because email addresses were created through GET variables. Now, they have changed it to POST variables. Now, I need to create an email address, while faking the following post variables: email domain password quota I know I need to use sockets, and pass the POST variables, but I have no idea how to.
Passing Variables With POST
I have a file named login.php that basically just checks if a username and password are in a MySQL database. If they aren't then it shows access denied. If they are then I want to pass the $name and $pass to project.php in a different directory. Code:
Looping Thru POST Variables
I need to know how to loop thru the variables my script receives from a form with action=post. I need to build a list of only those variables that comes from my checkboxes.
POST Variables Not Coming Through
For some reason, at random posts, the post variables don't get thru to the server. For example, if there is are two text fields: name and email... (I have register_globals on)... When I try to update the database with a query and use $name, $email, the $name is missing or the $email is missing. I am building an intranet application and all the 20 or so clients run IE. This happens very rarely. Something like once in 100 updates. But I can see this in the log files as update contact set name="", email="asda@pol.com" where contact_id=918. Notice the name field is blank. I have JS checks in the client side which does not allow blank name field.. Is this an IE random error? How do I get over this?
POST Variables From Programs
we are trying to make a program in C++ that will comminicate with a PHP script. But we dont know how to get the variables from the program. We got it figured out with perl/CGI, but PHP seems to be a better way to connect to SQL server. On PHP the GET works, its easy, but it's not secure enough. I need informtion on what headers does the PHP require to get the POSTed data from a program.
Sending Variables As POST?
I am currently trying to send information to another page using the POST method. Unfortuantley I can not find any information on how to do this. Currently I am trying Header ("Location: newpage.html?var=test&var2=test2"); Obviously this re-directs with the variables, but they are send using GET. Not what it need. Any ideas on how to post these variables to the new page?
Apache/PHP Post Variables
I'm working with someone on a PHP project. The other person is doing testing of scripts on their personal machine using Apache as a web server. The production server and the one I'm using are both using IIS. This other person reports that in their PHP scripts when tested with Apache, form variable sent via the POST method are not "coming through." (This is even using the "long method" of specifying them as $HTTP_POST_VARS['x'].) These same scripts work fine on the the IIS machine (the POST variable come through). I've looked online to see if I can find out if anything special must be specified in the Apache configuration to enable the POST method, and although I found other people posting similar problems, I saw no reference to a solution.
Forward POST-variables
I have a form which should be submitted with either of two actions. Tried with javascript but this seems unreliable. Now looking at php and a processor page as the action of the form (process.php) which then sends the user to the different actionpages...can't figure out how to forward the post-variables to the different pages. Code:
Post Variables From Header Redirect
I'm using header to redirect the browser to another page and in the url I've added ?var1=value1&var2=value2 to pass some argument as get to that script, can I pass in some way, arguments as post in this case ? may I do it in both methos at the same time ?
Passing Post Variables Using Fopen()
I'm trying to pull data from a website and read it into a file the I can parse. I've done the before to site without post variables but I can seem to get my statments to work with the post. Can someone help me out?below is the code I have so far. $url="www.somesitethatneedspostvariables.com"; $postdata = http_build_query( array( 'postvarname1' ='value1', 'postvarname2' ='value2' ) ); $opts = array('http' => array( 'method' ='POST', 'header' ='Content-type: application/x-www-form- urlencoded', 'content' =$postdata ) ); $context = stream_context_create($opts); $file = @fopen($url, "r", $content) or die("Connection Error, Please contact Webmaster ERROR CODE=0xDEADBEEF");
Get Unknown Number Of Variables From POST Or GET.
I am trying to create a page that redirects users to an advertiser's page. The reason for the redirect is statistics about who clicks where. The situation is simple when I only need to redirect them to a page, but some of the ads on my site include forms which put data in either POST or GET and I need to know how to allow my redirect page to take that data from POST or GET, whatever that data is, and pass it on to the page that the data were intended for. I think that once I get the data I can simply create a hidden form, on the redirect page, with the data from POST or GET already in it. However, I don't know how to get an arbitrary number of variables from POST or GET.
Search - Pass Variables Or Self Post
I've created a database of documents that is searchable by a variety of fields. Currently I have a PHP page called search.php with a form to get the keywords from the user and it then passes this back to itself, runs a query and displays the results. Doing it this way the address for the search page and the results of the search is the same. This all works fine and I'm happy with it but I was wondering if it should be implemented differently where the keywords are used as a part of the address like with search engines with Google. I don't know what the advantages or disadvantages is for either method so I'm keen to hear what others think is the best method.
How To Loop Through POST Variables And Contents
I am looking for a standard way/function to loop through all POST variables and their respective contents to update a database record. Here's my ideal to pass a function and it update: session variable - "ID" - that holds the record ID to update $_POST or $HTTP_POST_VARS The function would update the $_POST vaiables of the ID record with the $_POST variable's contents.
Get/Post Variables Not Showing Under Windows
I'm quite rusty with PHP and have a little issue. A script transmit parameters to itself through a simple form. It works fine when I run it on aproduction server (Linux+Apache+PHP4). When I run the same script on my development machine (Win2K+Apache2+PHP5) the submited variables don't show. Here's some simplified code: <HTML> <BODY> <?php print_r ($_SERVER); print_r ($submit); switch ($submit) { // ... } ?> <FORM METHOD=Get>Display content of:<BR> <INPUT TYPE=submit NAME=submit VALUE=APACD1> <INPUT TYPE=submit NAME=submit VALUE=APACD2> // ... </FORM> </BODY> </HTML>
PHP Not Populating Form Variables Passed Through POST Or GET
I"m running: Windows Xp SP2 Apache2 PHP5 MySQL4 Everything seems fine and dandy, and I can do scripting on server side, but for some reason I cannot get data from a form to be put into a variable. I have a simple form in an html page which submits, and in the php script that handles the input, none of the data in the form is going into the variables. My php.ini file does have all the GPC's in place(ie variable_order, the way they get processed).
How To Process Some Variables, Then Place Them Into POST And Redirect?
I'd like to do the following in PHP. Is there a way? Someone submits a form with data. I want to process the data, then once I'm done with it, take two of the variables, make them post variables and basically redirect the browser as if the user pressed the submit button with data filled in. The variables can't appear in the url.
How Do You Parse Post Variables To A Popup Window?
I know this isnt really a php question but can anyone tell me how you parse post variables to a popup window, here's my code so far, im trying to pass the value entered into a radio button: <head> <script language="JavaScript" type="text/JavaScript"> var win= null; function NewWindow(mypage,myname,w,h,scroll) { var winl = (screen.width-w)/2; var wint = (screen.height-h)/2; var settings ='height='+h+',' settings +='width='+w+',' settings +='top='+wint+',' settings +='left='+winl+',' settings +='scrollbars='+scroll+',' settings +='resizable=yes' win=window.open(mypage,myname,settings); if(parseInt(navigator.appVersion) >= 4){win.window.focus();} } <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); //--> </script> </head> <body> <form name="answer" action="result.php" method="post"> <input type="radio" name="group1" value="Milk"> Milk<br> <input type="radio" name="group1" value="Butter"> Butter<br> <input type="radio" name="group1" value="Cheese"> Cheese<br> <input type="submit" name="submit" value="submit" src="result.php" onClick="NewWindow(this.src,'name',âÆ',âÆ','yes');retur n false" > </form> </body>
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?
Forward To Page Alongwith Variables In POST
How to forward a page to another page alongwith the parameters passed into it I mean I have page a.php which is called with some parameters in $_POST and I require to pass these to another page with same variables in $_POST
Catching Xml Response
i really dont know how to ask it right, but i have this code: //-----------------// $xml= '<xml .. .. .. .. <enddoc>' $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://mydestination.com'); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, $xml); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec ($ch); // display the result var_dump($response); curl_close ($ch); //---------------------// this code is working well. upon running the code it will give an xml reply, however on the page it looks somethng like this: string(426) " xxxx.... .. Email already exist, 1 " on the page if your going to right click and view source, you will see a well structured xml: string(426) "<?xml version="1.0" encoding="UTF-8"?> <myxml> .. .. .. </myxml>" my issue is how to get the value of one of the element from this xml? next, i want the response not to be displayed right away on the page as raw string..i need to trap it and display that on a more fine manner.
SimpleXML Catching 404
I'm building a script with the last.fm datafeeds. When a incorrect username is given to the script, the last fm site throws a 404, and results in this PHP error: Warning: simplexml_load_file(http://ws.audioscrobbler.com/1.0/user/RichardJohn/tasteometer.xml?with=) [function.simplexml-load-file]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in /home/richardm/public_html/lastfmcompatibility.php on line 12 Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://ws.audioscrobbler.com/1.0/user/RichardJohn/tasteometer.xml?with=" in /home/richardm/public_html/lastfmcompatibility.php on line 12 There was a problem loading the data feed. Is there a way to catch this error and just present a friendly error?
Catching Errors?
I am having trouble wrapping my head around the general concept of catching errors. I have read the tutorials about exceptions on DevShed, as well as on Zend's website. It is still not clear to me. If I throw 5 exceptions, how come I need 5 catch phrases, and what does it mean when it travels up the stack? Sorry I am just really confused with the catch phrases and how they work, although I am almost positive I completely understand the throwing of exception concept.
Passing Variables In Frame Page By Post Method
Is it possible to send variables by post method through a submit button to a frames page, and have all 3 pages in the frame pick up the variable using the $_request[var] ?In other words, I click on a submit button. in form action method call index.php the index page has a top, main, and a left frame.how do i get each one of those to receive the variable, when i can only sendit to one page? or is it possible to send it to more than one page, but only action to one page?
Problems With Error Checking / Control Of POST Variables
I have a small form that on button press submits to a PHP file for further processing into a database. I have to change the script as it allows blank / nothing to be submitted to the database. The intention is that if any of the two form fields are blank (empty) then the page is resent stating that they have to fill in all the fields to post (to a database). If I deliberately leave the fields blank and submit the form, querying the database shows that both fields are zero / null - so nothing was entered in to the database. However, if I use an echo command to see what is going on (before the data is entered into a database) I get the $TheName field with a "1" and the $TheComment field with an unknown entry (it doesn't echo anything to the screen - but it's not empty). The code I've used to test this is: $TheName = $_POST[gbName]; $TheComment = $_POST[gbComment]; if (($TheName = NULL) or ($TheComment = NULL)) { echo 'Quick error check running:<BR>' echo "Name: $TheName<BR>"; echo "Comment: $TheComment"; exit; } This does NOT execute as these fields are not empty. It only runs if I change to: if (($TheName = !NULL) or ($TheComment = !NULL)) Which is pointless as it will always execute with genuine entries. Using the amended code below: if (($TheName = !NULL) or ($TheComment = !NULL)) { echo 'Quick error check running:<BR>' } echo "Name: $TheName<BR>"; echo "Comment: $TheComment"; I get the result that both the echoed lines are displayed as blank (no "1").
Catching Special Characters
I'm have trouble detecting and replacing special characters (specifically Czech-language characters ie š etc) in my php script. What I want the script to do is this: take in a string (posted from a prior form) run through a switch statement that checks each character to see if they are a "special" character, and if so replace it with their html equivalent. So far I have most of them working (specifically AEIOUY with the "acute" accent, both upper case and lower case), but when it comes to the Czech-specific characters above it doesn't detect them. I've tried every notation I can think of, including "x10D" and chr(268) (for the č letter) and nothing seems to work. The string input is a copy/paste from a Word document that already has the special letters encoded (ie I can see them normally in the text box window in my form) into the text box and then posted to my script. I've looked on the php.net manual and didn't find anything of help, and I did look at both the utf8_encode and utf8_decode pages. Though on the utf8_decode page it shows that the character "xc4xb0" is the character 0x130 and can be displayed as "&x#130;" but I don't understand the double "x" encoding ("xc4xb0").
Catching The 'Back' Button
I'm wondering if there's a way to catch when the user clicks the 'Back' button from a specific page. When this happens, I need to run a system call that deletes everything in a session-specific directory. The systems call would look something like this: system('rm -r /home/websites/genework/html/DATA/'.$Sess_ID.'/*'); So, the only thing left is the snag involving the catch of the 'Back' button. Javascript has a way to catch this action (window.onbeforeunload), but the tap-dancing that would be required to get PHP to activate the system call is extremely ugly and I'm not even sure it'd work.
PHP:Unable To Post Variables From Html Form To Mysql Database
Plz dont treat this as another newbie query , i did my homework but still getting nowhere :( :( :( Trying to learn PHP on Fedora core 1 (PHP 4.3,MySQL,HTTPD).Unable to post data from html form to php file(connecting to mysql database and inserting into a table) . This seemingly simple problem is making me go mad !!! I googled extensively and already tried the following I enabled " register_globals = On " .... in /etc/php.ini and also took used _$POST syntax. wot could be the problem .... is it the case that /etc/php.ini file is not being read .... how do i know whether this is the default location for php.ini? Where can i find the PHPRC environment variable (the variable responsible for the php.ini default location) Is the problem something else .....? Following is the code ... form.html --------- <HTML> <HEAD> <TITLE> email entry form </TITLE> </HEAD> <BODY> <P>plz fil the form </P> <FORM METHOD="POST" ACTON="form-handler.php"> NAME: <BR> <INPUT TYPE=TEXT NAME="givename" SIZE=25> <BR> AGE: <br> <INPUT TYPE=TEXT NAME="givenaddress" SIZE=25> <BR> <INPUT TYPE=SUBMIT> </FORM> </BODY> </HTML> form-handler.php ----------------- <HTML> <HEAD> <TITLE> EMAIL FORM HANDLER </TITLE> </HEAD> <BODY> <? mysql_connect("localhost","root") or die("Failure on db connection"); mysql_select_db("mydb");
Catching NULL Values Returned To Mysql_fetch_array()
Does anyone know how I can catch a null value that is passed to a reference to mysql_fetch_array? For example, I have the following code (i use classes intensively, so forgive me if the code appears complicated): print ( $this->_db->row[ "date" ] ); I get the following warning: PHP Warning: Undefined index: date in c:inetpubincludephplibBulletinBoard.php on line 193 I KNOW that this is because the value in the date field is null. I want to be able to catch this and control the output if it's null. Does anyone know of a PHP specific function (or even a mySQL function) that will help me do this?
Improve String Catching Of Html Page
I scripted a prog that extract a string from an html page excluding all the tags. The problem is that it works quite slowly and I wanted to know if somebody of us as an idea how to improve his performance. CODE $start="start_str"; //begin string $end="end_str"; //end string if($snoopy->fetch("http://www.informative.page.com";)) //get the html code { $string=$snoopy->results; //assign to $string all the html string - Hide quoted text - $i=1; $line = explode(" ", $string); //trim the html in lines while ($i<300) { //take only the middle if ($i>230) { //explode the line to control the content $piece = explode(" ", $line[$i]); $k=0; while ($k<200) { //if it content the string that i'm searching... :) if ($piece[$k] == "interesting_part") { $word=preg_split("/[s<>]+/", $line[$i]); //to eliminate html tags $j=1; $flag=0; //to say when print the word //extract the string without html while ($word[$j]) { if ($word[$j] == $begin) $flag = 1; if ($word[$j] == $stop) $flag = 0; if ($flag) echo "$word[$j] "; $j++; } } $k++; } } $i++; } }
Catching "File Name Too Long" Errors
Is there a way to redirect on "file name too long" errors? I'm using mod_rewrite to handle all unknown urls with an error page. That's not working for this error. Apparently the "file name too long" error occurs before mod_rewrite is invoked. Setting up an ErrorDocument is also ignored, even though it looks to the user (and listed in access.log) as a 403 error, it's not a normal 403 error.
Post And Redirect With Post Data
The solution we have though up is the following: 1. The user fills in data in a form and hits submit - This submits (POST) to another page (redirect.php) 2. redirect.php adds more POST data to POST and then submits all this POST data to another page (offsite [payment portal]) The reason why we have to do this is for someone who knows our to read html source code, could easily find the sucessful page which will then do the processing we need to do on our side. Which means freebeis.
PHP Post, Then HTML Post?
Using PHP, I want to POST or GET some variables to a second php page. This, I already know how to do. However, on the second php page, I want to use a simple, standard HTML form using the standard form-submitting method such as: <form action="https://orderpage.ic3.com/hop/orderform.jsp" method="post"> whereupon both sets of variables --- the earlier variables that were POSTed or GETted to the second page, along with the standard form variables derived within the second page --- will be POSTed to the above URL. In the second page, might I actually translate the received variables into actual HTML code? For instance, if my first page POSTed the variable xyz to the second page, then might the following code on the second page receive that variable and then include it when the second page's "Submit" button is pressed? <? $xyz=$_POST['xyz']; ?> <INPUT TYPE="HIDDEN" NAME="xyz" value="<?=$_POST['xyz']?>" > Or how, otherwise, might this be done?
Same Named Variables.. Or Addressing Variables In A Loop
I'm just starting to program in PHP.. fairly new to programming in general... and I've run across a (probably simple) programming problem I hope someone can help me with. I'm sending variable names through an HTTP get that are generated through a foreach loop. The names are along the lines of name1=, begin1=, end1=, name2=, begin2=, end2=.. etc. The number is the number of the current cycle through the loop. My problem is addressing the variables on the next page... namely how do I evaluate those variables in a loop? I want the value of name1.. but obviously for (i=1; i<3; i++) { echo "$name$i"; }; is not working. Is there an easy way to do this?
Passing Variables & Dummy Variables
Hi! thanks for all the previous help - I've made some progress & have dropdowns and a checkbox; however I have 2 probs which I can't figure out: grateful for any further help. THANKS! 1. Not sure how to code so that user can query from just 1 or all of the dropdowns (at the moment unless they select the correct answers from each dropdown - no results!) = defeats the whole purpose of searching. By selecting from menu options user selects from 2 diff tables. [the page allows user to search catalogue by selecting year of release, artist, music type - results from 2 tables need to be selected & sent to mysql. I just don't know how to code it so that user must make an initial selection to get any results, and whichever menu options they choose "add them together" if you like to make a complete query.... sorry my coding just isnt deep enough! A friend suggested using a dummy variable but as I'm a bit out of my depth; I need to get some help! The coding I've done so far;
Passing Variables And Session Variables
I'm currently working on a shopping cart script that works just fine with register_globals turned on but when turned off i get all kind of errors. The following page displays a detail of the book with the "Add to cart" link at the bottom. PHP Code:
Passing My Variables With Forms Variables
how to carry variables onto the next page along with the forms variables. I need to carry my own over too, but when I press submit on the form page only the forms variables carry over, not my own ?? I have two drop down menues on my form that provide two values "start & end" which I require to go with my own variables.I have tried "a href=" link which carries my variables but not the forms variables. <?php echo"<form method=get action=somepage.php?one=$one&two=$two&three=$three&four=$four>";?> also tried <a href=somepage.php?one=$one&two=$two&three=$three&four=$four&start=$start&end=$end
Persistant Variables - Application Variables
In the books I have read about PHP I haven't been able to find any descriptions of how to set variables that persist in the servers memory, in the way that Application variables persist in Cold Fusion. In CF, if I set an application variable then any of the application pages that are run will have access to those variables. And you can put complex arrays of data in the Application Variables and then access these variables at any time, without having to reload those variables for each page when it loads. I expect you can do this is PHP, but I can't find any info about how to do this.
Variables That Change Session Variables
I'm currently writing a mulit-page form app that uses a session to retain data from each form element in order for the user to jump between pages, then the final data is passed to a calculation script. However, I've noticed that if I assign a session variable to another variable, which then performs a mathematical calculation, the session variable changes. i.e. $_SESSION["inflation"] = 4; $temp_inf = $_SESSION["inflation"]; if ($_SESSION["inflation"] =="RPI") { $inflation = $rpi;} else {$inflation = ($temp_inf/100.0);} now it equals = 0.04 How can I take a value from a session and perform operations on it without altering the original session value.
|