954,591 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Showing results of a form in new window

Evening all, first post so be nice ;)

I want to know if it is possible to show the results of a form in a new window. So when you press the submit button on a post or get type of form, how do you get it to show the results in a new page?

I can post code if you want to but i think there is enough to go on.

Thanks and look forward to helping out too...

IK

IbnKuldun
Newbie Poster
10 posts since Jan 2004
Reputation Points: 10
Solved Threads: 0
 

Can be done in php, when yuo name the form's field, then you can export that as a $name variable.

rixius
Posting Whiz in Training
233 posts since Nov 2003
Reputation Points: 12
Solved Threads: 3
 

Welcome to TTF! :cool:

The easiest way is to submit the form to target="_blank" - here's some sample code in HTML/PHP. The PHP code is just so the form doesn't get displayed:

[PHP]<?
if(isset($_POST['something'])) {
echo $_POST['something'];
}
else {
echo '

Input Something: ';
}
?> [/PHP]

Any questions, just ask.

samaru
a.k.a inscissor
Team Colleague
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18
 

Thanks for the welcome guys and a successful one at that.

I didnt realise you could use the target variable in the form tag.

Thanks!

IbnKuldun
Newbie Poster
10 posts since Jan 2004
Reputation Points: 10
Solved Threads: 0
 
Can be done in php, when yuo name the form's field, then you can export that as a $name variable.

Hmm? What do you mean? What's the other way to do it? I can't think of any right this minute, so maybe you can clear it up. :cool:

samaru
a.k.a inscissor
Team Colleague
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18
 
<form action=page.php method=post>
<input type=text name=var>
<input type=text name=var2>
</form>


You could export the content of that form as $var and $var2.

rixius
Posting Whiz in Training
233 posts since Nov 2003
Reputation Points: 12
Solved Threads: 3
 

How does that open up a new window and display the variables submitted? Sorry, not trying to be a dick about it, just not following.

samaru
a.k.a inscissor
Team Colleague
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18
 

Greetings.
How about using Javascript alone?
Is it possible to show the results of a form in a new window?
I have seen how things were done using Request.QueryString by decoding the url. But is there other alternative similar to the ASP's Request.Form("element") way? I'm trying to avoid using ASP, because the server doesn't have IIS. Please help.

red_evolve
Posting Whiz
313 posts since Jun 2003
Reputation Points: 53
Solved Threads: 1
 
<?php if(isset($_POST['field1')){ 
if(isset($_POST['field2'])) { 
/* validate field values  
 if values acceptible
 connect to database 
 update database 
 set disabled flag ($disabled = true ) to prevent resubmission */ } } ?>
<form action='<?php echo $_server['PHP_SELF']; ?>' method='post'>
<input type='text' name='field1' value='<?php if(isset($_POST['field1'] {echo $_POST['field1'];} ?>' />
<input type='text' name='field2' value='<?php if(isset($_POST['field2'] {echo $_POST['field2'];} ?>' />
<input type='submit' value='whoopdiedoo' <?php if(isset($disabled) {echo 'disabled="disabled"';} ?>/></form>


incomplete code scrap
Form submits to itself displays the values submitted in the form (very messy code but its ONLY a sample of what can be done)

almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You