Sponsored Content
Top Forums Web Development I can't open my index.php page after insert php code Post 302355162 by metalfreakbr on Monday 21st of September 2009 08:17:28 PM
Old 09-21-2009
Question I can't open my index.php page after insert php code

Hello guys,
Does anyone can help me?
I've just made my simple index.php without any code, but after insert session code to check if any user is authenticated, my index.php doesn't work anymore.
Any fresh eyes could help me to see what and where the code is wrong?
Code:
<?
                    if ($_POST['entrar']=='Entrar!')
                       {
                        @session_start();
                        $result = mysql_query('select log_nome,senha from usuarios where log_nome="'.trim($nome).'";',$conexao);
                        if (mysql_num_rows($result)>0)
                        {
                         $usuSenha = mysql_result($result,0,senha);
                        else
                        {
                         $usuSenha = 'notuser';
                        }
                         if ($result and ($senha==$usuSenha) and ($usuSenha<>'notuser'))
                         {
                          @session_register($nome);
                          echo '<p align="center">';
                          echo '<font style="Tahoma" size=4>';
                          echo $nome.'</font><BR>';
                          echo '<font style="Tahoma" size=2>';
                          echo 'Você está on-line</font>';
                          echo '</p>';
                         }
                         else
                         {
                          echo 'Usuário não autorizado';
                         }
                        }
                        else
                        {
                         echo '<form method="post" name="logar" action="">
                         <font style="Tahoma" size=1>
                               Nome: <input type="text" name="nome" value="" size="15"><BR>
                               Senha: <input type="text" name="senha" value="" size="15"><BR>
                         </font>
                         <p align="center">
                         <input onmouseover=this.style.cursor="hand" type="submit"
                         name="entrar" value="Entrar!" STYLE="border:0; height:18;
                         width=50; background:#E8F3FD">
                         </p>
                               </form>';
                        }
                    ?>

I'll apreciate any kind of help.
Thanks
 

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

PHP: problem with index.php

iam geting a error with this index script. heres the error Parse error: parse error in c:\phpdev\www\dev\compulearn\in work\index.php on line 39 Whats wrong?? ------------------------ <?php //display header and left bars include ('header.php'); include ('left.php'); //connect... (13 Replies)
Discussion started by: perleo
13 Replies

2. Shell Programming and Scripting

PHP:page.php?id= ????

Hi, i have this script to read from mysql (layout below) and the script will display the course title, and a url to the id, but when i click on the url it just goes back to that page(displaying all the course titles)but when u click on a course title i want it to read from detail table in php and... (1 Reply)
Discussion started by: perleo
1 Replies

3. UNIX for Dummies Questions & Answers

Integrating bash script into php (page)

I have written a bash script...now i need to call the script from php page. Can you give me an example to demonstrate how it is done?:( (1 Reply)
Discussion started by: xerox
1 Replies

4. Shell Programming and Scripting

Running php index.php as shell in webpage

so i have a bit of a unique situation. i have an encrypted index.php file that that can't be run the normal way that a web browser would run it. if it is run the normal way, the php script will show only gibberish on the web browser, instead of the actual php code. when run from the command... (8 Replies)
Discussion started by: SkySmart
8 Replies

5. Shell Programming and Scripting

Test Server - Forum Code Changes for PHP 5.3.10 to PHP 7

Here is some docs of my ongoing work to port this forum PHP code which is running on 5.3.10, to PHP 7. Motivation: Unfortunately, every thing that has a beginning must have an end. PHP 5.6 active support ended January 19, 2017. It will receive security support until December 31, 2018. #1 ... (7 Replies)
Discussion started by: Neo
7 Replies
PHAR.CREATEDEFAULTSTUB(3)						 1						 PHAR.CREATEDEFAULTSTUB(3)

Phar::createDefaultStub - Create a phar-file format specific stub

SYNOPSIS
finalpublicstatic string Phar::createDefaultStub ([string $indexfile], [string $webindexfile]) DESCRIPTION
This method is intended for creation of phar-file format-specific stubs, and is not intended for use with tar- or zip-based phar archives. Phar archives contain a bootstrap loader, or stub written in PHP that is executed when the archive is executed in PHP either via include: <?php include 'myphar.phar'; ?> php myphar.phar This method provides a simple and easy method to create a stub that will run a startup file from the phar archive. In addition, different files can be specified for running the phar archive from the command line versus through a web server. The loader stub also calls Phar.interceptFileFuncs(3) to allow easy bundling of a PHP application that accesses the file system. If the phar extension is not present, the loader stub will extract the phar archive to a temporary directory and then operate on the files. A shutdown function erases the tempo- rary files on exit. RETURN VALUES
Returns a string containing the contents of a customized bootstrap loader (stub) that allows the created Phar archive to work with or without the Phar extension enabled. ERRORS
/EXCEPTIONS Throws UnexpectedValueException if either parameter is longer than 400 bytes. EXAMPLES
Example #1 A Phar.createDefaultStub(3) example <?php try { $phar = new Phar('myphar.phar'); $phar->setStub($phar->createDefaultStub('cli.php', 'web/index.php')); } catch (Exception $e) { // handle errors } ?> SEE ALSO
Phar.setStub(3), Phar.getStub(3). PHP Documentation Group PHAR.CREATEDEFAULTSTUB(3)
All times are GMT -4. The time now is 01:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy