claudfs Posted November 19, 2007 Share Posted November 19, 2007 OK i'l make it simple i got an html page ___________________________________________________________ <html> <body> <iframe src="http://example.com" height="100" width="200" frameborder="0" scrolling="no"> </iframe> </body> </html> ------------------------------------------------------------------- No what i would like is to make the iframe src = $variable and that variable is equal to what ever i input in this form _______________________________________________________________ <form action="index.php" method="post"> New Website: <input type="text" name="web"> <br> <input type="Submit"> </form> __________________________________________________________________ So what i would basically like is that i can goto this input form type a website in and click submit and then that becomes the variable for the iframe , until when ever i submit a new website? Know what i mean how can i do this please Quote Link to comment Share on other sites More sharing options...
rarebit Posted November 19, 2007 Share Posted November 19, 2007 With your form statement your using the 'POST' method, so to get the named elements you'd use something like: $src = "http://example.com"; if (isset($_POST['web'])) { $src = $_POST['web']; } ... echo "<iframe src='".$src."' height='100' width='200' frameborder='0' scrolling='no'></iframe>"; ... or something like, depending upon your style... Quote Link to comment Share on other sites More sharing options...
claudfs Posted November 19, 2007 Author Share Posted November 19, 2007 ok, Thanks, but not exactly what i wanted. Basically i want my iframe src to be set to a variable ($variable) and it fetches the variable from the .html or .php file and when ever i want to change the variable i goto a input form and submit the new variable so for example people goto www.example.com and my fixed variable for the iframe is google and it displays an iframe of google. But now i want to change it so i got my input form www.example.com/input and i enter a new website facebook.com so now when people goto www.example.com the iframe is facebook and not google. you know what i mean? Quote Link to comment Share on other sites More sharing options...
claudfs Posted November 19, 2007 Author Share Posted November 19, 2007 So i can keep on change the iframe variable by submitting a new one into the input form and that becomes the fixed variable till i change it again is there anyway to do this? 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.