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?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Sending HTTP Post
I'm writing a PHP script to wrap a CGI script that uses HTTP POST get its user input. If the CGI used GET, it would be easy, just do a PHP Code:
Sending POST To Refresh
I have a form which collects information that a user submits. There is a MTA page just after the form, which obviously sends the information. Can I....? Take the information from that MTA page, and send to another MTA page that sends another email based on the $_POST variables using a meta refresh? Why am I doing it this way? I'm still not very good at getting a form and control script all in one page, so thats why i do it this way.
Sending Post Variable
I have a script with a form <form action="a.php" ... method="post"> <input name="field" ...> </form> a.php gets the variable with $a = $_POST['field']; How can I send $a to another script via POST? I have another script that needs some fields using POST. 1) The user sends a form to a.php 2) a.php adds some fields and sends all to another script using POST. With GET I would get header('Location: b.php?k=h&newfield=' . $a);
Sending Form POST Data To SSL
I've seen posts on here before about this, but I could never figure it out. I even downloaded the code that was posted and tried to pick it apart to get it to do just what I need, but never succeeded. What what I understand it deals with using Sockets and sending the header information. Maybe that's where my lack of knowledge lies. For a regular post it should be sent to port 80, and for SSL 443 right? How do you go about forming the header of the data? I've never seen that kind of thing, and I'm guessing that's where I'm goofing up. I'm trying to set up a test: index.php posts data to test1.php and then displays the results. $var1 = 'test' then test1.php would do something very basic like drop it into a line of text. "This is a <? echo"$_POST['var1']";?> of the gotspy broadcast system." So I would assume if everything worked right, going to index.php should return: "This is a test of the gotspy broadcast system."?? Yes, no?
Sending Http Post Requests
I'm trying to send an http post request and see if the server got it correctly. I'm sending the http post request with this script: <? $address = 'domain.tld' $port = 80; $proxy = fsockopen("tcp://$address", (int) $port, $errno, $errstr, 1); $extra = "extra=blah&this=test"; fputs($proxy,"POST /test.php HTTP/1.0"); fputs($proxy,"Host: $address"); fputs($proxy,"Content-Length: ".strlen($extra).""); fputs($proxy,"$extra"); while (!feof($proxy)) print fgets($proxy); fclose($proxy); ?> test.php's contents are as follows: <? print_r($_POST); ?> this is what i want to see: Array ( [extra] => blah [this] => test ) this is what i am seeing: Array ( )
Sending POST Withought A Form
Im looking for a way to send data to a page as POST, but withought having to use a form. Eg GET is in the URL, but i want the URL to be withought all that data. Is it possible to send the POST this way, or isit only ann option with forms?
Sending/displaying POST Information Without Using Forms
What I need to do is build onto an existing login form, using POST forms. I would like to have to have to access the existing code, so what I ultimately have to do is write a PHP script that will spoof a form POST. I have found 2-3 different examples, however none of these will send the post, and then go to that page. All that these scripts do is send the post, and keep you on the existing page. The return from the form cannot be displayed in the page with the script on it because of licensing issues. So the script needs to send the POST information to that page, just as a regular form.
Fsockopen() Sending HTTP POST Header
I recently learned how to use fsockopen() to send a POST HTTP header and read the response, and I have done this successfully to get a rate zone table from the UPS Web site, having sent the origin ZIP code as one of the variables. I am now working on a completely separate project and trying to send a POST header to a test page on the server on which I am developing, and I have run into a snag. The fsockopen() function is connecting to the page specified in the POST header, but it doesn't appear to be receiving any of the variables. Code:
Sending A Multi-part POST Using Fsockopen
I have a php processor script that loops through an xml doc, extracts video data (names, file names...etc) and does a bunch of other stuff. Within this loop I need to have the script perform a "POST" basically emulating an HTML form but ofcourse in this case I do not want any HTML. I understand there are (mainly) 2 options to do this: fsockopen and curl. I would like to use fsockopen if possible, so I can get an http response code and hopefully analyze it when applicable. I have tried to do this using fsockopen for a little over a day now with no success. I've read various posts and tutorials, but with no success so far. I know I could be missing something simple or maybe complex, I do not know any more, I'm going crazy with this Can you please give me some guidance on how to send a POST using fsockopen for this situation: lets say I want to send 3 pieces of data: clipTitle='Funny Clip', clipDescr='this is some descr', clipCategory='humor' and I want to send (as if i'm uploading a file) file='1234.mpg' this file resides in the same dir as the script running this fsockopen.
Sending An Https Post Request Without A Form
I'd like to send a post request to an https server, but without using a form. Specifically, I want to send the contents of my internal shopping cart (stored in a session variable) to a paypal cart. I don't want to use a form, simply because I dont want to have to use hidden fields with all the pertinent data. I'd like to set up the post request, and execute it in the background without it being presented to the user, simply have the user redirected to the paypal site afterwards. basically, I have it set up to the point where I have the parameters stored in a variable, I just need to send that along to https://www.paypal.com/cgi-bin/webscr. I've tried a bit with fopen and such, but Im running apache on windows, and don't have SSL installed, and haven't really been able to find much information on doing that. What I want is just to have it do the same thing it would do if it was a form with a submit button.
Sending POST Urls From A Header(location);
I have a header location to redirect you.. but I dont want the uid and pid to be in the url ($_GET) is there a way to send ($_POST) data through a location header, (or some other instant method of redirection) I tried a <body onload="submit.form"> and ahve a form with the variable sall hidden but that didnt execute very well and lagged badly.
Sending File From Server As A Post Variable
I have a page that needs to be able to send a file to an existing form as a post request. The form is on another site so I can't change it, I have to be able to send a post request with a file attached. Any ideas how to do this?
Sending POST Data Without Submit Button Or Javascript.
say I have some data: $name = "Some Name" $email = "some@email.com" etc. I'd like to send these to a page as POST data, as if they were coming from a web form, but without having either a "submit" button or using Javascript's submit() function. Is there a way to do this?
Sending A Lot Of Data From Differnt Places Via Post Any Tips?
I'm trying to make a php game that has a map with movement on it, and i'm debating on how i want pass view changes between pages I really only have 4 views Map Battle Story Inventory Would it be safe to do it in Get instead of having to make each link its own form with a hidden type containing its command or should I make it in post so that way a person can't jump out of battle by changing the GET type, (I could code it so you can't do that, but Whats the point if its easier to make it more secure? The idea with get would not be a straight pass from GET it would be a switch so that would prevent any sort of hacker injection, but i think it only makes my life harder than doing it in post where the value can't be changed (i'm not worried about getting curled although i know it will happen)
Sending POST Data To A Remote Form When Cookies Are Involved.
there's this online service where you can fill a form to send SMS messages to cell phones. You know the drill. It's on a Brazilian site. I want to use it from my script, by "emulating" a form, and sending the POST data to their ASP script. Now, I'm having a hard time accomplishing this. I used a sniffer to see what Internet Explorer was feeding the script with (the complete request headers), and i tried emulating it first with Perl then with PHP, but their server returns a 302 - Object moved message, and doesn't send the SMS message. I'm not sure if the 302 warning is supposed to be there anyway (if you fill the form normally on their page, it will redirect to the default.asp page, so maybe the 302 message I'm getting is normal). On PHP, using sockets, I'm able to send POST data, for instance, using this: Code:
Sending Multiple Variables Via URL
Hi, to send a variable in the url, I would use this syntax: address.com?variable=data What syntax do I need to use to send several variables through using the URL address?
Fsockopen Sending Variables
I want to send 10 variables to a other server where i already got an recieve page my problem is how do i send the variables? Is it possible to do it by posting the variables? if i add it behind the (recall/comein2.php) part it fails PHP Code:
Sending Hidden $variables
How can I send a hidden variable via URL to another PHP file? eg. http://localhost/filename.php?name=forum&id=1 At the moment this url is showing up in the address bar of my browser. I don't want that to show in my browser address bar.
PHP.exe Interpreter And Sending Variables
Question, I am testing php scripts through the console app(php.exe) how can I send form variables to it? Or can I? Can I just fill in variables into _POST['val'] for example.
Sending Variables Through Link..
I've managed to send vars with links, but I have a problem with strings. I use this syntax after the original URL: ?var="STRING THAT I WANT TO SEND". When I try to print this string it prints: "STRING Does anyone know what I'm doing wrong?
Php Javascript And Sending Variables
Ive been trying for a while and nothing is working so i have this html <select> statement I have a submit button as well. As it is now, you select from the list, and hit the submit button, which sends the info that was selected as well as a hidden variable. Now what I really need, is to execute that submit button with an onchange of the select statement. But that would mean it would no long use the submit, therefore not execute the form action, therefore not sending the value of the selected. Is there a onchange(this.selected) to send to a javascript function which will execute a php header:location with the correct variables in the url to get in the next page? In short, I want you to click an option in the drop down and it takes you to the next page with that selected info.
Trouble Sending Variables To An SQL Query
I have a script that take a users input (rather chooses a few choises I've decided) and sends it to a mysql query. For some reason I get "Notice: Undefined variable: pass in D:KakeiaikotobaaikotobaADD.php on line 49" when I run it. (btw, this doesn't speak of line 49 in the code I've provided here... it's just the line where I tried to echo out one of the variables I'm trying to send.. obviosly, the variable is never set for some reason) This is how it looks: (I've cut away the HTML parts since those are pretty uninteresting I guess... just a a table in a <form> which sends the data to its own page. Why it do this you will see later) First I build my page with the pre-deffined choices and put them into drop down boxes, which looks like this (a bunch of them): PHP Code:
Sending Variables To An HTML Form
I have a form in an html file that sends to a PHP file for processing. The information is properly sent to the PHP file and it is processed and validated. What I want to be able to do is this: If there are errors in the form (found in the PHP validation), send the user back to the HTML form with the form still filled out with the information that the user had entered. I do not want the fields with errors sent back, just the good information. There are two seperate files, the html file and the PHP file.
Sending Mail With Variables In, Maybe Due To Slashes?
I'm using two pages, one with a form and the $email_content variable which (in the full version) can be edited by the site visitor, the other page to send an html email containing the $email_contact variable. Can anyone see the best way to do this in terms of using the appropriate functions? I'm using htmlentities on the first page and stripslashes but it's not working properly, I may be on the wrong track? I've experimented but either the email doesn't sent, or it excludes the variable, or it has slashes in the email which affect it visually. Code:
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;...
Sending Queries & Variables Across Included Files
I'm working on a template parsing engine of sorts. Basically the way it works is, depending on how a variable is set, a file is included. The file is an entire page containing HTML and PHP, starting at the <html> tag. What I had planned on doing was writing a query for that specific type page. For instance, on "index.php" I have my connection script, and on "include.php" I have the while($row = mysql_fetch_array($query)) loop to actually display what results the query got. Problem 1: Unless I write the query into a variable on include.php, I get an error. The error states that the query isn't a valid MySQL resource, but I know for certain it is, because if I write the exact same query on the included page with the exact same connection script, it works fine. Problem 2: For files that are included off of the included page (for example, I have an include on include.php that links "homeslice.php" to the page), I have to use the full path (http://mysite.com/ect/homeslice.php) rather than just the site path, (/ect/homeslice.php). My question: Is there a trick to getting these things to work the way I want them to, and if so, could someone please let me in on it?
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?
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.
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:
System() To Execute A Config-file And Sending Variables To Php
I've to read variables out of a config-file, that is stored on a Linux-machine. When I connect to the server with puTTY, I can execute the config with: .. /usr/local/webspace/config then I can echo the contained variables: echo $var1 everything works fine. Now I want to execute the config by a php-script. I try to open the file with the system() command: system('. /usr/local/webspace/config', $retval); I hoped to get the same variables now for doing some stuff with them in php. But there are no variables, but the $retval = 0
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 ?
|