You are invited to Log in or Register a free Frihost Account!

Automaticly Submit Post Data. 20 fri$ up for grabs.

Well I have tried doing this with php but I don't think their is a way so I would like to automatically submit post data without forum submission or anything.

So what I really want is a forum to have options which when submitted are redirected to another page which then handles it and redirects to a third page with the same post data submitted from the first.

Hope you understand.

Anyone who can help will get 20 fri$.
Dougie1 wrote:
So what I really want is a forum to have options which when submitted are redirected to another page which then handles it and redirects to a third page with the same post data submitted from the first.

By "forum" you mean "form", right?
Let me see if I get it... you want a simple form submission. The user enters data, then submits the form, then a php file process the form, and then presents the data submitted on another page, is that it?

And btw, you posted on the wrong thread, I'll ask some moderator do move it.
No I have posted in the right forum because I don't think there is a way to do this with PHP. I did mean form sorry! Quick typing for you...

Yeah so what I would like is I submit from an HTML page some post data. It goes to an HTML page and then some code on that redirects the page after a few seconds (time delay not necessary) with the same post data posted to it to another HTML page.

Well, html forms can be handled only on server side (at least I don't know any way to handle it in the browser side). Which means you should use cgi, php, etc...
And actually, there is a way of doing this with php.
This is possible, if you send the header directly.


$Header="POST /scripts/script.php HTTP/1.1\r\n" ;
$Header."Accept: */*\r\n";
$Header."Content-type: application/x-www-form-urlencoded\r\n";
$Header."Content-Lenght: 10\r\n";
$Header."Connection: close\r\n\r\n";
$Header."string=abc&valid=1\r\n" ;



Note: This is untested. You have to play around a bit with it. But that should be the basic thing...

greetz, TomS
I made an example with only 1 page... the form submits do itself, and decides whether to show the form or to display the data.

Check it out to see if it's what you really want.
Sorry Tom. I don't see what your PHP script does. I don't really understand headers. To post above, I know how to do that but would I be able to display that page, "test is", for so many seconds and then redirect to another page with the post data resubmitted to it automatically.

Let me reword this differently. Is there a way to view a homepage which after 5 seconds redirects to a page which has post data submitted already, ie. the page forces the browser to submit post data without having any inputs having to be put in.

Oh, now I understand... I need to research a little more... Very Happy
Just let me restate what I think you are asking for, because there may be a simple solution:

User fills in form on page1.html and submits it via POST to page2.php

page2.php displays a page which, after x seconds, redirects the user to page3.php which then processes the submitted information from page1.html.

Well, there are a few ways you can do this:

1. Have page2.php store the data in a database and have page3.php retrieve it.

2. Have page2.php write out a form with the data in hidden fields, and then use javascript to submit the form after a given delay.

If you want option 2, I could write a sample script for you.

If, on the other hand, you want to submit POST data to a page from a (different) PHP script without going through the browser, you can use cURL. I can *probably* help you with this as well.
But why do you want to redirect it then to a third page?
I don't get the point.
AOP Web Development
hey dude you if your plan is to stay your data to pass from page1 to page3 much better to use session because it will store automatically to the browser... here is an example.....

Let put that you are try to post data from page 1 to page 2
$_SESSION['data1']= $POST['data1'];

and after that will retrieve it to page 3

echo $_SESSION['data1'];
echo $_SESSION['data2'];

that's all you need to stay your post your data and you can retrieve it anywhere in the page you want even to page4 to page10....

Take note: everytime you use session try to don't forget session_start(); and to destroy it if you don't need it session_destroy();

I hope it can help to you!......

i have other option instead of using session you can also use hidden form int the html so that it will hold temporarily your data.....

for example:

post data from page1 to page2

<input type="hidden" name="data1" value="<?=$_POST['data1']?>">
and soon......

hope you it can help you dude!
Razz Razz
Related topics
[help]Pregunta- Cuanto duran los puntos?
SMU: Small GFX and WebSite Templates for Frih$
how to handle post data as an array
AJAX tutorial [2nd part now updated]
Solve The Riddles!!
PERL - post data from one script to another (Without LWP)
small php+mysql script, big reward
Need Expert help in php-mysql
Is there any way to submit post data with php?
Posting Data to multiple sites at once?
Checking if user exists, whats wrong?
pulling data out of a database and putting it on main page
1=.999....why? 20 frih$
My post gone
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

© 2005-2011 Frihost, forums powered by phpBB.