Ver Mensaje Individual
  #7 (permalink)  
Antiguo 08/06/2004, 12:42
Rabak
 
Fecha de Ingreso: junio-2004
Mensajes: 19
Antigüedad: 19 años, 10 meses
Puntos: 0
OK! :)

Mira, al principio de las paginas tengo lo siguiente :)

<?php

Function encabezado()
{
session_start();

echo " <html> <head> ";

echo " <title>Tutorial Tolerancia y Ajustes</title> ";

echo " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=Shift_JIS\"> ";

echo " <script language=\"JavaScript\"> ";

echo " <!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf(\"#\")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

";

echo " function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
x.src=x.oSrc;
}
";

echo "
function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf(\"?\"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms
[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
";

echo "
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for
(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

";
//-->
echo "</script> </head> ";

}
?>

Este es un pekeño Script para el menu superior donde hay pestañas para acceder a todas las opciones de esta :)

Despues escribo el menu dependiendo de si el usuario esta registrado o no, y
del tipo de usuario que sea, aki tienes el codigo:

<?php
if (!isset($tipo) OR !isset($id) OR $user == "")
//El alumno no ha pasado todavia por la seccion de registro
{
//header(Location: "../html/registro.php");
echo '<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages(\'image/botones/botonPrincipalON.gif\',\'image/botones/botonTeoriaON.gif\',
\'image/botones/botonPracticaON.gif\',\'image/botones/botonForoON.gif\',
\'image/botones/botonRegistroON.gif\',\'image/botones/botonContactaON.gif\')
">
<div align="center">


<table width="680" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="680" height="2"><img src="image/transparent.gif" width="15"
height="12"></td>
</tr>


<tr>

<td width="680">

<table width="680" border="0" cellspacing="0" cellpadding="1">


<tr>

<td width="90"><a href="index.php" target="_parent" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage
(\'button_01\',\'\',\'image/botones/botonPrincipalON.gif\',1)"><img src="image/botones/botonPrincipalOFF.gif" width="90" height="19" name="button_01" hspace="3" border="0"></a></td>
<td width="90"><a href="teoria.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'button_02\',\'\',\'ima ge/botones/botonTeoriaON.gif\',1)" target="_parent"><img src="image/botones/botonTeoriaOFF.gif" width="90" height="19" name="button_02" hspace="3" border="0"></a></td>
<td width="90"><a href="practica.php" target="_parent" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'button_03\',\'\',\'ima ge/botones/botonPracticaON.gif\',1)"><img src="image/botones/botonPracticaOFF.gif" width="90" height="19" border="0" hspace="3" name="button_03"></a></td>
<td width="90"><a href="foro.php" target="_parent" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'button_04\',\'\',\'ima ge/botones/botonForoON.gif\',1)"><img src="image/botones/botonForoOFF.gif" name="button_04" width="90" height="19" hspace="3" border="0"></a></td>
<td width="90"><a href="registro.php" target="_parent" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'button_05\',\'\',\'ima ge/botones/botonRegistroON.gif\',1)"><img src="image/botones/botonRegistroOFF.gif" width="90" height="19" border="0" hspace="3" name="button_05"></a></td>
<td width="90"><a href="contacta.php" target="_parent" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'button_06\',\'\',\'ima ge/botones/botonContactaON.gif\',1)"><img src="image/botones/botonContactaOFF.gif" width="90" height="19" border="0" hspace="3" name="button_06"></a></td>

</tr>

</table>
</td>
</tr>
<tr>

<td width="680" height="9"> <img src="image/bg_menu3.gif" width="685" height="86"></td>
</tr>
<tr>

</tr>

</table>';

}
else
{

echo '<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="onLoad="MM_preloadImages(\'image/botones/botonPrincipalON.gif\',\'image/botones/botonTeoriaON.gif\',
\'image/botones/botonPracticaON.gif\',\'image/botones/botonForoON.gif\',\'image/botones/botonRegistroON.gif\',\'image/botones/botonContactaON.gif\',';


if ( $tipo == "A" )
echo '\'image/botones/botonAlumnoON.gif\',)">';
else
echo '\'image/botones/botonProfesorON.gif\',)">';
echo '<div align="center">
<table width="680" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="680" height="2"><img
src="image/transparent.gif" width="15" height="12"></td>
</tr>
<tr>

<td width="680">

<table width="680" border="0" cellspacing="0" cellpadding="1">

<tr>

<td width="90"><a href="index.php" target="_parent"
onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'button_01\',\'\',\'ima ge/botones/botonPrincipalON.gif\',1)">
<img src="image/botones/botonPrincipalOFF.gif" width="90" height="19" name="button_01" hspace="3" border="0"></a></td>
<td width="90"><a href="teoria.php"
onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage
(\'button_02\',\'\',\'image/botones/botonTeoriaON.gif\',1)" target="_parent"><img src="image/botones/botonTeoriaOFF.gif"
width="90" height="19" name="button_02" hspace="3" border="0"></a></td>
<td width="90"><a href="practica.php" target="_parent"
onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'button_03\',\'\',\'ima ge/botones/botonPracticaON.gif\',1)"><img
src="image/botones/botonPracticaOFF.gif" width="90" height="19" border="0" hspace="3" name="button_03"></a></td>
<td width="90"><a href="foro.php" target="_parent" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'button_04\',\'\',\'ima ge/botones/botonForoON.gif\',1)"><img src="image/botones/botonForoOFF.gif" name="button_04" width="90" height="19" hspace="3" border="0"></a></td>
<td width="90"><a href="registro.php" target="_parent" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'button_05\',\'\',\'ima ge/botones/botonRegistroON.gif\',1)"><img src="image/botones/botonRegistroOFF.gif" width="90" height="19" border="0" hspace="3" name="button_05"></a></td>
<td width="90"><a href="contacta.php" target="_parent"
onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'button_06\',\'\',\'ima ge/botones/botonContactaON.gif\',1)"><img src="image/botones/botonContactaOFF.gif" width="90" height="19" border="0" hspace="3" name="button_06"></a></td>';

if ( $tipo == "A" )
echo '<td width="90"><a href="alumno.php" target="_parent" onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage(\'button_07\',\'\',\'ima ge/botones/botonAlumnoON.gif\',1)"><img src="image/botones/botonAlumnoOFF.gif" width="90" height="19" border="0" hspace="3" name="button_07"></a></td>';
else
echo '<td width="90"><a href="profesor.php" target="_parent" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'button_07\',\'\',\'ima ge/botones/botonProfesorON.gif\',1)"><img src="image/botones/botonProfesorOFF.gif" width="90" height="19" border="0" hspace="3" name="button_07"></a></td>';

echo '</tr> </table> </td> </tr> <tr> <td width="680" height="9"> <img src="image/bg_menu3.gif" width="685" height="86"></td>
</tr> <tr> </tr> </table>';
}

?>

Última edición por Rabak; 08/06/2004 a las 12:47