Navigation

Pligg Support

Ok. So when a user submits a story, just as I am submitting this support story, I would like after step 3 to redirect them to the page of the story they just submitted. How can I do that ?

Possible Answers

    Just replace example.com from the following example with your site's address.

    In your submit.php file find:

    header("Location: " . getmyurl('new'))

    and replace it with the following two lines:

    $thecat = get_cached_category_data('category_id', $linkres->category);

    header("Location: http://example.com/$thecat->category_name/$linkres->title_url");

    | Posted 58 days ago | Permalink | Hide Replies

    Any idea why it doesn't work for few categories? It gives 404 error. I don't understand why it works for stories submitted in category 'tech', but not for category 'politics'. Would be really nice if you can help me. Thanks.

    | Posted 42 days ago | Permalink | Hide Replies

    What url method are you using?

    | Posted 42 days ago | Permalink | Hide Replies

    Oh, I've wrote it wrong in the link.

    It's category_safe_name, not category_name.

    So it should be:

    header("Location: http://example.com/$thecat->category_safe_name/$linkres->title_url");

    | Posted 42 days ago | Permalink | Hide Replies

    It works! Thanks for your help.

    | Posted 42 days ago | Permalink | Hide Replies

    SEO URL method 2. I guess it's a category redirecting problem. Categor ID vs Category name? Would really appreciate your help.

    | Posted 42 days ago | Permalink | Hide Replies

    Wow. Thank you very much. You have no idea how much I have searched for this.

    For those that do not use SEO Urls the second line is : header("Location: http://example.com/story.php?title=$linkres->title_url");

    | Posted 58 days ago | Permalink | Hide Replies

Who Upvoted this Story