basketmen — 2010-01-18T08:09:40-05:00 — #1
Using below script after clicking the button it will reload the page and starting the application
I want people go to anchor link location after clicking the submit button, for example go to the bottom of the page because the program is in the bottom of the page
how to do that guys please help
echo '<form action="" id="frm_chat" method="post"><fieldset id="fieldset_chat"><legend>Chat</legend><div>';
echo "<label>Nick: </label>".$txt_nick->getHtml()."<br />";
echo "<label>Server: </label>".$ddl_server->getHtml()." or ".$txt_server->getHtml()."<br />";
echo "<label>Channel: </label>".$ddl_channel->getHtml()." or ".$txt_channel->getHtml()."<br />";
echo ' <input type="submit" class="btn" name="btn_chat" value="Chat Now"/></div></fieldset></form>';
ralphm — 2010-01-18T15:43:01-05:00 — #2
Don't know if this would work for the same page, but you could try putting an id on the header for the section--e.g
and them make the return url that section of the page:
header ('Location: #anchor');
header ('Location: index.php#anchor');
but I've not tried it. It would be easy if you were landing on another page.
felgall — 2010-01-18T15:45:29-05:00 — #3
The same code will work regardless of whether it is the same page or a different page being loaded if you include the filename of the page before the #.
autisticcuckoo — 2010-01-19T03:07:17-05:00 — #4
Both would be invalid, since the [Location header requires an absolute URI (see [url=http://tools.ietf.org/html/rfc2396]RFC2396](http://tools.ietf.org/html/rfc2616#page-135) for a definition).
Most browsers probably work with a relative URI as well, but you'd be relying on non-standard behaviour.
ralphm — 2010-01-19T04:09:53-05:00 — #5
Eek! Cheese and rice, it's amazing how unreliable books can be. How are we noobs to survive?
Answer: by the helpful advice of Tommy and co. Thanks for pointing this out.