Web based GUI issue for Robot


Hello all,
Im having a ‘little’ issue that is slowly driving me insane. For the last couple of days I have been going round in circles trying to find the solution to the problem.

I have built a roving robot which consists of the following:-

4x 6V DC motors
Adafruit V2 Motor Shield
Arduino Mega 2560
Adafruit CC3000 Wifi Breakout PCB
2x DC Voltage Converters
3S 3300mah LiPo

The controlling device is a Raspberry Pi with Apache, PHP, Curl and MySQL installed. I have built a webpage which is being hosted by the Pi. I have the main directional functions working, i.e Forward, Backward, Left, Right and Stop.
Before developing the robot and GUI further to incorporate sensors, I would like to be to set the speed from the GUI.

This is where I hit the problem.

The Problem
I would like to set an adjustable value from 0 to 255 on the GUI, preferably via a slider control.
The web page currently consists of 3 parts, the HTML based front-end, which uses javascript and jquery to recognise the button clicks and slider values and send them to the PHP script which is used to ‘transmit’ the information via Curl to the Robot (Arduino). The directional functions work well but the slider control level isnt being sent to the Robot. Im pretty sure the Arduino side of things is working as the initial 125 speed value is set to zero when trying to set a new speed level via the GUI, regardless as to what the slider value is. I think the issue lays with the javascript and or the PHP, however I know next to nothing about either and marginally more than that about HTML.

Images of the code are attached