Jump to content

help me plzz!


icefire

Recommended Posts

i'm trying to do a learning website page that show a code and its execution in one page

i used iframe technique for that. :P

 

my problem is that i'm trying to let the user to modify the code and save it then show the execution to next frame "output frame". 

 

How can i make this Step ??

what should i do ?  :shrug:

 

my webpages :

index.php

<?php
include("includes/config.php");

$page_title='Learning PHP step by step...';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset= UTF8-Bin" />
<link href="css/style.css" type="text/css" rel="stylesheet"/>
<title><?php echo APP_TITLE?> - <?php echo $page_title?></title>
<frame name = "m2" src = "include/m2.php" />
</head>

<body>
<div id="container">
    	<div id="header"><?php include("includes/header.php"); ?></div>
    	<div id="topBar"><?php include("includes/top-bar.php"); ?></div>
	<div id="topBar2"><?php include("includes/top-bar2.php"); ?></div>
        <div id="menu"><?php include("includes/menu.php"); ?></div>
        <div id="m2"><?php include("includes/m2.php"); ?></div>
	<div id="m3"><?php include("includes/m3.php"); ?></div>
        <br style="clear:both" />
        <div id="footer"><?php include("includes/footer.php"); ?> </div>
</div>
</div>
</body>
</html>

 

include/m2.php

<html>
<body>
<font face="verdana,arial" size="3">
<div align="center">

<p>
<iframe
name="iframe1"
width="320"
height="320"
src=""
frameborder="yes"
scrolling="yes">
</iframe>
<p>

</font>
</div>

 

include/m3.php

<html>
<body>
<font face="verdana,arial" size="3">
<div align="center">


<iframe 
name="iframe2" 
width="320" 
height="320" 
src="" 
frameborder="yes" 
scrolling="yes"> 
</iframe>
</font>
</div>

 

include/menu.php

<div>
<ul>
<li><a href="lab00.txt" target="iframe1">Getting started </a><a href="lesson00.html" target="iframe2">(Lesson00)</a></li>
    </ul>

    <p> </p>
    <p> </p>
    <p> </p>
     <p> </p>
    <p> </p>
    <p> </p>
     <p> </p>
    <p> </p>
    <p> </p>
     <p> </p>
</div>

 

 

include/top-bar2.php

<div style="background-color:#fdfdfd;border-bottom:solid 1px #BBB; padding:.8px">
..........................LESSONS ............................................................CODE..................................................................................OUTPUT....................................................<a href="#"></a>
</div>

Link to comment
Share on other sites

Using an iFrame for this, all you need is two pages (entercode.php and showcode.php, for example):

 

entercode.php

<form action="showcode.php" method="post" name="form" target="frame1">
<textarea name="msg" cols="50" rows="5"></textarea>
<input type="submit" value="Display Message" />
</form>

<iframe width="500" height="500" name="frame1">
</iframe>

 

showcode.php

<?php
$test = $_POST['msg'];
echo eval($test);
?>

 

This will give you the most basic method of doing something like this. 

Link to comment
Share on other sites

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.