Index.html include php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
toucan
Forum Newbie
Posts: 3
Joined: Fri Mar 26, 2010 7:17 am

Index.html include php

Post by toucan »

Hi, have a simple index.htm and I want a link to execute a php script.

I think i need my html page something like this:

<html>
<body>

<h1>Welcome to my home page!</h1>
<p>Some text.</p>

<a href="/install.php">Install CMS</a>
</body>
</html>

and then my install.php page something like this:

<html>
<body>

<?php $foo = system('wget http://www.myserver.com/myfile.tar ~',$output);?>
<? system("tar -zxvf myfile.tar") ?>

</body>
</html>


Am I going about this the right way?
rahulsonar
Forum Newbie
Posts: 10
Joined: Wed Mar 11, 2009 8:54 am

Re: Index.html include php

Post by rahulsonar »

yes, this is the correct way. User an href in index.html and then do whatever you want in php file...
toucan
Forum Newbie
Posts: 3
Joined: Fri Mar 26, 2010 7:17 am

Re: Index.html include php

Post by toucan »

Wow, it worked! Of course, now I've got my files and untarred them, I want it to be executed. So, I put in an HREF linking to the newly created file, but what I'd really like it to do is load the new index.php itself, after the script has run.

How would I do this?
Post Reply