ryanwood4 Posted February 23, 2009 Share Posted February 23, 2009 It might be a really stupid question. I am trying to add a login page to my website. The page uses a .php extension, but I can't figure out where the PHP stuff should go in the page, and where the HTML stuff should go in the page. So basically, I have the normal html page, but in the content area is the login form. I have tried some combinations like, the PHP at the top of the document and the HTML underneath with the form where I want it, but it just won't work. Thanks. Quote Link to comment Share on other sites More sharing options...
phpdragon Posted February 23, 2009 Share Posted February 23, 2009 For php to work you need to use the php extension, to use php on a page you also need to put it inside the php tag <?php code here ?>. Html code can be used anywhere around the outside of this tag. As far as a login page goes you would have the form on your page for user and pass, when submitted will either goto another processing page or make it relaod the current page. If you wish to reload the current page the put the php form processing at the top of the page in php brackets and use a if statement to check if the submit button has been clicked. eg.. login.php <?php if (isset($_POST['submit'])) { process form here } ?> <html> <form action="<?php $_SERVER['PHP_SELF']?>" method="post"> inputs feilds here </form> </html> Quote Link to comment Share on other sites More sharing options...
ryanwood4 Posted February 23, 2009 Author Share Posted February 23, 2009 Thanks, I have added some html images to the page, but they don't who, nor does the CSS. Why is this? Quote Link to comment Share on other sites More sharing options...
contra10 Posted February 23, 2009 Share Posted February 23, 2009 for the css you can save your css as filename.css and link using this code <link href="filename.css" rel="stylesheet" type="text/css" /> that of course has to be placed in your head then you can place your divs in the php document i guess your trying to make the images show are you doing "<img src='src'>" inside php or regular html? Quote Link to comment Share on other sites More sharing options...
phpdragon Posted February 23, 2009 Share Posted February 23, 2009 when your looking at your page in the browser, right click on the images that are not showing and look at the properties, you need to check to make sure you file locations are set correctly and the images are actually on the server or they will not show Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.