• Resolved kwss

    (@kwss)


    Hello.
    Please help me with inserting PHP code.
    I want soon to migrate from localhost to my server, and im afraid i will have to change every img and href source manually after i move my site from localhost.
    I want to insert in actual html code:

    <img src="https://localhost/wordpress/wp-content/uploads/2015/07
    /ppoz.jpg"/>   <-- something like PHP path to attachement
    
    short code: https://localhost/wordpress/?p=81
    (i copied and paste this path manually...)
    
    and here:
     <a href="https://localhost/wordpress/sprzet-ppoz/">
    Zobacz wi?cej</a> <- and here PHP path to page with id,
    
    shortcode: https://localhost/wordpress/?p=53
    
    i was trying with:
    $actual_link = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]?p=53";>

    but dont know how to get it with it

    here are some helpfull screenshoots:
    https://postimg.org/image/7nazdmwwr/

Viewing 3 replies - 1 through 3 (of 3 total)
  • You will. The easiest way is to use phpmyadmin to get a dump of your database. Then open it in a text editor and replace “localhost/wordpress” with the new website’s domain. You’ll also need to update every instance of your path.

    If you’re running multisite you’ll need to update the table prefixes as well.

    When it do it, it takes literally 30 seconds and then I import the database into the new site.

    Thread Starter kwss

    (@kwss)

    Ohh thanks, hope that works!
    I tought i gonna edit every single page (few pages has more than 100 subpages for every products), but if it will work by just editing database, would be better option.
    So it’s a better solotuion than to insert a php code? Or just put my site to server right now, since i dont have 1000 pages yet and try doing it there?

    It’s my preferred method. There are plugins to automate this, but this is how I’ve done it for years so it’s my preferred method.

    The only time it’s slightly challenging is if it’s for a multisite install because you need to match up the table prefixes.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘insert php url’ is closed to new replies.