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: Copy / Restore  ::  Remove Scroll Bars
  1. <a href=".">Home</a>
  2. <a href='?act=1'>First</a>
Beginning of PHP:
CODE: Copy / Restore  ::  Remove Scroll Bars
  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: Copy / Restore  ::  Remove Scroll Bars
  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: Copy / Restore  ::  Remove Scroll Bars
  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: Copy / Restore  ::  Remove Scroll Bars
  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: Copy / Restore  ::  Remove Scroll Bars
  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 4.25 Years Ago
 
 
Oh, also, TAB! Tabbing looks better and again, is back to using standards.
 
Izzmo     Posted 4.25 Years 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
thetrojan01's brainfuck tutorial - from the beginning to the interpreter.
My Experiences So Far with Languages
Selecting Your First Programming Language
[PHP] - Lets kill the complex IF
Basic PortScanner in VB6.0
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
Recently Rated "Programming" Articles
Selecting Your First Programming Language
thetrojan01's brainfuck tutorial - from the beginning to the interpreter.
[PHP] - Lets kill the complex IF
Actionscript API
Actionscript Events
My Experiences So Far with Languages
Vectors in C++
[C++] Templates
Quick Threading Tutorial - C++
Intorduction to memoization.
source codes Categories articles
Browse All
Business & E-Commerce (2)
Databases (1)
Design & Creativity (1)
Hardware (1)
Internet & Web Sites (3)
Life In General (2)
Networking (1)
Operating Systems (4)
Other (2)
Programming (46)
Security (8)
Software Development (5)
Web Development (14)
search Search Inside
Programming
 
 
Latest News About Coder Profile
Coder Profile Poll
Why do you get bored with programming?

Not enough time to do something productive
I run out of ideas
Too hard to show people my creations
Everything i do has too many errors, and it's too hard
I don't get bored!!!


please login to cast your vote
and see the results of this poll
Latest Coder Profile Changes
Coder Profile was last updated
3.48 Years Ago
Official Blog :: Make A Donation :: Credits :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents :: Wallpapers
Version 1.46.00
Copyright © 2007 - 2012, Scott Thompson, All Rights Reserved