logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Coding & Scripting Corner View previous topic :: View next topic
Reply to topic   Topic: Problem with js web form buttons after moving app to new Svr
Author
jrsmith



Joined: 13 Oct 2017
Posts: 1
Location: Canada, Edmonton

PostPosted: Sat 14 Oct '17 21:11    Post subject: Problem with js web form buttons after moving app to new Svr Reply with quote

First of all i'm a Sys Admin & my Systems Analyst doesn't know html, ajax, or javascript! My work inherited an old Debian 5.0 web server running Apache 2.2.9, PHP 5.0.51a-24+lenny1, & MySQL 5.0.51a. It runs a fairly simple person information database that we need to keep running so i've setup a virtuallized Debian 9.1 web server running Apache 2.4.25, php 7.0.19-1 & MariaDB 10.1.26. The webserver itself is operating fine. I've setup the sql database no problem, php is operating fine, I installed phpmyadmin & it's connecting just fine to the database with everything the same as the old server. After i moved the webserver files over I was getting some errors relating to the missing mysql api, so I got my systems analyst to update all of the php files to mysqli syntax.

I am able to query the database & look up person info. The problem is when I try and add or modify a user using the buttons "add" or "update" instead of it adding or updating, it's bringing up a text box window with what appears to be the info that it should be sending to the database.

I'm attaching a picture of the webform & text box that pops up after I click "add". What i think are the relevant code sections are below. I'm also adding a link to download the index.html & the two associated javascript files.

Any help will be super appreciated!!!

https://1drv.ms/u/s!AlMbe74f1lupjZAJQUYUHWaAqApHPg

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/autosuggest.css" />
<link rel="stylesheet" type="text/css" href="css/web.css" />
<!--[if !IE]>--><link rel="stylesheet" type="text/css" href="css/notIE.css" /><!--<![endif]-->
<!--[if IE]><link rel="stylesheet" type="text/css" href="css/IE.css" /><![endif]-->
<script type="text/javascript" src="js/bsn.AutoSuggest_c_2.1.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<title>Church Record System</title>

This is the button I was clicking on (update)

<div class="divBut">
<span><button onclick="notice(1);return false;">Summary</button><button onclick="setPersonInfo('New');clearAllForms();return false;">Add</button><button onclick="setPersonInfo();return false;">Update</button><button onclick="clearAllForms();return false;">Clear All</button></span>
</div>


This is the function setPersonInfo from the file utils.js:

function setPersonInfo (writeMode)
{
var onSuccessFunc = function (ajaxClassReference) { alert(ajaxClassReference.getResponseText()); };
var onErrorFunc = function (status) { alert("setPersonInfo AJAX error: "+status); };

var url = window.location + "php/insertPerson.php?Mode=";
if(writeMode == "New")
url += "New";
else
url += "Update";

var setPersonInfoAjax = new ajaxClass();
setPersonInfoAjax.serializeFormToURI( url, "pplinfo" );
setPersonInfoAjax.XMLreq( "", "GET", onSuccessFunc, onErrorFunc );
}


Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Tue 31 Oct '17 17:28    Post subject: Reply with quote

The issue is clear. The php code isn't executed.
First guess change <? to <?php
Back to top


Reply to topic   Topic: Problem with js web form buttons after moving app to new Svr View previous topic :: View next topic
Post new topic   Forum Index -> Coding & Scripting Corner