Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-09-2007, 11:19 AM   #1
div3x
Confirmed User
 
Join Date: Jun 2003
Location: Portugal
Posts: 491
wordpress help

anyone know's how to find url string on all posts like out.php and replace it by exit.php for example without beeing done one by one


thanks
div3x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-09-2007, 12:28 PM   #2
sortie
Confirmed User
 
sortie's Avatar
 
Industry Role:
Join Date: Mar 2007
Posts: 7,771
I don't use wordpress but this may help.


#!/usr/bin/perl
print "content-type: text/html\n\n";
$filname = "some/file/on/server/path.ext";
open(DD, "$filename");
@dd = <DD>;
close(DD);
$newdd = join("", @dd);
$newdd =~ s/out.php/exit.php/ig;
open(DD, ">$filename");
print DD $newdd;
close(DD);
print "completed";
exit;

Change the yellow stuff to the actual file.
__________________
sortie is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-09-2007, 12:37 PM   #3
fusionx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Olongapo City, Philippines
Posts: 4,618
THIS IS DANGEROUS CODE - run it at your own risk. Test it on a test install of word press first to be sure it's right. I have not tested this!

This should do it. If there are any other uses of out.php it will replace them as well, so if you can, add more identifying info, like your domain name, etc - as much as you can add into the replacement strings the better. It has to exactly match what it will find in the posts, of course.

In this code, the first string 'out.php' will get replaced with 'exit.php' in all posts.

Do I need to remind you to back up your database first?

If you don't know how to run SQL commands or you don't have access to the database, look for a wordpress plugin that will do search and replace.

Code:
UPDATE wp_posts 
SET post_content=( 
REPLACE (post_content,
'out.php',
'exit.php'));
fusionx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.