Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

transfer form's datas

Status
Not open for further replies.

maryer

IS-IT--Management
Jun 10, 2002
16
CY
hi there
how can i transfer form's datas from the one test.php file to the javascript opened window to print result
i tryed include('"test.php"), but this didnt work
thank you

 
Let me see if I understand. You want to present a form on the browser, enter data into a form element, click submit, and have that data appear in a new window?

If so, I'd just add a new attribute to the form tag. Add "target=_top". That would present the output of the CGI processing the form in a new window.

If instead you want to have the data presented in a JavaScript dialog box, then have PHP create JavaScript on the return page.

Have your CGI script include the following at the of the return page:

<script language=JavaScript>
dialog (\&quot;<variable containing form data\&quot;);
</script>

Perfection in engineering does not happen when there is nothing more to add. Rather it happens when there is nothing more to take away.
 
what is your opinion how can i transfer php form's submitted datas to the js pop-up window. i tryed include(&quot;request.php&quot;) in my new printform.php js window but it didnt make any sense. So if you can suggest me anything i would be thankful.
 
if you use a java link like this:

<a href=&quot;#&quot; onclick='window.open(&quot;popup.php?name=John&lastname=Smiths&age=99&quot;, &quot;popup&quot;,&quot;width=130,height=190,scrollbars=no,menubar=no&quot;);'>Click Here</a>

and popup.php looks like this:

<?php
echo &quot;name: $name <br>&quot;;
echo &quot;lastname: $lastname <br>&quot;;
echo &quot;age: $age<br>&quot;;
?>

the popup window will show you:
name: John
lastname: Smith
age: 99

but instead of fixing the name in the link use your variables

<?php
printf(&quot;<a href=\&quot;#\&quot; onclick='window.open(\&quot;popup.php?name=$fname&lastname=$lname&age=$age\&quot;, \&quot;popup\&quot;,\&quot;width=130,height=190,scrollbars=no,menubar=no\&quot;);'>Click Here</a>&quot;);
?> ***************************************
Party on, dudes!
[cannon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top