The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Composer
tudsy
post Feb 14 2018, 02:21 PM
Post #1


Advanced Member
****

Group: Members
Posts: 137
Joined: 30-September 14
Member No.: 21,611



Hi

I am having trouble resolving paths. I have installed composer in a directory called 'Composer' but my script says it cannot find 'vendor/autoload.php'. Vendor directory is installed under Composer with composer.json and composer.lock (see attached).


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<title>ECOVIB2D©</title>
<style type="text/css"><!--
body {
background-color: #660000;
}
style1 {
font-size: 36px;
color: #00FF33;
}
style5 {
font-size: 36px;
color: #00FF00;
}
-->
</style>




<script>

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-908952-3', 'auto');
ga('send', 'pageview');
ga('require','linkid');
</script>



</head>
<body>




<?php


require '../Composer/vendor/autoloader.php';



$firstname=$_GET['Firstname'];
$surname= $_GET['Surname'];
$name= $firstname.''.$surname;
$email= $_GET['email'];
$itemid='';
$Price= $_GET['Price'];
$Graphic= $_GET['Graphic'];

$apiKey= 'F9802AM9NdTVj1VDz/ns9WxWWvKh4Y4yOKBO99XZGTZgF6ZpU1g5geP/H8vgOZNeAjr8Jh';
$apiPassword='dAvRvUbR';
$apiEndpoint='\Eway\Rapid\Client::MODE_SANDBOX';

$client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint);

$transaction = [
'Customer'=> [
'FirstName'=> $firstname,
'LastName'=> $surname,
'Email'=> $email,
],
'item'=> [
'Description'=> 'Graphic:'.$Graphic,
'Quantity'=> 1,
],
'RedirectUrl' => "http://$_SERVER[HTTP_HOST]" . dirname($_SERVER['REQUEST_URI']) . '/response.php',
'CancelUrl' => "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]",

'Payment'=> [
'TotalAmount'=> $Price*100,

],

'TransactionType'=> \Eway\Rapid\Enum\TransactionType::PURCHASE,
];


$response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::TRANSPARENT_REDIRECT, $transaction);

$transactionResponse = $response->Transactions[0];


if ($transactionResponse->TransactionStatus) {
echo 'Payment successful! ID: ' .
$transactionResponse->TransactionID;
} else {
$errors = split(', ', $transactionResponse->ResponseMessage);
foreach ($errors as $error) {
echo "Payment failed: " .
\Eway\Rapid::getMessage($error)."<br>";
}
die();
}


echo '<a href="'.$sharedURL.'">Pay with our secure payment page</a>';

try{

//database connection goes here

$servername= "localhost";
$user= "ecovibdc_tudsy66";
$password= "power99661";









$conn = new PDO("mysql:host=$servername;dbname=ecovibdc_Subscribers", $user, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

//add the information to the database.
$query = "INSERT INTO CustomersArt (itemid,email,graphic,name,Price)
VALUES ('$itemid','$email','$Graphic','$name','$Price')";

$conn->query($query) OR die(mysql_error());


}
catch(PDOException $e)
{
echo "Connection failed: " . $e->getMessage();

$line3 = "<br>;<a href='http://ecovib2d.blogspot.com.au'> Back to my blog - Try again !</a>" ;
echo $line3;
}




?>


Attached thumbnail(s)
Attached Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
CharlesEF
post Feb 18 2018, 01:28 PM
Post #2


This is My Life
*******

Group: Members
Posts: 1,490
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



I still don't see an answer to the question. Where is the actual page located? In what directory/folder? I can't even read your directory structure picture. And even if I could read it I still don't know where the calling page is located.

In one of your posts you posted:
CODE
require '/public_html/ecovibdc/Composer/vendor/autoloader.php';
Is that a correct path?

If is is correct, then try this:
CODE
require '../../Composer/vendor/autoloader.php';


Until you post the actual location of the page this is just a guess.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th April 2018 - 04:41 AM