Jump to content

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


AFVA | Mitchell

Recommended Posts

Hello all,

For WorldACARS I have chosen to have the program open a browser and go to 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

Link to comment
Share on other sites

  • Administrators

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...