mynamesleo Posted November 8, 2006 Share Posted November 8, 2006 Hi guys, this is a little messy to explain. First of all its not important, was just an idea... so either way its not worth too much though.On my page code, its basicly setout like thisFormphp functionresultSo they input some info and click submit, the php function does its job then shows them the result (which is a weblink) in the form of a hyperlink, well was a hyper link now it shows another form button, so they click this button to go to the new link.I wanted it so when they add the info and click submit, the php will do its thing then automaticly send them to the link.. without them having to click a hyper link or anything. I couldnt set the <form action=linkhere> as this is above the php function for obvios reasons. I also thought about onlick on the submit button but was having a nightmare due to having to echo the form then in php etc etc..I am very new to php and website programming so do forgive me, i hope the idea is clear and allows you to tell me if this is possible? thanks!! Link to comment https://forums.phpfreaks.com/topic/26571-idea/ Share on other sites More sharing options...
AbydosGater Posted November 8, 2006 Share Posted November 8, 2006 Well if you have your php up and running,where you have the button displaying the link...replace that with...$theurl = $_POST['theurl'];echo "<META HTTP-EQUIV=\"refresh\" CONTENT=\"0;URL=$theurl\">and make sure $theurl is set! Link to comment https://forums.phpfreaks.com/topic/26571-idea/#findComment-121532 Share on other sites More sharing options...
Orio Posted November 8, 2006 Share Posted November 8, 2006 You should look into the [url=http://www.php.net/header]header()[/url] function-header("Location: ".$link);Orio. Link to comment https://forums.phpfreaks.com/topic/26571-idea/#findComment-121533 Share on other sites More sharing options...
mynamesleo Posted November 8, 2006 Author Share Posted November 8, 2006 I tried this on its own file and it worked. <?php$link="http://yahoo.com";header("Location: ".$link);?>but the same exact same code in my php code doesn't work? just seems to ignore it? Link to comment https://forums.phpfreaks.com/topic/26571-idea/#findComment-121562 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.