error in php

zeniard

New Member
Messages
10
Reaction score
0
Points
0
i've got errors in my php....it doesnt run properly in my site when i uploaded it ... but in my apache in runs smooth
 

Scoochi2

New Member
Messages
185
Reaction score
0
Points
0
What errors do you get?
Please include the code that relates to the error (a few lines before and after, or the whole code if you prefer, as well as anything else that may affect it, such as includes).
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
just post the errors, and we can help. the errors php displays are very easy to debug.

Common errors would include:
- T_ENCAPSED_AND_WHITESPACE:
when you improperly use an array syntax inside of string
PHP:
echo "Hello $test['world']";
// or
echo "hello""world";

- unexpected T_ECHO/T_VARIABLE/T_FOR...
you forgot a semicolon on the line above where the error said it was.
PHP:
// t_echo
$var = "Hello World"
echo $var;

// t_variable
$var = "hello world"
$var2 = $var;

// t_for
$var = 'hello world'
for ($i=0;$i<5;$i++)

- unexpected $end
you still have a container tag open {} when the script is done executing
PHP:
if ($hello == "world")
{
  for ($i=0;$i<5;$i++)
  {
    echo $i;
  }

there's more, but those are the more common errors.
http://www.v-nessa.net/2007/12/07/common-php-errors
 
Top