Look, I'm just going to come straight out and ask..
Do you actually have any of your own code and experience? OR Are you trying to understand how _someone else's_ website works?
Are you familiar with AJAX? (Asynchronous JavaScript And Xml)
Except for plugins like Flash Player, there is no C++ code executed on the client machine. It all happens on the server. Even then, there is most often nothing other than XAMPP or ASP.NET running natively, everything else is a script like ASP, VBScript, PHP.
That is how pages refresh/update their content.
1) User clicks button to do 'something'
2) JavaScript on the webpage responds to this click.
3) Javascript sends request to server for relevant information
4) Server finds information, sends reply
5) Javascript on the page receives information
6) Javascript on page updates/adds the page contents with the new info.
I created a webpage for viewing Student timetables at a college I worked at. The timetables were held inside a database that was internal to a (Windows) native application. This application exposed functionality via COM.
When the web-page was loaded, an AJAX request was sent, that asked for a list of all the student IDs. The response was in the form of the HTML needed for a ListBox that contained all of the IDs.
Then, when you selected a student & hit "Get Timetable", Javascript on the webpage got the selected item's index from the ListBox. It then got the text(the student's ID) from the ListBox using this index. For this example lets say ID=12345678 From there, it sent a request to retrieve the page located at "textTimetable.php?id=12345678&type=student"
Because it's a PHP page, it doesn't just get spewed out from the server like an HTML page or an image, it gets examined and executed. The file textTimetable.php then looks to see that it has the variables "id" and "type" it then creates a COM object that allows it to communicate with the Timetable Scheduling Software (Syllabus Plus by Scientia) It finds the relevant student, gets their list of classes(and their times/days). From there, it sorts the classes by start-time, before printing the classes out, each on a separate line. :phew! what a mouthful:
When the response is received from textTimetable.php it is inserted as the innerHTML of the target container on the HTML page.
I also have pdfTimetable.php and pngTimetable.php - these are essentially identical to textTimetable.php, with the exception of the exact format of the content they return. It is essentially same process whether I want an HTML table, a PNG or an (inline) PDF - albeit with minor differences to the way it's inserted into the page. The HTML can just go as the innerHTML of a DIV, the (url of the) PNG get set as the URL of an image on the page, whereas the PDF gets set as the source of an IFrame.
I am aware of no means by which the PHP running on the server may be visually debugged as it is running. The Javascript, certainly.
Now then,
if your app is filling the role of Syllabus Plus - you will need to Attach To Process - after some action on the page has caused your code to be called, and while it's still running. Once done, one would pause execution and begin single-stepping.
Ah-hah! Found it. Here's the Javascript on the web-page that is called when I hit the "GetClassList" button. Also, the content of the PHP page that it requests.
(Man, what a tiring answer. Think I need a coffee or 4 and a 6 pack of V) :D
function loadClassList()
{
var actName, actId, dayNum, weekNum, dayStr, weekStr, str;
var dayIn=byId("dayList"), weekIn=byId("weekList"), actIn=byId("actListDaily");
weekNum = weekIn.options.selectedIndex;
dayStr = dayIn.options[dayIn.options.selectedIndex].text;
actName = actIn.options[actIn.options.selectedIndex].text;
actId = actIn.options[actIn.options.selectedIndex].value;
byId("blueHeaderBarTitle").innerHTML = actName;
var day, week, str, isOk, url;
dayNum = dayIn.options.selectedIndex;
weekNum = weekIn.options.selectedIndex;
actId = actId.replace("#", "");
url = "getStudentList.php";
url += "?dayNum="+dayNum;
url += "&weekNum=" + weekNum;
url += "&actId=" + actId;
byId("classListHolder").innerHTML = '<div class="progBar2">LOADING</div>';
myGetAjaxResponseWithCallback(byId("classListHolder"), url, function(){doScrollBars(byId("infoBoxHolder"));});
}
<?php
$dayNum = $_GET['dayNum'];
$weekNum = $_GET['weekNum'];
$actId = $_GET['actId'];
$actId = sprintf('#%s', $actId);
$app=new COM('Splus.application') or die('Cannot start syllabus for you');
$mCollege = $app->ActiveCollege;
$mActivities = $mCollege->Activities;
$nameArray = array();
$studentArray = array();
$myAct = $mActivities->Find($actId, "", "");
try{
$curAct = $myAct[1];
}
catch (Exception $e)
{
printf('<p>You need to select a valid activity first<p>');
die;
}
foreach ($myAct as $curAct)
{
$myStudentSets = $curAct->StudentSets;
foreach ($myStudentSets as $curSet)
{
if ($curSet->RealSize() != 0)
foreach ($curSet->Students as $curStudent)
{
$studentArray[] = new sylStudent($curStudent->Name, $curStudent->HostKey, $curStudent->Department, $curStudent->Email, $curStudent->Gender);
}
}
}
$didSort = usort($studentArray, array('sylStudent', '_cmpStudentIdAsc'));
createAccordianPHP($studentArray);
class sylStudent
{
var $name; var $id; var $department; var $email; var $gender;
function sylStudent($name, $id, $department, $email, $gender)
{
$this->name = $name;
$this->id = $id;
$this->department = $department;
$this->email = $email;
$this->gender = $gender;
}
function _cmpStudentIdAsc($item1, $item2)
{
return ($item1->id < $item2->id) ? -1 : 1;
}
function _cmpStudentNameAsc($item1, $item2)
{
return (strcmp($item1->name, $item2->name)<0) ? -1 : 1;
}
function _cmpStudentEmailAsc($item1, $item2)
{
return (strcmp($item1->email, $item2->email)<0) ? -1 : 1;
}
}
function makeInnerContentPHP($name, $id, $department, $email, $gender, $rowNum)
{
$genderStr = array('Male', 'Female');
if ($gender<>0)
$imgSrc='femaleThumb.png';
else
$imgSrc='maleThumb.png';
$str = sprintf("<div id=\"sc%d\" class='switchcontent'>", $rowNum);
$str = sprintf('%s%s', $str, '<table>');
$str = sprintf('%s%s', $str, "<tr><td rowspan=\"6\"class=\"studPic\"><img src=\"$imgSrc\" alt=\'$imgSrc\'></td><th>Name</th><td>$name</td></tr>");
$str = sprintf('%s%s', $str, "<tr><th>ID:</th><td>$id</td></tr>");
$str = sprintf('%s%s', $str, "<tr><th>Email:</th><td>$email</td></tr>");
$str = sprintf('%s%s', $str, "<tr><th>Department:</th><td>$department</td></tr>");
$str = sprintf('%s%s', $str, "<tr><th>Gender:</th><td>$genderStr[$gender]</td></tr>");
$str = sprintf('%s%s', $str, "<tr><th>Timetable:</th><td><a onclick=\"showTextTt($id);\">html</a> <a onclick=\"showPdfTt($id);\">pdf</a> <a onclick=\"showPngTt($id);\">png</a></td></tr>");
$str = sprintf('%s%s', $str, '</table></div>');
return $str;
}
function makeOuterContentPHP($name, $id, $email, $rowNum)
{
$imgStr = "bulDown.gif";
$str = sprintf('%s', "<div id='row$rowNum' class='row1'><div class='imgCell'><img alt=\"bullet\" id=\"bul$rowNum\"src=\"$imgStr\"></div><div onclick='expandContent(\"sc$rowNum\", \"bul$rowNum\", \"row$rowNum\");'");
$str = sprintf('%s%s', $str, "class=\"authcateCell\" title=\"click here to expand/contract\">$id</div>");
$str = sprintf('%s%s', $str, "<div class=\"nameCell\">$name</div>");
$str = sprintf('%s%s', $str, "<div class=\"emailCell\">$email</div>");
$str = sprintf('%s%s', $str, '</div>');
return $str;
}
function makeOuterContentPHP2($name, $id, $email, $rowNum)
{
$imgStr = "bulRight.gif";
$str = sprintf('%s', "<div id=\"row$rowNum\" class=\"row1\">");
$str = sprintf('%s%s', $str, "<table cellspacing='0' cellpadding='0'>\n");
$str = sprintf('%s%s', $str, '<tr>');
$str = sprintf('%s%s', $str, "<td class=\"imgCell\"><img alt=\"bullet\" id=\"bul$rowNum\" src=\"$imgStr\"></td>");
$str = sprintf('%s%s', $str, "<td class='authcateCell' onclick='expandContent(\"sc$rowNum\", \"bul$rowNum\", \"row$rowNum\");'>$id</td>");
$str = sprintf('%s%s', $str, "<td class=\"nameCell\">$name</td>");
$str = sprintf('%s%s', $str, "<td class=\"emailCell\">$email</td>");
$str = sprintf('%s%s', $str, '<tr>');
$str = sprintf('%s%s', $str, '</table></div>');
return $str;
}
function makeAccordianEntryPHP($name, $id, $email, $gender, $department, $rowNum)
{
$str1 = makeInnerContentPHP($name, $id, $department, $email, $gender, $rowNum);
$str2 = makeOuterContentPHP2($name, $id, $email, $rowNum);
return sprintf('%s%s', $str2, $str1);
}
function createAccordianPHP($studentArray)
{
printf('<div id=\'contentList\' class=\'contentList\'>');
for ($i=0; $i<count($studentArray); $i++)
printf('%s', makeAccordianEntryPHP($studentArray[$i]->name, $studentArray[$i]->id, $studentArray[$i]->email, $studentArray[$i]->gender, $studentArray[$i]->department, $i));
printf('</div>');
}
function fixName($name)
{
$commaPos = strpos($name, ',');
$spacePos = $commaPos;
$christianNamePos = $spacePos+1;
$newStr = substr($name, $christianNamePos);
$newStr = sprintf('%s %s', $newStr, substr($name, 0, $commaPos));
return $newStr;
}
?>