Nueva pregunta

Pregunta:

Fecha: 12-03-2018 01:55:55 (En Español)

Problema al incluir un archivo php [No resuelta]

Hola buenas, sigo con el mismo problema que la ultima vez... la cosa es que extraje informacion de una pagina web y lo almacene en una base de datos y despues de eso lo que quiero es publicarlo en mi pagina web. Para ello le cambie al index del .html al .php y hasta hay bien como me dijisteis aqui ya que se visualiza bien. El problema es cuando quiero incluir mi tabla .php en el index.php ya que la tabla se visualiza mal y nose como ponerlo bien... La linea que utilizo es
<?php require ?>
me gustaria poder poneros una foto de como se visualiza pero no he conseguido incluirlo...
Si alguno sabe como solucionar el problema de la tabla se lo agradeceria.
Un saludo y gracias ;)
Etiquetas: CSS - HTML - PHP Votos: 0 - Respuestas: 3 - Vistas: 20 Compartir en: Google Facebook Twitter LinkedIn Link
 

Respuestas:

  • Fecha: 12-03-2018 08:40:02 Primero puedes subir la imagen al algún servicio como ESTE y luego colocas aquí la url o la imagen como tal.

    Por otro lado, debes publicar ambos códigos tanto el que genera la tabla con la consulta a la base de datos, como el archivo donde muestra dicha tabla para poder analizar lo que haces, como lo haces y las posibles soluciones.
      Votos: 0 - Link respuesta
     
  • Fecha: 12-03-2018 08:53:27 Imanol, hola, publica tus códigos para ayudarte.
    Aparentemente la tabla estaría mal diseñada quizás, publica tu código.
    Publica el código html de la tabla con las inclusiones de php (<? echo $valorCampo3 ?>) para empezar.

    Saludos
      Votos: 0 - Link respuesta
     
  • Fecha: 13-03-2018 00:19:09 https://ibb.co/hpewhx



    bien, os mando el codigo del index.php y el .css y la tabla

    <!DOCTYPE HTML>
    <!--
    -->
    <html>
    	<head>
    		<title>NOVUSBET</title>
    		<meta charset="utf-8" />
    		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    		<!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
    		<link rel="stylesheet" href="assets/css/main.css" />
    		<!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
    		<!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
    	</head>
    	<body>
    
    <!-- Wrapper -->
    	<div id="wrapper">
    
    				<!-- Main -->
    					<div id="main">
    						<div class="inner">
    
    							<!-- Header -->
    								<header id="header">
    									<a href="index.php" class="logo"><strong>NOVUSBET</strong>TEAMS</a>
    									<ul class="icons">
    										<li><a href="#" class="icon fa-twitter"><span class="label">Twitter</span></a></li>
    										<li><a href="#" class="icon fa-facebook"><span class="label">Facebook</span></a></li>
    										<li><a href="#" class="icon fa-snapchat-ghost"><span class="label">Snapchat</span></a></li>
    										<li><a href="#" class="icon fa-instagram"><span class="label">Instagram</span></a></li>
    										<li><a href="#" class="icon fa-medium"><span class="label">Medium</span></a></li>
    									</ul>
    								</header>
    						</div>
    					</div>
    
    								
    				<!-- sidebar -->			
    					<div id="sidebar">
    						<div class="inner">
    
    							<!-- Search -->
    								<section id="search" class="alt">
    									<form method="post" action="#">
    							<input type="text" name="query" id="query" placeholder="Search" />
    									</form>
    								</section>
    
    							<!-- Menu -->
    								<nav id="menu">
    									<header class="major">
    										<h2>SPORTS</h2>
    									</header>
    									<ul>
    										<li><a href="index.php">SOCCER</a></li>
    										<li><a href="generic.php">Generic</a></li>
    										<li><a href="elements.php">Elements</a></li>
    										<li>
    									
    										<span class="opener">SOCCER</span>
    										<span class="opener">EUROPE</span>
    										<span class="opener">TOP COUNTRIES</span>
    										<span class="opener">ENGLAND</span>
    											
    										<div class="checkbox">
    											
    										<input type="checkbox" id="check1">
    										<label for="check1">PREMIER LEAGUE</label>
    											<?php require('\premier-league.php');?>
    											<input type="checkbox" id="check2">
    											<label for="check2">CHAMPIONSHIP</label>		
    													<input type="checkbox" id="check3">
    											<label for="check3">LEAGUE ONE</label>			
    													<input type="checkbox" id="check4">
    										<label for="check4">NATIONAL LEAGUE</label>		
    													<input type="checkbox" id="check5">
    								<label for="check6">FOOTBALL LEAGUE TROPHY</label>	
    											
    											</div>											
    												
    											<span class="opener">TURKEY</span>
    											<ul>
    												<li><a href="#">SUPER LIG</a></li>
    												<li><a href="#">1. LIG</a></li>
    												<li><a href="#">AMATEUR</a></li> 
    											</ul>
    											<span class="opener">SCOTLAND</span>
    											<ul>
    												<li><a href="#">PREMIERSHIP</a></li>
    												<li><a href="#">CHAMPIONSHIP</a></li>
    												<li><a href="#">LEAGUE ONE</a></li>
    												<li><a href="#">LEAGUE TWO</a></li>
    										<li><a href="#">DEVELOPMENT LEAGUE</a></li>
    									<li><a href="#">PREMIER LEAGUE 1, WOMEN</a></li>
    											</ul>
    											<span class="opener">SPAIN</span>
    											<ul>
    												<li><a href="#">LA LIGA</a></li>
    												<li><a href="#">LA LIGA 2</a></li>
    											<li><a href="#">SECOND DIVISION B</a></li>
    									<li><a href="#">PRIMERA DIVISION WOMEN</a></li>
    												<li><a href="#">AMATEUR</a></li>
    											</ul>


    ese seria el index.php no estan todo los datos pero la pagina es asi, faltan incluir mas tablas.
    Lo que me pasa es que en los checkbox me deja seleccionarlos pero no me hace nada, es decir, seleccionandolo o sin seleccionarlo me sale la tabla y yo solo lo quiero cuando lo selecciono. (Si la opcion de los checkbox esta mal lo puedo poner de la otra manera que aparece)

    /* Table */
    
    	.table-wrapper {
    		-webkit-overflow-scrolling: touch;
    		overflow-x: auto;
    	}
    
    	table {
    		margin: 0 0 2em 0;
    		width: 100%;
    	}
    
    		table tbody tr {
    			border: solid 1px rgba(210, 215, 217, 0.75);
    			border-left: 0;
    			border-right: 0;
    		}
    
    			table tbody tr:nth-child(2n + 1) {
    				background-color: rgba(230, 235, 237, 0.25);
    			}
    
    		table td {
    			padding: 0.75em 0.75em;
    		}
    
    		table th {
    			color: #3d4449;
    			font-size: 0.9em;
    			font-weight: 600;
    			padding: 0 0.75em 0.75em 0.75em;
    			text-align: left;
    		}
    
    		table thead {
    			border-bottom: solid 2px rgba(210, 215, 217, 0.75);
    		}
    
    		table tfoot {
    			border-top: solid 2px rgba(210, 215, 217, 0.75);
    		}
    
    		table.alt {
    			border-collapse: separate;
    		}
    
    			table.alt tbody tr td {
    				border: solid 1px rgba(210, 215, 217, 0.75);
    				border-left-width: 0;
    				border-top-width: 0;
    			}
    
    				table.alt tbody tr td:first-child {
    					border-left-width: 1px;
    				}
    
    			table.alt tbody tr:first-child td {
    				border-top-width: 1px;
    			}
    
    			table.alt thead {
    				border-bottom: 0;
    			}
    
    			table.alt tfoot {
    				border-top: 0;
    			}


    este seria el de la tabla el .css

    /* Menu */
    
    	#menu input [type=checkbox]:checked + label {
    		display:none;
    		}
    	
    	#menu ul {
    		-moz-user-select: none;
    		-webkit-user-select: none;
    		-ms-user-select: none;
    		user-select: none;
    		color: #3d4449;
    		font-family: "Roboto Slab", serif;
    		font-family: 400;
    		letter-spacing: 0.075em;
    		list-style: none;
    		margin-bottom: 0;
    		padding: 0;
    		text-transform: uppercase;
    	}
    
    		#menu ul a, #menu ul span {
    			border-bottom: 0;
    			color: inherit;
    			cursor: pointer;
    			display: block;
    			font-size: 0.9em;
    			padding: 0.625em 0;
    		}
    
    			#menu ul a:hover, #menu ul span:hover {
    				color: #f56a6a;
    			}
    
    			#menu ul a.opener, #menu ul span.opener {
    				-moz-transition: color 0.2s ease-in-out;
    				-webkit-transition: color 0.2s ease-in-out;
    				-ms-transition: color 0.2s ease-in-out;
    				transition: color 0.2s ease-in-out;
    				text-decoration: none;
    				-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
    				position: relative;
    			}
    
    				#menu ul a.opener:before, #menu ul span.opener:before {
    					-moz-osx-font-smoothing: grayscale;
    					-webkit-font-smoothing: antialiased;
    					font-family: FontAwesome;
    					font-style: normal;
    					font-weight: normal;
    					text-transform: none !important;
    				}
    
    				#menu ul a.opener:before, #menu ul span.opener:before {
    					-moz-transition: color 0.2s ease-in-out, -moz-transform 0.2s ease-in-out;
    					-webkit-transition: color 0.2s ease-in-out, -webkit-transform 0.2s ease-in-out;
    					-ms-transition: color 0.2s ease-in-out, -ms-transform 0.2s ease-in-out;
    					transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
    					color: #9fa3a6;
    					content: '\f078';
    					position: absolute;
    					right: 0;
    				}
    
    				#menu ul a.opener:hover:before, #menu ul span.opener:hover:before {
    					color: #f56a6a;
    				}
    
    				#menu ul a.opener.active + ul, #menu ul span.opener.active + ul {
    					display: block;
    				}
    
    				#menu ul a.opener.active:before, #menu ul span.opener.active:before {
    					-moz-transform: rotate(-180deg);
    					-webkit-transform: rotate(-180deg);
    					-ms-transform: rotate(-180deg);
    					transform: rotate(-180deg);
    				}
    
    	#menu > ul > li {
    		border-top: solid 1px rgba(210, 215, 217, 0.75);
    		margin: 0.5em 0 0 0;
    		padding: 0.5em 0 0 0;
    	}
    
    		#menu > ul > li > ul {
    			color: #9fa3a6;
    			display: none;
    			margin: 0.5em 0 1.5em 0;
    			padding-left: 1em;
    		}
    
    			#menu > ul > li > ul a, #menu > ul > li > ul span {
    				font-size: 0.8em;
    			}
    
    			#menu > ul > li > ul > li {
    				margin: 0.125em 0 0 0;
    				padding: 0.125em 0 0 0;
    			}
    
    		#menu > ul > li:first-child {
    			border-top: 0;
    			margin-top: 0;
    			padding-top: 0;
    		}


    este seria la parte del menu en el .css

    <!DOCTYPE html>
    <html>
    	<head>
    		<title>PREMIER LEAGUE</title>
    		<meta charset="UTF-8" />
    	<style>
    	thead {color:blue;}
    		table, tr, th, td {
    			border: 2px solid black;
    			height: 20px;
    			width: 520px;
    		}
    	</style>
    	</head>
    	<body>
    	
    <?php	
    $servername = "localhost";
    $username = "";
    $password = "";
    $dbname = ";
    
    // Create connection
    $conn = new mysqli($servername, $username, $password, $dbname);
    
    // Check connection
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    } 
    
    ?>
    
    <table align="center">
    	<thead>
    	<tr>
    		<td colspan ="8">PREMIER LEAGUE 2017/18</td>
    	</tr>
    	</thead>
    	<tr>
    		<th>Team</th>
    		<th>Played</th>
    		<th>Win</th>
    		<th>Draw</th>
    		<th>Loss</th>
    		<th>Goals</th>
    		<th>Diff</th>
    		<th>Points</th>
    	</tr>
    		
    		<?php
    		$result = mysqli_query($conn,"SELECT * FROM `premierleague2017/18`");
    		while($row = mysqli_fetch_array($result))
    		{?>
    			<tr>
    			
    			<td><?php echo $row["Team"];?></td>
    			<td><?php echo $row["Played"];?></td>
    			<td><?php echo $row["Wins"];?></td>
    			<td><?php echo $row["Deals"];?></td>
    			<td><?php echo $row["Loss"];?></td>
    			<td><?php echo $row["Goals"];?></td>
    			<td><?php echo $row["Diff"];?></td>
    			<td><?php echo $row["Points"];?></td>
    			
    				</tr>
    		
    		<?php
    		}	
    		
    		?>
    		
    		</table>
    	</body>
    </html>
    


    y esta seria la parte del .php de la tabla (todas son iguales)

    muchas gracias ante todo! si necesitais algo mas yo os lo mostrare.
      Votos: 0 - Link respuesta
     
Para participar activamente de la comunidad primero debes autenticarte, ingresa al sistema.Iniciar Sesión
 
frjcbbae garagebible.com