Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/05/2011, 08:06
patiurco
 
Fecha de Ingreso: mayo-2011
Ubicación: Toluca
Mensajes: 115
Antigüedad: 13 años
Puntos: 2
"Insertar formulario php en template"

Hola a todos, buen dia quisiera saber como insertar mis formularios php en un template, ya lo he intentado pero sin suerte alguna, ya que no me reconoce el codigo php, y por lo tanto mis botones y todas la cosas creadas no funcionan, alguien podria explicarme como insertar mis formulario, gracias a todos, debajo dejo el codigo de mi template, y el codigo del formulario que quiero insertar hasta luego:

Template

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3.     <head>
  4.         <title></title>
  5.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6.         <meta name="keywords" content="" />
  7.         <meta name="description" content="" />
  8.         <link href="default.css" rel="stylesheet" type="text/css" media="all" />
  9.     </head>
  10.    
  11.     <body>
  12.  
  13.         <div id="wrapper">
  14.        
  15.             <div id="logo">
  16.                 <h1>Simply<span>Blue</span></h1>
  17.                 <p>Nemo enim ipsam voluptatem quia</p>
  18.             </div>
  19.            
  20.             <div id="page" class="round">
  21.            
  22.                 <div id="menu" class="round">
  23.                     <ul>
  24.                         <li><a href="#" title="" class="round active">Homepage</a></li>
  25.                         <li><a href="#" title="" class="round">About Us</a></li>
  26.                         <li><a href="#" title="" class="round">Services</a></li>
  27.                         <li><a href="#" title="" class="round">Products</a></li>
  28.                         <li><a href="#" title="" class="round">My Account</a></li>
  29.                         <li><a href="#" title="" class="round">Contact Us</a></li>
  30.                     </ul>  
  31.                 </div>
  32.                
  33.                 <div id="splash">
  34.                     <img src="images/splash.jpg" alt="" width="960" height="200" class="round" />
  35.                 </div>
  36.                
  37.                 <div id="wrapper2" class="round">
  38.                
  39.                     <div id="sidebar" class="round">
  40.                    
  41.                         <h3>Header Level 3</h3>
  42.                         <ul>
  43.                            <li><a href="#">Home</a></li>
  44.                            <li><a href="#">About</a></li>
  45.                            <li><a href="#">Clients</a></li>
  46.                            <li><a href="#">Contact Us</a></li>
  47.                         </ul>              
  48.                        
  49.                         <h3>Header Level 3</h3>
  50.                         <ul>
  51.                            <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
  52.                            <li>Aliquam tincidunt mauris eu risus.</li>
  53.                            <li>Vestibulum auctor dapibus neque.</li>
  54.                            <li>Morbi in sem quis dui placerat ornare.</li>
  55.                         </ul>
  56.  
  57.                         <h3>Header Level 3</h3>
  58.                         <ul>
  59.                            <li>Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat.</li>
  60.                         </ul>
  61.                    
  62.                     <!-- End Sidebar -->               
  63.                     </div>
  64.                    
  65.                     <div id="content" class="round">
  66.                       <h1><!-- End Content -->
  67.                       </h1>
  68.                                    
  69.                      
  70.                       <h1>&nbsp; </h1>
  71.                     </div>
  72.            
  73.                   <div style="clear: both"></div>
  74.            
  75.                 <!-- End Wrapper 2 -->
  76.                 </div>
  77.                
  78.             <!-- End Page -->
  79.             </div>
  80.        
  81.         <!-- End Wrapper -->
  82.         </div>
  83.        
  84.         <div id="footer">
  85.             <p>copyright &copy; 2011 Simply Blue. Design <a href="http://freewebsitetemplat.es" title="free website templates">Free Website Templates</a>.</p>
  86.         </div>
  87.        
  88.        
  89.     <div style="text-align: center; font-size: 0.75em;">Design downloaded from <a href="http://www.freewebtemplates.com/">free website templates</a>.</div></body>
  90.    
  91. </html>



Formulario:

Código PHP:
Ver original
  1. <?php
  2. echo"<table border=1 bordercolor='Black' background='Images/9.jpg'><tr><td><table border=0><tr><td align='left'><img src='Images/8.jpg'></td></tr>";
  3. echo"<form action='agregar.php' method='POST' name='add' id='add' target='_self'>";
  4. echo"<tr align='center'><td><input type='submit' value='Agregar producto' class='botonsexy'><img src='Images/3.png'></td></tr></form>";
  5. echo"<form action='modificar.php' method='POST' name='mod' id='mod' target='_self'>";
  6. echo"<tr align='center'><td><input type='submit' value='Modificar informacion de producto' class='botonsexy'><img src='Images/4.png'></td></tr></form>";
  7. echo"<form action='eliminar.php' method='POST' name='del' id='del' target='_self'>";
  8. echo"<tr align='center'><td><input type='submit' value='Eliminar producto' class='botonsexy'><img src='Images/5.png'></td></tr></form>";
  9. echo"<form action='reporte.php' method='POST' name='rep' id='rep' target='_self'>";
  10. echo"<tr align='center'><td><input type='submit' value='Generar reporte' class='botonsexy'><img src='Images/6.png'></td></tr></form></table></table>";
  11. echo"<div id='ajax'></div>";
  12. ?>
  13. <script type="text/javascript">
  14. $(function (e) {
  15.     $('#add').submit(function (e) {
  16.         e.preventDefault()
  17.         $('#ajax').load('agregar.php?' + $('#add').serialize())
  18.     })
  19. })
  20. </script>
  21. <script type="text/javascript">
  22. $(function (e) {
  23.     $('#mod').submit(function (e) {
  24.         e.preventDefault()
  25.         $('#ajax').load('modificar.php?' + $('#mod').serialize())
  26.     })
  27. })
  28. </script>
  29. <script type="text/javascript">
  30. $(function (e) {
  31.     $('#del').submit(function (e) {
  32.         e.preventDefault()
  33.         $('#ajax').load('eliminar.php?' + $('#del').serialize())
  34.     })
  35. })
  36. </script>
  37. <script type="text/javascript">
  38. $(function (e) {
  39.     $('#rep').submit(function (e) {
  40.         e.preventDefault()
  41.         $('#ajax').load('reporte.php?' + $('#rep').serialize())
  42.     })
  43. })
  44. </script>
  45. </html>