Search Results

Search found 55732 results on 2230 pages for 'php html'.

Page 25/2230 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • HTML encoding and decoding

    - by Zerotoinfinite
    Hi All, I am looking for a HTML editor, and I found many links through google like this http://online-html-editor.org/ Now I have written something on it: Let say the below content <div> <span style="font-weight: bold; font-size: 12pt; "> Heading</span></div> <div><br /> </div> The'la;skdlajlsdjansdkahskdkhaksdhkhaskdhkhaskhdkashdkhaksda <div>asdljalsjdljalsdjljalsdjljalsdjljalsdlajs;fl'ajduyasdahsldjkagsdhasvdjyhlasjdgklastgians,dkasjdlhakhsdl</div> <div>amsdka;sdlyasdalshdlj,asdh,asdjg,absdlasd/.malskdla'slduljds,vaskkd;jas;dl'asldu'alsdaskd;lk'as;d</div> <div>'a</div> <div>sd;jasldj;asdaklsdka'sld'sai'dkabskdm;;lsidaasfhdlasjd;ljaspodi;ajsd;lka'sld</div> <div>'</div> <div>ad'</div> <div>a;fj;ljas;dfjalshdoiauslkfdnkasfnlka's;dkap[sd'alsd;jlaksfdkajsdfh;alsd;</div> <div>asdkasjd;kaskd;as;dk;aksd;ajsdlkjalksjdlasjdkgasfkjashdjashdkasfdkjashkdasdjo[uipuhlkasdjlkajsdljalsjdlkajsdljaljsdljalsjdlkaslkjdlkasdjlasjdlkjaslkdjlasjdlasudqpeohw09iqwpekjqwehlj</div> <div><br /> </div> <div> <div> bool tt = new bool();</div> <div> if (txtStatus.Text == "true")</div> <div> tt = true;</div> <div> else</div> <div> tt = false;</div> <div><br /> </div> <div> </div></div> Now I want to save this content into the database and display as a normal text on a page. While extracting I can use Server.HTMLDecode, but I am facing problem while inserting this html data which I have copied from the sites. Please help. Thanks in advance.

    Read the article

  • Saving page as PDF or as HTML but with all entries

    - by Fincha
    Hello every one :) I wont to create a pdf from a form on my page, but the Problem is, I need it excactly like the page with form, all entires. So I have for example 2 Input Fields, 7 Radio, 2 Checkboxes, and as result i need a PDF with the same sructure, but if someone check the checkbox, it must be saved in pdf. I have tryed to save the html content of the page on submit, and save it first in html file, but the problem is, my selections woundn't be saved. The result must have the same as i would print my form. I hope someone can help. PS: I using PHP and jQuery

    Read the article

  • Robust unit-testing of HTML in PHP

    - by asbja
    I'm adding unit-tests to an older PHP codebase at work. I will be testing and then rewriting a lot of HTML generation code and currently I'm just testing if the generated strings are identical to the expected string, like so: (using PHPUnit) public function testConntype_select() { $this->assertEquals( '<select><option value="blabla">Some text</option></select>', conntype_select(1); // A value from the test dataset. ); } This way has the downside that attribute ordering, whitespace and a lot of other irrelevant details are tested as well. I'm wondering if there are any better ways to do this. For example if there are any good and easy ways to compare the generated DOM trees. I found very similar questions for ruby, but couldn't find anything for PHP.

    Read the article

  • How can I convert input to HTML Characters correctly

    - by Codex73
    Let's say I'm including a file which contains html. The html have characters as exclamation symbols, Spanish accents (á, ó). The parsed included text gets processed as symbols instead of their correct value. This happens on FF but not on IE (8). I have tried the following functions: htmlspecialchars, htmlentities, utf8_encode include htmlentities("cont/file.php"); Sample file.php contents: <div>Canción, “Song Name”</div> Output: Canci?n, ?Song Name?

    Read the article

  • php regex to remove HTML

    - by Me1000
    Before we start, strip_tags() doesn't work. now, I've got some data that needs to be parsed, the problem is, I need to get rid of all the HTML that has been formated very strangely. the tags look like this: (notice the spaces) < p > blah blah blah < / p > < a href= " link.html " > blah blah blah < /a > All the regexs I've been trying aren't working, and I don't know enough about regex formating to make them work. I don't care about preserving anything inside of the tags, and would prefer to get rid of the text inside a link if I could. Anyone have any idea? (I really need to just sit down and learn regular expressions one day)

    Read the article

  • Regex: Strip HTML attributes except SRC

    - by Ian Silber
    Hi, I'm trying to write a regular expression that will strip all tag attributes except for the SRC attribute. For example: <p id="paragraph" class="green">This is a paragraph with an image <img src="/path/to/image.jpg" width="50" height="75"/></p> Would be returned as: <p>This is a paragraph with an image <img src="/path/to/image.jpg" /></p> I have a regular expression to strip all attributes, but I'm trying to tweak it to leave in src. Here's what I have so far: <?php preg_replace('/<([A-Z][A-Z0-9]*)(\b[^>]*)>/i', '<$1>', '<html><goes><here>'); Using PHP's preg_replace() for this. Thanks! Ian

    Read the article

  • How to stop HTML text in textarea to be interpreted as code

    - by Myone
    I have a textarea that users can edit. After the edit I save the text in a PHP variable $bio. When I want to display it I do this: <?php $bio = nl2br($bio); echo $bio; ?> But if a user for example types an HTML command like "strong" in their text my site will actually output the text as bold. Which is nothing I want. How can I print/echo the $bio on the screen just as text and not as HTML code? Thanks in advance!

    Read the article

  • Issue with my wordpress functions.php script

    - by iMayne
    Hello peeps. Im having an issues when activating my theme in wordpress. I got this error message: "Parse error: syntax error, unexpected $end in C:\xampp\htdocs\xampp\wordpress\wp-content\themes\xit\functions.php on line 223". Whats wrong, I totally dont understand. The script of the php is: <?php if ( function_exists('register_sidebar') ) register_sidebar(array( 'before_widget' => '', 'after_widget' => '', 'before_title' => '<h2>', 'after_title' => '</h2>', )); function content($num) { $theContent = get_the_content(); $output = preg_replace('/<img[^>]+./','', $theContent); $limit = $num+1; $content = explode(' ', $output, $limit); array_pop($content); $content = implode(" ",$content)."..."; echo $content; } function post_is_in_descendant_category( $cats, $_post = null ) { foreach ( (array) $cats as $cat ) { // get_term_children() accepts integer ID only $descendants = get_term_children( (int) $cat, 'category'); if ( $descendants && in_category( $descendants, $_post ) ) return true; } return false; } //custom comments function mytheme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>"> <div id="comment-<?php comment_ID(); ?>"> <div class="comment-author vcard"> <div class="comment-meta commentmetadata"> <?php echo get_avatar($comment,$size='32',$default='http://www.gravatar.com/avatar/61a58ec1c1fba116f8424035089b7c71?s=32&d=&r=G' ); ?> <?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?> <br /><?php printf(__('<strong>%s</strong> says:'), get_comment_author_link()) ?><?php edit_comment_link(__('(Edit)'),' ','') ?></div> </div> <?php if ($comment->comment_approved == '0') : ?> <em><?php _e('Your comment is awaiting moderation.') ?></em> <br /> <?php endif; ?> <div class="text"><?php comment_text() ?></div> <div class="reply"> <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?> </div> </div> <?php } add_action('admin_menu', 'xit_theme_page'); function xit_theme_page () { if ( count($_POST) > 0 && isset($_POST['xit_settings']) ) { $options = array ( 'style','logo_img','logo_alt','logo_txt', 'logo_tagline', 'tagline_width', 'contact_email','ads', 'advertise_page', 'twitter_link', 'facebook_link', 'flickr', 'about_tit', 'about_txt', 'analytics'); foreach ( $options as $opt ) { delete_option ( 'xit_'.$opt, $_POST[$opt] ); add_option ( 'xit_'.$opt, $_POST[$opt] ); } } add_theme_page(__('Xit Options'), __('Xit Options'), 'edit_themes', basename(__FILE__), 'xit_settings'); } function xit_settings () {?> <div class="wrap"> <h2>XIT Options Panel</h2> <form method="post" action=""> <table class="form-table"> <!-- General settings --> <tr> <th colspan="2"><strong>General Settings</strong></th> </tr> <tr valign="top"> <th scope="row"><label for="style">Theme Color Scheme</label></th> <td> <select name="style" id="style"> <option value="pink.css" <?php if(get_option('xit_style') == 'pink.css'){?>selected="selected"<?php }?>>pink.css</option> <option value="blue.css" <?php if(get_option('xit_style') == 'blue.css'){?>selected="selected"<?php }?>>blue.css</option> <option value="orange.css" <?php if(get_option('xit_style') == 'orange.css'){?>selected="selected"<?php }?>>orange.css</option> </select> </td> </tr> <tr valign="top"> <th scope="row"><label for="logo_img">Logo image (full path to image)</label></th> <td> <input name="logo_img" type="text" id="logo_img" value="<?php echo get_option('xit_logo_img'); ?>" class="regular-text" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="logo_alt">Logo image ALT text</label></th> <td> <input name="logo_alt" type="text" id="logo_alt" value="<?php echo get_option('xit_logo_alt'); ?>" class="regular-text" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="logo_txt">Text logo</label></th> <td> <input name="logo_txt" type="text" id="logo_txt" value="<?php echo get_option('xit_logo_txt'); ?>" class="regular-text" /> <br /><em>Leave this empty if you entered an image as logo</em> </td> </tr> <tr valign="top"> <th scope="row"><label for="logo_tagline">Logo Tag Line</label></th> <td> <input name="logo_tagline" type="text" id="logo_tagline" value="<?php echo get_option('xit_logo_tagline'); ?>" class="regular-text" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="tagline_width">Tag Line Box Width (px)</label><br /><em style="font-size:11px">Default width: 300px</em></th> <td> <input name="tagline_width" type="text" id="tagline_width" value="<?php echo get_option('xit_tagline_width'); ?>" class="regular-text" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="contact_email">Email Address for Contact Form</label></th> <td> <input name="contact_email" type="text" id="contact_email" value="<?php echo get_option('xit_contact_email'); ?>" class="regular-text" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="twitter_link">Twitter link</label></th> <td> <input name="twitter_link" type="text" id="twitter_link" value="<?php echo get_option('xit_twitter_link'); ?>" class="regular-text" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="facebook_link">Facebook link</label></th> <td> <input name="facebook_link" type="text" id="facebook_link" value="<?php echo get_option('xit_facebook_link'); ?>" class="regular-text" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="flickr">Flickr Photostream</label></th> <td> <select name="flickr" id="flickr"> <option value="yes" <?php if(get_option('xit_flickr') == 'yes'){?>selected="selected"<?php }?>>Yes</option> <option value="no" <?php if(get_option('xit_flickr') == 'no'){?>selected="selected"<?php }?>>No</option> </select> <br /><em>Make sure you have FlickrRSS plugin activated if you choose to enable Flickr Photostream</em> </td> </tr> <!-- Sidebar ABout Box--> <tr> <th colspan="2"><strong>Sidebar About Box</strong></th> </tr> <tr valign="top"> <th scope="row"><label for="about_tit">Title</label></th> <td> <input name="about_tit" type="text" id="about_tit" value="<?php echo get_option('xit_about_tit'); ?>" class="regular-text" /> </td> </tr> <tr valign="top"> <th scope="row"><label for="about_txt">Text</label></th> <td> <textarea cols="60" rows="5" name="about_txt" type="text" id="about_txt" class="regular-text" /><?php echo get_option('xit_about_txt'); ?></textarea> </td> </tr> <!-- Ads Box Settings --> <tr> <th colspan="2"><strong>Ads Box Settings</strong></th> </tr> <tr> <th><label for="ads">Ads Section Enabled:</label></th> <td> <select name="ads" id="ads"> <option value="yes" <?php if(get_option('xit_ads') == 'yes'){?>selected="selected"<?php }?>>Yes</option> <option value="no" <?php if(get_option('xit_ads') == 'no'){?>selected="selected"<?php }?>>No</option> </select> <br /><em>Make sure you have AdMinister plugin activated and have the position "Sidebar" created within the plugin.</em> </td> </tr> <tr valign="top"> <th scope="row"><label for="advertise_page">Advertise Page</label></th> <td> <?php wp_dropdown_pages("name=advertise_page&show_option_none=".__('- Select -')."&selected=" .get_option('xit_advertise_page')); ?> </td> </tr> <!-- Google Analytics --> <tr> <th><label for="ads">Google Analytics code:</label></th> <td> <textarea name="analytics" id="analytics" rows="7" cols="70" style="font-size:11px;"><?php echo stripslashes(get_option('xit_analytics')); ?></textarea> </td> </tr> </table> <p class="submit"> <input type="submit" name="Submit" class="button-primary" value="Save Changes" /> <input type="hidden" name="xit_settings" value="save" style="display:none;" /> </p> </form> </div> <? }?> <?php function get_first_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); $first_img = $matches [1] [0]; if(empty($first_img)){ //Defines a default image $first_img = "/images/default.jpg"; } return $first_img; } ?> The last line is line 223.

    Read the article

  • Replacing text node of HTML input in PHP

    - by Aman Kumar Jain
    Hi, I want to replace all the text nodes in a html text. I'll explain with an example: $html = " <div> <p> text2 text2 word text2 <span>abcd</span> text2 text2 word text2 <p> this is a long, very long statement with punctuations. </div> I want to replace "text2 text2 word text2" with "<span>text2 text2 word text2</span>" and "this is a long, very long statement with punctuations." with "<span>this is a long, very long statement with punctuations.</span>" What should be the regular expression for the same?

    Read the article

  • Split string into smaller part with constrain [PHP RegEx HTML]

    - by Sadi
    Hello, I need to split long string into a array with following constrains: Each part will have a limited number of character (e.g. not more than 8000 character) Each part can contain multiple sentences (delimited by . [full stop]) but never a partial sentences. Except if the last part of the string (as last part may not have any full stop. The string may contain HTML tags. But the tag can not be divided as ( to ). That means HTML tag should be intact. But starting tag and ending tag can be stay on different segment/chunk. I think regular expression with preg_split can do it. Would please help me with the proper RegEx. Thank you Sadi

    Read the article

  • HTML/jQuery/CSS Drop Down Menu Issue / Safari

    - by mmundiff
    I have a drop down menu that is coded in HTML, CSS, and jQuery and it works fine in Firefox and IE but not in Safari, and also not in Firefox on Mac. The drop down displays inline as opposed to list-item for the drop down in Safari. Any ideas why? <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script type="text/javascript" > $(document).ready(function(){ $('#menu li').hover( function() { //$('ul', this).css('display', 'block'); $('ul', this).fadeIn(200); var src = $('img.item', this).attr('src').match(/[^\.]+/) + '_over.png'; $('img.item', this).attr('src', src); }, function() { //$('ul', this).css('display', 'none'); $('ul', this).fadeOut(350); var src = $('img.item', this).attr('src').replace('_over', ''); $('img.item', this).attr('src', src); }); }); </script> <style type="text/css"> /* General */ body { arial, sans-serif; background-color: white; } * { padding: 0; margin: 0; } #menu{ white-space:nowrap; list-style:none; margin-left: 1px; } #menu ul { list-style: none; position:absolute; left:0; display:none; margin:0 -3px 0 -1px; padding:0; background: #000000; z-index: 500; margin-top: -4px; } #menu li{ display:inline; float: left; /* Added */ position:relative; } #menu li a { display: block; } #menu ul li { width:116px; float:left; border-top:1px dotted #666666; display: block; } #menu li ul { display: none; border-top: 1px black solid; text-align: left; } #menu ul a:hover { text-decoration:none; background: #efda83; color: #000000; } #menu ul a { text-decoration:none; display:block; height:15px; padding: 8px 5px; color:#efda83; font-size: 12px; } img{ border: 0 none; } .clear{ clear: both; } </style> </head> <body> <div> <ul id="menu"> <li ><a href="index.php"><img src="images/ssr_nav_home.png" class="item" alt="Home" /></a> </li> <li ><a href="about.php"><img src="images/ssr_nav_about.png" class="item" alt="About" /></a> <ul> <li><a href="about_contributors.php">Contributors</a></li> <li><a href="about_behind.php">Behind the Exhibit</a></li> <li><a href="about_sponsors.php">Sponsors</a></li> </ul> <div class="clear"></div> </li> <li ><a href="exhibit_intro.php"><img class="item" src="images/ssr_nav_exhibit.png" alt="Exhibit" /></a> <ul> <li><a href="exhibit_intro.php">Intro</a></li> <li><a href="exhibit_silkroad.php">Silk Road</a></li> <li><a href="exhibit_western_regions.php">Western Regions</a></li> <li><a href="exhibit_daily_life.php">Daily Life</a></li> <li><a href="exhibit_burial_practices.php">Burial Practices</a></li> <li><a href="exhibit_relevance.php">Relevance</a></li> </ul> <div class="clear"></div> </li> <li ><a href="visit.php"><img class="item" src="images/ssr_nav_visit.png" alt="Visit" /></a> <ul> <li><a href="visit_tickets.php">Tickets</a></li> <li><a href="visit_specials.php">Special Offers</a></li> <li><a href="visit_tours.php">Tours</a></li> <li><a href="visit_groups.php">Groups</a></li> </ul> <div class="clear"></div> </li> <li ><a href="events.php"><img class="item" src="images/ssr_nav_events.png" alt="Events" /></a> <ul> <li><a href="events_lectures.php">Lecture Series</a></li> <li><a href="events_symposium.php">Symposium</a></li> <li><a href="kids_and_family.php">Kids &amp; Family</a></li> <li><a href="events_calendar.php">Event Calendar</a></li> </ul> <div class="clear"></div> </li> <li ><a href="gallery.php"><img class="item" src="images/ssr_nav_images.png" alt="Gallery" /></a></li> <li ><a href="resources.php"><img class="item" src="images/ssr_nav_resources.png" alt="Resources" /></a> <ul> <li><a href="resources_teachers.php">For Teachers</a></li> <li><a href="kids_and_family.php">Kids &amp; Family</a></li> <li><a href="http://www.penn.museum/podcasts-and-videos/819-secrets-of-the-silk-road.html" rel="external">Podcasts &amp; Videos</a></li> <!-- <li><a href="map.php">Silk Road Map</a></li> <li><a href="resources_timeline.php">Timeline</a></li> --> <li><a href="resources_quiz.php">Quiz</a></li> <li><a href="glossary.php">Glossary</a></li> <li><a href="blogs.php">Blog</a></li> </ul> <div class="clear"></div> </li> <li ><a href="press.php"><img class="item" src="images/ssr_nav_press.png" alt="Press" /></a> <ul> <li><a href="press_release.php">Press Release</a></li> <li><a href="press_images.php">Press Images</a></li> <li><a href="press_bloggers.php">Bloggers</a></li> </ul> <div class="clear"></div> </li> </ul> </div> </body> </html>

    Read the article

  • jquery to php (wait for php script until result/finish)

    - by user354051
    Hi, I am executing a php call from javascript(jQuery), php sript is sending result back. The problem is that these php scripts are taking some time (milliseconds), and java script is not waiting for them to finish, thus variables are not getting initialized with correct values. The code is simple: $.get("php/validation.php",{'email':email},function(data){ // valid_email now contains true/false alert(data); if(data=="true"){ var valid_email = true;} }); The "alert" is printing true but value of valid_mail is recognized as "false" in the code below. Is there any other better way to call php scripts and wait for until they are not finished? Prashant

    Read the article

  • PHP eval() code in between <?php ?> from database

    - by kr1zmo
    Some of you may be annoyed with this question, and claim it's unsafe blah blah. I want to be able to put php into the database and run it. I have to do this because I store page layouts in the database and each our different for each other, however in some cases I want to use dynamic content for some of the pages. assume $query_from_db is the string returned from the database. php should only eval() the code in between <?php and ?> $query_from_db = '<div> <?php //php to run function dosomething() { //bleh } ?> </div> '; php echo eval($query_from_db);

    Read the article

  • Fetch HTML page and store it in MYSQL- How to

    - by codemaker
    Hi, What's the best way to store a formatted html page with CSS on to MYSQL database? Is it possible? What the column type should be? How to retrieve the stored formatted HTML and display it correctly using PHP? What if the page I would like to fetch has pics and videos, show I store the page as blob What's the best way to fetch a page using PHP-CURL,fopen,..-? Many questions guys but I really need your help to put me on the right way to do it. Thanks a lot.

    Read the article

  • Pretty-print HTML via PHP without validation?

    - by brianjcohen
    I'd like to automatically pretty-print (indentation, mostly) the HTML output that my PHP scripts generate. I've been messing with Tidy, but have found that in its efforts to validate and clean my code, Tidy is changing way too much. I know Tidy's intentions are good but I'm really just looking for an HTML beautifier. Is there a simpler library out there that can run in PHP and just do the pretty-printing? Or, is there a way to configure Tidy to skip all the validation stuff and just beautify?

    Read the article

  • submit button on html to output result on same page

    - by amateur
    Hi, Although this seems like something very basic, but no matter what I tried I couldn't get my head around it. Basically I want a html form where a user types in their ID number in an input text box and when they hit the submit button it displays their email address which is their company ID number @ company.com, such as below <form action=""> ID Number: <input type="text" name="idnumber" /><br/> <input type="submit" value="Whats my email address" /> </form> <p>Your email address is 'idnumber'@email.com</p> Can this even be done using html or would I need to use Javascript or PHP for it? Thanks

    Read the article

  • Want to 'sandbox' user form submitted HTML

    - by pmmenneg
    Hi all. I have a user form with a textarea that allows users to submit html formatted data. The html itself is limited by PHP strip_tags, but of course that does no completion checking etc. My basic problem is that should a user leave a tag unclosed, such as the tag, then all the content following that, including page content that follows that is 'outside' the user content display area, could now be malformed. Checking for proper tag completion is one solution I will look at, but ideally I'd like to firewall the user htmlified content away from the rest of the site somehow. Any suggestions on the best approach? Thanks!

    Read the article

  • Read external HTML page and then find data within

    - by inthewayboy
    I'm playing around with an idea, and I'm stuck at this one part. I want to read an external HTML page and then extract the data held within two <dd> tags. I've been using file_get_contents with good results, but I'm at a loss as to how to accomplish that last part. The two tags I want to extract the value from are always enclosed within a particular <div>, was wondering if that might help? In my mind it reads the entire html file into a string, then dumps all the data up until this one particular <div>, and dumps all the data after the closing </div>. Is that possible? I think this needs regex syntax which I've never used yet. So any tips, links, or examples would be great! I can provide more info as necessary.

    Read the article

  • PHP Templated site w/ file_get_content links

    - by s32ialx
    Ok so i have a template script my friend built for me. I'll include all file names OK so what is not working is file_get_contents is not grabing the content (1 I don't know where the content should be placed and 2 i want it placed in a directory so that IF i change the template the area where content stays is the same. I'm trying to get file_get_contents to load the links ?=about ?=services etc to load in to body.tpl in the contents div please any help is apperciated. /* file.class.php */ <?php $file = new file(); class file{ var $path = "templates/clean"; var $ext = "tpl"; function loadfile($filename){ return file_get_contents($this->path . "/" . $filename . "." . $this->ext); } function css($val,$content='',$contentvar='#CSS#') { if(is_array($val)) { $css = 'style="'; foreach($val as $p) { $css .= $p . ";"; } $css .= '"'; } else { $css = 'style="' . $val . '"'; } if($content!='') { return str_replace($contentvar,' ' . $css,$content); } else { return $css; } } function setsize($content,$width='-1',$height='-1',$border='-1'){ $css = ''; if($width!='-1') { $css = $css . "width=\"".$width."\""; } if($height!='-1') { $css = $css . "height=\"".$height."\""; } if($border!='-1') { $css = $css . "border=\"" . $border . "\""; } return str_replace('#SIZE#',' ' . $css,$content); } function setcontent($content,$newcontent,$vartoreplace='#CONTENT#'){ $val = str_replace($vartoreplace,$newcontent,$content); return $val; } function p($content) { $v = $content; $v = str_replace('#CONTENT#','',$v); $v = str_replace('#SIZE#','',$v); print $v; } } if (isset($_GET['page'])) { $content = $_GET['page'].'.php'; } else { $content = 'main.php'; } ?> if some one could trim that down so it JUST is the template required code and file get contents. /* index.php */ <?php include('classes/file.class.php'); //load template content $header = $file->loadfile('header'); $body = $file->loadfile('body'); $footer = $file->loadfile('footer'); //assign content to multiple variables $file->p($header . $body . $footer); ?> /* header.tpl */ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <meta name="robots" content="index,follow"/> <meta name="distribution" content="global"/> <meta name="description" content=""/> <meta name="keywords" content=""/> <link href="templates/clean/style.css" rel="stylesheet" type="text/css" media="screen" /> <link rel="stylesheet" href="templates/clean/menu_style.css" type="text/css" /> <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script> </head> <body> <div id="header"> <div id="logo"><a href="index.php" style="height:30px;width:150px;"><img src="images/logo.png" border="0" alt=""/></a></div> <div id="menuo"> <div class="menu"> <ul id="menu"> <li><a href="?page=home">Home</a></li> <li><a href="?page=about">About Us</a></li> <li><a href="?page=services">Services</a> <ul> <li><a href="?page=instore">InStore Repairs</a></li> <li><a href="?page=inhome">InHome Repairs</a></li> <li><a href="?page=website">Website Design</a></li> <li><a href="?page=soon">Comming Soon.</a></li> </ul> </li> <li><a href="?page=products">Products</a> <ul> <li><a href="?page=pchard">Computer Hardware</a></li> <li><a href="?page=monitor">Monitor's</a></li> <li><a href="?page=laptop">Laptop + Netbooks</a></li> <li><a href="?page=soon">Comming Soon.</a></li> </ul> </li> <li><a href="?page=contact">Contact</a></li> </ul> </div> </div> </div> <div id="headerf"> </div> /* body.tpl */ <div id="bodys"> <div id="bodt"></div> <div id="bodm"> <div id="contents"> #CONTENT# </div> /* footer.tpl */ <div id="footer"> <div style="position:absolute; top:4px; left:4px;"><img src="images/ff.png" alt="ok"></div> <div style="position:absolute; top:4px; right:5px; color:#FFFFFF;">&copy;2010 <a href="mailto:">Company Name</a></div> </div> </body> </html>

    Read the article

  • What shall I include in a 10 week web technologies course?

    - by Iain
    In September I will be teaching a university module on web technologies. This session will be available to 1st year (freshman) students who don't necessarily have any programming knowledge or know how the web works. In the 2nd semester I will be teaching Flash, which is my specialism, so I know exactly what I am going to teach, but in the 1st semester I will be teaching them web standards technologies - HTML, CSS, JS, jQuery, PHP and MySQL. Where I need advice is how to proportion the emphasis for each part, and which parts of each technology to cover. Another real issue I'm struggling with is how much of the bad old ways should I teach them? Do they need to know about bold as well as strong, etc. UPDATE: based, on your feedback I will only be teaching the latest version of everything - CSS3, HTML5 etc. I'm not sure exactly how long the semester will be but I'm guessing about 10-12 weeks. Each session is a 2 hour lab. Obviously there's only so much I can cover in that time and it will be up to the students to go a research this stuff properly on W3 schools etc. My ideas so far were: Lesson 0 - Course intro and overview of the current tech landscape. What is out there, what will we be learning, what won't we. What is a web server, URL etc. Looking at different example websites and discussing how they work. Lesson 1 - HTML basics (head, body, title, img, table, a, lists, h1, strong etc) Lesson 2 - CSS for styling and layout - fonts, webfonts, float etc Lesson 3 - Intro to programming JS (variables, loops, conditionals, functions) Lesson 4 - more JS programming fundamentals, DOM manipulation Lesson 5 - jQuery - making things fly about and look cool Lesson 6 - XML and Ajax Lesson 7 - PHP basics - syntax, server-side principles Lesson 8 - PHP and MySQL - forms, logins, saving user info Lesson 9 - don't know Lesson 10 - don't know Please let me know if you think this is the right order, what have I missed, how to use any spare sessions etc. Thanks :) UPDATE BASED ON RESPONSES: Thanks for all your responses - some great stuff. To be absolutely clear, this is not a computer science course, it is a practical module on a creative technology course. The emphasis definitely has to be on making cool things work rather than understanding how the backbone of the internet works. That can come later, if the students are interested. At the end of the module I would like the students to be able to produce a web page or pages that does something cool, using some or all of the technologies I cover. Many of these topics are of course far beyond the scope of a 2 hour session, however I do not have the option of reducing the syllabus, I will just have to explain what the technology does and encourage the student to research it in their own time.

    Read the article

  • What should someone learn to become a great web-app builder by 2015

    - by rickdronkers
    My brother just started learning some html/css at school and he loves it. He asked me to give my advice on what languages to learn in order to build great web-apps by the time he leaves school. (2015 or something like that.) I did some research, and right now I want to tell him (in this particular order): HTML - HTML5 CSS - CSS3 Javascript - jQuery - AJAX PHP - Zend Framework MySQL Ruby - RoR I would like to know if this is correct before I waste his time. Stackoverflow seems like a place where people know the answer to these kind of questions ;). Thanks!

    Read the article

  • Php mail pulling form data from previous page

    - by Mark
    So I have a form being filled out on one php like so: <p> <label for="first_name">First Name: </label> <input type="text" size="30" name="first_name" id="first_name"/> </p> <p> <label for="last_name"> Last Name:</label> <input type="text" size="30" name="last_name" id="last_name"/> </p> <p> <label for="address_street">Street:</label> <input type="text" size="30" name="address_street" id="address_street"/> </p> <p> <label for="address_city">City:</label> <input type="text" size="30" name="address_city" id="address_city"/> </p> <p> <label for="address_state">State/Province:</label> <input type="text" size="30" name="address_state" id="address_state"/> </p> <p> <label for="email">Your e-mail: </label> <input type="text" size="30" name="email" id="email"/> </p> <p> <label for="phone">Your phone number: </label> <input type="text" size="30" name="phone" id="phone"/> </p> This is on one php page. From here, it goes to another php which part of it contains script to send a html email to recipient. Problem is, I cannot seem to get it to pull the variables even though I thought I declared them correctly and mixed them into the html correctly. <?php $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $to = "[email protected], [email protected]"; $subject = "HTML email for ALPS"; $message .= ' <html> <body> <div style="display: inline-block; width: 28%; float: left;"> <img src="http://englishintheusa.com/images/alps-logo.jpg" alt="ALPS Language School" /> </div> <div style="display: inline-block; width: 68%; float: right;"> <p style="color: #4F81BD; font-size: 20px; text-decoration: underline;">Thanks You For Your Inquiry!</p> </div> <div style="padding-left: 20px; color: #666666; font-size: 16.8px; clear: both;"> <p>Dear $first_name $last_name ,</p> </br > <p>Thank you for the following inquiry:</p> </br > </br > </br > </br > <p>****Comment goes here****</p> </br > </br > <p>We will contact you within 2 business days. Our office is open Monday-Friday, 8:30 AM - 5:00 PM Pacific Standard Time.</p> </br > <p>Thank you for your interest!</p> </br > </br > <p>Best Regards,</p> </br > </br > <p>ALPS Language School</p> </br > </br > <p>430 Broadway East</p> <p>Seattle WA 98102</p> <p>Phone: 206.720.6363</p> <p>Fax: 206. 720.1806</p> <p>Email: [email protected]</p> </div> </body> </html>'; // Always set content-type when sending HTML email $headers .= "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // More headers mail($to,$subject,$message,$headers); ?> So you see where I am trying to get first_name and last_name. Well it doesn't come out correctly. Can someone help here?

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >