I'm working on a project where the opening page is .php. It allows users to select a map file they want to view. That page sends the variable to another page that has javascript on it. I'm not a js programmer, so I'm struggling here. The problem is that I need to apply that variable from the php page to a concatenated string in the js. Here's what I have...
<script>
<?php
$filename = $_GET["filename"];
$fileTrimed = str_replace(".mxd", "", $filename);
?>
var trimmed = (<?php $fileTrimed ?>)
var firstURL = "http://localhost:6080/arcgis/rest/";
var secondURL = "/MapServer";
var finalURL = firstURL + trimmed + secondURL;
I have also tried it as...
?>
var firstURL = "http://localhost:6080/arcgis/rest/";
var secondURL = "/MapServer";
var finalURL = firstURL + $fileTrimed + secondURL;
I appreciate any help y'all can offer.