SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2005
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A frame question

    I have a page find.php where the user enters a person's id into a blank field and clicks submit. The follow page needs to be a frame (At least thats the only way I can think to do this) that has 2 parts. The left frame is findtable.php which shows all the person's information. The right frame donations.php holds only the records of all that person's donations. When I post everything from find.php to just findtable.php it shows all that person's info. But when I post it to findframe.php it does not show up in the left frame.

    findframe.php is just this:

    <html>
    <head>
    <title>My frameset</title>
    </head>
    <frameset cols="50%,*">
    <frame src="findtable.php" name="links" target="main">
    <frame src="donations.php" name="main" target="main">
    </frameset>
    <noframes>
    <body>

    Anyone know how to pass my values through this frame to make it do what I want.

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Bloomington, IL
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <frame src="findtable.php?id=<?php echo $_POST['id'];?>" name="links" target="main">
    <frame src="donations.php?id=<?php echo $_POST['id'];?>" name="main" target="main">

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2005
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems that is doing something. The pages are still coming up empty but when I look at the source it does hold the id number in id. Its just communicating that with the frames in the frameset. Mabye I'm missing something, do I pass that id value along to findtable.php to make the query in findtable.php work so it pulls out the info. See I use that id to query the database and pull out all the info I need. I am hating frames but its what the client wants. I hope anyone can help and if I am not being clear and you have some time I can answer anything Im not being clear on.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jun 2005
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I use that code do I still need: $donor_id = addslashes($_POST['donor_id']);

    on findtable.php because findtable.php comes up in the left frame but for some reason it is not showing up with the variable values.

    here is a simple version of the 3 pages:

    find.php prints out a list of donors with their unique donor_id, the user types in the donor_id and clicks submit.

    <form method="POST" action="findframe.php">

    <pre>
    Enter Id of Donor to Find: <input type="text" name="donor_id" size="5">
    <input type="submit" value="Submit"><input type="reset">

    findframe.php is just the 2 frame links

    <frame src="findtable.php?id=<?php echo $_POST['donor_id'];?>" name="links" target="main">
    <frame src="donations.php?id=<?php echo $_POST['donor_id'];?>" name="main" target="main">

    donations.php i am not worried about yet, if i get the one side of the frame working i can get the other.

    findtable.php is

    <?PHP
    $donor_id = addslashes($_POST['donor_id']);

    $result = mysql_query("SELECT * FROM Donor WHERE donor_id='$donor_id'")
    or die("SELECT Error: ".mysql_error());

    $num=mysql_num_rows($result);

    mysql_close();

    $i=0;
    while ($i < $num) {

    $donor_id = mysql_result($result,$i,"donor_id");
    //other variables declaired the same way here
    //then I print them out(below)
    ?>

    <TR><TD align=right width="36%">
    <B><FONT face=Verdana size=2 color="#000000">Donor ID: Auto Generated </FONT></B>&nbsp;
    </TD><TD width="64%"><INPUT size=40 name="ud_donor_id" value="<? echo $donor_id; ?>"></TD></TR>

    <?PHP//this works as a page by itself but not with the frames.?>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •