I have a site in HTML but want to change to PHP - How?

Discussion in 'HTML & Website Design' started by geester1, Jul 23, 2011.

  1. #1
    I have been considering and putting off changing my site to a wordpress blog so that when I post a new thread it appears on the front page of my website, is this possible to be without a complete rewrite?

    I love html but I am told php is the only way to use this plugin to post the title and excerpt on home page of website, I am also concerned about the large amount of backlinks I have built to my html pages and I do not know how to change or redirect them?

    Any ideas?;)
     
    geester1, Jul 23, 2011 IP
  2. suryawl

    suryawl Peon

    Messages:
    54
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Try wordpress. you can build your site easily, then you can add your backlinks manually in the template you use. hope that helps
     
    suryawl, Jul 23, 2011 IP
  3. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #3
    ALL web sites MUST use HTML and there are NO exceptions. The reason PHP was recommended is because you want to dynamically alter some things which HTML cannot do by itself but HTML is always involved.
     
    drhowarddrfine, Jul 23, 2011 IP
  4. yog888

    yog888 Greenhorn

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    yog888, Jul 23, 2011 IP
  5. gpcola

    gpcola Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If all you need is to be able use a plugin then surely all that's required is to save the page with a .php extension and then place necessary code in your page's html. Or did I miss something?
     
    gpcola, Jul 24, 2011 IP
  6. MRFD

    MRFD Active Member

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    93
    #6
    What I suggest you is to use XMLHttpRequest on your homepage, and to configure it to automatically send a request to a PHP file when the page is loaded (window.onload javascript function)
    The PHP file could get the contents of the thread (file_get_contents function), extract what you need (maybe with some regex) and echo the result.
    The XMLHttpRequest will then print the result where you want on your homepage.
     
    MRFD, Jul 24, 2011 IP
  7. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #7
    He doesn't even know the difference between PHP and HTML and you think he can do all that?!
     
    drhowarddrfine, Jul 24, 2011 IP
  8. Mafishioso

    Mafishioso Well-Known Member

    Messages:
    199
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    #8
    I agree with drhowarddrfine.. Nevertheless, WordPress is the best way to suit your needs.
     
    Mafishioso, Jul 24, 2011 IP
  9. MRFD

    MRFD Active Member

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    93
    #9
    It's not so difficult... but OK, more simple:

    Just create a php file and name it as latest_thread.php:
    <?php
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Pragma: no-cache");
    ?>
    This is the title
    <br />
    <br />
    This is the content: bla bla bla, bla bla bla,
    bla bla bla, bla bla bla, bla bla bla, bla bla bla,
    bla bla bla, bla bla bla, bla bla bla, bla bla bla,
    bla bla bla, bla bla bla, bla bla bla, bla bla bla
    Code (markup):
    Upload it to your server in the same directory as your index.html file.

    Now add this code to your index.html :
    <div id="latestThread"></div>
    
    <script type="text/javascript">
    var xhr = null;
    if (window.XMLHttpRequest) {
    	xhr = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
    	try {
    		xhr = new ActiveXObject("Msxml2.XMLHTTP");
    	} catch(e) {
    		try {
    			xhr = new ActiveXObject("Microsoft.XMLHTTP");
    		} catch(e1) {
    			xhr = null;
    		}
    	}
    } else {
    	alert("XMLHttpRequest not supported!")
    }
    
    function getThread() {
    	xhr.open("GET","latest_thread.php?rand="+ Math.floor(Math.random()*99999) ,true);
    	xhr.onreadystatechange = function() {
    		if (xhr.readyState == 4) {
    			var result = xhr.responseText;
    			if (document.getElementById('latestThread')) {
    				document.getElementById('latestThread').innerHTML = result;
    			}
    		}
    	};
    	xhr.send(null);
    }
    
    window.onload = function() {
    	getThread();
    }
    </script>
    Code (markup):
    Now every time you post a new thread, just edit the latest_thread.php file.
     
    Last edited: Jul 25, 2011
    MRFD, Jul 25, 2011 IP
  10. developer.designer

    developer.designer Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    you can also do it with jquery/javascript
     
    developer.designer, Jul 25, 2011 IP
  11. MichaelX

    MichaelX Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Actually wordpress is a great choice for blogging (considering that original WP was created only for blogging purpose), there are load of video tutorials on how to convert HTML/CSS template to Wordpress so I think it won't be problematic for you. If you still require some help, I can provide you some video tutorials.
     
    MichaelX, Jul 25, 2011 IP
  12. geester1

    geester1 Well-Known Member

    Messages:
    2,250
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    105
    #12
    Stop your condisending mutterings, I do know the difference I was just asking as the plugin I want to use ONLY works on php (WORDPRESS) sites NOT HTML.
     
    geester1, Jul 25, 2011 IP
  13. ChrisBR

    ChrisBR Greenhorn

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #13
    I advise installing wordpress its very sophisticated and would improve the overall functionality of your site
     
    ChrisBR, Jul 25, 2011 IP
  14. Andre91

    Andre91 Peon

    Messages:
    197
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    0
    #14
    OP, send me a PM of your site and I'll be glad to help you out at no cost. Its giving month I guess :confused:
     
    Andre91, Jul 25, 2011 IP
  15. mera

    mera Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    i think wordpress is the best
     
    mera, Jul 25, 2011 IP
  16. mikepua

    mikepua Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    You can start migrating to wordpress now.
    The sooner you migrate, the sooner your followers will know your new pages.

    Migrating you pages to PHP will really sacrifice your previous readers.
    But then, you can still make your previous html pages available while already using PHP with WordPress as you Content Management System.
    Just put link on your html pages pointing to your new wordpress pages so your readers know.
     
    mikepua, Jul 25, 2011 IP
  17. amit199222

    amit199222 Greenhorn

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #17
    Use wordpress its easy to use
     
    amit199222, Jul 25, 2011 IP