PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY browser, (Net web server)

PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY browser, you ll see that the here ID has been automatically inserted into the correct link. If you experience any problems, compare your code with menu.inc02.php in the download files. Figure 4-5. With the help of some simple conditional code, the include file produces different output for each page. Now that you know how to find the filename of the current page, you might also find it useful to automate the tag of each page. This works only if you use filenames that tell you something about the page s contents, but since that s a good practice anyway, it s not really a restriction. PHP Solution 4-4: Automatically generating a page s title from its filename Although the following steps use the Japan Journey website, you can try this out with any page. 1. The basename() function used in the previous solution takes an optional second argument: a string containing the filename extension. Create a new PHP file and insert the following code between a pair of PHP tags (the code is in scriptname2.php): echo basename($_SERVER[’SCRIPT_NAME’], ‘.php’); Note that when passing more than one argument to a function, you separate the arguments with commas. 2. Save the page with any name you like (as long as it has a .php filename extension), and load it into a browser. It should display the name of the file stripped of the .php extension. The download file displays scriptname2. <br />You need excellent and relaible webhost company to host your web applications? Then pay a visit to <a href="http://www.b5websitehosting.com">Inexpensive Web Hosting</a> services. </p> <p class="postmetadata alt"> <small> This entry was posted on Wednesday, November 21st, 2007 at 8:21 am and is filed under <a href="http://mysql5.armadillowebhosting.com/category/mysql5/" title="View all posts in MYSQL5" rel="category tag">MYSQL5</a>. You can follow any responses to this entry through the <a href='http://mysql5.armadillowebhosting.com/mysql5/php-solutions-dynamic-web-design-made-easy-browser-net-web-server/feed/'>RSS 2.0</a> feed. You can <a href="#respond">leave a response</a>, or <a href="http://mysql5.armadillowebhosting.com/mysql5/php-solutions-dynamic-web-design-made-easy-browser-net-web-server/trackback/" rel="trackback">trackback</a> from your own site. </small> </p> </div> </div> <!-- You can start editing here. --> <!-- If comments are open, but there are no comments. --> <h3 id="respond">Leave a Reply</h3> <form action="http://mysql5.armadillowebhosting.com/wp-comments-post.php" method="post" id="commentform"> <p><input type="text" name="author" id="author" value="" size="22" tabindex="1" /> <label for="author"><small>Name (required)</small></label></p> <p><input type="text" name="email" id="email" value="" size="22" tabindex="2" /> <label for="email"><small>Mail (will not be published) (required)</small></label></p> <p><input type="text" name="url" id="url" value="" size="22" tabindex="3" /> <label for="url"><small>Website</small></label></p> <!--<p><small><strong>XHTML:</strong> You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> </small></p>--> <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p> <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /> <input type="hidden" name="comment_post_ID" value="318" /> </p> </form> </div> <hr /> <div id="footer"> <!-- If you'd like to support WordPress, having the "powered by" link someone on your blog is the best way, it's our only promotion or advertising. --> <p> Jsp, Tomcat, J2Ee, Hibernate Programming, Http Web Server Blog is proudly powered by <a href="http://www.visionwebhosting.net/">cheap hosting</a> <br /><a href="feed:http://mysql5.armadillowebhosting.com/feed/">Entries (RSS)</a> and <a href="feed:http://mysql5.armadillowebhosting.com/comments/feed/">Comments (RSS)</a>. <!-- 20 queries. 1.176 seconds. --> </p> </div> </div> <!-- Gorgeous design by Michael Heilemann - http://binarybonsai.com/kubrick/ --> </body> </html>