Jump to content

Header("location: Blah.com") With Post Data?


supertrucker

Recommended Posts

Is there a way to send POST data with the header function? I.e., right now, I'm doing this:header("Location: http://blah.com?reallylongdatahere");...which is breaking, I'm assuming because the GET method I'm using has a 100 character limit. Any ideas?

Link to comment
Share on other sites

That's just it, how do you preserve post data with a redirect?

Link to comment
Share on other sites

The header function returns a header to the browser. The location header tells the browser to redirect. There's not a way for the server to tell the browser to send a post request, and what data to use for the post request. The server can send a post request, but it can't tell the browser to do it. If you want the browser to send a post request you need to create a form and have it automatically submit.

Link to comment
Share on other sites

The header function returns a header to the browser. The location header tells the browser to redirect. There's not a way for the server to tell the browser to send a post request, and what data to use for the post request. The server can send a post request, but it can't tell the browser to do it. If you want the browser to send a post request you need to create a form and have it automatically submit.
Whoa, so I can use a header to 'post' data for another page to use?Please look here and tell me if that is a viable option for solving this??? PLEASE !!!Ok, you already posted on that thread....http://w3schools.invisionzone.com/index.ph...mp;#entry143795I will keep it there.
Link to comment
Share on other sites

Thanks for the reply, I was thinking about this one way too hard! Used Sessions, problem solved, hate it when that happens!

Link to comment
Share on other sites

The solution is solved, but if you're curious, the intent was the following:1. A bookmarklet uses Javscript to forward the current page address to extract.php.2. Extract.php uses cUrl to extract the pages meta data.3. Extract.php forwards this new information to a link submission form, submitlink.php.4. Submitlink.php receives the data and prefills out a form with the data collected. User reviews data and submits the data.Works great now that I'm using $_sessions like I should have from the get go! Of course, now that I think about it, couldn't javascript have been used to extract all the metadata in the first place?What's a bookmarklet? Little piece of javascript that you save as a bookmark. Works wonderfully for forwarding web pages, saving bookmarks for social bookmarking sites, etc.

Link to comment
Share on other sites

The solution is solved, but if you're curious, the intent was the following:1. A bookmarklet uses Javscript to forward the current page address to extract.php.2. Extract.php uses cUrl to extract the pages meta data.3. Extract.php forwards this new information to a link submission form, submitlink.php.4. Submitlink.php receives the data and prefills out a form with the data collected. User reviews data and submits the data.Works great now that I'm using $_sessions like I should have from the get go! Of course, now that I think about it, couldn't javascript have been used to extract all the metadata in the first place?What's a bookmarklet? Little piece of javascript that you save as a bookmark. Works wonderfully for forwarding web pages, saving bookmarks for social bookmarking sites, etc.

Link to comment
Share on other sites

I guess I need to do a little reading up on Javascript. When it comes to mobile applications, using Javascript isn't practical since not all mobile browsers support it. However, that's beginning to change as the newer phones sport more advanced browsers. Even most of the dumb phones I've had included a simple subset of Javascript, but I've never read anywhere when it's okay to use it for mobiles, just always do what you can for the user server side.For personal use, however, I will have to play around with it and see what cool stuff I can do client side.Thanks for the support!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...