I have some Landing Page in html code, now I am thinking about passing them to wordpress, in contact.php I have a php code that takes some values, I would like to know if I pass it to wordpress those php codes that I have in the contact Can I put them in the plugin contact form 7 of wordpress?
I put the code that I have in contact.php that we use composer
<?php
// Composer's auto-loading functionality
require "vendor/autoload.php";
use Google\Spreadsheet\DefaultServiceRequest;
use Google\Spreadsheet\ServiceRequestFactory;
//
$nombreAplicacion = "XXXX";
$direccionCorreo = "XXXXXXX";
$idCliente = "XXXXX";
// Nombre del SpreadSheet creada
$nombreSpreahSheet = "Php Sheet volcado";
// Nombre de hoja de cálculo
$hojaCalculo = "Hoja 2";
$scope = array('https://spreadsheets.google.com/feeds');
// Inicializamos Google Client
$client = new Google_Client();
$client->setApplicationName($nombreAplicacion);
$client->setClientId($idCliente);
// credenciales, scope y archivo p12. Agregar el correcto Path al archivo p12
$cred = new Google_Auth_AssertionCredentials(
$direccionCorreo,
$scope,
file_get_contents('PhpSheet-3a5bbd2c9ada.p12')
);
$client->setAssertionCredentials($cred);
// si expiro el access token generamos otro
if($client->isAccessTokenExpired()) {
$client->getAuth()->refreshTokenWithAssertion($cred);
}
// Obtenemos el access token
$obj_token = json_decode($client->getAccessToken());
$accessToken = $obj_token->access_token;
// Inicializamos google-spreadsheet-client
$serviceRequest = new DefaultServiceRequest($accessToken);
ServiceRequestFactory::setInstance($serviceRequest);
//Obtenemos los Spreadsheets disponibles para las credenciales actuales
$spreadsheetService = new Google\Spreadsheet\SpreadsheetService();
$spreadsheetFeed = $spreadsheetService->getSpreadsheets();
// Obtenemos la spreadsheet por su nombre
$spreadsheet = $spreadsheetFeed->getByTitle($nombreSpreahSheet);
// Obtenemos las hojas de cálculo de la spreadsheet obetenida
$worksheetFeed = $spreadsheet->getWorksheets();
// Obtenemos la hoja de cálculo por su nombre
$worksheet = $worksheetFeed->getByTitle($hojaCalculo);
$listFeed = $worksheet->getListFeed();
if(!empty($_SESSION['nombre'])) {
$dataAgregar = array('gclid' => $_SESSION['gclid'],
'nombre' => $_SESSION['nombre'],
'email' => $_SESSION['email'],
'telefono' =>"'" .$_SESSION['phone'],
'mensaje' => $_SESSION['mensaje'],
'landing' => $landingP
);
$listFeed->insert($dataAgregar);
}
if(!empty($_SESSION['nombre2'])) {
$dataAgregar2 = array('gclid' => $_SESSION['gclid2'],
'nombre' => $_SESSION['nombre2'],
'email' => $_SESSION['email2'],
'telefono' =>"'" .$_SESSION['phone2'],
'mensaje' => $_SESSION['mensaje2'],
'landing' => $landingP2
);
$listFeed->insert($dataAgregar2);
}
?>
As we have to use composer in the theme folder I have to upload an index.php, a vendor folder and some composer files, as in the theme we already have an index.php I do not know if it also serves to catch the code the index .php and enter it in the theme index.php to make composer work?