Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Carolina Louise Coelho

Php

Recommended Posts

 

<?PHP
session_start();
include("conexao.php");
if($_POST['continuar_login']) {
$login=$_POST["login"];
$senha=$_POST["senha"];
$VerificaLogin=mysql_num_rows(mysql_query("select login from contas where login='".$login."' and senha='".$senha."'"));
$VerificaSenha=mysql_num_rows(mysql_query("select senha from contas where senha='".$senha."' and login='".$login."'"));
if(empty($login)||empty($senha)){
session_destroy();
echo "<script>alert('Preencha todos os campos.');
location='javascript:history.back()'</script>";
}elseif($VerificaLogin<=0){
session_destroy();
echo "<script>alert('Login ou senha incorretos.');
location='javascript:history.back()'</script>";
}elseif($VerificaSenha<=0){
session_destroy();
echo "<script>alert('Login ou senha incorretos.');
location='javascript:history.back()'</script>";
}else{
echo "<script>alert('Logado com sucesso.');
location='javascript:history.back()'</script>";
}
?>
<!DOCTYPE html>
<!--[if IE 8]> <html class="ie ie8"> <![endif]-->
<!--[if IE 9]> <html class="ie ie9"> <![endif]-->
<!--[if gt IE 9]><!--> <html> <!--<![endif]-->
<head>
 
<!-- Basic -->
<meta charset="utf-8">
<title>Right Sidebar | Porto - Responsive HTML5 Template</title>
<meta name="keywords" content="HTML5 Template" />
<meta name="description" content="Porto - Responsive HTML5 Template">
<meta name="author" content="Crivos.com">
 
<!-- Mobile Metas -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
 
<!-- Web Fonts  -->
<link href="[url=http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800|Shadows+Into+Light]http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800|Shadows+Into+Light [/url]" rel="stylesheet" type="text/css">
 
<!-- Libs CSS -->
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/fonts/font-awesome/css/font-awesome.css">
<link rel="stylesheet" href="vendor/flexslider/flexslider.css" media="screen" />
<link rel="stylesheet" href="vendor/fancybox/jquery.fancybox.css" media="screen" />
 
<!-- Theme CSS -->
<link rel="stylesheet" href="css/theme.css">
<link rel="stylesheet" href="css/theme-elements.css">
 
<!-- Custom CSS -->
<link rel="stylesheet" href="css/custom.css">
 
<!-- Skin -->
<link rel="stylesheet" href="css/skins/blue.css">
 
<!-- Responsive CSS -->
<link rel="stylesheet" href="css/bootstrap-responsive.css" />
<link rel="stylesheet" href="css/theme-responsive.css" />
 
<!-- Favicons -->
<link rel="shortcut icon" href="img/favicon.ico">
<link rel="apple-touch-icon" href="img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="img/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="img/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="144x144" href="img/apple-touch-icon-144x144.png">
 
<!-- Head Libs -->
<script src="vendor/modernizr.js"></script>
 
<!--[if IE]>
<link rel="stylesheet" href="css/ie.css">
<![endif]-->
 
<!--[if lte IE 8]>
<script src="vendor/respond.js"></script>
<![endif]-->
 
<!-- Facebook OpenGraph Tags - Go to [url=http://developers.facebook.com/]http://developers.facebook.com/ [/url] for more information.
<meta property="og:title" content="Porto Website Template."/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="[url=http://www.crivos.com/themes/porto'>http://www.crivos.com/themes/porto]http://www.crivos.com/themes/porto'>http://www.crivos.com/themes/porto [/url]"/>
<meta property="og:image" content="[url=http://www.crivos.com/themes/porto'>http://www.crivos.com/themes/porto/]http://www.crivos.com/themes/porto'>http://www.crivos.com/themes/porto/ [/url]"/>
<meta property="og:site_name" content="Porto"/>
<meta property="fb:app_id" content=""/>
<meta property="og:description" content="Porto - Responsive HTML5 Template"/>
-->
</head>
<body>
 
<div class="body">
<header>
<div class="container">
<h1 class="logo">
<a href="index.html">
<img alt="Porto" src="img/logo.png">
</a>
</h1>
<div class="search">
<form class="form-search" id="searchForm" action="page-search-results.html" method="get">
<div class="control-group">
<input type="text" class="input-medium search-query" name="q" id="q" placeholder="Procurar...">
<button class="search" type="submit"><i class="icon-search"></i></button>
</div>
</form>
</div>
<nav>
<ul class="nav nav-pills nav-top">
<li>
<a href="about-us.html"><i class="icon-angle-right"></i>Sobre</a>
</li>
<li>
<a href="contact-us.html"><i class="icon-angle-right"></i>Contato</a>
</li>
</ul>
</nav>
<div class="social-icons">
<ul class="social-icons">
<li class="facebook"><a href="[url=http://www.facebook.com/'>http://www.facebook.com/]http://www.facebook.com/'>http://www.facebook.com/ [/url]" target="_blank" title="Facebook">Facebook</a></li>
<li class="twitter"><a href="[url=http://www.twitter.com/'>http://www.twitter.com/]http://www.twitter.com/'>http://www.twitter.com/ [/url]" target="_blank" title="Twitter">Twitter</a></li>
</ul>
</div>
<nav>
                        <ul class="nav nav-pills nav-main" id="mainMenu">
<li>
<a href="contact-us.html">Home</a>
</li>
                            <li>
<a href="contact-us.html">Cadastrar</a>
</li>
                            <li>
<a href="contact-us.html">Animês</a>
</li>
                            <li>
<a href="contact-us.html">Mangás</a>
</li>
                            <li>
<a href="contact-us.html">Contato</a>
</li>
</ul>
</nav>
</div>
</header>
 
<div role="main" class="main">
 
<section class="page-top">
<div class="container">
<div class="row">
<div class="span12">
<ul class="breadcrumb">
<li><a href="index.html">Home</a> </li>
</ul>
</div>
</div>
<div class="row">
<div class="span12">
<h2>Home</h2>
</div>
</div>
</div>
</section>
 
<div class="container">
 
<div class="row">
<? 
$ir=$_GET["ir"];
$ext=(isset($_GET["ext"]));
if(empty($ext))
$ext="php";
if(empty($ir))
$ir="home.php";
else $ir.=".".$ext;
if(file_exists($ir)) 
include $ir;
else
include("404.php");
?>
 
<div class="span3">
<aside class="sidebar">
 
<h4>Categorias</h4>
<ul class="nav nav-list primary pull-bottom">
<li><a href="#">Home</a></li>
                                    <li><a href="#">Cadastrar</a></li>
<li><a href="#">Animês</a></li>
<li><a href="#">Mangás</a></li>
<li><a href="#">Contato</a></li>
</ul>
 
<div class="tabs">
<ul class="nav nav-tabs">
<li class="active"><a href="#popularPosts" data-toggle="tab"><i class="icon-star"></i> Popular</a></li>
<li><a href="#recentPosts" data-toggle="tab">Últimos Updates</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="popularPosts">
<ul class="simple-post-list">
<li>
<div class="post-image">
<div class="thumbnail">
<a href="blog-single.html">
<img src="img/blog/blog-thumb-1.jpg" alt="">
</a>
</div>
</div>
<div class="post-info">
<a href="blog-single.html">Nullam Vitae Nibh Un Odiosters</a>
<div class="post-meta">
Jan 10, 2013
</div>
</div>
</li>
<li>
<div class="post-image">
<div class="thumbnail">
<a href="blog-single.html">
<img src="img/blog/blog-thumb-2.jpg" alt="">
</a>
</div>
</div>
<div class="post-info">
<a href="blog-single.html">Vitae Nibh Un Odiosters</a>
<div class="post-meta">
Jan 10, 2013
</div>
</div>
</li>
<li>
<div class="post-image">
<div class="thumbnail">
<a href="blog-single.html">
<img src="img/blog/blog-thumb-3.jpg" alt="">
</a>
</div>
</div>
<div class="post-info">
<a href="blog-single.html">Odiosters Nullam Vitae</a>
<div class="post-meta">
Jan 10, 2013
</div>
</div>
</li>
</ul>
</div>
<div class="tab-pane" id="recentPosts">
<ul class="simple-post-list">
<li>
<div class="post-image">
<div class="thumbnail">
<a href="blog-single.html">
<img src="img/blog/blog-thumb-2.jpg" alt="">
</a>
</div>
</div>
<div class="post-info">
<a href="blog-single.html">Vitae Nibh Un Odiosters</a>
<div class="post-meta">
Jan 10, 2013
</div>
</div>
</li>
<li>
<div class="post-image">
<div class="thumbnail">
<a href="blog-single.html">
<img src="img/blog/blog-thumb-3.jpg" alt="">
</a>
</div>
</div>
<div class="post-info">
<a href="blog-single.html">Odiosters Nullam Vitae</a>
<div class="post-meta">
Jan 10, 2013
</div>
</div>
</li>
<li>
<div class="post-image">
<div class="thumbnail">
<a href="blog-single.html">
<img src="img/blog/blog-thumb-1.jpg" alt="">
</a>
</div>
</div>
<div class="post-info">
<a href="blog-single.html">Nullam Vitae Nibh Un Odiosters</a>
<div class="post-meta">
Jan 10, 2013
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
 
<hr />
<?
if(!isset($_SESSION["login"])){
echo"<h4>Login</h4>\n<form name=\"continuar_login\" id=\"continuar_login\" method=\"post\" action\"\">\n<p>Login:</p>\n<input name=\"login\" id=\"login\" type=\"text\">\n<p>Senha:</p>\n<input name=\"senha\" id=\"senha\" type=\"password\">\n<input name=\"continuar_login\" id=\"continuar_login\" type=\"submit\"  class=\"btn btn-primary btn-large\" value=\"Entrar\">\n</form>\n"; 
}elseif(!isset($_SESSION["senha"])){
echo"<h4>Login</h4>\n<form name=\"continuar_login\" id=\"continuar_login\" method=\"post\" action\"\">\n<p>Login:</p>\n<input name=\"login\" id=\"login\" type=\"text\">\n<p>Senha:</p>\n<input name=\"senha\" id=\"senha\" type=\"password\">\n<input name=\"continuar_login\" id=\"continuar_login\" type=\"submit\"  class=\"btn btn-primary btn-large\" value=\"Entrar\">\n</form>\n"; 
}elseif(isset($_SESSION["login"])){
$login=$_SESSION["login"];
$senha=$_SESSION["senha"];
$acesso=mysql_fetch_row(mysql_query("select acesso from contas where login='".$login."' AND senha='".$senha."'"));
switch($tipoconta[0]){
case 0:$acesso="Normal"; 
break;
case 1:$acesso="Equipe";
break;
case 2:$acesso="Adm-in";
break;
default:$acesso="Não especificado.";
}
echo"sucesso";
}
?>
</aside>
</div>
</div>
 
</div>
 
</div>
 
<footer>
<div class="container">
<div class="row">
<div class="span3">
<h4>Últimos Tweet:</h4>
<div id="tweet" class="twitter">
<p>Espere um tempo...</p>
</div>
</div>
<div class="span4">
<div class="contact-details">
<h4>Pedidos</h4>
<ul class="contact">
<li><p><i class="icon-envelope"></i> <strong>Email:</strong> <a href="mailto:admin@drawn.com">admin@drawn.com</a></p></li>
</ul>
</div>
</div>
<div class="span2">
<h4>Nos Siga:</h4>
<div class="social-icons">
<ul class="social-icons">
<li class="facebook"><a href="[url=http://www.facebook.com/'>http://www.facebook.com/]http://www.facebook.com/'>http://www.facebook.com/ [/url]" target="_blank" data-placement="bottom" rel="tooltip" title="Facebook">Facebook</a></li>
<li class="twitter"><a href="[url=http://www.twitter.com/'>http://www.twitter.com/]http://www.twitter.com/'>http://www.twitter.com/ [/url]" target="_blank" data-placement="bottom" rel="tooltip" title="Twitter">Twitter</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
<div class="row">
<div class="span1">
<a href="index.html" class="logo">
<img alt="Porto Website Template" src="img/logo-footer.png">
</a>
</div>
<div class="span7">
<p>© Copyright 2013 by Crivos. Powered by <a href="mailto:brundbar@live.com">Bruno Barros</a>. All Rights Reserved.</p>
</div>
<div class="span4"></div>
</div>
</div>
</div>
</footer>
</div>
 
<!-- Libs -->
<script type="text/javascript" src="[url=https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js]https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js [/url]"></script>
<script>window.jQuery || document.write('<script src="vendor/jquery.js"><\/script>')</script>
<script src="vendor/jquery.easing.js"></script>
<script src="vendor/jquery.cookie.js"></script>
<!-- <script src="master/style-switcher/style.switcher.js"></script> -->
<script src="vendor/bootstrap.js"></script>
<script src="vendor/selectnav.js"></script>
<script src="vendor/twitterjs/twitter.js"></script>
<script src="vendor/flexslider/jquery.flexslider.js"></script>
<script src="vendor/jflickrfeed/jflickrfeed.js"></script>
<script src="vendor/fancybox/jquery.fancybox.js"></script>
<script src="vendor/jquery.validate.js"></script>
 
<script src="js/plugins.js"></script>
 
<!-- Page Scripts -->
 
<!-- Theme Initializer -->
<script src="js/theme.js"></script>
 
<!-- Custom JS -->
<script src="js/custom.js"></script>
 
<!-- Google Analytics: Change UA-XXXXX-X to be your site's ID. Go to [url=http://www.google.com/analytics/'>http://www.google.com/analytics/]http://www.google.com/analytics/'>http://www.google.com/analytics/ [/url] for more information. -->
<!--
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
 
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? '[url=https://ssl]https://ssl [/url]' : '[url=http://www]http://www [/url]') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
-->
</body>
</html>

 

 

o seguinte erro é esse:

Parse error: syntax error, unexpected $end in C:\AppServ\www\aqui\index.php on line 420

 

 

já consegui arrumar o erro.

Compartilhar este post


Link para o post
Compartilhar em outros sites

constatei que você esqueceu de fechar o primeiro, tente atualizar o inicio de seu código por esse aqui e veja se funciona

 

<?php
session_start();
include("conexao.php");
if($_POST['continuar_login']) {
$login=$_POST["login"];
$senha=$_POST["senha"];
$VerificaLogin=mysql_num_rows(mysql_query("select login from contas where login='".$login."' and senha='".$senha."'"));
$VerificaSenha=mysql_num_rows(mysql_query("select senha from contas where senha='".$senha."' and login='".$login."'"));

if(empty($login)||empty($senha)){
	
session_destroy();
echo "<script>alert('Preencha todos os campos.');
location='javascript:history.back()'</script>";

}elseif($VerificaLogin<=0){
	
session_destroy();
echo "<script>alert('Login ou senha incorretos.');
location='javascript:history.back()'</script>";

}elseif($VerificaSenha<=0){
	
session_destroy();
echo "<script>alert('Login ou senha incorretos.');
location='javascript:history.back()'</script>";
}else{
	
echo "<script>alert('Logado com sucesso.');
location='javascript:history.back()'</script>";
}

} // estava faltando fechar o primeiro IF
?>
<!DOCTYPE html>

Se ajudou clica no rep_up.png aqui ao lado para dar um pontinho e marque o tópico como resolvido.. :natalsmile:

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.