Jump to content

[SOLVED] variable passing from one frame to another frame


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>");

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.