Still cant POST to a frame

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

Post Reply
virgil
Forum Commoner
Posts: 59
Joined: Thu Jun 13, 2002 11:43 pm
Location: New York, U.S.

Still cant POST to a frame

Post by virgil »

Hi

I am trying to get a search form(.html) to send its MySQL query results(.php) to a frame in a frame page.

If I use
Code:
<form method="post" action="resultsframe.htm">

I get a (405)Method Not Allowed
The requested method POST is not allowed for the URL /resultsframe.htm. error.

The code below just replaces the search page with the query results in the same original window.

Can I tweek it to make it display the query results in a frame page?

Code: Select all

<form  method="post" action="query.php" target="resultsframe.htm" onSubmit="resultsframe.htm">
The frames page has query.php set as its source(src=query.php).


I thought it might be a logic problem. Like maybe you cant post to a frame itself, you have to post to an actual page. Is there a way to route the post through the frame url to the .php query page url?

Thanks for any advice. Virgil
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

Code: Select all

<form  method="post" action="query.php" target="resultsframe.htm" onSubmit="resultsframe.htm">
The target needs to be the name of the frame.

Take this for example:

Code: Select all

<frameset  cols="150,*">
    <frame name="leftFrame" src="navigation.php" marginwidth="10" marginheight="10" scrolling="auto" frameborder="1" bordercolor="black">
    <frame name="mainFrame" src="main.php" marginwidth="10" marginheight="10" scrolling="auto" frameborder="1" bordercolor="black">
</frameset>
If I had a form in the leftFrame ("navigation.php"), I would make the form be like this:

Code: Select all

<form  method="post" action="main.php" target="mainFrame">
This would send the data to the main.php in the mainFrame.
Post Reply