So I recently came across this tutorial for creating a double opt in script. But it does not seem to be working.
Can someone check it out and see what's wrong with it?
Every time I try to use it, I get the error
Class 'Email' not found in register.php at line 12
Here is the link to the article: http://tonygaitatzis.tumblr.com/post/66610863603/double-opt-in-email-registration
Here is the github link for the download: https://github.com/backupbrain/double-opt-in-registration-php
In the register.php only emailregistration class is loaded.
But at line 12, you are trying to create instance of class email which is not loaded in this php file.
Load this class before using it in the code
require_once('classes/Email.class.php');
Related
I am beginner in cakePHP and woking on cakePHP 2.0. I am trying to generate CSV file, to accomplish this task i am using the following method.
cake php official site refr.
github refr.
i have got stucked in step no. 2 when it is loading the plugin. the following error is occurring in app/Config/bootstrap.php file
Fatal error: Class 'CakePlugin' not found in /var/www/html/sitefolder/app/config/bootstrap.php on line 51
CakePlugin::load('Export');
Please correct me.
Thnaks
Thnaks guys for your precious response on this
For now i have find the solution of this by following steps.
download the plugin files form
https://github.com/joshuapaling/CakePHP-Export-CSV-Plugin
by pass the step no.2 and step no.3 of what they have mentioned in official refer.
copy the file "ExportComponent.php" from plugin and paste it in
site_folder/app/controllers/components
add it in controller's component array variable
$components = array('blabla1', 'blabal2', 'Export')
create $data array variable (which contains the csv file data ) and just do like
$this->Export->exportCsv($data, 'filename1.csv');
Its done and working fine for me
I have installed League\Csv\Reader which uses SplTempFileObject and when run comes back with Error:
Class 'App\Controller\SplTempFileObject' not found
I cant seem to find a Use statement, any help appreciated code below:
$writer = Writer::createFromFileObject(new SplTempFileObject());
Thanks
Richard
PHP namespacing 101, you need to use \SplTempFileObject (backslash prefix) or add use SplTempFileObject; at top of file.
I am attempting to build a PHPMailer based email system for a basic website.
This is the line of code that is giving me trouble:
$xajax->printJavascript('xajax/');
Now, this is the tutorial I am using.
Regarding the above line of code, the tutorial says this:
How to use the code inside a webpage?
Place the form (variable), the function (and the includes) before of all html code. Next we need to include some JavaScript file in the documents HTML header (place also php tags):
$xajax->printJavascript('xajax/');
When I run all of the code (including: PHPMailer script; Ajax script), I get this error, on the aforementioned line of code.
Fatal error: Call to a member function on a non-object
So, my question is, do I need to in someway customize this code or make it run to a filepath of some ajax core file or something?
I would be willing to be $xajax is not defined. Try adding this after including the libraries but before including the call to that method:
$xajax = new xajax();
There may be some additional setup required by xajax. A more complete code example could help troubleshoot.
I want a piece of code on the index of my Code Igniter's script so I can change the identety or name of my controller from agent69 to agent007_and_supergirl,and also a way to beat any rule that pages might have against using underscore to separate words as an amendment.
In other words I want that all the calls that the processor of my server has inside my code igniter for agent69 be translated to calls to agent007_and_supergirl
Is just a change of identety for the controller without altering the main controler's functionality and without getting my hands dirty with coding.
If you want re route your default controller url, you have to edit routing configuration like this:
in application/config/route.php
$route['agent007_and_supergirl'] = 'agent69';
Now agent69 Controller will be accessible by http://youriste.com/agent69 and http://yoursite.com/agent007_and_supergirl as well
CodeIgniter URI Routing Guide
Working on config/routes.php yelded miserabe results on past,remember that is an identity matter
And I want all the calls of agent69 be sent to agent007_and_supergirl that is its new identity
What was successfull on the past about this mattar was controller and file cloning,it worked masterfully
but this only intercepted few server calls so for me to get all the server calls, I need to clone every
single fie on the script so I feel silly teling you again thats why I didnt want to get my hands dirty with code
because is plenty of code.
Well hope that you can help me master this code that goes on the index of my code igniter script--///The code cant appear here so its below in the comment to lighta thanks 4 readin
I know with selenium RC, I used to pass a commandline operator... -firefoxProfileTemplate and that would work. Now working with Selenium2 (Webdriver), that doesn't seem to work anymore.
Since I'm using PHPUnit for other tests, I would like to continue to use it. Anyone know how to define a custom firefox profile for it?
This does not explicitly answer the question above, however, it did help solve the immediate problem as my setup for selenium would only ever use 1 Firefox instance and not try to load them on the fly.
With that said, this would help the majority of users out there, thus the reason I'm putting it as an "Answer" here, but not selecting it as the correct one.
I found the answer here at phpunit-selenium issue queue on github. Thanks emaks.
Simply load your selenium server with the command line option
-Dwebdriver.firefox.profile=PROFILE_NAME
Note: PROFILE_NAME is the machine name located in your profiles.ini in the Firefox Application Data directory. It is not a path or what not.
Lets say you use php-webdriver with FirefoxDriver.
And you want to start FirefoxDriver with specific Firefox profile. (for staying logged in and save your login and cookies every selenium run)
First of all, find directory with you firefox profile data. For me on Win 10 it is C:/Users/MyWinProfile/AppData/Roaming/Mozilla/Firefox/Profiles/pivdau5sa.selen
After that use such code for opening firefox php-webdriver:
namespace Facebook\WebDriver;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Firefox\FirefoxDriver;
use Facebook\WebDriver\Firefox\FirefoxOptions;
require_once('vendor/autoload.php');
$firefoxOptions = new FirefoxOptions();
$firefoxOptions->addArguments(['-profile', 'C:/Users/<MyUserName>/AppData/Roaming/Mozilla/Firefox/Profiles/pivdau5sa.selen']);
$capabilities = DesiredCapabilities::firefox();
$capabilities->setCapability(FirefoxOptions::CAPABILITY, $firefoxOptions);
putenv('WEBDRIVER_FIREFOX_DRIVER=C:\PHP\geckodriver.exe'); // you may dont need this line
$driver = FirefoxDriver::start($capabilities);