# Pulling Data from URL (action.php/wacars/pirep?id= etc)

**URL:** <https://forum.phpvms.net/t/pulling-data-from-url-action-php-wacars-pirep-id-etc/2804>\
**Category:** phpVMS Legacy Support (v2/v5)\
**Created:** [June 5, 2010, 11:54pm UTC](https://forum.phpvms.net/t/pulling-data-from-url-action-php-wacars-pirep-id-etc/2804 "2010-06-05T23:54:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AFVA\_Mitchell](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/a/35a633/32.png) [@AFVA\_Mitchell](https://forum.phpvms.net/u/AFVA_Mitchell)\
**Post date:** [June 5, 2010, 11:54pm UTC](https://forum.phpvms.net/t/pulling-data-from-url-action-php-wacars-pirep-id-etc/2804/1 "2010-06-05T23:54:52Z")

</div>

Hello all,

For WorldACARS I have chosen to have the program open a browser and go to [http://localhost/action.php/wacars/pirep](http://localhost/action.php/wacars/pirep) and then insert the data after the url (e.g wacars/pirep?id=1&code=VMS). I always get:

```
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'wacars::pirep' was given in /home/a5059087/public_html/core/classes/MainController.class.php on line 218

```

With this code:

```
private function pirep()
	{

			$id = $_GET['id'];      		

			$code = $_GET['code'];      		

			$flightnum = $_GET['flightnum'];      		

			$depicao = $_GET['depicao'];      		

			$arricao = $_GET['arricao'];  

			$aircraft = $_GET['aircraft'];  

			$flighttime = $_GET['flighttime'];  

			$landingrate = $_GET['landingrate'];  

			$comment = $_GET['comment'];  

			$fuelused = $_GET['fuelused'];      	  

			$load = $_GET['load'];   	

			$data = array(
			'pilotid'=>$id,
			'code'=>$code,
			'flightnum'=>$flightnum,
			'depicao'=>$depicao,
			'arricao'=>$arricao,
			'aircraft'=> $aircraft,
			'registration'=>$registration,
			'flighttime'=> $flighttime,
			'landingrate'=> $landingrate,
			'submitdate'=>'NOW()',
			'comment'=> $comment,
			'fuelused'=> $fuelused,
			'source'=>'worldacars',
			'load'=>$load,
			'log'=>$log,
			'flighttype'=>$type,
			);

			$ret = ACARSData::FilePIREP($pilotid, $data);

	}

```

Something about the code doesn’t seem right to me with that code pulling the data from the URL…

Can anyone help me?

Thanks,

Mitchell

---

<div class="post-metadata">

**Author:** ![nabeel](https://forum.phpvms.net/user_avatar/forum.phpvms.net/nabeel/32/2971_2.png) [@nabeel](https://forum.phpvms.net/u/nabeel)\
**Post date:** [June 6, 2010, 3:20pm UTC](https://forum.phpvms.net/t/pulling-data-from-url-action-php-wacars-pirep-id-etc/2804/2 "2010-06-06T15:20:19Z")

</div>

I would recommend using POST and sending it as XML (or parameters, but XML might be easier), which you can parse easily.

The problem with GET is that there is a character limit.

Also, you did **private** function when it should be **public**. As private, the dispatcher can’t call it.
