Forum Moderators: coopster
echo "<form action='swversion.php' METHOD=POST>";
echo "<input type=hidden name='action'value='swlist'>";
echo "<INPUT TYPE=HIDDEN NAME='entry' VALUE='.'>\n";
echo "<input type='submit' value='List Software' class = 'formstyle'>";
echo "</form>";
Hey guys, I wanted to add something to this little form code; How do i redirect this index.php, once I click on the submit button it will take to me swversion.php as you could see that my action is doin that. I want that to happen after 5 secs or right away. As soon as hit the button, I want to that page to go back to this index.php again.
Suresh
LG
[edited by: jatar_k at 7:15 pm (utc) on Nov. 1, 2004]
[edit reason] removed url [/edit]
header("HTTP/1.1 301 Moved Permanently");
header("Location: [domain.tld...]
header("Connection: close");
I guess you can make some serverside timer that counts down, before using the header function, but beware:
header must be used before *any* parsing of *anything*.
eg. a simple " " in front of the <?php tag, can cause the error "headers already sent".
*nothing* can be parsed before header().
the 301 fixes the google crawler, so it wont punish you in the pagerank system.
This will not be crawled by the spider, as it will be in the page posted to, not in the page posting, but it's good to have good habits, when programming.
The connection close, fixes some IE error..
<meta http-equiv=refresh content="5; URL=ht*p://www.domain.tld/">
ps. do not use the meta refresh on pages that google or other spiders searchengines can crawl!
If you do, your pagerank will suffer!
If you wish to make it in a page which is only submitted to, you are safe!
Good luck!