Jump to content


DARK_LINK

Member Since 06/10/2003
Offline Last Active 02/08/2004, 20:48
-----

Topics I've Started

Erro No Php, Variavel Sendo Um Código...

29/06/2004, 22:02

Pessoal, olha o que eu fiz:
Página Principal (index.php)
<?php require_once('Connections/principal.php'); ?>
<?php
mysql_select_db($database_principal, $principal);
$query_Recordset1 = "SELECT codigo,n FROM codigos ORDER BY n ASC";
$Recordset1 = mysql_query($query_Recordset1, $principal) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
if($row_Recordset1['n'] == 1) {
$cod[0] = $row_Recordset1['codigo'];
$cod[0];
}
if($row_Recordset1['n'] == 2) {
   if(empty($cod[0])) {
   }else{
   $cod[1] = $row_Recordset1['codigo'];
   }
}
if($row_Recordset1['n'] == 3) {
   if(empty($cod[0])) {
   }else{
   $cod[2] = $row_Recordset1['codigo'];
   }
}
?>

<title>RPGZone | Gera&ccedil;&atilde;o Elizar | Games??? &Eacute; aqui mesmo!!</title><style type="text/css">
<!--
body {
	background-image: url(imagens/fundo.jpg);
}
-->
</style>
<table width="766" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="17" height="13"></td>
    <td width="209"></td>
    <td width="19"></td>
    <td width="279"></td>
    <td width="16"></td>
    <td width="209"></td>
    <td width="17"></td>
  </tr>
  <tr>
    <td height="106">&nbsp;</td>
    <td colspan="3" valign="top" background="imagens/logo.jpg"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td>&nbsp;</td>
    <td rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="imagens/headlines.jpg">
      <!--DWLayoutTable-->
      <tr>
        <td width="12" height="26">&nbsp;</td>
        <td width="183">&nbsp;</td>
        <td width="14">&nbsp;</td>
      </tr>
      <tr>
        <td height="72">&nbsp;</td>
        <td valign="top"><?php $cod[1]; ?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="27">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="19"></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="13"></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="434"></td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="imagens/m_principal.jpg">
      <!--DWLayoutTable-->
      <tr>
        <td width="19" height="37">&nbsp;</td>
        <td width="167">&nbsp;</td>
        <td width="23">&nbsp;</td>
      </tr>
      <tr>
        <td height="367">&nbsp;</td>
        <td valign="top">Conte&uacute;do Principal do menu &eacute; aqui! </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="30">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table></td>
    <td>&nbsp;</td>
    <td valign="top"><table width="261" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="261" height="61" valign="top" background="imagens/c_cima.jpg"><!--DWLayoutEmptyCell-->&nbsp;</td>
        </tr>
      <tr>
        <td height="326" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="imagens/c_meio.jpg">
          <!--DWLayoutTable-->
          <tr>
            <td width="30" height="326">&nbsp;</td>
            <td width="205" valign="top"><?php $cod[2]; ?></td>
            <td width="26">&nbsp;</td>
          </tr>
        </table></td>
        </tr>
      <tr>
        <td height="47" valign="top" background="imagens/c_baixo.jpg"><!--DWLayoutEmptyCell-->&nbsp;</td>
        </tr>
    </table></td>
    <td></td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="imagens/m_segundo.jpg">
      <!--DWLayoutTable-->
      <tr>
        <td width="15" height="38">&nbsp;</td>
        <td width="178">&nbsp;</td>
        <td width="16">&nbsp;</td>
      </tr>
      <tr>
        <td height="367">&nbsp;</td>
        <td valign="top">Conte&uacute;do do Menu &eacute; Aqui </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="29">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table></td>
    <td></td>
  </tr>
  <tr>
    <td height="16"></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="47"></td>
    <td colspan="5" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td></td>
  </tr>
</table>
<?php
mysql_free_result($Recordset1);
?>
arquivo 'Connections/principal.php'
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_principal = "localhost";
$database_principal = "rpgzone";
$username_principal = "root";
$password_principal = "";
$principal = mysql_pconnect($hostname_principal, $username_principal, $password_principal) or trigger_error(mysql_error(),E_USER_ERROR); 
?>

Dados do DB:
rpgzone
->codigos
->n
-->n=1
-->codigos

<?php

$mzn_path = "e:\\site\\rpgzone\\mznews"; require_once($mzn_path ."/mzn2.php"); $mzn_selfpage = $s->req['PHP_SELF'];

$mzn2 = new MZn2_Noticias;
$mzn2->categoria = "principal";

?>
e
rpgzone
->codigos
->n
-->n=2
-->codigos

<?php
$mzn2->data = $s->req['mzn_data'];
$mzn2->usuario = $s->req['mzn_usuario'];
$mzn2->busca = $s->req['mzn_busca'];
$mzn2->pagina = $s->req['mzn_pg'];

$mzn2->porpagina = 0;
$mzn2->mostrar_manchetes();
?>

e
rpgzone
->codigos
->n
-->n=3
-->codigos

<?php

$mzn2->data = $s->req['mzn_data'];
$mzn2->usuario = $s->req['mzn_usuario'];
$mzn2->busca = $s->req['mzn_busca'];
$mzn2->pagina = $s->req['mzn_pg'];

$mzn2->porpagina = 5;
$mzn2->mostrar_noticias();

$mzn2->mostrar_paginacao($mzn_selfpage ."?mzn_pg={pagina}", 1);

?>

eu teria que fazer os comandos que estão gravados em MySQL sejam executados no index.php
alguem pode me ajudar?

Variavel Função Dentro De Um Echo

23/05/2004, 19:11

Ae pessoal, tava fazendo uns negocio de logon de usuário, e parei num lugar assim:
Eu fiz isso:
PHP
<?php if(empty($_SESSION["MM_Username"])) {
echo(
'
<form name="login" method="POST" action="<?php echo $loginFormAction; ?>">
<p>Login:
<input type="text" name="login">
<br>
Senha:
<input type="text" name="senha">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
<p>&nbsp;</p>
</form>'
);
}else{
echo(
"Você está logado como:".$_SESSION["MM_Username"]);
echo(
'<BR><a href="<?php echo $logoutAction ?>">Clique aqui para sair</a>');
}
?>

mas tipow as funções $logoutAction , $loginFormAction, como eu faço para ai dentro ele quando clicar por exemplo no "Clique aqui para sair" ele excutar a ação??

aki vai ações:
PHP
<?php
//initialize the session
session_start();

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset(
$_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset(
$_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
session_unregister('MM_Username');
session_unregister('MM_UserGroup');

$logoutGoTo = "index.php";
if (
$logoutGoTo) {
header("Location: $logoutGoTo");
exit;
}
}
?>
<?php
// *** Validate request to login to this site.
session_start();

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset(
$accesscheck)) {
$GLOBALS['PrevUrl'] = $accesscheck;
session_register('PrevUrl');
}

if (isset(
$_POST['login'])) {
$loginUsername=$_POST['login'];
$password=$_POST['senha'];
$MM_fldUserAuthorization = "cargo";
$MM_redirectLoginSuccess = "pagina.php";
$MM_redirectLoginFailed = "restrito.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_rpgzone, $rpgzone);

$LoginRS__query=sprintf("SELECT login, senha, cargo FROM logindata WHERE login='%s' AND senha='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
 
$LoginRS = mysql_query($LoginRS__query, $rpgzone) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if (
$loginFoundUser) {

$loginStrGroup = mysql_result($LoginRS,0,'cargo');

//declare two session variables and assign them
$GLOBALS['MM_Username'] = $loginUsername;
$GLOBALS['MM_UserGroup'] = $loginStrGroup;

//register the session variables
session_register("MM_Username");
session_register("MM_UserGroup");

if (isset(
$_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>

Asp .net

23/05/2004, 17:55

Aew Pessoal, eu tenho uns scripts de administração do meu IIS, mas ele saum Windows-Based, ou seja, eles saum feitos para rodar em widnwos, olhe um exemplo do mkwebdir.vb

'---------------------------------------------------------------------------------------------------
' This function creates a virtual web directory on the specified web site
' and with the specified path
'
'mkwebdir [--computer|-c COMPUTER1, COMPUTER2, COMPUTER3]
'         <--website|-w WEBSITE>
'         <--virtualdir|-v NAME1,PATH1,NAME2,PATH2,...>
'         [--help|-?]
'
'COMPUTER                Computer on which users exists
'WEBSITE1,WEBSITE2       Virtual Web Sites on which directories will be created
'NAME1,PATH1,NAME2,PATH2 Virtual Directories names and paths to create
'
'Example 1  mkwebdir -c MyComputer -w "Default Web Site"
'                       -v "Virtual Dir1","c:\inetpub\wwwroot\dir1","Virtual Dir2","c:\inetpub\wwwroot\dir2"
'
'---------------------------------------------------------------------------------------------------

alguem sabe como eu executo esse script no meu server em ASP .NET?

Visual C++

10/05/2004, 20:22

Pessoal, quando vou adicionar o controle do Winsock no VS 2003.net.. ele da um erro:

Você não tem autorização para usar esse plug-in...

Alguem jah teve esse erro e pode me explicar como eu tiro ele?

Newbie Em Visual C#... Eh Isso Msm...

08/05/2004, 22:24

aew pessoal, eu programava Delphi e Bat... mas queria saber como faço para usar a função goto...

tipow
da uma olhada no ciodigo
Console.Write("Usuário: ");
 	 string user = Console.ReadLine();
 	 if(user == "lucas") 
 	 {
    Console.Write("Usuário correto");
    goto logar;
 	 }
 	 else
 	 { 
    Console.Write("Usuário Incorreto");
    goto fim;
 	 }
 	 Console.Write("Senha: ");
 	 string pass = Console.ReadLine();
 	 if(pass == "teske") {
    Console.Write("Senha Correta!");
    goto logar;
 	 }
 	 else
    Console.Write("Senha Incorreta!");
       goto fim;
 	 }
  fim //preciso definir isso como goto

 	 Console.In.Close;

  logar //preciso definir isso como goto

 	 Console.Write("Logado, inciar? (S/N)");
 	 string sn = Console.ReadLine();

IPB Skin By Virteq