Sorry not quite what im looking for; as stated above it is NOT a form i require (so there is no actual user input at all) But a method for posting data from one page to another without using a form and a method for receive that data on the other page.
I think possible i going about this the wrong way. I want one page of code to run through and finish, then in the last few lines open up the next page of code to run though but in opening of the page send a couple of varibles to it.
The closest thing i knew of was a php form with a submit button hence the title, but mabye im going in the wrong direction????
Using a header() redirect does create a new request. It would be equivalent to submitting a new form whose method="get".
The way HTTP works is the server sends headers right before the content of a page.
When the browser receives these headers, it processes them in various ways (for example, a 'Content-type' header tells the browser what sort of data comes after the headers [might be HTML or binary data or a JPEG image, etc.]).
When the browser sees a 'Location' header, it stops what it is doing and sends a new request.
So when you call [code=php]header("locatio n:abc.php?usern ame=xyz");[/code] you are literally telling the browser, "send over a new request for abc.php and set username to xyz."
This should do what you are looking for; the only gotcha is that you'll have to reference $_GET instead of $_POST.
The only other way to accomplish what you want is to compartmentaliz e your functionality using functions and classes so that you can combine the two files into one.
Thanks i will do a little research into this, also i read above "valajio" mentioning that that javascript can be used to automatically post a form on a certain event, is there anyway possible this could be done without javascript but with purely php because i don't really want the user to be able to accidently blocking the send form.
Or if not some way in which the javascript would be executed on the server but not in the users browser to limit what they can see
PHP cannot directly interface with HTML the way you need it to. PHP is executed on the server and generates the HTML and JavaScript that the browser then executes. The browser never sees a single line of PHP code.
The only option there is to submit the form using JavaScript, e.g.:
[code=javascript]
document.getEle mentById('theFo rm').submit();
[/code]
Comment