Support Overview

Tutorials

Usage Examples

Upgrade Information

FAQ

New Release History

You are here:   Visualware >   MyConnection Server >   Support >   Usage Examples >   Set the UDP Packet Size for a Capacity test (PHP)

Set the UDP Packet Size for a Capacity test (PHP)

The example below shows how a Capacity test can be published allowing the user to change the packet size used for the test.

This exact example is achieved using PHP.


Choose UDP Packet Size:

Code Required

The code below can be added to a PHP ready web page to mimic the example above.

Copy and paste the code below just under the "body" tag in the web page. This code is responsible for grabbing the parameters from the address bar in the browser and setting up the packet size value.

<?php

if(isset($_GET['ps'])) { $ps = $_GET['ps']; } else { $ps = '50'; }

?>


Now copy and paste the code below where you want the table containing the packet size selection to go. Note the table widths etc may need adjusting to fit in with the web page being copied to.

<form method="get" action="capacitypacketsize.php">
<table width="900" cellpadding="5" cellspacing="1"><tr>
<td width="167">Choose UDP Packet Size:</td>
<td width="731">

<select name="ps" onChange="this.form.submit()">
<option>Choose Packet Size...</option>
<option id="size172" value="172" <?php if ($ps == "172") { echo "selected"; } ?>>172 kB</option>
<option id="size695" value="695" <?php if ($ps == "695") { echo "selected"; } ?>>695 kB</option>
<option id="size1390" value="1390" <?php if ($ps == "1390") { echo "selected"; } ?>>1390 kB</option>

</select>
</td>
</tr>
</table>
</form>

Code Comments:






// If "ps" equals 172 then set it as selected

// If "ps" equals 695 then set it as selected

// If "ps" equals 1390 then set it as selected


Now copy and paste the code below where you want the applet to appear. The only change that will be needed is the codebase, highligted in blue below. This should be changed to the address of your MyConnection Server installation.

<applet mayscript name="mcs" code="myspeedserver/applet/myspeed.class" archive="/myspeed/myspeed_s_8.jar,/myspeed/plugins_s_8.jar" codebase="http://mcssjc.visualware.com/myspeed" width=600 height=400>
<param name="capacity_udppacketsize" value="<?php echo "$ps" ?>">
<param name="testspecid" value="-7">
<param name="permissions" value="all-permissions">
</applet>

Code Comments:

// Change code base to match your server
// Sets the parameter value to the value of "ps"

 

MyConnection Server

Home
Online Testing Portal
Download
Purchase
Resources
Support

Visualware Products

VisualRoute
eMailTrackerPro
Visual IP Trace

   

© Visualware Inc. 2014 - All Rights Reserved