Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8427761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:52:02+00:00 2026-06-10T04:52:02+00:00

How do i change a url in a string example : This is a

  • 0

How do i change a url in a string example :

This is a link <a href="http://google.com.au">http://google.com.au</a>

To something like this

This a warning page link <a href="./warn.php?link=http://google.com.au">http://google.com.au</a>

EDIT:

What i’m trying to do is take a description entered by the end user, They might enter links in the description, i want to change all the links to make them GOTO a warning page, the warning page is ./warn.php?site=link

The string might look like this

This is a awesome description <a href="google.com.au">Google</a> and this another link <a href="http://google.com.au/images">Google images</a>

Ok here’s what i tried:

$descc = mysql_real_escape_string($_POST['description']);

$descc = preg_replace('"\b(http://\S+)"', '<a href="./warn.php?site='.base64_encode(.'$1'.).'">$1</a>', $descc);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T04:52:04+00:00Added an answer on June 10, 2026 at 4:52 am

    Check this, although im not sure if you are really refering to this, just let me know the case then —

    $mylink = "http://google.com.au";
    
    This a warning page link <a href="./warn.php?link=<?php echo $mylink ?>">http://google.com.au</a>
    

    EDIT version 1.0

    Even it is on description box data you can fetch it via jquery or php like

    $mylink = $_GET['desc_name_data']; 
    

    Please be more specific with the problem 🙂

    EDIT Version 1.1

    Check this and let me know then —

    echo preg_replace('(<a href="http://\S+)', '<a href="./warn.php?site='.'google.com.au'.'">google.com.au', $descc);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have pass url to another page via javascript .For example www.example.com/share.php?url=http://google.com/ (I create
I have links like http://example.com?query1=query1&query2=query2 as href of anchor tag. I want to do
I've this NGINX rewrite URL: if ($http_host !~ ([a-zA-Z0-9.-]+)\.example\.com(.+)) { rewrite ^ http://example.com/browse.php?u=http://$1$2? permanent;
I would like to change url the HTTP POST to during the request in
I want to change the url or query string without reloading the page... I
I have a string which looks like: <html><head><title>example</title></head><body>some example text</body></html> I get this string
I am trying to get my urls to look like this: example.com/posts/id_of_post/title_of_post I have
I'd like to change my jQM page's URL dynamically (when the user does some
I use Pjax with tutorial from http://railscasts.com/episodes/294-playing-with-pjax?view=comments I don't need change url and this
Possible Duplicate: Change the URL in the browser without loading the new page using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.