Jump to content

ajax response


ouldfella

Recommended Posts

hi,

i created a file named selectcountry.php in the root

the content of this file is :

use Illuminate\Database\Capsule\Manager as Capsule;

$invoice = Capsule::table('voip')->where('iso', $_POST['selectediso'])->get();

i send a variable selected country with ajax method POST the variable is received correctly but

i had an error internal server error 500

Link to comment
Share on other sites

finally,

i added the page structure like this :

<?php

 

use WHMCS\ClientArea;

use WHMCS\Database\Capsule;

 

define('CLIENTAREA', true);

 

require __DIR__ . '/init.php';

 

$ca = new ClientArea();

 

$ca->setPageTitle('Tarifs et Recharge');

 

$ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname'));

$ca->addToBreadCrumb('selectcountry.php', 'Tarifs et Recharge');

 

$ca->initPage();

 

//$ca->requireLogin(); // Uncomment this line to require a login to access this page

// To assign variables to the template system use the following syntax.

// These can then be referenced using {$variablename} in the template.

//$ca->assign('variablename', $value);

// Check login status

 

$tarifs = Capsule::table('voip')

->where('iso', $_POST['selectediso'])

->get();

$tarifs = json_encode($tarifs);

echo $tarifs;

it works

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated