php


PHP global variable seems to cause HTTP 500 error on dev server but not live server


I am in the process of migrating a website that was developed in India, and moving it to another webhost. Not being an expert at PHP has my head hurting from tracing the code. I think I narrowed down the problem to this bit here...
<?php include("../config.php"); ?>
<?php include("../header.php");
if(!empty($_REQUEST)){
$newsid = $_REQUEST['name'];
?>
<script>
$(document).ready(function() {
$('.story_container').each(function(index) {
if ($(this).attr("id") == '<?php print $newsid; ?>' ) {
$(this).show();
}
else {
$(this).hide();
}
});
});
</script>
<?
}
?>
Specifically, if I delete the third and fourth lines, the 500 error goes away and the page loads, although not correctly, with a $newsid item loaded in the main part of the webpage.
If I'm not mistaken, there is a formatting error and looks like it is missing a terminating curly brace? The purpose of the opening and closing php tag at the end just to include a curly brace has me perplexed. If I close the if statement, the 500 error goes away, but again, the page doesn't load with a $newsid item in the main part of the webpage.
I am at a loss and hoping someone can help me troubleshoot this. Thanks!
Almost forgot. I mentioned the site was developed in India because this page in particular I had converted from ANSI format to UTF-8, in case that gives any more clues.
Thank you Rasclatt, the issue was that short codes were not enabled.

Related Links

How to individual print every word of a sentence in PHP? [closed]
JetBrains PhpStorm Not Resolving Server Variable?
couldn't fetch session value to another page
Edit YAML array with php Symfony2.8
preg_replace and hidden chars or hidden encoding
BelongsToMany with BelongsToMany relation [closed]
What is equivalent of strtotime in SQL?
Expecting statement after if
Extract array from inside array
How to group from MySQLi using PHP
How to file_get_contents from HTTPS with basic authentication?
WordPress custom taxonomy query
Server Concurrency with High CPU Load
Localhost and 127.0.0.1 show different content in web browser
wordpress - Injecting script with wp_head testing if already exit
Why am I getting error class ImagePixel not found?

Categories

HOME
azure-functions
facebook-messenger
adfs3.0
dry
initialization
apk
portable-class-library
cypher
bittorrent
haxe
onvif
minecraft
angular2-template
tweepy
timber
reportviewer
lda
closures
c#-7.0
scala-ide
xsl-fo
salt-cloud
http-authentication
spyder
akka-persistence
batch-rename
pdf.js
software-packaging
beego
points
amazon-cloudtrail
envoy
instructions
mongodb-3.4
delayed-job
payeezy
jfxtras
bluemixtools
nsuserdefaults
cartopy
sspi
selenide
1wire
transparency
kitura
rightnow-crm
knockout-2.0
nonlinear-functions
openstack-glance
gestures
gnome-terminal
predicates
swiperefreshlayout
sidewaffle
bigdecimal
verisign
wif4.5
voronoi
msgpack
highest
blank-line
roxygen2
phpredis
clarion
r.java-file
microsoft-expression-web
configurable-product
adwords-apiv201402
network-printers
forceclose
ctp
saga
colon
ax
chefspec
significant-digits
icenium
onconfigurationchanged
nsmutablestring
platform-independent
wcf-callbacks
acpi
multidrop-bus
snackjs
botnet
rtd
bass
android-input-method
google-translator-toolkit
community-server

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App