www.webdeveloper.com
Results 1 to 4 of 4

Thread: frame or php include, and how?

  1. #1
    Join Date
    May 2008
    Posts
    297

    frame or php include, and how?

    Hello,
    In my main page, I am trying to show a poll as below. The poll file is called display_poll.php. I want it to appear only in the div poll_ai as below, just a small part of the whole page. But it doesnt show anything.
    I tried everything written in comment tags too as below. It shows nothing.
    By the way, the poll file form is like this:
    echo "<form method=\"post\" action=\"display_poll.php\" target=\"_self\" >";
    so once user clicks submit, again it posts to itself. So, what I want is, it still should display this file as part of the main page, in that frame. I dont want it to open as a separate page, as it currently does if I did php inlude.


    Code:
    <div class="poll_ai">
    <!--<frameset cols="100%,0%">
    ->
    
    <iframe src="display_poll.php"></iframe>
    
    <!--
    <?php
    //include("display_poll.php");
    ?>
    -->
    <!--
    </frameset>
    -->
    
    </div>

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    <div class="poll_ai">
    <iframe src="display_poll.php"></iframe>
    </div>
    For the form:
    Code:
    <form action="<?php echo $PHP_SELF; ?>" method="post">
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    May 2008
    Posts
    297
    this works, thanks a lot. well not exactly how you wrote because the echo form statement was in php already, so here is how:

    $a= $_SERVER['PHP_SELF'];


    $aa=explode("/",$a);


    $kat=$aa[1];


    echo "<form method=\"post\" action=$kat target=\"_self\" >";

    and i use php include, not I frame...for some reason, I can not get iframe to work....

    if anybody knows a shortcut to this, I would like to see that too...

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    What has the frameset go to do with the problem?

    The document display_poll.php must be a complete document to be loaded into an iframe, yet you apparently also load it into the parent document. This is wrong.
    At least 98% of internet users' DNA is identical to that of chimpanzees

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles