454 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Microlancer Beta Tester
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says

This is probably going to be simple, but it’s driving me nuts!

I am using SMOF options in a theme, works brilliantly but got one tiny issue with echo’ing variables in a PHP Class e.g

$uploader = new DropboxUploader($data['db_email'], $data['db_pass']);

This doesn’t work, but if I do:

<?php echo $data['db_email']; ?>

It outputs the data stored, so how do I do the echo inside the class. e.g.

$uploader = new DropboxUploader(echo $data['db_email'], echo $data['db_pass']);

But obviously this doesn’t work!

Thanks in advance

28 posts ozythemes.com
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Exclusive Author
  • Has been a member for 7-8 years
  • Europe
  • Bought between 10 and 49 items
freevision says

Have you tried set your parameters after creating instance of the class?

403 posts
  • Microlancer Beta Tester
  • Interviewed on the Envato Notes blog
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 1 000 and 5 000 dollars
RelStudios says

This is probably going to be simple, but it’s driving me nuts!

I am using SMOF options in a theme, works brilliantly but got one tiny issue with echo’ing variables in a PHP Class e.g

$uploader = new DropboxUploader($data['db_email'], $data['db_pass']);

This doesn’t work, but if I do:

<?php echo $data['db_email']; ?>

It outputs the data stored, so how do I do the echo inside the class. e.g.

$uploader = new DropboxUploader(echo $data['db_email'], echo $data['db_pass']);

But obviously this doesn’t work!

Thanks in advance

First you have to create the instance of that class and echo that value with the help of reference..I your case

$uploader = new DropboxUploader($data['db_email'], $data['db_pass']);
echo $uploader->method_name/class variables as you want
28 posts ozythemes.com
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Exclusive Author
  • Has been a member for 7-8 years
  • Europe
  • Bought between 10 and 49 items
freevision says

Have you tried set your parameters after creating instance of the class?

I mean probably your parameters not passing, echo your incoming parameters in class/function.

454 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Microlancer Beta Tester
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says


This is probably going to be simple, but it’s driving me nuts!

I am using SMOF options in a theme, works brilliantly but got one tiny issue with echo’ing variables in a PHP Class e.g

$uploader = new DropboxUploader($data['db_email'], $data['db_pass']);

This doesn’t work, but if I do:

<?php echo $data['db_email']; ?>

It outputs the data stored, so how do I do the echo inside the class. e.g.

$uploader = new DropboxUploader(echo $data['db_email'], echo $data['db_pass']);

But obviously this doesn’t work!

Thanks in advance

First you have to create the instance of that class and echo that value with the help of reference..I your case

$uploader = new DropboxUploader($data['db_email'], $data['db_pass']);
echo $uploader->method_name/class variables as you want

Think I may have confused you guys, the instances I showed are for a username and password, which don’t need to be echo’d BUT they do need to be utilised by the class.

The login script isn’t working, as the user and pass aren’t being set in the class,

I can add the user and pass in the class, like so:

$uploader = new DropboxUploader('email@address.com', 'password');

This works fine, and I can also use php $_POST and it works but I am trying to utilise the admin panel from SMOF to allow the user to set this data.

28 posts ozythemes.com
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Exclusive Author
  • Has been a member for 7-8 years
  • Europe
  • Bought between 10 and 49 items
freevision says

Tried something like (string)$data[“db_email”] ? And I prefer to check echo result on “view source”




This is probably going to be simple, but it’s driving me nuts!

I am using SMOF options in a theme, works brilliantly but got one tiny issue with echo’ing variables in a PHP Class e.g

$uploader = new DropboxUploader($data['db_email'], $data['db_pass']);

This doesn’t work, but if I do:

<?php echo $data['db_email']; ?>

It outputs the data stored, so how do I do the echo inside the class. e.g.

$uploader = new DropboxUploader(echo $data['db_email'], echo $data['db_pass']);

But obviously this doesn’t work!

Thanks in advance

First you have to create the instance of that class and echo that value with the help of reference..I your case

$uploader = new DropboxUploader($data['db_email'], $data['db_pass']);
echo $uploader->method_name/class variables as you want

Think I may have confused you guys, the instances I showed are for a username and password, which don’t need to be echo’d BUT they do need to be utilised by the class.

The login script isn’t working, as the user and pass aren’t being set in the class,

I can add the user and pass in the class, like so:

$uploader = new DropboxUploader('email@address.com', 'password');
This works fine, and I can also use php $_POST and it works but I am trying to utilise the admin panel from SMOF to allow the user to set this data.
454 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Microlancer Beta Tester
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says

Still can’t get this to work, after trying other things

Now using:

$db_email = $data['db_email'];
$db_pass = $data['db_pass'];

$uploader = new DropboxUploader($db_email, $db_pass);

If I echo the 2 strings, they display the contents, but won’t work in the class.

It’s gotta be something so simple to fix but I am stumped,

629 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 100 and 1 000 dollars
Thecodingdude says

Open the dropbox uploader class, find it’s __construct function, echo the parameters that is passed too see what is output. Once we know the answer to that it’ll be a lot easier to debug.

454 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Microlancer Beta Tester
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says

I am using this class, and I haven’t modified the DropboxUploader.php file.

753 posts
  • Sold between 10 000 and 50 000 dollars
  • Referred between 10 and 49 users
  • Author had a Free File of the Month
  • Exclusive Author
  • Has been a member for 5-6 years
  • Bought between 1 and 9 items
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
AdamGold says
What does the following code output?
echo 'Email:' , $data['db_email'] , ', Password:' , $data['db_pass'];
by
by
by
by
by
by