HTML - How Do I Display C++ Code On A Web Page?
I'm new to HTML and I need help with posting up c++ code. I have very bland formatting for code in my blog.
I need to be able to post up c++ code like in this guy's Blog Or like this guys site Notice how the c++ code is formatted nicely to show line numbers and colors. What tags or techniques does one use to get this kind of formatting? Similar TutorialsHello, I currently run a shell script that generates a web page. I have never been happy with the layout and feel I could make it better by instead of having to parse each command into html to use text files. I have put some example code on pastebin and hoped someone could help me in getting the basics working, I know little about iframes and java. I would really love to have the items on the left to be clicked on so they expand and allow me to choose a more granular menu system that allows the items clicked to open in the right hand iframe, a bit like the IBM / HP ilo screens. I have no preference into the code type etc as long as it would be easy to generate the code for ie the menus. css would proved an added benefit as well. current page New look page Thanks Hi Im new to the forum, it looks like a great place, would be very grateful for your help I am looking for some code to make up a contact system. When a user clicks on a link or button in my website it forwards them to my contact form and in a field in the contact form it pastes either the items title they were enquiring about or the page they had been enquiring on at the time I found a javascript function that may be able to do it called dopostback but after reading some forums I am concerned it will hinder web crawlers from crawling my site Is there anything equivalent in HTML or other language that could achieve it? Regards Jamie Hei! I'm trying to create a table with three columns, first and last with one row each and middle with two rows. There's pictures in left, right and in the middle bottom cell. Here's the code: Code: <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td width="16%" colspan="1" rowspan="2"><img src="kuvat/hat-right.jpg" border="0" width="100%" height="100%" alt="-------"> </td> <td width="64%" align='center'><a href="index.php">Main page</a> | <a href="aboutus.php">About Us</a> | <a href="showprods.php?sizeToShow=All">Catalog</a> | <a href="contacts.php">Contacts</a> </td> <td width="16%" colspan="1" rowspan="2"><img src="kuvat/hat-left.jpg" border="0" width="100%" height="100%" alt="----"> </td> </tr> <tr> <td width="64%"><img src="kuvat/hat1.jpg" width="100%" height="100%" alt="---------"></td> </tr> </tbody> </table> It works like I want it to do in Firefox, looks ugly in Konqueror and not displayed in Internet Explorer 6. Where's the problem? Thanks in advance! how do I display html code as text? The page is an html document, I want users to be able to highlight and copy a piece of html code. I have tried putting it in a text box in a form, but I can't seem to do it without the code being read as REAL html. Thanks in advance Hugeknot display html code without creating an actual link? I am writing an instruction manual an am having problems showing the html code without it becoming a link. Hi guys, I have on my webhost a ton of pictures and I would like to be able to go to that directory... xxx.com/photos ...and have a page display all the files located in that directory just in a list....then be able to click on them so it displays. Just a file list basically. eg: pic1.jpeg pic2.jpeg etc Is there a simple code to allow me to do this? Thanks! HTLM code to display a directory listing??? Hi there, I wonder whether anyone can help me, I am been desperately searchnig for this answer. Is there any HTML code I can use which I can insert into a webpage, that will show me the directory contents of a particular directory thats within the webserver? I have a webserver which contains a list of files, which I can browse to and view ONLY if I insert the location into a web broswer such as: http://webserver/mydocuments/ I have files that are regularly copied into this directory on my webserver, I want to keep watch on this folder everytime a new file is added. The only way I can do this now is to type in the URL HTTP://webserver/mydocuments and then keep hitting the REFRESH button on IE. Is there a way where the page will keep refreshing every minute/seconds to enable me to keep watch on added files into this location? I thought that if there is some HTML code I can insert into a say a index.html file to allow me to view directory contents, I can then insert code to keep refreshing that page. Any help with this will be appreciated. I thankyou for your help and ideas. Yours, Jameera Hi, in Firefox my page displays fine. as picture below. but in IE it messes up. I assume i have missed something in the html FF http://i46.tinypic.com/4uwd43.png IE http://i47.tinypic.com/9ixmj5.png code below Code: <?php include('header.php'); ?> <?php include('RightSide.php'); ?> <div id="primaryContentContainer"> <div id="primaryContent"> <h2>Contact Simple Coders</h2> <p class="nopadd"> If you have any problem, suggestion, comment, or you found a bug. You can send a message to <script type="text/javascript"> //<![CDATA[ document.write('<a'+' href="mailto:sup'); document.write('port@'+'simplecoders.com">'); document.write('support'); document.write('@simplecoders.com<'+'/a>'); //]]> </script><a href="mailto:support@simplecoders.com"></a> <p>Please read the following first:</p> <ul> <li>Please write your message in English, even if your english is very poor. I simply delete other languages because I cannot understand any word.</li> <li> Your email address will only be used to send a reply to your message, if it's needed. I will not give your email to anyone else</li> <li> If you are a spammer, please don't add my email to your list. I already have enough junk in my inbox</li> </ul> <p>You can also fill the form below: </p> </div> </div> <form style="margin: 0px 0px 0px 0px;" method="POST" name="formData" action="contactmail.php"> <div style="position: absolute; top:500px; left: 254px;"> Your Name: </div> <div style="position: absolute; top: 500px; left: 325px;"> <input type="text" name="to" size="30" /> </div> <div style="position: absolute; top:533px; left: 255px;"> Your Email: </div> <div style="position: absolute; top: 533px; left: 325px;"> <input type="text" name="subject" size="30" /> </div> <div style="position: absolute; top:565px; left: 258px;"> No Robots: </div> <div style="position: absolute; top: 565px; left: 325px;"> <input type="text" name="norobots" size="30" value="Ip Address Here" onclick="this.value=''" /> </div> <div style="position: absolute; top:568px; left: 540px;"> Your Ip Address is: <strong><?php echo $_SERVER['REMOTE_ADDR']; ?></strong> </div> <div style="position: absolute; top:598px; left: 266px;"> Message: </div> <div style="position: absolute; top: 598px; left: 325px;"> <textarea id="msg" name="msg" style="width: 400px; height:170px; font-size: 12px;"</textarea> </div> <div style="position: absolute; top: 785px; left: 325px;"> <input type="submit" alt="Submit Form" name="submit" size="30" value="Send" /> </div> </p> </form> <?php include('LeftSide.php'); ?> Our organization's webpage was created in Dreamweaver, with some additional javascript and html code added by an intrepid staff member with just enough knowledge to be dangerous. The page displays properly in Internet Explorer and Firefox for Windows, as well as Firefox and Netscape for Mac. However, the page displays a white screen in Safari. The page is loading, because the page title displays, and it is possible to view the source code for the page using the "View --> View Source" menu option. But none of the page content shows up. I did not find any relevant help in the Safari forums on the apple page, so I'm wondering if this is a simple coding problem that I don't know enough to ferret out. Any assistance would be greatly appreciated. The website address is http://www.buttecounty.net/bclibrary Thanks, Derek i have a trivia site, so far with 500 or so questions and answers. the answers each have a separate html page, but i am looking for a way to put them all on about 5 pages, and just have one section display in a frame when the question is answered. i have figured out how to display a certain part of a page, but the problem is, i don't want anything else from the page displayed, because they are all embedded youtube videos and they would all start at once. am i just stuck with having an html page for each answer? if you can help god bless you i'm really stuck on this. this is basically what the page will look like, even though there's much work to be done so all the links aren't working, etc... http://trilogy.awardspace.com/iframe.html i'm a bit confused.. it always worked, that i uplaoded the hml code as a new web page in the ftp web tool... (without even name it to .html at the end of the site name...) How can I make that the webpage which i uploaded is diplayed as the actual webpage (and not shown the html code instead) WITHOUT have to add .html to the url??? Example: url.com/contact --> shows only html code url.com/contact.html --> shows correct site but if u access any site... you usually never have to add .html to the url: e.g.: www.mtv.com/music PLEASE, thanks Hello friend, If I post article more then some words , it takes two pages to display the content. Please help me to display the whole article in one page. See this: http://www.solvedhow.com/How+to+Lose+Weight-5.html This is the coding in paging.html. Please help me PHP Code: <?php class Lib_Paging { var $output=array(); var $prev; var $next; function Lib_Paging($model,$par,$cssstyle) { if($model='classic') $this->doClassicPaging($par,$cssstyle); if($model='default') $this->doDefaultPaging($par,$cssstyle); } function doClassicPaging($par = array(),$cssstyle) { // print_r($par);exit; // echo $cssstyle;exit; if(count($par)>0) { if(!isset($_GET['page'])) { $start = 1; $end = ($par['length']>$par['totalpages'] ? $par['totalpages'] : $par['length']); $s = 0; for($i=$start;$i<=$end;$i++) { $tmp = $_SERVER['QUERY_STRING']."&page=".$i; if($_GET['page'] == "" && $i==1) $this->output[++$s]= '<span class="current">'.$i.'</span>'; else $this->output[++$s]= '<a href="?'.$tmp.'" class=\''.$cssstyle.'\'>'.$i.'</a>'; } if($par['totalpages']>$par['length']) { $tmp = $_SERVER['QUERY_STRING']."&page=".($start+1); $this->next = '<a href="?'.($tmp).'" class=\''.$cssstyle.'\'>Next </a>'; } return true; } else if (isset($_GET['page'])) { $cpage = $_GET['page']; $mid = (int) ($par['length']/2); if($cpage > ($mid+1)) { $start = ($cpage - $mid); $end = $start + $par['length']-1; } else { $start = 1; $end = ($par['length']>$par['totalpages'] ? $par['totalpages'] : $par['length']); } $s=0; for($i=$start;$i<=$end;$i++) { $tmp = split('page',$_SERVER['QUERY_STRING']); $q = $tmp[0]."page=".$i; $tmp = split('&',$tmp[1]); $q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : ''); if($_GET['page']==$i) $this->output[++$s] = '<span class="current">'.$i.'</span>'; else { if($i<=$par['totalpages']) $this->output[++$s] = '<a href="?'.$q.' " class=\''.$cssstyle.'\'>'.$i.'</a>'; } } if ($_GET['page']<$par['totalpages']) { $tmp = split('page',$_SERVER['QUERY_STRING']); $q = $tmp[0]."page=".($_GET['page']+1); $tmp = split('&',$tmp[1]); $q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : ''); $this->next = '<a href="?'.($q).' " class=\''.$cssstyle.'\'>Next </a>'; } if($_GET['page']>1) { $tmp = split('page',$_SERVER['QUERY_STRING']); $q = $tmp[0]."page=".($_GET['page']-1); $tmp = split('&',$tmp[1]); $q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : ''); $this->prev .= ' <a href="?'.($q).'" class=\''.$cssstyle.'\'>Prev</a>'; } } } } function doDefaultPaging($par = array(),$cssstyle) { // print_r($par);exit; // echo $cssstyle;exit; if(count($par)>0) { if(!isset($_GET['page'])) { $start = 1; $end = ($par['length']>$par['totalpages'] ? $par['totalpages'] : $par['length']); $s = 0; for($i=$start;$i<=$end;$i++) { $tmp = $_SERVER['QUERY_STRING']."&page=".$i; if ($end==1) // For A Single Display Page { $this->output[++$s]= ''; } else { if($_GET['page'] == "" && $i==1) $this->output[++$s]= '<li class=\''.$cssstyle.' selected\'>'.$i.'</li>'; else $this->output[++$s]= '<li class=\''.$cssstyle.'\'><a href="'.$_SESSION['ajasiteset']['sitefullpath'].'?'.$tmp.'" >'.$i.'</a></li>'; } } if($par['totalpages']>$par['length']) { $tmp = $_SERVER['QUERY_STRING']."&page=".($start+1); $this->next = '<li><a href="'.$_SESSION['ajasiteset']['sitefullpath'].'?'.($tmp).'"><span class="view_edit_next"></span> </a></li>'; } return true; } else if (isset($_GET['page'])) { $cpage = $_GET['page']; $mid = (int) ($par['length']/2); if($cpage > ($mid+1)) { $start = ($cpage - $mid); $end = $start + $par['length']-1; } else { $start = 1; $end = ($par['length']>$par['totalpages'] ? $par['totalpages'] : $par['length']); } $s=0; for($i=$start;$i<=$end;$i++) { $tmp = split('page',$_SERVER['QUERY_STRING']); $q = $tmp[0]."page=".$i; $tmp = split('&',$tmp[1]); $q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : ''); if($_GET['page']==$i) $this->output[++$s] = '<li class=\''.$cssstyle.' selected\'>'.$i.'</li>'; else { if($i<=$par['totalpages']) $this->output[++$s] = '<li class=\''.$cssstyle.'\'><a href="'.$_SESSION['ajasiteset']['sitefullpath'].'?'.$q.' " >'.$i.'</a></li>'; } } if ($_GET['page']<$par['totalpages']) { $tmp = split('page',$_SERVER['QUERY_STRING']); $q = $tmp[0]."page=".($_GET['page']+1); $tmp = split('&',$tmp[1]); $q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : ''); $this->next = '<li><a href="'.$_SESSION['ajasiteset']['sitefullpath'].'?'.($q).'" ><span class="view_edit_next"></span> </a></li>'; } if($_GET['page']>1) { $tmp = split('page',$_SERVER['QUERY_STRING']); $q = $tmp[0]."page=".($_GET['page']-1); $tmp = split('&',$tmp[1]); $q .= (strlen(trim($tmp[1]) > 0) ? '&'.$tmp[1] : ''); $this->prev = '<li><a href="'.$_SESSION['ajasiteset']['sitefullpath'].'?'.($q).'" ><span class="view_edit_pre"></span></a></li>'; } } } } } ?> Good day I need some help. I created a website in adobe dreamworks a while ago. I have added another link to a html file hosted on my website, but it doesn't work in IE and works fine in Chrome and Firefox. the link works, but not the whole page loads any suggestions? Hi, I don't really know html, I have messed around with it and looked at some scripts; I have some understanding of a couple of langauges, but... lets say I'm a beginer. So... I have a website which is designed with WYSIWYG Web Builder and plan to do more advanced things with it. One of the things I plan to do is put a popup for a poll I have created on my hompage. But so users dont get annoyed by the popup everytime they visit I need a Check box; and when ticked sets a cookie to stop the popup coming up. Seen as I'm new to html code I would like the full code/script and maybe instructions please! Hi all Firstly I’m a repeat newbie... I had a brief spell with a mate doing web things in 2000, playing comand and conquer most of the time over a network, we were poor but we had fun...blimey things have changed, in many ways!! I've put together a web site using a trial version of dreamweaver but the problem is that although it displays fine on all my machines at work and at home, the client (friend really) gets a muddled view on her laptop... Like the screen shot. !! I’ve run the compatibility and validator on dreamweaver and it seems ok. I’ve also run the address through w3.org validator and it seems ok. The adress is www.julietbidwell.co.uk Any help will be much appreciated. Thanks Phil PS – note to self I must stop saying I’ll have a go at stuff for people!! Hi, i can't seem to figure this out. How would i go about showing a pages url on the page itself. For example, i am on a page with the url http://www.website.com/page.html, how would i display the pages url on the page automatically, without typing it myself? Any help is greatly appreciated, thanks. Hi. I am making a template for my site, and i really need my title image to display at the very top of the page, so the top of the image touches the bottom of the tool bar of the browser. This is currently what my page looks like www.skyhigh3d.com/testpage.html I would like the top of the black image to touch the top of the browser, so there is no background visable above the image. The image and navbar are in a table, so really i need to table to be at the very top. I know this is possible becuase i have seen many sites with the image at the very top, but no matter what i do it doesnt seem to work. Your help would be very much appreciated. Thanks -JC I'm uploading a file to a server like this: <form action="upload.php" enctype="multipart/form-data" method="post"> <input type="file" name="datafile" size="40"> <input type="hidden" name="MAX_FILE_SIZE" value="1000000"> <input type="submit" value="Send"> </form> upload.php is receiving the file fine. I am processing the uploaded file which may take minutes to do. Upload.php displays results as it processes the uploaded file. However the new page drawn by upload.php does not display until the entire uploaded file is processed. Is there a way to have the new page display the progress of the processing? thanks, William Hello Everyone, I've a gif file that I want to display on my jsp page. The file is located on the server If I give something like <img src="\\filer\home\mine\myimage.gif" alt="not found" title="Image"> then "not found" is shown on jsp page I even moved the image to my c: dir and tried this <img src="C:\myimage.gif" alt="not found" title="Image"> but that didn't worked either. Can someone please tell me where am I supposed to put the image file. Thanks. I got this form in simple html HTML Code: <form name="input" action="display.html" method="get"> Username: <input type="text" name="user" /> <input type="submit" value="Submit" /> </form> When the user clicks the submit button the user should be directed to display.html and should display the name he entered on the form previously. I want the coding in either javascripts or html. y javascript or html ? I want to upload form to a site, so that users can download the form and then fill that form and view what they entered.. To fill the form when running in local machine, you cannot have php scripts, Not all will hav ephp installed in their Pc's.That's y i want in javascript or html... I want to know whats the script to be in display.html page to view the name entered by the user on the form page.......... |