biwerw Posted March 9, 2010 Share Posted March 9, 2010 I have a script that takes input from a form and creates a .html file based upon what was entered. I would like for the end result to load the created page in the browser. I can't seem to find the correct code to do so. Any help would be great. Quote Link to comment https://forums.phpfreaks.com/topic/194644-load-or-redirect-to-a-page/ Share on other sites More sharing options...
aeroswat Posted March 9, 2010 Share Posted March 9, 2010 I have a script that takes input from a form and creates a .html file based upon what was entered. I would like for the end result to load the created page in the browser. I can't seem to find the correct code to do so. Any help would be great. Where is the created page? Is it hosted on the server as well? If so and you have the link to it then you can just use the header function: header('Location: http://www.yoursite.com/htmlfile.html'); Quote Link to comment https://forums.phpfreaks.com/topic/194644-load-or-redirect-to-a-page/#findComment-1023673 Share on other sites More sharing options...
biwerw Posted March 9, 2010 Author Share Posted March 9, 2010 That should work however I'm using one of the input variables from the form to create the name for the .html file so each time would be different. How would I use a $info inside the code you provided? Below is what I attempted, but failed. <?php header('Location: "$cuidnumber".html'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/194644-load-or-redirect-to-a-page/#findComment-1023676 Share on other sites More sharing options...
MadTechie Posted March 9, 2010 Share Posted March 9, 2010 Was close, but try this <?php header("Location: $cuidnumber.html"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/194644-load-or-redirect-to-a-page/#findComment-1023680 Share on other sites More sharing options...
biwerw Posted March 9, 2010 Author Share Posted March 9, 2010 I'm sure you already know, but that worked perfect. Thanks a lot everyone for the help. Quote Link to comment https://forums.phpfreaks.com/topic/194644-load-or-redirect-to-a-page/#findComment-1023681 Share on other sites More sharing options...
MadTechie Posted March 9, 2010 Share Posted March 9, 2010 Welcome, can you click the "Mark SOLVED" button bottom left (saved others coming to help out on a solved topic, you can also unsolve it if needed) Quote Link to comment https://forums.phpfreaks.com/topic/194644-load-or-redirect-to-a-page/#findComment-1023684 Share on other sites More sharing options...
biwerw Posted March 9, 2010 Author Share Posted March 9, 2010 No Problem. Was looking for it on the right side but couldn't find it and thought maybe I dreamed this Forum had one. Consider this topic solved. Quote Link to comment https://forums.phpfreaks.com/topic/194644-load-or-redirect-to-a-page/#findComment-1023686 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.