submitting form to multiple pages

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
akkad
Forum Newbie
Posts: 14
Joined: Tue Jul 31, 2007 4:09 am

submitting form to multiple pages

Post by akkad »

hello every body..

i have a page which contains 2 frames:

Code: Select all

[syntax=php]frameset rows="7%,84%" > 
<frame src="first.php" name="first" noresize scrolling="No" frameborder="0"> 
<frame src="second.php" name="second" noresize scrolling="No" frameborder="0"> 
<NOFRAMES><body>Your browser does not support frames. 

You must set AWStats UseFramesWhenCGI parameter to 0 
to see your reports. 

</body></NOFRAMES> 
</frameset>
[/syntax]


first frame: first, contains a page the contains form

Code: Select all

[syntax=php]<?php 
         echo" <FORM style=PADDING-RIGHT: 0px; MARGIN-TOP: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px 
name=FormDateFilter method=get action=second.php target=second>"; 

echo"<SELECT class=formfield name=day> 
 <OPTION  selected>-Day-</OPTION> 
<OPTION value=01>01</OPTION> <OPTION value=02>02</OPTION> 
<OPTION value=03>03</OPTION> <OPTION value=04 >04</OPTION> 
<OPTION value=05>05</OPTION> 
<OPTION value=06>06</OPTION> <OPTION value=07>07</OPTION> <OPTION 
value=08>08</OPTION> <OPTION value=09>09</OPTION> <OPTION 
 value=10>10</OPTION> <OPTION value=11>11</OPTION> <OPTION 
value=12>12</OPTION> 
<OPTION value=13>13</OPTION> <OPTION value=14>14</OPTION> 
<OPTION value=15>15</OPTION> <OPTION value=16 >16</OPTION> 
<OPTION value=17>17</OPTION> 
<OPTION value=18>18</OPTION> <OPTION value=19>19</OPTION> <OPTION 
value=20>20</OPTION> <OPTION value=21>21</OPTION> <OPTION 
value=22>22</OPTION> <OPTION value=23>23</OPTION> <OPTION 
value=24>24</OPTION> 
<OPTION value=25>25</OPTION> 
<OPTION value=26>26</OPTION> <OPTION value=27>27</OPTION> <OPTION 
value=28>28</OPTION> <OPTION value=29>29</OPTION> <OPTION 
value=30>30</OPTION> <OPTION value=31>31</OPTION> </SELECT> 
<SELECT class=formfield name=month> 
<OPTION  selected>-Month-</OPTION>        
<OPTION value=01>Jan</OPTION> <OPTION value=02>Feb</OPTION> 
<OPTION value=03>Mar</OPTION> <OPTION value=04 
 >Apr</OPTION> <OPTION value=05>May</OPTION> <OPTION 
value=06>Jun</OPTION> <OPTION value=07>Jul</OPTION> <OPTION 
value=08>Aug</OPTION> <OPTION value=09>Sep</OPTION> <OPTION 
value=10>Oct</OPTION> <OPTION value=11>Nov</OPTION> <OPTION 
value=12>Dec</OPTION> </SELECT> 
<SELECT class=aws_formfield name=year> 
<OPTION  selected>-Year-</OPTION>          
<OPTION value=2006>2006</OPTION> 
<OPTION value=2007>2007</OPTION> 
</SELECT> 
<input type=text name=first_param value=First-Parameter> 
<input type=text name=second_param value=Second-Parameter> 
<INPUT class=aws_button type=submit value=OK>"; 
?>
[/syntax]


the second frame, second , contains a page that have 2 frames also :

Code: Select all

[syntax=php]<frameset name="akkad" cols="20%,50%" > 
<frame src="left.php" name="left" noresize frameborder="1"> 
<frame src="body.php" name="body" noresize frameborder="1"> 
</frameset>
[/syntax]


the first frame , left, contains the left.php page:

Code: Select all

[syntax=php]<FORM name="SendForm" action="body.php" method="post" target="body"> 
   <input name="fp" value="<?php $_GET['first_param'];?>" type="hidden"> 
   <input name="sp" value="<?php $_GET['second_param'];?>" type="hidden"> 
   <input name="day"  value="<?php $_GET['day'];?>"  type="hidden"> 
   <input name="month" value="<?php $_GET['month'];?>"  type="hidden"> 
   <input name="year" value="<?php $_GET['year'];?>"  type="hidden"> 
    
</form> 



<a href="javascript:document.SendForm.submit();">summary[/url]
[/syntax]



the second frame , body contains the page body.php


Code: Select all

[syntax=php]<?php 
$fp=$_GET['first_param']; 
$sp =$_GET['second_param']; 
$day=$_GET['day']; 
$month=$_GET['month']; 
$year=$_GET['year']; 
?>
[/syntax]

now what i want is to send the form variables or informations to both frames in the second.php page is there any possibility for that and how ?

Code: Select all

[syntax="html"]
[/syntax]
Last edited by akkad on Thu Aug 16, 2007 3:17 am, edited 2 times in total.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

I can't really read all of that code without it in the [ code ] [ syntax ] or [ php ] boxes/highlighters.

But, you shouldn't really need multiple targets. You could send to one frame that sends to another. Or use a javascript solution.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
akkad
Forum Newbie
Posts: 14
Joined: Tue Jul 31, 2007 4:09 am

submitting form to multiple pages

Post by akkad »

i have edited the code so [s]u[/s] you can read it well, is it ok now ?

would [s]u[/s] you explain in more details how to send data from one frame to other:

i meant i understand how to send from the frame that contains the actual form to another frame but from the second frame to the third one how i can send the data?
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

This is a duplicate thread. akkad, I'm getting pretty tired of you not following the rules. Please start following the rules, or this will escalate.
Locked