Jump to content

Just a little help please


Rabbar

Recommended Posts

Hello I really need a little help with this

 

<?php

(nothing important here)

 

HERE I NEED HELP!!!

    if ($bla == "blabla")  """then I want to open "first file.php" in the iframe"""

    else """then I want to open "second file.php" in the iframe"""

}

?>

<iframe src="???" name="mainframe" height="600px" width="800px">

</iframe>

 

Can someone please help me with this?

Link to comment
https://forums.phpfreaks.com/topic/87077-just-a-little-help-please/
Share on other sites

No... I want to open the file in the iframe not just open it in new window or something.

 

if ($bla == "blabla")  """then I want to open "first file.php" in the iframe"""

    else """then I want to open "second file.php" in the iframe"""

 

<iframe src="" name="mainframe" height="600px" width="800px">

</iframe>

LIKE THIS IT DOES NOT WORK

 

<?php

if ($bla == 'blabla') {

    $file = 'file1.php'

} else {

    $file = 'file2.php'

}

?>

 

<iframe src="<?php echo $file ?>" name="mainframe" height="600px" width="800px">

</iframe>

 

 

This way it works

 

<?php

$file = 'file.htm'

?>

<iframe src="<?php echo $file ?>" name="mainframe" height="600px" width="800px">

</iframe>

 

 

So when the """if ($bla == 'blabla')"""

It does not work

I want to change this

"if ($two_letter_country_code == "IS")include('careframe.is.htm');

else include('careframe.en.htm');"

 

To This

"if ($two_letter_country_code == "IS")  """OPEN """careframe.is.htm""" IN IFRAME"""

AND

else """OPEN """careframe.en.htm""" IN IFRAME"""

 

 

"The code"

<?php

$IPaddress=$_SERVER['REMOTE_ADDR'];$two_letter_country_code=iptocountry($IPaddress);function iptocountry($ip) {$numbers = preg_split( "/\./", $ip);include("ip_files/".$numbers[0].".php");$code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);foreach($ranges as $key => $value){if($key<=$code){if($ranges[$key][0]>=$code){$two_letter_country_code=$ranges[$key][1];break;}}}

 

    if ($two_letter_country_code == "IS")include('careframe.is.htm');

    else include('careframe.en.htm');

}

?>

<body>

<td width="79%" align="center" valign="middle">

<center>

<iframe src="" name="mainframe" height="600px" width="800px">

</iframe>

</center>

</td>

Archived

This topic is now archived and is closed to further replies.

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