Note that there are some explanatory texts on larger screens.

plurals
  1. POMy webpage stops loading when reaching a php tag in javascript
    primarykey
    data
    text
    <p>I have a problem with a website which I never had before on other sites, it's probably something simple, but can't seem to get it. Please see and advise.</p> <pre><code>&lt;!--All Header Elements--&gt; &lt;?php $pageName = "Easy-Quote"; $siteName = "Bloemendal"; include("../Includes/header_non_index.inc"); include("../Includes/function12.inc"); ?&gt; &lt;?php error_reporting (E_ALL ^ E_NOTICE); ?&gt; &lt;!--All Header Elements--&gt; &lt;body&gt; &lt;script type="text/javascript"&gt; var total = 0; var allVenues = ""; var allVenuePricing = ""; var allTents = ""; var allTentPricing = ""; var allDFPricing = ""; var allMenus = ""; var allMenuPricing = ""; var allSF = ""; var venueName = ""; var venuePrice = 0; var tentName = ""; var tentPrice = 0; var DF = ""; var DFPrice = 0; var menuName = ""; var menuPrice = 0; var serviceFee = 0; var getGuests = null; var totalField = null; var venueField = null; var tentField = null; var DFField = null; var menuField = null; //Get Fields function getFields() { getGuests = document.getElementById('Guests'); totalField = document.getElementById('TotalField'); depositField = document.getElementById('DepositField'); venueField = document.getElementById('getValue'); tentField = document.getElementById('getTent'); DFField = document.getElementById('getDF'); menuField = document.getElementById('getMenu'); serviceField = document.getElementById('getServiceCharge'); } function convertAllArrays() { &lt;?php $allVenues=getVenues(); $allVenuePricing=getVenuePricing(); $allTents=getTents(); $allTentPricing=getTentPricing(); $allDFPricing=getDFPricing(); $allMenus=getMenus(); $allMenuPricing=getMenuPricing(); $allSF=getServiceFee(); //##################Declaring All Arrays###########################\\ echo "allVenues = ". json_encode($allVenues) . ";\n"; //All the Venue Names echo "allVenuePricing = ". json_encode($allVenuePricing) . ";\n"; //All the Venue Pricing echo "allTents = ". json_encode($allTents) . ";\n"; //All the Tent Names echo "allTentPricing = ". json_encode($allTentPricing) . ";\n"; //All the Tent Pricing echo "allDFPricing = ". json_encode($allDFPricing) . ";\n"; //All the Dance Floors echo "allMenus = ". json_encode($allMenus) . ";\n"; //All the Menu Names echo "allMenuPricing = ". json_encode($allMenuPricing) . ";\n"; //All the Menu Pricing echo "allSF = ". json_encode($allSF) . ";\n"; //All the Service Fees ?&gt; } function activeControl() { //Check Venue Field if(getGuests.value &gt; 0) { venueField.disabled = false; }else{ venueField.options[0].selected = true; venuePrice = 0; venueName = ""; venueField.disabled = true; } //Check Tent Field if(venueField.selectedIndex == 1) { tentField.disabled = false; }else{ tentPrice = 0; tentName = ""; tentField.options[1].selected = true; tentField.disabled = true; } //Check Menu Field if(venueField.selectedIndex &gt; 0) { menuField.disabled = false; }else{ menuPrice = 0; menuName = ""; menuField.options[0].selected = true; menuField.disabled = true; } //Check Dance Floor Field if(venueField.selectedIndex == 1) { DFField.disabled = false; }else{ DFField.checked = false; DF = "No"; DFPrice = 0; DFField.disabled = true; } updateTotal(); } function updateTotal() { //Get Venue Details var getSelectedVenue = venueField.selectedIndex; if(getSelectedVenue &gt; 0) { venueName = allVenues[getSelectedVenue]; venuePrice = allVenuePricing[getSelectedVenue] } //Get Tent Details var getSelectedTent = tentField.selectedIndex; if(getSelectedTent &gt; 1) { tentName = allTents[getSelectedTent-1]; tentPrice = allTentPricing[getSelectedTent-1] }else if(getSelectedTent == 1) { tentName = ""; tentPrice = 0; } //Get DF Details if(DFField.checked) { DF = "Yes"; DFPrice = allDFPricing[1]; }else { DF = "No"; DFPrice = 0; } //Get Menu Details var getSelectedMenu = menuField.selectedIndex; if(getSelectedMenu &gt; 0) { menuName = allMenus[getSelectedMenu]; menuPrice = allMenuPricing[getSelectedMenu] } //Get Service Fee Details var getSelectedSF =serviceField.selectedIndex; if(getSelectedSF &gt; 0) { serviceFee = allSF[getSelectedSF]; } venuePrice = parseFloat(venuePrice,10); tentPrice = parseFloat(tentPrice,10); DFPrice = parseFloat(DFPrice,10); menuPrice = parseFloat(menuPrice,10); serviceFee = parseFloat(serviceFee,10); //Update Total Field total = venuePrice + tentPrice +DFPrice + (menuPrice*getGuests.value); total = total + (total*serviceFee); totalField.value = "R"+total; //Update Deposit Fee depositField.value = "R"+(total*0.3); } &lt;/script&gt; &lt;!--Global Elements--&gt; </code></pre> <p>That is the first 196 lines of the site. Offline it loads, but when uploaded to the webserver, it only uploads up to: </p> <pre><code>function convertAllArrays() { </code></pre> <p>PS: I know that calling php variables in javascript is not ideal, but it should suffice for my purpose.</p> <p>!!EDIT!! <br /> Website Link: <a href="http://bloemendal.co.za/Easy-Quote/" rel="nofollow">http://bloemendal.co.za/Easy-Quote/</a></p> <p>!!EDIT!! <br /> The first few line of code in the function12.inc include. the getVenues() etc functions are declared in this include: </p> <pre><code>&lt;?php //############################Venues###############################\\ function getVenues() { include("../Includes/db_bloem_01_logon.inc"); $cxn = mysqli_connect($host,$user,$passwd,$dbname); $query = "SELECT VenueName FROM venues WHERE ID &lt; 5"; $results = mysqli_query($cxn, $query) or die ("Could't execute query"); $allVenues= array(); $counter = 1; while($row = mysqli_fetch_assoc($results)) { extract ($row); $allVenues[$counter] = "$VenueName"; $counter++; } return $allVenues; } function getVenuePricing() { include("../Includes/db_bloem_01_logon.inc"); $cxn = mysqli_connect($host,$user,$passwd,$dbname); $query = "SELECT Price FROM venues WHERE ID &lt; 5"; $results = mysqli_query($cxn, $query) or die ("Could't execute query"); $allVenuePricing= array(); $counter = 1; while($row = mysqli_fetch_assoc($results)) { extract ($row); $allVenuePricing[$counter] = "$Price"; $counter++; } return $allVenuePricing; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload