kleb Posted December 20, 2011 Share Posted December 20, 2011 i need help here..i want to echo a lage code of html but it is giving me problems..i know it will hv to do with the syntax but am confused on how to go about it..below is the php code and the html codes <?php include"header.php"; session_start(); if(isset($_POST['submit'])) { $log=mysql_real_escape_string($_POST['mail1']); $pas=($_POST['pass1']); if($log=='' || $pas=='') { echo "Please supply your Username(your email address) and your password"; } else { $sel="SELECT user_name,userID FROM user WHERE (user_email='$log') AND (user_password='$pas')"; $ok=mysql_query($sel) or die(mysql_error()); if(mysql_num_rows($ok)==0)echo"Wroung Username or Password used,Please try again"; else { while($row=mysql_fetch_array($ok)) { $_SESSION['userID']=$row['userID']; $_SESSION['user_name']=$row['user_name']; $_SESSION['user_date']=$row['user_date']; echo $_SESSION['user_date']=$row['user_date']; echo"this is where i want to put the html codes so that the user_name appears on the page".$_SESSION['user_name']; } } } } mysql_close(); ?> this is the html codes <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta name="Description" content="Information architecture, Web Design, Web Standards." /> <meta name="Keywords" content="your, keywords" /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="Distribution" content="Global" /> <meta name="Author" content="Erwin Aligam - [email protected]" /> <meta name="Robots" content="index,follow" /> <link rel="stylesheet" href="images/PixelGreen.css" type="text/css" /> <title>Planetafric</title> </head> <body> <!-- wrap starts here --> <div id="wrap"> <div id="header"><div id="header-content"> <h1 id="logo"><a href="index.html" title="">speak<span class="gray">out</span></a></h1> <h2 id="slogan">The Revolution is now...</h2> <!-- Menu Tabs --> <ul> <li><a href="index.html" id="current">Home</a></li> <li><a href="index.html">News</a></li> <li><a href="index.html">Downloads</a></li> <li><a href="index.html">Support</a></li> <li><a href="index.html">About</a><li> </ul> </div></div> <div class="headerphoto"></div> <!-- content-wrap starts here --> <div id="content-wrap"><div id="content"> <div id="sidebar" > <div class="sidebox"> <h1>About this Website</h1> <p>Due to the injustice we face conitnualy in this nation WE (KTECHGROUP) have decided to stamp our feet against all this ills in our country..THE TIME IS NOW ..Stand against non avalabitlty of social amenities, stand against unemployment and stand against corruption.<img src="speakout_1.png"/></p> </div> <div class="sidebox"> <h1 class="clear">Sidebar Menu</h1> <ul class="sidemenu"> <li><a href="index.html" class="top">Home</a></li> <li><a href="#TemplateInfo">Template Info</a></li> <li><a href="#SampleTags">Sample Tags</a></li> <li><a href="http://www.styleshout.com/">More Templates...</a></li> <li><a href="http://www.4templates.com/?aff=ealigam">Premium Templates</a></li> </ul> </div> <div class="sidebox"> <h1>Sponsors</h1> <ul class="sidemenu"> <li><img src="watch.jpg"/></br><h3>Longinnes wrist watch forsale at reduced price</h3></li> <li><img src="htc.jpg"/><label>4templates</label</li> <li><a href="http://store.templatemonster.com/?aff=ealigam">TemplateMonster</a></li> <li><a href="http://www.fotolia.com/partner/114283">Fotolia.com</a></li> <li><a href="http://www.text-link-ads.com/?ref=40025">Text Link Ads</a></li> </ul> </div> <div class="sidebox"> <h1>Wise Words</h1> <p>"No man can live happily who regards himself alone; who turns everything to his own advantage. You must live for others if you wish to live for yourself."</p> <p class="align-right">- Seneca</p> </div> <div class="sidebox"> <h1>Support Speakout</h1> <p>If you are interested in supporting this work and would like to contribute, you are welcome to make a small donation through the <a href="http://www.styleshout.com/">donate link</a> on this website - it will be a great help and will surely be appreciated.</p> </div> <div class="sidebox"> <h1>Search Box</h1> <form action="#" class="searchform"> <p> <input name="search_query" class="textbox" type="text" /> <input name="search" class="button" value="Search" type="submit" /> </p> </form> </div> </div> <div id="main"> <div class="post"> <a name="TemplateInfo"></a> <h1> </h1> <p>Posted by <a href="index.html">Adetoye Oni</a></p> <p><strong>A weeping Eye</strong> is a free, W3C-compliant, CSS-based website template by <strong><a href="http://www.styleshout.com/">styleshout.com</a></strong>.<p align="left"><img src="soldier_crying.jpg"/></p align> This work is distributed under thel;kmbkl;;lsjljhl;hjklghl;kk;gjhflk;jfgkl;jflhjflkhlkkjgfklk Creative Commons Attribution 2.5 License</a>, which means that you are free to use and modify it for any purpose. All I ask is that you include a link back tohjsklvjksjkskjvskdv dhlkdhlshdlkjhdslkjhkljsdhjsdhjlghdsjhjkdshgjkdhjkshdjkhdsjkhdkjsjgdgl sddjgkldsjlkgdlkshgldhsgldhlghdlshgdlhgldhlkhdlkdkhdlkgdgd djkdjklgdjklgjdslkjdlksjkldsjkldsjlkdsjklgjsldkjgkldsgdsgjdklsgjsljgl\ksdjgjldkgj;ldsk\jglkdsg <a href="http://www.styleshout.com/">my website</a> in your credits.</p> <p>For more free designs, you can visit <a href="http://www.styleshout.com/">my website</a> to see my other works.</p> <p>Good luck and I hope you find my free templates useful!</p> <p class="post-footer align-right"> <a href="index.html" class="readmore">Read more</a> <a href="index.html" class="comments"><?php if(isset($_SESSION['views'])) $_SESSION['views']=$_SESSION['views']+1; else $_SESSION['views']=1; echo"Comments:".$_SESSION['views']; ?></a> <span class="date">Nov 11, 2006</span> </p> </div> <h3>Comments:</h3> <table> <tr class="row-a"> <td class="first"><?php include"header.php"; $sql="SELECT *FROM post "; $result=mysql_query($sql)or die(mysql_error()); while($row=mysql_fetch_array($result)) { echo"{$row['post_date']}"."</br>"; } ?></td> <td><?php include"header.php"; $sql="SELECT *FROM post "; $result=mysql_query($sql)or die(mysql_error()); while($row=mysql_fetch_array($result)) { echo"{$row['post_content']}"."</br>"; } ?></td> </tr> </table> <h3>Post your comments here</h3> <form action='reply.php'method='post'> <textarea name="comment" id="content" style="width:400px;height:50px;background-color:#D0F18F;color:#000000;font:15px/20px cursive;scrollbar-base-color:#638E0D;"></textarea> <br /> <input class="button" type="submit"name="submit"value="submit" /> </p> </form> <br /> </div> <!-- content-wrap ends here --> </div></div> <!-- footer starts here --> <div id="footer"><div id="footer-content"> <div class="col float-left"> <h1>Site Partners</h1> <ul> <li><a href="http://www.dreamhost.com/r.cgi?287326"><strong>Dreamhost</strong> - Affordable & Reliable Webhosting</a></li> <li><a href="http://www.4templates.com/?aff=ealigam"><strong>4templates</strong> - Low Cost Hi-Quality Templates</a></li> <li><a href="http://store.templatemonster.com/?aff=ealigam"><strong>TemplateMonster</strong> - Best templates on the net!</a></li> <li><a href="http://www.fotolia.com/partner/114283"><strong>Fotolia</strong> - Free stock images or from $1</a></li> <li><a href="http://www.text-link-ads.com/?ref=40025"><strong>Text Link Ads</strong> - Easiest. Money. Ever.</a></li> </ul> </div> <div class="col float-left"> <h1>Links</h1> <ul> <li><a href="http://www.openwebdesign.org/">openwebdesign.org</a></li> <li><a href="http://www.opendesigns.org/">Opendesigns.org</a></li> <li><a href="http://www.pdphoto.org/">PDPhoto.org</a></li> <li><a href="http://www.alistapart.com">Alistapart</a></li> <li><a href="http://www.cssremix.com">CSS Remix</a></li> </ul> </div> <div crrlass="col2 float-right"> <p> © copyright 2006 <strong>Ktech group</strong><br /> Programme by: <a href="index.html"><strong>Adeleye Caleb</strong></a> Valid <a href="http://jigsaw.w3.org/css-validator/check/referer"><strong>CSS</strong></a> | <a href="http://validator.w3.org/check/referer"><strong>XHTML</strong></a> </p> <ul> <li><a href="index.html"><strong>Home</strong></a></li> <li><a href="index.html"><strong>Sitemap</strong></a></li> <li><a href="index.html"><strong>RSS Feed</strong></a></li> </ul> </div> </div></div> <!-- footer ends here --> <!-- wrap ends here --> </div> </body> </html> Thanks in advance and this is the html Quote Link to comment https://forums.phpfreaks.com/topic/253532-i-want-to-echo-large-html-codes/ Share on other sites More sharing options...
SergeiSS Posted December 20, 2011 Share Posted December 20, 2011 I'm not sure what do you like to do... One of the problems is that you say HTML about the file containing PHP code. You maybe like to use include() or include_once() for your aim? Quote Link to comment https://forums.phpfreaks.com/topic/253532-i-want-to-echo-large-html-codes/#findComment-1299648 Share on other sites More sharing options...
kleb Posted December 20, 2011 Author Share Posted December 20, 2011 sergies dont border about those php codes i embeded in the html codes..i hv tried to use include but it gave me errors thats why i want to use echo""; Quote Link to comment https://forums.phpfreaks.com/topic/253532-i-want-to-echo-large-html-codes/#findComment-1299650 Share on other sites More sharing options...
SergeiSS Posted December 20, 2011 Share Posted December 20, 2011 What kind of error did you get with include()? Quote Link to comment https://forums.phpfreaks.com/topic/253532-i-want-to-echo-large-html-codes/#findComment-1299653 Share on other sites More sharing options...
kleb Posted December 20, 2011 Author Share Posted December 20, 2011 Hi sergies, i hv forgotten how i did iti that time that it gave me errors.i want when users sign in it sholud show that html page although i name it in php format and their name to show on the page Quote Link to comment https://forums.phpfreaks.com/topic/253532-i-want-to-echo-large-html-codes/#findComment-1299664 Share on other sites More sharing options...
SergeiSS Posted December 20, 2011 Share Posted December 20, 2011 OK... You may use: 1. include() - the best solution, AFAIK for such a case 2. echo file_get_contents('name_of_you_file); - that you wish now; will work only a case with HTML without PHP 3. .... some other methods Quote Link to comment https://forums.phpfreaks.com/topic/253532-i-want-to-echo-large-html-codes/#findComment-1299679 Share on other sites More sharing options...
kleb Posted December 20, 2011 Author Share Posted December 20, 2011 please i dont understand that step two clearly Quote Link to comment https://forums.phpfreaks.com/topic/253532-i-want-to-echo-large-html-codes/#findComment-1299685 Share on other sites More sharing options...
SergeiSS Posted December 20, 2011 Share Posted December 20, 2011 These are not steps, these are different possibilities. 1. Use include() http://ru.php.net/manual/en/function.include.php 2. Use file_get_contents() http://ru.php.net/manual/en/function.file-get-contents.php 3. May use iframes... Quote Link to comment https://forums.phpfreaks.com/topic/253532-i-want-to-echo-large-html-codes/#findComment-1299687 Share on other sites More sharing options...
kleb Posted December 20, 2011 Author Share Posted December 20, 2011 >:(sergie Quote Link to comment https://forums.phpfreaks.com/topic/253532-i-want-to-echo-large-html-codes/#findComment-1299704 Share on other sites More sharing options...
SergeiSS Posted December 20, 2011 Share Posted December 20, 2011 Didn't understand... Is something is not clear? Quote Link to comment https://forums.phpfreaks.com/topic/253532-i-want-to-echo-large-html-codes/#findComment-1299722 Share on other sites More sharing options...
kleb Posted December 20, 2011 Author Share Posted December 20, 2011 yea..i hv been to those links but doesnt seem to explain wot i need Quote Link to comment https://forums.phpfreaks.com/topic/253532-i-want-to-echo-large-html-codes/#findComment-1299742 Share on other sites More sharing options...
SergeiSS Posted December 20, 2011 Share Posted December 20, 2011 yea..i hv been to those links but doesnt seem to explain wot i need Why??? In the beginning you say //i want to echo a lage code of html but it is giving me problems echo"this is where i want to put the html codes so that the user_name appears on the page".$_SESSION['user_name']; Why don't you like function file_get_contents()? It just do what you asked. Or maybe you changed your mind? Also, include() does the same as file_get_contents() + you may use PHP code inside the included file. Quote Link to comment https://forums.phpfreaks.com/topic/253532-i-want-to-echo-large-html-codes/#findComment-1299869 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.