Forum Moderators: rogerd & travelin cat
http ://example.com/device-driver-v12.exe
in post named mysite.com/postname.html <?php
if(file_exists('../../../wp-config.php')){ require('../../../wp-config.php'); } else { require('wp-config.php'); }
global $table_prefix, $wpdb;
$get_id = $_SERVER['QUERY_STRING'];
$pieces = explode("|", $get_id);
$get_id = $pieces[0];
$variables = $pieces[1];
$table_name = $table_prefix . "short_url";
if($get_id){
$site_redirect = $wpdb->get_var("SELECT link_url FROM $table_name WHERE link_id='$get_id'");
if($site_redirect){
$wpdb->query("UPDATE $table_name SET link_count = link_count + 1 WHERE link_id='$get_id'");
$site_redirect = str_replace("$2", $variables, $site_redirect);
header("Location: $site_redirect");
exit;
}
echo "<h2>Short URL Not Found</h2>";
echo "<p>Sorry but the URL you entered was not found to redirect anywhere. Please check the link and try again.</p>";
}As us see the plugin connect to DB grebe shorted link from it table .. ../../../wp-config.php Sorry but the URL you entered was not found to redirect anywhere. Please check the link and try again.
You want to make the user wait for some period of time before you redirect them to ... yoursite.com/somedir/adifferentfile
The only issue is short link add from plugin admin area not added automatically specially their is at less 260 link needed to modify.
about ../../../wp-config.php path I think the author us it to reach wp-config.php on site root from current plugin path which is
../wp-contens/plugin/short-url-plugin
I understand that you have many many links in this form, so you want something to happen automatically. You don't want to edit 260 posts
require('wp-config.php'); safe to use .I search and found no one use it .