Jump to content

Quick to the point quesion Newbie help


claudfs

Recommended Posts

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

 

 

 

 

 

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.