Jump to content

confused with the flow of my new method.?? please help


deepson2

Recommended Posts

I am working on blog related site

 

 

earlier i have my blog details page with this url

mysite/categories/my_world-johnd

 

Where my world is the title and i was appending the username with it so we came to know that "johnd" is the registered user for the blog "my world"

 

Now we have many anonymous blogs on our site.

 

mysite/categories1/my_life

 

 

i want user could claim on it. and then redirect those url to the old one. so the new url would be like this

 

mysite/categories/my_life-geetap

 

where geetap is the username and its her blog now registered on the site.

 

 

function info(){    

         global $url;
          $info1= &NEW abc;
         // echo $url;
         $user=explode("-", $url, 2);
          $urlarr= explode("_", $user[0]);
          $extrcond="";
           $urrcount=count($urlarr);
          for($i=0;$i<$urrcount;$i++){
          $extrcond .="AND b.title like '%".$urlarr[$i]."%'";
          }
       $result = "SELECT  b.title, b.id,b.url, u.id,u.username FROM b_details b,user_details u WHERE u.id = b.id AND a.username='".$user[1]."' ".$extrcond);

       return $info1;
}

 

 

categories.php

 

<?php
$url =$_REQUEST['url'];
//echo $url;
// this url is my url which comes in address bar- mysite/categories/my_worls-jonhd
$details    = $abc->info();

?>

 

 

Can anyone please read this and guide me in the right direction. i am not able to figure it out whether i can do this with only php or i need to change my mod-rewrite as well??

 

I have put up a thread in Apache HTTP Server sections as well

 

http://www.phpfreaks.com/forums/index.php/topic,280594.0.html

 

please help me.

 

Link to comment
Share on other sites

With putting some condition i am able to get both the links on same page with some condition that

So if geetap claims her blog then her new blog url should be

 

mysite/categories/my_world-geetap

 

so i want to redirect old url

i.e

mysite/categories/my_world

 

to

 

 

mysite/categories/my_world-geetap

 

Can anyone please tell me how can i do that?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.