DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   HTML and CSS (http://www.daniweb.com/forums/forum143.html)
-   -   Showing results of a form in new window (http://www.daniweb.com/forums/thread2452.html)

IbnKuldun Jan 6th, 2004 8:18 pm
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

rixius Jan 6th, 2004 10:08 pm
Re: Showing results of a form in new window
 
Can be done in php, when yuo name the form's field, then you can export that as a $name variable.

samaru Jan 7th, 2004 1:05 am
Re: Showing results of a form in new window
 
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 '
<form action="'.$_POST['SCRIPT_NAME'].'" method="post" target="_blank" >
Input Something: <input type="text" name="something">
<input type="submit" value="Submit">
</form>';
}
?> [/PHP]

Any questions, just ask.

IbnKuldun Jan 7th, 2004 2:56 pm
Re: Showing results of a form in new window
 
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!

samaru Jan 9th, 2004 12:43 pm
Re: Showing results of a form in new window
 
Quote:

Originally Posted by rixius
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:

rixius Jan 10th, 2004 4:26 pm
Re: Showing results of a form in new window
 
<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.

samaru Jan 11th, 2004 7:05 pm
Re: Showing results of a form in new window
 
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.

red_evolve May 26th, 2004 10:16 pm
Re: Showing results of a form in new window
 
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.


All times are GMT -4. The time now is 5:18 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC