garfee wrote:It does work on my remote server. So would that be a source code issue ?
It is always a mix of environment (os, configuration, components, etc) and the code itself that provide a functionality.
If your code relies on specific configuration parameters, the sourcecode is very important to know.
In your case it is the short_open_tag setting of php your code relies on:
- Code: Select all
[...]
<td width="10%"><? echo $rows['id']; ?></td>
<td width="30%"><? echo $rows['name']; ?></td>
<td width="30%"><? echo $rows['lastname']; ?></td>
<td width="30%"><? echo $rows['email']; ?></td>
[...]
You can use something like this (it is independend of short_open_tag setting):
- Code: Select all
[...]
<td width="10%"><?php echo $rows['id']; ?></td>
<td width="30%"><?php echo $rows['name']; ?></td>
<td width="30%"><?php echo $rows['lastname']; ?></td>
<td width="30%"><?php echo $rows['email']; ?></td>
[...]
or something like this (working on all versions with enabled short_open_tag setting or PHP >=5.4)
- Code: Select all
[...]
<td width="10%"><?=$rows['id']?></td>
<td width="30%"><?=$rows['name']?></td>
<td width="30%"><?=$rows['lastname']?></td>
<td width="30%"><?=$rows['email']?></td>
[...]
(<?= is a short open tag too, but since PHP 5.4 it will work even with disabled short_open_tag setting).
There is also a solution by activating short_open_tag in your php.ini, but that is not recommend. It is always better if the code is independend from any settings (unless there is no way around that).
best wishes,
Altrea
P.S::
- Code: Select all
mysql_connect("$host", "$username", "$password")
The quotes around the variables are not needed.