You will need a code editor to create the custom PHP Code from this lesson. I am using Dreamweaver from Adobe which has a built in FTP client so I can upload the file to my server.
If you want to use free tools and do not have an FTP client or no FTP access to your site, use these alternatives:
Free Code Editor: Brackets
Create directories and upload files to Wordpress using the File Manager Plugin.
A Word of warning for this plugin. You can completely destroy your Wordpress site with this plugin. Make sure to not delete or rename any files or folders.
With your FTP client or the File Manager Plugin create a new folder directly below the root folder of your wordpress site. Name the folder “riddle” for example. Make sure to pick a name that is not used by Wordpress (do not name it uploads for example). Then upload the file you created following the steps from this lesson to this folder.
Lastly enter the full URL of this file as the custom result page into Riddle, replacing the test URL we used in Lesson one. The file path could be https://www.mysite.com/riddle/customphpfile.php
Note: the file needs to be in a subdirectory of the Wordpress site where you want to host the custom result page and your site needs to be SSL secured, meaning your domain needs to start with https and not http.
Read our instructions on how the code works here on our documentation on custom result pages.
If you already know what you are doing, you can also just copy the code from below. Make sure to alter the $redirectPage values to match your site (more on that in lesson 3).