Deoctor Posted November 19, 2009 Share Posted November 19, 2009 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. <?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... Link to comment https://forums.phpfreaks.com/topic/182143-solved-variable-passing-from-one-frame-to-another-frame/ Share on other sites More sharing options...
JonnoTheDev Posted November 19, 2009 Share Posted November 19, 2009 GET parameters i.e. frame3.php?id=123 <?php // frame3.php // $id has the value 123 $id = $_GET['id']; ?> Link to comment https://forums.phpfreaks.com/topic/182143-solved-variable-passing-from-one-frame-to-another-frame/#findComment-960955 Share on other sites More sharing options...
Deoctor Posted November 19, 2009 Author Share Posted November 19, 2009 i could not get it.. can you explain me in more detail :'( Link to comment https://forums.phpfreaks.com/topic/182143-solved-variable-passing-from-one-frame-to-another-frame/#findComment-960959 Share on other sites More sharing options...
JonnoTheDev Posted November 19, 2009 Share Posted November 19, 2009 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, Link to comment https://forums.phpfreaks.com/topic/182143-solved-variable-passing-from-one-frame-to-another-frame/#findComment-960966 Share on other sites More sharing options...
Deoctor Posted November 19, 2009 Author Share Posted November 19, 2009 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 echo ("<br><a href = 'note.php?rss=$url'target='frame3'>$url</a>"); Link to comment https://forums.phpfreaks.com/topic/182143-solved-variable-passing-from-one-frame-to-another-frame/#findComment-960984 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.