Jump to content

[SOLVED] variable passing from one frame to another frame


Deoctor

Recommended Posts

Hai 

i have written my entire code in php and i have put those in frames in a html file.

now the thing is that i need to pass the variable value in one php which i am displaying in second frame to be passed to the third frame.

:confused:

 

<?php
include("access.php");
//echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"5; URL=display.php\">";
mysql_select_db($dbname);
if (isset($_COOKIE['user']))
{
    //echo "Welcome $_COOKIE[user]<br>";
    $username="$_COOKIE[user]";
    //echo "<p>$username</p>";
    $query = mysql_query("SELECT email,password FROM userlogin WHERE username = '$username'") or die(mysql_error());
    $data = mysql_result($query,0);
    //echo $data;
}
else
{
    echo $_COOKIE['user'];
    
    //echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=login.php\">";
}

$select=mysql_query("select url from usubs where email='$data'") or die(mysql_error());

while($row = mysql_fetch_array($select))
{

    $url = $row['url'];
    //echo "<br>".$row['url']."<br>";
    
    echo ("<br><a href = '$url'target='frame3'>$url</a>");
    
}


?>

i need to pass this url into the third frame which is having a php file.

please help me out... :shrug:

When you want to maintain data through pages on a website, one of the most common ways is to pass the data in the url as a parameter. i.e

 

http://www.google.com/search?q=cars

 

The paramater in this case is 'q' and its value is 'cars'.

The value can be obtained using the $_GET superglobal i.e.

<?php 
// $q has the value 'cars'
$q = $_GET['q']; 
?>

So if I have 2 pages and I set a value in page 1 and I want it to be available in page 2 I can pass it through the url as a paramater.

On another note, why are you using framesets. They have been out of date for years and are a really bad way of designing a web application,

Hai

Thank you for your help. I have finally done it out

i need to change my code the little bit

when the echo command has been changed like this it is displaying correctly :D

echo ("<br><a href = 'note.php?rss=$url'target='frame3'>$url</a>");

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.