1096 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 2
+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

75 posts ozythemes.com
  • Trendsetter
  • Weekly Top Seller
  • Author Level 10
  • Elite Author
+6 more
freevision
says

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

417 posts
  • Author Level 3
  • Beta Tester
  • Collector Level 2
  • Blog Interview
+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
75 posts ozythemes.com
  • Trendsetter
  • Weekly Top Seller
  • Author Level 10
  • Elite Author
+6 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.

1096 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 2
+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.

75 posts ozythemes.com
  • Trendsetter
  • Weekly Top Seller
  • Author Level 10
  • Elite Author
+6 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.
1096 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 2
+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
  • 5 Years of Membership
  • Author Level 2
  • Collector Level 2
  • Exclusive Author
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.

1096 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 2
+5 more
Gareth_Gillman
says

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

753 posts
  • Affiliate Level 2
  • Author Level 5
  • Collector Level 1
  • Weekly Top Seller
+5 more
AdamGold
says
What does the following code output?
echo 'Email:' , $data['db_email'] , ', Password:' , $data['db_pass'];
by
by
by
by
by
by