1046 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
+5 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

74 posts ozythemes.com
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
+4 more
freevision
says

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

414 posts
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
  • Interviewed on an Envato blog
+2 more
CodeScribe
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
74 posts ozythemes.com
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
+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.

1046 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
+5 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.

74 posts ozythemes.com
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
+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.
1046 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
+5 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,

637 posts
  • Has been part of the Envato Community for over 5 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.

1046 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
+5 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'];
by
by
by
by
by
by