473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

PHP/HTML question

Cross posting this in the HTML forum as well, as I am not sure which is better.

I have a index page that is a frame set.
My frame set is
-1-|------2-------|
-3-|-4-|--5--|-6-|

I have a navigation pane in frame 3. The list is php/mysql driven. is what I would like is to display the content of the link in frame 5. I can do this fine making static pages and using name/target. Is what I am looking to do is make frame 5 a dynamic php/mysql driven page.

Ie they click on link xyz from panel 3 and it will display the xyz page in frame 5, but there is no static page for xyz.

Make sense? Help? Or am I out of luck?
Apr 3 '07 #1
7 1329
Motoma
3,237 Expert 2GB
Cross posting this in the HTML forum as well, as I am not sure which is better.

I have a index page that is a frame set.
My frame set is
-1-|------2-------|
-3-|-4-|--5--|-6-|

I have a navigation pane in frame 3. The list is php/mysql driven. is what I would like is to display the content of the link in frame 5. I can do this fine making static pages and using name/target. Is what I am looking to do is make frame 5 a dynamic php/mysql driven page.

Ie they click on link xyz from panel 3 and it will display the xyz page in frame 5, but there is no static page for xyz.

Make sense? Help? Or am I out of luck?
Double posting is a no no.
I'm not sure what part of this you are having trouble with...it seems you have the concept, flow, and structure already thought out. Perhaps if you asked a question, you would get better responses.
Apr 3 '07 #2
sorry I should have checked the forum rules first ><


my question is how do I get that done?

in my <a href> do I add ,_$POST=$row[2] to the end of the file name? (Where post 2 is what I need passed?

I was just confused because I have never done post and get in frames, so I didn't know if it was possible. All my previous php passing has been via a form.
Apr 3 '07 #3
Motoma
3,237 Expert 2GB
If your navigation frame is being populated by the database, then you just have it draw up the correct URLs in the HREF tag.
Apr 3 '07 #4
I might not be making this clear. Here is my navigation pane.

<?
$result = mysql_query("SELECT name, link, pkey FROM links ORDER BY lorder");
if($result)
{
while($row=mysql_fetch_row($result))
echo "<a href=$row[1] target='tbody'>$row[0]</a><br>";
}
?>

Is what I would like is a way to pass pkey (row[2]) to frame tbody so I can make one generic page that would look like this

<?
$result = mysql_query("SELECT text, header, FROM text WHERE llink=passed variable");

output results
?>


That way I don't have to make 10 pages for 10 links, I can make one page that will pull the information from the database (in frame 5).
Apr 3 '07 #5
Motoma
3,237 Expert 2GB
I see what you are getting at now:

Yes, I would do something like this:

[PHP]
<?php
//Nav page
$result = mysql_query("SELECT name, pkey FROM links ORDER BY lorder");
if($result)
{
while($row=mysql_fetch_row($result))
echo "<a href='loadLink.php?pkey={$row['pkey']}' target='tbody'>{$row['name']}</a><br>";
}
?>

<?php
//loadLink.php
$keyPage = $_GET['pkey'];

// Load correct data based on what the $keyPage number is
[/PHP]

I might not be making this clear. Here is my navigation pane.

<?
$result = mysql_query("SELECT name, link, pkey FROM links ORDER BY lorder");
if($result)
{
while($row=mysql_fetch_row($result))
echo "<a href=$row[1] target='tbody'>$row[0]</a><br>";
}
?>

Is what I would like is a way to pass pkey (row[2]) to frame tbody so I can make one generic page that would look like this

<?
$result = mysql_query("SELECT text, header, FROM text WHERE llink=passed variable");

output results
?>


That way I don't have to make 10 pages for 10 links, I can make one page that will pull the information from the database (in frame 5).
Apr 3 '07 #6
I see what you are getting at now:

Yes, I would do something like this:

[PHP]
<?php
//Nav page
$result = mysql_query("SELECT name, pkey FROM links ORDER BY lorder");
if($result)
{
while($row=mysql_fetch_row($result))
echo "<a href='loadLink.php?pkey={$row['pkey']}' target='tbody'>{$row['name']}</a><br>";
}
?>

<?php
//loadLink.php
$keyPage = $_GET['pkey'];

// Load correct data based on what the $keyPage number is
[/PHP]
That works exactly right, thanks so much. I think my probelm is I wasn't adding { } after the =
Apr 3 '07 #7
Motoma
3,237 Expert 2GB
Yes, you need to do this otherwise PHP will not correctly interpret arrays embeded in strings. The other way to do this is to exit the string, and concatenate:

[php]
$var = "The POST value for username was ".$_POST['username'].", but we didn't let him in!";
[/php]

A good thing to do would be to look up the difference between single and double quotes; double quotes are parsed for variables, meaning they take a very slight performance hit versus single quotes.
Apr 3 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: VK | last post by:
09/30/03 Phil Powell posted his "Radio buttons do not appear checked" question. This question led to a long discussion about the naming rules applying to variables, objects, methods and properties...
0
by: Boris Ammerlaan | last post by:
This notice is posted about every week. I'll endeavor to use the same subject line so that those of you who have seen it can kill-file the subject; additionally, Supersedes: headers are used to...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
17
by: henry | last post by:
Folks Here's a skeleton, generic HTML page, call it "index.php". You'll see a bit of php code in the middle: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.