3.5 - Passing Custom Parameters to Database

Top  Previous  Next

 

Prerequisites

 

READ THIS: This is advance users only, it is necessary to have PHP coding and debugging experience before proceeding. Our technical support does not support modified source code, do the changes at your own risk.

 

 

Overview

 

We support totally 3 Custom Parameters,  allowing you to pass any STRING from the starting ASPX/PHP page (Java Applet page) to the database via the statistics URL.

 

Pass custom parameters to the database via the Java Applet is very useful. For example you can use this to gather information such as UserID, Email, or Location ID from the ASPX/PHP page, and when the user finishes the speed test, all the parameters will be passed to the SpeedCheck_statistics.aspx/php  then writes to the database.  The results shows in the admin report, you can identify the session is coming from which user or which location.

 

Usage Example

 

You have installed 3 instances of SpeedCheck on several locations, say New York, California, Florida. The administrator would like to know where the test results comes from, how can this be configured?

 

Solution:
 

1. In SpeedCheck.aspx or SpeedCheck.php, modify:

 

From:

<param name="custom_parameter_1" value="<%=HttpUtility.UrlEncode("Custom1")%>">

 

To:

<param name="custom_parameter_1" value="<%=HttpUtility.UrlEncode("New York")%>">

 

 

2. Modify the report

 

ASPX VERSION: In SpeedCheck_admin_report.aspx

 

From:

<asp:BoundColumn DataField="custom_1" HeaderText="Custom1"></asp:BoundColumn>

<asp:BoundColumn DataField="custom_2" HeaderText="Custom2"></asp:BoundColumn>

<asp:BoundColumn DataField="custom_3" HeaderText="Custom3"></asp:BoundColumn>

 

To:  (change the header, and hide the other 2 custom parameters from the report)

<asp:BoundColumn DataField="custom_1" HeaderText="Location"></asp:BoundColumn>

<asp:BoundColumn DataField="custom_2" HeaderText="Custom2" Visible="false"></asp:BoundColumn>

<asp:BoundColumn DataField="custom_3" HeaderText="Custom3" Visible="false"></asp:BoundColumn>

 

 

PHP VERSION: In SpeedCheck_admin_report.php

 

From:

<td align="left" valign="top" bgcolor="#7070A0"><span style="color:#ffffff">Custom1</span></td>

<td align="left" valign="top" bgcolor="#7070A0"><span style="color:#ffffff">Custom2</span></td>

<td align="left" valign="top" bgcolor="#7070A0"><span style="color:#ffffff">Custom3</span></td>

 

To:  (change the header)

<td align="left" valign="top" bgcolor="#7070A0"><span style="color:#ffffff">Location</span></td>

 

 

 

From: 

<td align="left" valign="top" bgcolor="#f0f0ff"><?php echo $my_custom_1?></td>

<td align="left" valign="top" bgcolor="#f0f0ff"><?php echo $my_custom_2?></td>

<td align="left" valign="top" bgcolor="#f0f0ff"><?php echo $my_custom_3?></td>        

 

To: (hide the other 2 custom parameters from the report by deleting the 2 lines)

<td align="left" valign="top" bgcolor="#f0f0ff"><?php echo $my_custom_1?></td>

 

 

 

3. When you run the report from the New York location, you should see this: