Coder Profile - Show off your skills, get a coder profile.
 
 
 
Integrating your website with PHP
Programming
PHP is nice coding language. With it, you can do many things, like guest books, different calculators and so on. With PHP, you can also easily integrate your website.

You can see Integration example in use HERE:http://www39.ikolnet.fi/test/

See, it's working nicely. All you need are do is:
Make links like this:
Code :: URL Copy / Restore
  1. <a href=".">Home</a>
  2. <a href='?act=1'>First</a>
Beginning of PHP:
Code :: Beginning Copy / Restore
  1. <?
  2.      switch($_GET['act']){
  3.           default:
Then, after that default, add whatever you like to see in the index. In example, there is lines like this:
Code :: example Copy / Restore
  1. echo 'Welcome to this site';
  2. break;
Remember to add (break;) after all the code you like.

Then, let's add what is after the that link(this is picked from example site's code:
Code :: example2 Copy / Restore
  1. case"1":
  2. echo 'Here are example of url';
  3. echo '<br>';
  4. echo '<a href="http://www.CoderProfile.com" target=_blank>Coder Profile</a>';
  5. break;
See, you can use HTML inside echo, so you can add whatever you like to your site, even it is still the one same file...

After writing the code, lets end the PHP:
Code :: Ending Copy / Restore
  1. }
  2. ?>
and you're done! it's that simple.

Like this, you can easily cut down small files in your website. If you make your site like this, you just have to edit few files in your website, even if your website is HUGE. This is pretty simple example though. If you know what to do, you can even integrate PHP/MySQL stuff into your website. It's a bit harder to make, but it's not impossible. Also, you can name the integrations, simply change the 1 in (<a href='?act=1'>First</a>) and in (case"1":) to anything you like. It's recommended to name those to represent the code what is in there. If you have for example Links to several sites in there, name it something like (links) or (urls) or whatever you like. It makes the code way more comfortable to edit like that, and sites url tells what is in there... Go figure, possibilities are endless.

Here is the complete source of that example site:
Code :: Index.php Copy / Restore
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>Index</title>
  6. </head>
  7. <body>
  8. <table width=800 height=150 border=0>
  9. <tr><th></th></tr>
  10. </table>
  11. <table width=800 height=700 border=0>
  12.    <tr>
  13.      <th width=260 valign="top" scope="row"><div align="left">
  14.        <p><strong><a href=".">Home</a></strong></p>
  15. <p><strong>Something:</strong></p>
  16. <ul>
  17.    <li><a href='?act=1'>First</a></li>
  18.    <li><a href='?act=2'>Second</a></li>
  19. </ul>
  20. <p><strong>More something:</strong></p>
  21. <ul>
  22.    <li><a href='?act=3'>Third</a></li>
  23. </ul>
  24.      </div></th>
  25. <th width=440 valign="top" scope="row"><div align="center">
  26. <?
  27.      switch($_GET['act']){
  28.           default:
  29. echo 'Welcome to this site';
  30. break;
  31. case"1":
  32. echo 'Here are example of url';
  33. echo '<br>';
  34. echo '<a href="http://www.CoderProfile.com" target=_blank>Coder Profile</a>';
  35. break;
  36. case"2":
  37. echo 'its nice when your website is in one file';
  38. break;
  39. case"3":
  40. echo 'Needs less bunchies';
  41. break;
  42. }
  43. ?>
  44. </div></th>
  45.    </tr>
  46. </table>
  47. </body>
  48. </html>
Have fun with this!


Posted By Fogrotten
Please login to rate coding articles.

Click here to register a free account with us.
Comments
Please login to post comments.
 
Izzmo     Posted 233 Days Ago
 
 
Oh, also, TAB! Tabbing looks better and again, is back to using standards.
 
Izzmo     Posted 233 Days Ago
 
 
I don't know about easier, but it's better when being a "better
programmer" and writing in standards. Short hand is just bad practice.
Page 1 of 1
More Articles By This Author
Integrating your website with PHP
Recently Posted "Programming" Articles
N-Queens-Series Part I (Only the fittest survive)
Currying in JavaScript: Fun for the Whole Family!
[PHP] Create A Unique Page Hits Counter
Actionscript Events
Actionscript API
Quick Threading Tutorial - C++
C++ And Me (A Love Story)
First look at C
Introduction to Pseudo Code
Integrating your website with PHP
Recently Rated "Programming" Articles
[C++] Templates
Quick Threading Tutorial - C++
Intorduction to memoization.
N-Queens-Series Part I (Only the fittest survive)
[PHP] Create A Unique Page Hits Counter
Currying in JavaScript: Fun for the Whole Family!
Actionscript Events
First look at C
if/else, switch/case and ?/: Statements In Actionscript 2.0
Actionscript API
source codes Categories articles
Browse All
Business & E-Commerce (1)
Databases (1)
Design & Creativity (1)
Internet & Web Sites (1)
Life In General (2)
Operating Systems (3)
Other (2)
Programming (48)
Security (10)
Software Development (5)
Web Development (15)
search Search Inside
Programming
 
 
Part of the MyPingle Network
Development Blog :: Make A Donation :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents
Version 1.44.00
Copyright © 2007 - 2008, Scott Thompson, All Rights Reserved