Reputation: 10224
Weirdest PHP issue I have gotten. There is some PHP code that runs on some machines only.
Client called to fix the problem. The name of the file is portada.html
I had seen the website before and it worked fine. I know PHP code is usually run on .php files but this one used to run just fine on this .html file. Maybe some apache conf or something their former web developer did.
So now it runs fine when you use some machines but on others it doesn't run. Anyone has an idea of why something like this would happen?
Here's the code that doesn't run fine.
<script language="" type="text/javascript">
var so = new SWFObject("gallery.swf?xmlPath=galleries/gallery__something_<?
$sql_conf="select galeria_something from ct_conf";
$res_conf=mysql_query($sql_conf);
$row_conf=mysql_fetch_assoc($res_conf);
echo $row_conf["galeria_something"];
?>.xml", "something", "320", "238", 7, "");
so.addParam("allowScriptAccess", "sameDomain")
so.addParam("quality", "high");
so.addParam("scale", "noscale");
so.write("renta");
</script>
the code gets executed on Google Chrome, not on Firefox
Upvotes: 0
Views: 74
Reputation: 129
You say the file name is portada.html. If that's correct and it's not saved as a .php file, then you would also need to make sure that the server recognizes .html files as needing to be processed by the PHP interpreter. You can do this from an .htaccess file by adding:
AddType application/x-httpd-php .html
Upvotes: 0
Reputation: 46060
To make you code compatible across many machines:
<?
, use full tags <?php
mysql_query
, use mysqli_query
etc http://www.php.net/manual/en/book.mysqli.phpini_set('display_errors', 1); error_reporting(E_ALL);
Upvotes: 0
Reputation: 219894
Can't say for certain but it may have to do with you using short tags which is typically disabled by default. Try using <?php
instead of just <?
.
Also your queries may be case sensitive on Linux servers but not on windows servers.
Upvotes: 0