Mr_J Posted July 28, 2008 Share Posted July 28, 2008 Hi all I’m new to PHP. I got myself a book, SAMS TEACH YOURSELF PHP IN 10 MINUTES. a Very simple project just to learn: I made a page in php to display the time and date. To go 1 step further, I added some HTML between the codes. When the page is loaded, everything is there except it made 2 extra lines witch I gave no command to do so... ??? This is my code... It is the bottom part from <HTML> as I’m still fooling around with bad code, " vs ', stop statements and comments etc. <?php /* The time is // lesson 1.1 echo date('H|i|s');?> and the date is <?php echo date('j F Y');?> <?php /* die bg wys die tyd en datum sonder enige spasies... ?> <?php // lesson 1.2 echo "The Time Is "; echo date('H:i:s'); echo " The Date Is "; echo date ('j F Y'); // Hierdie het `n spasie tussen die tyd en text van die datum gemaak... */ ?> <?php // lesson 1.3 BADLY Formatted script ?> <?php /*echo "The time is "; echo date('H:i:s'); echo " and the date is " ; echo date( 'j F Y' ); // New line in browser: [ \n ] nog `n ignore statement: [ # ] */?> <?php # lesson 1.4 is om "comments" in jou script te gebruik... /* time.php [naam van file] tussen die volgende sal als ge-ignore word deur php /* en */ ?> <html> <title>PHP in 10 Minutes</title> <body> <p><h2><li>Les </h2><h1>1</h1> <h2>gaan oor ECHO "</h2></li></p> <?php echo "The time is "; echo date("H:i:s"); //Hours, minutes, seconds echo " The date is "; echo date("j F Y"); //Dag naam, maand naam en jaar * let op die spasie voor en na " in die text ?> <p><h2><strong>Einde van LESSON 1!</strong></h2></p> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/116957-stiil-a-php-newbi/ Share on other sites More sharing options...
waynew Posted July 28, 2008 Share Posted July 28, 2008 When the page is loaded, everything is there except it made 2 extra lines witch I gave no command to do so... What do you mean? Quote Link to comment https://forums.phpfreaks.com/topic/116957-stiil-a-php-newbi/#findComment-601435 Share on other sites More sharing options...
LemonInflux Posted July 28, 2008 Share Posted July 28, 2008 1) Use code tags 2) Post output ---------------- Now playing: Enter Shikari - Adieu via FoxyTunes Quote Link to comment https://forums.phpfreaks.com/topic/116957-stiil-a-php-newbi/#findComment-601441 Share on other sites More sharing options...
waynew Posted July 28, 2008 Share Posted July 28, 2008 Are you sure that you're not talking about ther margin/padding on the <H2> ? Quote Link to comment https://forums.phpfreaks.com/topic/116957-stiil-a-php-newbi/#findComment-601447 Share on other sites More sharing options...
ignace Posted July 28, 2008 Share Posted July 28, 2008 save the css from this page into a file called reset.css and include it in your html page http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ -- dutch --------------- als je wil kan ik je verder helpen in het nederlands als dat wat makkelijker is voor je Quote Link to comment https://forums.phpfreaks.com/topic/116957-stiil-a-php-newbi/#findComment-601461 Share on other sites More sharing options...
Mr_J Posted July 28, 2008 Author Share Posted July 28, 2008 There is more than 1 line or paragraph ... Link: http://cycletrac.co.za/sub-php/time.php I insert a header for the page, supposed to be displayed in line 1 then the time and date then the footer... Quote Link to comment https://forums.phpfreaks.com/topic/116957-stiil-a-php-newbi/#findComment-601462 Share on other sites More sharing options...
LemonInflux Posted July 28, 2008 Share Posted July 28, 2008 Eh? Of course it won't, and that's not a PHP error. Basic HTML puts headers and paragraph text on new lines. ---------------- Now playing: Enter Shikari - Closing via FoxyTunes Quote Link to comment https://forums.phpfreaks.com/topic/116957-stiil-a-php-newbi/#findComment-601467 Share on other sites More sharing options...
Mr_J Posted July 28, 2008 Author Share Posted July 28, 2008 Thank you... Small mistake but I need to point out my problem to be able to get it right! I just love myself too much I guess... Quote Link to comment https://forums.phpfreaks.com/topic/116957-stiil-a-php-newbi/#findComment-601473 Share on other sites More sharing options...
Pyro Posted July 28, 2008 Share Posted July 28, 2008 hey, he is right its just html, you need to learn that first before you jump into php. www.w3schools.com all you need to know all there Quote Link to comment https://forums.phpfreaks.com/topic/116957-stiil-a-php-newbi/#findComment-601475 Share on other sites More sharing options...
Mr_J Posted July 28, 2008 Author Share Posted July 28, 2008 save the css from this page into a file called reset.css and include it in your html page http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ -- dutch --------------- als je wil kan ik je verder helpen in het nederlands als dat wat makkelijker is voor je Hoe kan ek jou kontak? Quote Link to comment https://forums.phpfreaks.com/topic/116957-stiil-a-php-newbi/#findComment-601478 Share on other sites More sharing options...
LemonInflux Posted July 28, 2008 Share Posted July 28, 2008 Sorry, I only speak english translation please? ---------------- Now playing: Enter Shikari - Closing via FoxyTunes Quote Link to comment https://forums.phpfreaks.com/topic/116957-stiil-a-php-newbi/#findComment-601484 Share on other sites More sharing options...
Mr_J Posted July 28, 2008 Author Share Posted July 28, 2008 Sorry, I only speak english translation please? ---------------- Now playing: Enter Shikari - Closing via FoxyTunes Sorry, this was ment for "Ignace" it says: "How can I contact you" in Afrikaans. He is dutch and will understand what I said. Quote Link to comment https://forums.phpfreaks.com/topic/116957-stiil-a-php-newbi/#findComment-601498 Share on other sites More sharing options...
LemonInflux Posted July 28, 2008 Share Posted July 28, 2008 Oooh I see. *sits quietly* ---------------- Now playing: Enter Shikari - The Feast (Demo) via FoxyTunes Quote Link to comment https://forums.phpfreaks.com/topic/116957-stiil-a-php-newbi/#findComment-601500 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.