Sponsored Content
Top Forums Web Development I can't open my index.php page after insert php code Post 302356419 by metalfreakbr on Friday 25th of September 2009 11:59:39 AM
Old 09-25-2009
I can´t believe it !!! I´ve just found my stupid mistake!!

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';
        }
...

Now, look what I´ve forgot to insert or better... finnish !!

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';
        }
...

I forgot to finnish the code ( { } ).
Anyway, thanks for your patience Neo.
regards.
 

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
ARRAY(3)								 1								  ARRAY(3)

array - Create an array

SYNOPSIS
array array ([mixed $...]) DESCRIPTION
Creates an array. Read the section on the array type for more information on what an array is. PARAMETERS
o $... - Syntax "index => values", separated by commas, define index and values. index may be of type string or integer. When index is omitted, an integer index is automatically generated, starting at 0. If index is an integer, next generated index will be the big- gest integer index + 1. Note that when two identical index are defined, the last overwrite the first. Having a trailing comma after the last defined array entry, while unusual, is a valid syntax. RETURN VALUES
Returns an array of the parameters. The parameters can be given an index with the => operator. Read the section on the array type for more information on what an array is. EXAMPLES
The following example demonstrates how to create a two-dimensional array, how to specify keys for associative arrays, and how to skip-and- continue numeric indices in normal arrays. Example #1 array(3) example <?php $fruits = array ( "fruits" => array("a" => "orange", "b" => "banana", "c" => "apple"), "numbers" => array(1, 2, 3, 4, 5, 6), "holes" => array("first", 5 => "second", "third") ); ?> Example #2 Automatic index with array(3) <?php $array = array(1, 1, 1, 1, 1, 8 => 1, 4 => 1, 19, 3 => 13); print_r($array); ?> The above example will output: Array ( [0] => 1 [1] => 1 [2] => 1 [3] => 13 [4] => 1 [8] => 1 [9] => 19 ) Note that index '3' is defined twice, and keep its final value of 13. Index 4 is defined after index 8, and next generated index (value 19) is 9, since biggest index was 8. This example creates a 1-based array. Example #3 1-based index with array(3) <?php $firstquarter = array(1 => 'January', 'February', 'March'); print_r($firstquarter); ?> The above example will output: Array ( [1] => January [2] => February [3] => March ) As in Perl, you can access a value from the array inside double quotes. However, with PHP you'll need to enclose your array between curly braces. Example #4 Accessing an array inside double quotes <?php $foo = array('bar' => 'baz'); echo "Hello {$foo['bar']}!"; // Hello baz! ?> NOTES
Note array(3) is a language construct used to represent literal arrays, and not a regular function. SEE ALSO
array_pad(3), list(3), count(3), range(3), foreach, The array type. PHP Documentation Group ARRAY(3)
All times are GMT -4. The time now is 10:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy