Capturing $_REQUEST And Reusing It Later
I'm working on an authentication system in which it's possible that a user
might be requested to log-in as a result of submitting a form if the
inactivity timeout is exceeded. In order that they don't lose the
information in the form I would like to capture this information ($_RESULT),
serialise it and store it in their session. After they've successfully
logged in I would like to retrieve this information and put it back in
$_RESULT so the user can carry on with what they were doing. Is $_RESULT
meant to be writable in this wayand is there any reason why this isn't a
good idea?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Reusing An Object For Common Select To Database
I've noticed that after I finished this app, I had repeated a similar task over and over and would like to modularize it. The repeated task was connecting to the database, executing a select, putting all the results of the columns into different variables of an object. PHP Code:
$_REQUEST
I have this code: <? if ($_REQUEST['p']){ include("incs/files.inc.php"); } else { echo "We are still in developement"; } Now as of now, if someone types in index.php?p=asd It will not find it, and it will go blank, is there a way I can set a default so if someone does go to asd, it shows the default page?
$_REQUEST Problem
This line of code make an "Undefined index" error on my PC, however it is okay on my friend's PC.Anyone has this experience?
$_GET Vs. $_REQUEST
Can anyone give me a good example of the difference between $_GET and $_REQUEST. I've read the manual and tested them both. They seem to do the same thing accept $_REQUEST works with forms. Any other difference? Which is preferred?
Strval $_REQUEST
I have seen some code like $value = strval($REQUEST['value']); I would like to know what is the use of strval here since $_REQUEST values are strings?
$_POST Is Different From $_REQUEST
Has anyone ever had a PHP script that had different values in the $_POST array than in the $_REQUEST array? Take a look at the values below and you will see that data sent through a method="POST" form became different for both arrays. Code:
Reason To Not Use $_REQUEST Superglobal?
I have rarely, if ever, seen people using the $_REQUEST superglobal in favor of $_POST, $_COOKIE, or $_GET. I have a few instances where a variable may be given through the URL (get) or through a form (post). Seems like a situation to use $_REQUEST. Is this a security risk?
$_REQUEST Vs $_POST And $_GET
I noticed that answers to most incoming variables questions still suggest using $_POST and $_GET array variables. Am I the only one using $_REQUEST? I personally like it because it uses the parsing order in php.ini and still leaves me the option to use the old variables.
$_REQUEST With Force Download
Im using this code forom the code snipits bit of the forum, but cant work out how to enter the file name? I tried$file = $_REQUEST['/var/www/html/file.mp3'] but it gave me the error: QuoteNotice: Undefined index: /var/www/vhosts/qrecords.co.uk/httpdocs/PumpUpThePirates.mp3 in /var/www/html/file.mp3 on line 2 Code:
Extract $_REQUEST Explain
I understand extract breaks apart an array and sets variables, but how do I know what variables are inside of the $_REQUEST Array? extract($_REQUEST);
& Symbol Can Not Be Accessed Thru $_REQUEST
I have one page which shows some book category name which is hyperlinked. If click on it, I need to display all the books in that particular category. If the category name contains a "&" symbol which can not be accessed through $_REQUEST array.
Switch($_REQUEST['language'])
I am doing a webpage with two different languages. So I have a folder 'english' with all the files and a folder 'deutsch' with the same files called the same names. In the english navigation I have a button where I can choos the same page but in german. And I know there is a way to switch the root folder but still link to the same file..... I dont know if you understand what I mean but I found some kind of code, but just dont know how to get it to work. Code:
Dynamic Form And $_REQUEST
My current project needs to run on both windows and linux. I figured out that windows needs $_REQUEST to read the form elements. This worked well until parsing a dynamically built form with checkboxes named: cb0, cb1, cb2, etc. I can't figure out how I can use $_REQUEST to read the form elements, when I try $_REQUEST[$i] for example all values of the array elements are 'cc'. No idea where this comes from as cc is never used as a value?
Is There A Security Risk Using The $_REQUEST Vars?
I am trying to convert some scripts to not depend on register_globals being turned on. These scripts receive both GET and POST requests and this seems like the easiest way to do it. Are there any issues with using the $_REQUEST array.
Newbie: Can't Get $_GET Or $_REQUEST To Work
I just started learning PHP and I can't figure out why all of the following var_dump statements are returning NULL when I submit data via the INPUT field. I can see that the variable 'value' is being passed in the url (my address bar says "test.php?value=blah) but the four var_dump statements print "NULL NULL NULL NULL". test.php: <html> <head> <title> Hello World! </title> </head> <body> <form action="test.php"> <input name="value" ></input> <input type="submit"></input> </form> <?php var_dump ($_REQUEST); var_dump ($_REQUEST['value']); var_dump ($_GET); var_dump ($_GET['value']); ?> </body> </html>
Capturing URL
I have a form that composes and sends me an e-mail. Within the message, I would like to dynamicaly include the URL which the form was completed in. It needs to be dynamic because I want to use this form on many different pages.
Capturing The Entire URL
Been playing around with capturing the entire URL. I dont have any problems if it a file, i.e. http://www.mydomain.com/somefile.php, I am running into problems with this, http://www.mydomain.com/test This is what I use for "redirection" now (btw, it is IIS (Win2k) and PHP 4.3.2) The test.mydomain.com is setup as a host header under IIS $redirect = getenv("HTTP_HOST"); if ($redirect=="test.mydomain.com"){ header("Location:http://www.mydomain.com/modules.php?name=test"); } The above code works fine. Redirects no problem. However, I am trying to get this to do the same thing: www.mydomain.com/test or www.mydomain.com/test/ and both would take you here: http://www.mydomain.com/modules.php?name=test I have tried every combination of the SERVER vars, but no luck. I either generate a 404 or the test isn't part of the URL.
Getting Arguments From A Shellscript Into $_REQUEST When Faking Callfrom A Web Server
My knowledge of php is regrettably poor but I need to call a third-party php script from within a bash cgi script (don't ask why, it's a long story). Now normally (with eg perl-cgi) to do this I need to set QUERY_STRING and REQUEST_METHOD appropriately; however with php this doesn't work, the $_REQUEST array is empty. $ export QUERY_STRING='test=1&wibble=2'export REQUEST_METHOD=GET;php -n -r 'print_r($_REQUEST);' Array ( ) $ What do I need to set in order for the _REQUEST variable to be populated correctly?
Isset($_REQUEST['var']) Works Fine On One Server But Not On Another
The isset($_REQUEST['var']) works okay on other servers but not on mine. The way the application works is the links are provided as: http://url.com/cc.php?page=currencies&new And then in cc.php the code is if isset($_REQUEST['new']) { ... } The problem is with the above code it sees new as not set and the if statement isn't exectuted. The same code on other servers works OK. If I change the url to: http://url.com/cc.php?page=currencies&new= or http://url.com/cc.php?page=currencies&new=something Then the isset($_REQUEST['new']) will be true. Is there any setting in my php config to make php see 'new' variable as set as I've shown in the first url in this message?
Capturing Input From A Form
I currently have a search form on my website. When you type something in, it redirects you to a page that displays the results. I would also like the users searches to get input into an access database at the same time. How would I do this?
Capturing Data From A Radiobox
I am a beginner to web design. I want to create a personality test for my site. Here is what I want ... I want my test to ask 4 pages worth of questions. I want some questions to be weighted more heavily than others I created some questions using HTML forms and radio boxes. How can I capture which option was selected?
Capturing Data From Another Php File
I'm trying to capture data that is created by launching a php file, for example the last 10 posts in a message forum. If last10.php is called directly in your browser you'll see hyperlinks to the last 10 posts. This file is located in /home/mydomain/last10.php . Now I'm trying to capture that data in a template in a CMS I'm using where you can launch php scripts. I'm just unsure how one can "run" last10.php and capture the stream into a variable and then include that variable to be outputted in another template. As long as I capture the stream, that variable can simply be placed in another template so I'm not so concerned about that. Now I'm familiar with includes and requires, but this doesn't really "launch" the file, it only includes the items so that you can use the variables from my understanding. The problem is that I need the whole stream from the last10.php to be captured into one variable that will then print out this html that was output. Learning this stuff is truly amazing... I hope to quit my day job. :)
Capturing Form Input
I will try to be short and to the point.(good Luck) I have a form written in HTML. I have a Mysql database. I am using a linux server and I would like to use php to write the following code: After the user inputs their name, address, email, phone, etc. in my html form. They will hit the submit button. I need for the information they entered to go into my database. I have looked now for about 12 hours and haven't been able to find an answer. I know I must be missing something since I've been to the w3 site, codewalkers, phpfreaks,php.net(?), and many more. If there is an easier way of doing this I would love to hear it. If somene could point me in the right direction I could stop banging my head and pulling my hair.
Capturing Substrings With Preg_match_all()
I'm experiencing a problem when trying to capture substrings with preg_match_all() from strings like "set('Hello','World')" using the following Regular Expression (PERL syntax): "/^set((?:'([^']+)'(?(?!)),))+)$/" The resulting matches array looks like this: Array ( [0] =Array ( [0] =set('Hello','World') ) [1] =Array ( [0] =World ) ) I wonder why "Hello" is not in the matches array. Did I do something wrong in my Regular Expression?
Capturing Windows Login Name
I know it is not possible to get Windows login name using PHP because it is a server-side script, but I dunno whether anyone has tried using JavaScript in conjuction with PHP to capture the login name and save it as a php variable. Here is the JScript I used to capture the windows login name:
Capturing The End Of A URL? Session Variable?...
I have a system where users log in, and then they can see a list of documents. There are 15 document names listed at a time, with "next"/"prev" buttons to navigate to the next/prev set of 15 document names. When they find the one that they want to edit, they click the "EDIT" link next to the document name, and it takes them to the fields to edit. All of this works just fine... When they've submitted their edits (or if they click a "Go Back" link on that update page), it takes them back to the default "documentList.php" page. I want to know if there is a way to (when they click the "EDIT" link on the document list page, maybe?) to capture all of the stuff after "documentList.php" in the URL (starting with the "?"). That way, instead of having them always go back to the first set of 15 records, I can have the "Go Back" link send them back to the last set of 15 records that they were viewing (that would have the record that they last clicked to edit)... If there's a different way from what I described above to approach my same end-result that I want, I'm open to that suggestion as well.
Capturing/using Results Of Query
I would like to display/capture/use the URL's that are displayed on a web page after making a query to a forum. What do I mean? I am part of a forum that uses vBulletin. One option is to display the forum topics that have had posts that day, i.e. active topics. Essentially, when you click on the link: http://www.somedomain.com/forum/search.php?do=getdaily the resultant page has a list of the active topics, highlighted as links. What i would like to do is capture/access that resultant page and use regular expressions to grab the URLs. I can do the RegEx but I cannot seem to capture that resultant page.
Capturing An Image Produced On The Fly
I have a script running on Server1 that creates an image, saves it, then loads it and sends it to the browser, then deletes the image from disk.....Server2 needs to have access to that image, and have the ability to manipulate the image. Server1's address would look something similar to http://128.23.23.23/file.php?name=picname Now what I need to do is access that image from Server2, and save it as a jpg. Code:
Capturing Data After Question Mark
On the first page I have: <a href="jobs4.php?id=$myrow[0]"> So on the next page I'd get: 'jobs4.php?id=1' On the next page how do I select from the database where id= the id that was passed through (in this case 1)?
Capturing Output Of Another Script As A String
I have a client who has decided to output the OO PHP/mySQL site I have made for them onto a cd. I realize that $html = include('somefile.php'); gets 1 for success as its return value. In what manner can I access my files so what would be output to the browser from 'someFile.php?id=1213' gets into $someVar as a string so I can write it to a static file for the CD?
Capturing User Leaving Site
What I was thinking is checking to see how much time has elapsed for a visitor session with no activity and if too much has passed (say 5 mins) then use that as a end of session time.
Capturing File Modification Times
I was just wondering if it was possible to capture a file's modification time before it is uploaded through a from post. For instance, I know you can get the name & type of file's orignal values as the file is being uploaded but is it possible to get the mod date?
Capturing Results Of A Form Submission
Is it possible, in PHP, to capture the resulting HTML of a submitted form returning from a server and incorporate that HTML into say a table, or some predefined layout? I am trying to incorporate the resulting HTML into a layout I have created in order to keep the look & feel of my site consistent, but the resulting page is a plain "cheesy" page.
Capturing Output From GPG Command In Shell...
I have finally sorted out that it was permissions that were preventing me from running the gpg commands I was trying to run and I can now run them. The problem is that I am having real trouble capturing the output from the commands I am running. Just to be clear; $output = shell_exec("ls -l"); echo $output; does echo to the browser what one would expect ( a long string containing the results of the command). Unfortunately, when I run this command: $output = shell_exec("/usr/local/bin/gpg --homedir /usr/home/manager/.gnupg -b test.xml"); and then I echo $output I get nothing out of the variable - I'm stumped. The command does work - I have run it on the server from the command line and it does sign the document by creating a detached signature (as I want it to do). Am I missing something?
Capturing User Login Information Of Windows
I want develop the intranet site with seamless authentication. Is there any way to capture only the user name who has logged in the windows machine. Iam using PHP 5.0 MySQL and IIS Server. I have tried with $_SERVER['LOGON_USER'] but its returning nothing.
Problem With Preg_match With Capturing And Back-reference
I'm trying to detect and extract a quoted portion of a string. The quote chars may be the usual quote, the "single" quote (apostrophe) or the back-tick quote. For example: $vl = "My O'Name"; if (preg_match ( '/(["'`])([^1]*)/' ) , $vl , $x ) { // found it } The first parenthesized expression will capture the leading quote (whatever it is). The second *SHOULD* capture everything up to, but not including, the matching trailing quote. What I get is $x[1] contains the quote (as expected), but $x[2] is everything up to AND INCLUDING the trailing quote.
Capturing PERL Script Output Into PHP Variable
This must be easy, but I'm missing something... I want to execute a Perl script, and capture ALL its output into a PHP variable. Here are my 2 files: ------------------------------------- test3.pl ------------------------------------- print "PERL Hello from Perl! (plain print)<br> "; print STDERR "PERL This is text sent to STDERR<br> "; $output="PERL Some output:<br> "; for ($i=0; $i<5; $i++) { print STDOUT "PERL $i: This is text sent to STDOUT<br> "; $output .= "PERL line $i of output---<br> "; } print $output; exit; ------------------------------------- passthru3.php ------------------------------------- <? $command = "/usr/local/bin/perl"; $pgm = "test3.pl"; print "PHP: Before passthru, in PHP...<br> "; $result=passthru("$command $pgm your_variable"); print "PHP: After passthru, result=($result)<br> "; ?> ------------------------------------- OUTPUT: ------------------------------------- PHP: Before passthru, in PHP... PERL Hello from Perl! (plain print) PERL 0: This is text sent to STDOUT PERL 1: This is text sent to STDOUT PERL 2: This is text sent to STDOUT PERL 3: This is text sent to STDOUT PERL 4: This is text sent to STDOUT PERL Some output: PERL line 0 of output--- PERL line 1 of output--- PERL line 2 of output--- PERL line 3 of output--- PERL line 4 of output--- PHP: After passthru, result=()
Capturing Print Output Of Function To Variable
I have a function, say: function printTable($Variables) { ?> <table> <tr><td>Your name is</td></tr> <tr><td> <?php print $Name; print "</td></tr></table>"; } (Obviously not my exact function, but a simple one to demonstrate my needs... The function I have inherited is much bigger with much mixed php and html like the example) It is currently used to print the same data table on many pages. I have been asked to have the system send this data table by email, so what I want to do is run the function, but send the output of the function to a variable, in the same way that print_r($arr,1) will return the output instead of printing it.
Capturing Chinese/Korean Characters In A Form?
I am new to PHP and have been asked to create an HTMl form that captures data onto a text file. I have that working fine. I now need to capture Chinese/Korean characters from this same form and onto a text file. How do I do this? Is it possible to have one form that can capture US Alphabet and Chinese/Korean characters?
Capturing Redirect URLs And Final Landing URL Using Snoopy Or CURL
I'm trying to capture redirect urls and the final landing url when I read a page through snoopy or cURL. So for example if i read http://www.example.com (1) which redirects to http*://www.example.com (2) and which inturn redirects to http*://www.example.com (3), I wana be able to capture all the URLs in the middle and the final landing url.
|