A2xA Posted January 23, 2008 Share Posted January 23, 2008 I want to make it where the user fills out a form of some sort. <form action="disaster.php" method="post"> Enter the Website: <input type="text" name="website" /> <input type="submit" /> </form> And then it will re-direct the user to another page with this. then somehow define the website they entered from the form previously $website=(What they entered in form) <?php print preg_replace('/.*<body>(.*)<\/body>.*/', '$1', trim(file_get_contents ('$website <--Website Name they entered'))); ?> Quote Link to comment https://forums.phpfreaks.com/topic/87304-solved-making-what-user-types-in-form-fill-in-variable-simple/ Share on other sites More sharing options...
kts Posted January 23, 2008 Share Posted January 23, 2008 $_POST['website'] would grab the textfield Quote Link to comment https://forums.phpfreaks.com/topic/87304-solved-making-what-user-types-in-form-fill-in-variable-simple/#findComment-446548 Share on other sites More sharing options...
A2xA Posted January 23, 2008 Author Share Posted January 23, 2008 Ah, that's what I was looking for, Thanks Quote Link to comment https://forums.phpfreaks.com/topic/87304-solved-making-what-user-types-in-form-fill-in-variable-simple/#findComment-446549 Share on other sites More sharing options...
kts Posted January 23, 2008 Share Posted January 23, 2008 No problem Also make sure the url includes the http:// Quote Link to comment https://forums.phpfreaks.com/topic/87304-solved-making-what-user-types-in-form-fill-in-variable-simple/#findComment-446553 Share on other sites More sharing options...
A2xA Posted January 23, 2008 Author Share Posted January 23, 2008 I get this error Warning: file_get_contents($website) [function.file-get-contents]: failed to open stream: No such file or directory in /home/wiicharg/public_html/ Quote Link to comment https://forums.phpfreaks.com/topic/87304-solved-making-what-user-types-in-form-fill-in-variable-simple/#findComment-446558 Share on other sites More sharing options...
kts Posted January 23, 2008 Share Posted January 23, 2008 Remove the ' ' apostraphe's around $website Quote Link to comment https://forums.phpfreaks.com/topic/87304-solved-making-what-user-types-in-form-fill-in-variable-simple/#findComment-446560 Share on other sites More sharing options...
A2xA Posted January 23, 2008 Author Share Posted January 23, 2008 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/87304-solved-making-what-user-types-in-form-fill-in-variable-simple/#findComment-446563 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.