-2

The current URL
www.mydomain.com/?ct_keyword&ct_city=la-jolla&ct_property_type=apartments&ct_ct_status=for-rent

New URL .
www.mydomain.com/valueof-ct_city/valueof-ct_property_type/valueof-ct_status?ct_keyword&ct_city=la-jolla&ct_property_type=apartments&ct_ct_status=for-rent

Note: It should take 3 variables from the string and add it to the path

Example of the results
www.mydomain.com/la-jolla/apartments/for-rent/?ct_keyword&ct_city=la-jolla&ct_property_type=apartments&ct_ct_status=for-rent

And of course, the query string is changing so it should take the variables from the current query string.
The query string has more variables in it, I just want the 3 specified above added to the path.

The site is based on WordPress.

Any ideas on how can I do this?

4
  • 1
    What have you tried? What was the result? Without a code sample of what you've tried and a bad result, it's going to be very difficult to help. Commented May 3, 2019 at 16:52
  • have any code sample??? Check This Javascript: stackoverflow.com/a/50338047/10771500 or with php (Server Side): stackoverflow.com/a/4366077/10771500 Commented May 3, 2019 at 18:01
  • Welcome to StackOverflow! Please make sure to add a minimal verifiable code snippet for others to take a look and understand your problem. For more details on how to create minimal reproducible example Commented May 3, 2019 at 19:19
  • Improve formatting and english Commented May 3, 2019 at 19:26

1 Answer 1

-1

Use the ampersand & to glue variables together:

$url = "http://domainname/main.php?email=$email_address&event_id=$event_id";

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.