joethall
Forum Replies Created
-
Forum: Hacks
In reply to: How to invoke a URL from a PHP plug-in?I have been properly chastized for my naive approach. Please accept my apologies!
I assure you that I was not looking for a “free ride”.I am almost totally new to WordPress and its plug-ins and I’m trying hard to bootstrap myself with enough information to move forward.
I was hoping to collect the little pieces of information that I need to put this together.Since you have not shown us any of the HTML structure you want to produce or use or output, you have not told us where this key is going to come from, how many such user elements there are going to be, whether the key can be computed based on the page (post id) alone, or additional form inputs, etcetera etcetera etcetera,
There is no HTML structure to be produced. I simply need to have a link in a WordPress web site cause the execution of a plug-in of my own design. The author of the WordPress web site knows how to install the link and my plug-in, but I am responsible for what the link does!
The key will be generated and encrypted by the plug-in code (JavaScript is preferred but PHP can be used as well).
There are several things that need to be included in the key string before encryption: 1) a one-time password (I know how to do this), 2) an identification of the WordPress web site user that clicked the link (I don’t know how to get this information). Your reply is the first time I’ve heard the term “post ID” and I will research to find out what it means.
There are no other inputs, form or otherwise, just the creation of a URL with an encrypted key string – that’s it!!!
Said another way – I would like to have WP automatically and securely redirect the WP user to a ‘different, premium content, non-WP site’ when the user clicks a link to an iframe element inside of WP. The login information would be transmitted by an encoded key value generated on the WP server, and passed to the premium content site as an encoded ascii key value in the initial URL.
I will certainly post to this thread all of the information that contributes to the solution to this problem when it becomes clear to me.
I thank you for your patience!
Forum: Hacks
In reply to: How to invoke a URL from a PHP plug-in?Well, I posted this thread a couple of months ago but I got sidetracked and I’m just now getting back to it. The problem I need to solve has not changed. I need to, from a PHP plug-in in WordPress, to cause a dynamic URL to be built and then executed (redirected)
The destination for the URL will be the same each time but there are standard HTML parameters that must also be included. The general form for the URL would be: https://www.xxx.com?key=A114C5F0
The key is computed each time and it is assumed that this plug-in can be triggered in various ways in the WordPress web site. Here’s is a prototype of such a plug-in:
`/*
Plugin Name: Database Search
Description: Search Database
Author: Joe T. Hall
Author URI: http://JoeTHall.com/
Plugin URI: https://www.xxx.com
Version: 1.0
*/
<?php
function redirect_to_KSRsearch() {
header( ‘Location: https://www.xxx.com/yyy.php’ ) ;
}
add_action ( ‘wp-head’, ‘redirect_to_xxx’ );’Would it be possible for me to enter into an email conversation with someone that might know how to accomplish this task?
Thanks
Joe
Forum: Hacks
In reply to: How to invoke a URL from a PHP plug-in?What I need to do is to, from a PHP program that is a WP plug-in, redirect out of WP and off to a full URL which I will specify.
I have never written a WP plug-in and my PHP is very slight. Can you share the skeleton source for a PHP plug-in with redirection to, for example, http://www.jthweb.com/KSR/KSRsearch.php, just as a test.
I need to do some more things, but if I could get this much working I would be one happy camper!!
If I should do this in JavaScript instead of PHP, so be it. In fact, I would rather do it that way if at all possible because I have much more experience writing JavaScript than I do PHP. Again, samples would be much appreciated.