898 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+4 more
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

59 posts ozythemes.com
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
+4 more
freevision says

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

410 posts
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
  • Located in Nepal
+3 more
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
59 posts ozythemes.com
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
+4 more
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.

898 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+4 more
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.

59 posts ozythemes.com
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
+4 more
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.
898 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+4 more
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,

633 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $100+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
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.

898 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+4 more
Gareth_Gillman says

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

753 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Had an item featured on Envato Market
+4 more
AdamGold says
What does the following code output?
echo 'Email:' , $data['db_email'] , ', Password:' , $data['db_pass'];

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by