OrigamiDave Posted November 20, 2013 Share Posted November 20, 2013 Not sure if this the best forum for this, but here goes: Background: I have an account with Smugmug.com They recently revamped their website. With this revamp, they no longer allow you to add your own Javascript to customize your page. They only allow HTML and CSS modifications. So I created a free website through awardspace that allows me to run JS and PHP scripts. I want to create a way for a client to enter their last name and their password and have their pages opened in new tabs. Question: How do I do this without javascript? I can do it for a single page using PHP, but as far as I can tell PHP cant open multiple tabs... Here's the HTML: <form action="http://myfreescriptingsite.com/ClientSearch.php" method="get"> Name: <input type="text" name="tName"><br> Password: <input type="password" name="tPassword"><br> <input type="submit"> </form> I control the ClientSearch.php file. This could also be an HTML page or a JS file... Here is the ClientSearch.php file: $name = strtolower($_GET["tName"]); $password = $_GET["tPassword"]; switch($name){ case "smitherton": if ($password == "password") {header("Location: http://www.myrealwebsite.com/Clients/Smitherton/SmithertonFamily2013");} break; default: header("Location: http://www.myrealwebsite.com/Client-Search/"); } Again, the above PHP code only works for one location. I need it to load up multiple pages: if ($password == "password") { header("Location: http://www.myrealwebsite.com/Clients/Smitherton/SmithertonFamily2011"); #header("Location: http://www.myrealwebsite.com/Clients/Smitherton/SmithertonFamily2012"); #header("Location: http://www.myrealwebsite.com/Clients/Smitherton/SmithertonFamily2013"); } Any ideas on how to accomplish this? Thanks, Dave Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted November 20, 2013 Share Posted November 20, 2013 You can't do it using header, is not made for that purpose. header() maybe try to include() them, or iframe them Quote Link to comment Share on other sites More sharing options...
OrigamiDave Posted November 20, 2013 Author Share Posted November 20, 2013 You can't do it using header, is not made for that purpose. header() maybe try to include() them, or iframe them Yeah, i know that doesn't work... Include doesnt appear to work, it thinks its supposed to be another PHP file... Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted November 20, 2013 Share Posted November 20, 2013 if ($password == "password") { echo file_get_contents('http://www.myrealwebsite.com/Clients/Smitherton/SmithertonFamily2011'); echo file_get_contents('http://www.myrealwebsite.com/Clients/Smitherton/SmithertonFamily2012'); echo file_get_contents('http://www.myrealwebsite.com/Clients/Smitherton/SmithertonFamily2013'); } Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted November 20, 2013 Share Posted November 20, 2013 I know you said without js, but here it is if needed that. <script type="text/javascript"> function open_pages(){ window.open("http://www.myrealwebsite.com/Clients/Smitherton/SmithertonFamily2011"); window.open("http://www.myrealwebsite.com/Clients/Smitherton/SmithertonFamily2012"); window.open("http://www.myrealwebsite.com/Clients/Smitherton/SmithertonFamily2013"); } </script> <a href="javascript:open_pages()">View your pages</a> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.