Disregarding POST Data After It Is Used Once
I have written a pretty nice messageboard website in PHP, but it has one problem -- when a user posts a comment, it takes them back to the thread they were in and shows them the comment they just posted. However, if the user then hits their browser's "Refresh" or "Reload" button, the browser resends all the data that was in the comment form to the PHP script again, and reposts the data a second time.
Is there some way I can make this POST data disappear after it has been inserted into the MySQL database once? Or, perhaps a different solution would be to make a very small PHP script that only does one thing -- it takes in the comment data, inserts it into the database, then immediately forwards the user to the PHP script that actually draws the page... this way if the user hit the refresh button, it wouldn't be refreshing the page that the POST data was sent to.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Disregarding Case Sensitivity When Comparing Strings
I recently rewrote my a login script so that the possibility of an SQL injection is diminished. However, I now have a new issue that I have come across. Since I now compare the username in php rather than in a query, how can I make it so that it compares 2 strings regardless of case and returns true if they match?
Simulate Send Data With POST And Get Data From A Web Page (whith A Session)
I'd like to get text of a webpageB that I reach by putting a login and a password in a webpageA. I mean: I'd like to get text of a WebPageB with a php script. But before I can see WebPageB I have to autenticate myself in a WebPageA writing my login and my password in a form, the host recognise me and (by session) let me see the WebPageB. The question is: 1)how to simulate send data (login an password) in form with a PHP script? 2)how to navigate in a Web usin the same session?
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.
Post Data To A CGI
How in PHP do you send post data to a CGI and let the CGI carry on the request (what I'm doing is: a form is filled out a load of PHP to check that each option is correct and some other stuff then when its ready redirects off to a CGI but sending the form data with it (using a post rather than a get).
Raw POST Data
Is there a way to access the raw data sent to a PHP app via POST? I'm trying to read the XML sent by a Flash program with XML.send() and its sent via POST but not URL encoded. PHP is expecting URL encoding so it comes in like: $_POST['<?xml version'] = '"1.0"?>' Perl can read it just fine like so: read (STDIN, $rawpost, $ENV{'CONTENT_LENGTH'}); s/&/&/g;
POST Data
I am trying to build a checkout process for my site that goes from filling in ship and bill info to confirm order info. The problem I am having is that I want to be able to skip the first step if the client already has an account and has signed in. This would be easy except I am posting the data from step1 (ship/bill info) on my form like: <form action="<?php echo $_SERVER['PHP_SELF']; ?>?step=2" method="post" name="frmCheckout" id="frmCheckout" onSubmit="return checkShippingAndPaymentInfo();"> the onSubmit goes to a js function that will send the user back to step1 if data is missing. in my confirm.php I check to see if the steps are being served up correct like <?php if (!defined('WEB_ROOT') || !isset($_GET['step']) || (int)$_GET['step'] != 2 || $_SERVER['HTTP_REFERER'] != 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?step=1') { exit; } which works well for making sure that the user who is not logged in gives me all the required data - but also prohibits me from skipping step 1 I do set a session variable for ClientId - once logged in - so is there any way that I could add that to the condition so that I could skip step 1 ?? and how should I deal with the POST data normally retrieved from step1??
Post Data
im writing a small forum here, i have used a get to grab the button input to post a message, then it goes to a screen to post the data into mysql but im not sure the best way to deal with the post data once submitted: Code:
Post Data W/out Form
I want to post variables to a php script, but I do not want to use a form to do this... is there some sort of header I can use to redirect and post values to another page? Cookies and sessions are not an option, URL line ('get') variables can't hold large enough a string...
Read Raw Post-Data In PHP
I need to read the RAW DATA that is sent using a HTTP-Post Command in PHP. I cannot User $HTTP_POST_VARS since the Data is not associated with a particular variable.
Redirect With Post Data Using PHP
Normally I use javascript for doing this form1.submit() it works properly. it can redirect to another page with post data. But there is another problem. Some cheater Do Cheat with me. they click Stop Button on IE when it is submitted and they view the source. by this way they know my secure information what i need to supply to another page.. Any One know this solution using PHP? I know there is a solution for doing this Because some websites use php to do it like 2CheckOut and WorldPay. But I don`t know what the solution. Can Anybody Help me?
CGI (in PHP) Can't Read POST Data
I am trying to have a CGI script write text to a file based on input from a form. However my write.cgi's $_POST is empty. Whenever I use write.php for the action of the form $_POST has the correct data. The form uses POST method. I want to use write.cgi because only cgi scripts can write to files in my server (run by suexec) I have been researching this for two days now
Http POST Data
and I've been looking all day on the web for an answer to this question. I'm trying to send some binary data, a relatively large amount (~128K), to a PHP script from a wireless device that has TCP/IP sockets. So I'm sending all of my data manually (ie ,"POST http://www.blah.com/process.php HTTP/1.0 "). I am able to send regular form data such as "tireqty=3&oilqty=4&sparkqty=1&address=4204MainStreet "; To do this I have a header for the content type like so: "Content-Type: application/x-www-form-urlencoded ";" I have even encoded my data in base64 so that it is ready to send as ASCII. This data is broken into chunks where after each 76 characters there is a line break. I read that I needed to do that. But HOW do I send it? If I send it as form data, with variables, then it only receives the data up until the first line break. I tried changing the content type to "Content-Type: application/octet-stream ", thinking that I could just send the data without form variables, but then how do you access that from PHP? For example I tried sending the string "data=XXXYYY" where XXXYYY is my base64 encoded data, but it didn't work. I can't seem to find any good documentation about this. Which Content-Type shouldI be using? Can I use octet-streams and still have the data connected to php variables? It's very confusing.
Form Data Will Not Post
can anyone be so kind as to look at http://www.mysolution.ws/HYPOCRITE.php and let me know why it isn't passing the form data to http://www.mysolution.ws/insertHYPOCRITES.php for the most part, the scripts were created with http://phpcodegenie.sourceforge.net/
How To Return Data Using POST
I have a vendor sending me a text file using POST. I have a PHP program receiving the data that works. I need to in the same stream return an answer via POST. How do I send that POST in the same stream? A snip from the code for the output portion: $LINKOUT = implode('', file($LINKFILE . '.out')); $LOUT = array( 'http'=>array( 'method'=>"POST", 'header'=>"Content-type: application/x-www-form-urlencoded " . "Content-length: " . strlen("$LINKOUT"), 'content'=>"$LINKOUT" ) ); $context = stream_context_create($LOUT);
Faking Post Data
i've copied my bank's login form and saved a copy on my computer. However when i try to submit it, i get a 405 method not allowed error. Can't for the life of me figure out why, it's posting exactly the same data from exactly the same html code. Any ideas? It's a https (SSL) site.
Problem With POST Data
I have a script that will upload a file and store its information in a database based on POST data. The script will set a variable to either a success message or an error message, depending on whether the upload was successful or not. The message variable will then be outputted to the user. The problem here is that if a user successfully uploads a file and then clicks back or refresh in the browser, the "You are trying to view a page that contains POSTDATA" dialog will appear. If the user simply clicks OK on this dialog, the file will be re-uploaded and a duplicate of the submission's record will be created. The only way I know to avoid this dialog is by using the header() function to clear the POST data. However, if I use this function, not only will the POST data be cleared, but the variable containing the success message will also be cleared, and there will be no confirmation to the user that their submission was uploaded successfully.
Resending Post Data?
I have a page that loads a calendar via POST (It can't be done with GET so don't suggest that)after you update some bookings it processes via POST and I want to return it back to the calendar page, but the page is set to purposely not load if it doesn't know what Year, Month, and the Location it needs to be querying for. How can I reset this data, I thought of sending the user back in the browser, but I don't know how that would work as I can't envoke php going backwards.
POST Data In A Link..
Is it possible to to send POST data if you click a link? Such as, using a link to replace a submit button. A submit button usually has a value. (value=""). Could you do this in a link?
Refreshing & Post Data
Is there a good way to avoid the warning message that comes up when refreshing a page with post data? I've hard approaches here you use PHP to store the post data in GET variables and reload the page to itself, parse the form and proceed as normal, unsetting the GET variables before rendering the page. I guess this might work but probably not with files. Is there a more elegant solution?
AJAX & Post Data
Two part question: #1. I've built a little AJAX app, but the problem is anytime I do an update, I have to delete my temp files before I can see the update. Is there anyway around this? #2. Is there a way to know all the variables submitted to a form without knowing what the variables are before hand? For example, I have a form, where there are checkboxes. Each checkbox's name is an ID value from the database. When I submit the form, I need to know all the rows that were checked...
How To Clear POST Data?
I've looked everywhere and cannot find my answer. After a successful form submission it tells the admin it was successful but then I want the form to clear out. Because I do have it where the data is redisplayed in the form just in case of an error. But when there isn't an error and the form is processed it still shows the POST data ... anyway to clear this out?
Using HTTP POST To Transmit XML Data /w PHP
Hello, I am attempting to interface with UPS's shipping API's via PHP. The API expects to receive an XML dococument via HTTP POST or TCP/IP sockets. The POST request responds with the the desired info in XML form. So, lets say I have a package it is going from x to y, it ways w lbs. using UPS Ground-> This returns the shipping cost for that item. Now, I am fairly certain that this can be done using curl, but I am wondering if anyone can think of any other means of accomplishing this, perhaps with sockets or ...???
Possible To Use PHP To Post XML Data To An .aspx File?
We need to post XML data to an .aspx file however we can not use ASP and MSXML to do so. I was wondering if anyone has encountered this sort of problem before and how can you do this using PHP. If anyone knows both ASP and PHP, this is how I would go about it in ASP: Function PostRequest Dim objSrvHTTP Dim objXMLDocument Dim strXML strXML = "Your xml request goes here" Set objSrvHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP.4.0") Set objXMLDocument = Server.CreateObject("MSXML2.DOMDocument.4.0") objXMLDocument.async = false objXMLDocument.loadXML (strXML) objSrvHTTP.open ("POST", "<somefile>.aspx", false) objSrvHTTP.send(objXMLDocument) Response.Write("<PRE>" & objSrvHTTP.responseText & "</PRE>") End Function Excuse my newbiness when it comes to XML, I have not extensively worked with it before.
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?
How To Post Form Data After Validation
I'm posting the contents of a html form (I have the html form on the same file as the php mail()) to itself in order to validate and then send an e-mail. However, I'd like it to post it to another php file after upon successful validation. Can someone tell me how to do this? Just a bit of background - the reason why I'd like to do this is because I have multiple contact us forms on a site, and for efficiency purposes, I'd like to have a single form mail script so that I don't have to keep editing the php.
Validating Post Data Origin
how can i validate reasonably safe that post data sent by a form is sent by my form and not by anyone elses?
Printing POST Data In Netscape.
I've got a site that generates all sorts of reports on the fly both by including text files with content and pulling stuff from a database all based on user selections from a form. Needless to say, users HAVE to be able to print these reports for this thing to have any applicable use whatsoever. My Problem: Netscape will not print these pages. The error is: Data Missing. This document resulted from a POST operation and has expired from the cache. If you wish you can repost the form data to recreate the document by pressing the reload button. It would seem the solution lies in forcing Netscape to cache these pages. This seems ridiculous to me as these will always be dynamically generated pages - but whatever, the "common sense" of Netscape eludes me often.
Old Question (perhaps): Redirect With POST Of Data?
A question that has certainly been asked before and I've googled etc. for answers with no certain outcome... I'd like my PHP script to redirect the client browser to another page, POSTing some data at the same time. (To take them back to an html page showing a form that needs correcting because some data is missing.) I believe this is either tricky or not possible from what I've seen, but I'd just like to see what others think currently... It's a little annoying because plain redirecting is easy and plain POST to a URL (and get the results back) is easy too, but combining them seems to be another matter...
Send Post Data In Attachment?
Is it possible, using a post form, to send the data via an emailed attachment? Basically, I was wondering if I could put the data into a .html attachment which would be printer friendly and editable.
How To Attach POST Data To CURL
I'm trying to use CURL to submit XML requests to web service API's. I've got everything working except that I can't figure out how to actually attach my own custom XML string request to the POST. As such, I'm getting XML responses that simply say 'Invalid Request'. Here's what my CURL function currently looks like: Code:
Wget --post-data Usage
I'm want to post a string to a server. And using the 'wget --post-data' command. how can I retrive this posted data on the server using a php script? thanx
Server Can Not Send Data Via Get/Post???
I have a form that when processed produces a url of /search.php?type=1&location=Special+Events and when i say <?php foreach ($_GET as $key => $value){ echo $key." :".$value; } ?> nothing is showing up. Nor Can i access anything get anyway. I've tried using post on it too, nothing I'm on 4.7 so I know the $_GET nomenclature isn't an issue, but I've stumped.
Trying To Perform Calculation With Post Data
I've setup a form that submits two values and a select menu with a list of bitwise operators. The problem I'm having is I can't get the php to do the math when I display the results it simply displays the values as characters. I'm sure it's something simple that I should be able to figure out on my own. For instance if I submit 0111 >> 2 that is exactly what I see in my php how do I get it to complete the right shift? Code:
Form To Insert Mysql Row *and* POST Data
I'm reasonably new to PHP and after searching all over the place can't find anything useful I need to insert some variables into a mysql row and then POST variables to another web page using the same form The page i'm posting to is an SSL (bank hosted)ecommerce transaction page which I have no powers to change I don't have any problems inserting just mysql rows or making html forms to post separately, I just don't know where to start to get the one form to do both.
Dynamic Insert Of POST Data Into Database
I have two tables one with game data ie visitor team home team so on and so forth and one with team name and team id, this info is pulled into a dynamic form. I can get the data from the form ok foreach($_POST as $key => $value){ echo "$key:$value"; } when I echo the info it gives me the correct output game1:7 game1id:513 game2:14 game2id:514 I have columns in the database that correspond to the form var fields What my question is is how do I get the info into the database through each iteration in one row? This is an example I have tried and I know doesn't work $sql = "INSERT INTO teampicks ($key) VALUES('". $value ."')"; $res = mysql_query($sql);
How To Pass Current POST Data To Next Page ?
I got 2 php pages, called A.php and B.php. A.php will display all the selected records to the user and ask for confirmation before any attempt to delete. Let say the user click on the submit button, the action of the form is pointed to B.php. So my problem is, how can I pass all the current POST data in A.php to B.php as well ? I need that cauz the POST data in A.php contains the data needed like ID, to perform the deletion. I can manually write a VBScript to transfer the existing data into a query string and transfer it to the next page. However, it's not a POST data in nature. It wil become GET data right ? So what should I do ?
CURL To Post Form Data To Another Site
Is there a way to use CURL to post form data to another site and make the URL change from the current php script to the url of the site that I curl to? Right now when i test this the URL remains as the name of mu script ... ie> www.mysite.com/curl.php instead of changing to the address I am doing the curl to. I tried setting this variable curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); but it only changes to the new sites URL when I click a link on that site.
How To Post The Data From A Form To A Web Page Of Other Site
I WANT TO POST THE INFORMATION FROM MY FORM AFTER TAKING INPUT FROM THE USERS TO A WEBPAGE( PAYMENT PROCESSING SITE) WITHOUT VISTING THAT PAGE. I MEAN THE WEBPAGE SHOULD NOT BE DIRECTED TO THAT WEBPAGE(PAYMENT PROCESSING SITE). THE RECEPIENT WEBPAGE (payment processing page) RECEIVES THE INFORMATION THROUGH "GET" METHOD OF THE FORM. SO WE CAN USE "GET" METHOD IN OUR FORM.
Dynamic Include Page Post Data
I have a index file which carry content as included page. Its take parameters like this (index.php?page=katlist). So I am trying to send data from form inside page as (index.php?page=katlist&searchterm=blabla) but I dindt success.....
Email Form Does Not Submit Data In Post Method
I have an email which contains a whole form to be submitted to the php code. When I use get method, it works properly, but when I make it to POST method, it does not work. Also, same HTML code as an pure HTML page works properly for POST method. What can be the problem? How can I make the email to submit the data through POST method? My HTML code for email : ==== <form name="form1" method="post" action="getSurvey.php" target="_blank"> ==== My php code : ==== reset ($HTTP_POST_VARS); while (list ($key, $val) = each ($HTTP_POST_VARS)) { ====
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)
|