42 users online (0 members and 42 guests)  


  Results 1 to 4 of 4

Related

  1. Replies: 0
  2. How to check File is Valid or Not in PERL?    Forum: CGI Perl Forum
    Replies: 2
  3. td background not valid?    Forum: HTML Forum
    Replies: 2
  4. valid referrer for image directories?    Forum: Website Scripts Forum
    Replies: 3
  1. #1
    Ywun's Avatar
    RAPTOR

    Status
    Offline
    Join Date
    May 2003
    Location
    New Jersey
    Posts
    86

    Is this a valid Php script?

    I downloaded an Html to Anything Converter

    I converted my site script into Php here is how it turned out:

    Code:
    <?php
    echo "<html>\n";
    echo "<head>\n";
    echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=encoding\" />\n";
    echo "<TITLE>Raptor</TITLE>\n";
    echo "<META content=\"Raptor\" name=classification>\n";
    echo "<META content=\"RARTOR13\" name=Author>\n";
    echo "<META content=\"copyright 2003 RAPTOR13\" name=copyright>\n";
    echo "<META content=\"Fifth, Element, Ywun, RAPTOR13, raptor\" name=keywords>\n";
    echo "<META content=\"RAPTOR13's homepage.  Find out about RAPTOR13 a member for the Xbox Live clan [the Fifth Element]  You can find Ghost Recon and other cool games!!\" name=description>\n";
    echo "\n";
    echo "<style type=\"text/css\">\n";
    echo "body {color: white;\n";
    echo "font: 12pt verdana;\n";
    echo "font-weight: normal;\n";
    echo "background-color: black;\n";
    echo "}\n";
    echo "a:link{color: green; text-decoration: none;\n";
    echo "}\n";
    echo "a:visited{color: green; text-decoration: none;\n";
    echo "}\n";
    echo "a:focus{color: green; text-decoration: none;\n";
    echo "}\n";
    echo "a:hover{color: green; text-decoration: underline;\n";
    echo "}\n";
    echo "\n";
    echo "h1 {font: 12pt verdana;\n";
    echo "color: green;\n";
    echo "font-weight: normal;\n";
    echo "}\n";
    echo "\n";
    echo ".left {width: 150px;\n";
    echo "height: 300px;\n";
    echo "overflow: scroll;\n";
    echo "clear: left;\n";
    echo "float: left;\n";
    echo "}\n";
    echo ".left2 {width: 150px;\n";
    echo "border-right: 1px solid gray;\n";
    echo "clear: left;\n";
    echo "float: left;\n";
    echo "}\n";
    echo ".center {border-left: 1px solid gray;\n";
    echo "}\n";
    echo "</style>\n";
    echo "</head>\n";
    echo "<body>\n";
    echo "<img src=\"pics\\ravenshield.gif\" aling=\"left\"><img src=\"pics\\mc_rl.gif\" height=\"120\">\n";
    echo "<table>\n";
    echo "<tr>\n";
    echo "<td valign=\"top\">\n";
    echo "<div class=\"left\">\n";
    echo "<h1>Updates:</h1>\n";
    echo "9/24/03:<br />\n";
    echo "I added the new Halo section!  But like all the other section of this site it is under construction!  Well theres probably going to be a lot more pics!  Of Halo!<br />\n";
    echo "Updates:<br />\n";
    echo "9/20/03<br />\n";
    echo "My new homepage is up!<br />\n";
    echo "I didn't say that it was complete just that it was up!  So this means this site is under heavy construction!<br />\n";
    echo "<br />\n";
    echo "So in the mean time check out these sites:<br />\n";
    echo "<a href=\"http://www.thefifthelement.cjb.net\">My Ghost Recon site</a><br />\n";
    echo "<a href=\"http://www.geocities.com/elite343/index.htm\">Halo 343</a><br />\n";
    echo "<a href=\"http://www.ahfb2000.com\">Ahfb2000.com</a><br />\n";
    echo "</p>\n";
    echo "</div>\n";
    echo "<div class=\"left2\">\n";
    echo "<h1>Navigation</h1>\n";
    echo "<p>\n";
    echo "<a href=\"index.asp\">Home</a><br />\n";
    echo "<a href=\"media.asp\">Media</a><br />\n";
    echo "<a href=\"covert_warfare_pics.asp\">Covert Warfare Pics</a><br />\n";
    echo "<a href=\"links.asp\">Links</a><br />\n";
    echo "<a href=\"partners.asp\">Partners</a><br />\n";
    echo "<a href=\"http://www.geocities.com/covert_warfare/fifthelement.html\">Clan Fifth Element</a><br />\n";
    echo "</p>\n";
    echo "</div>\n";
    echo "<!-- Gostats.com web hit code. Please do not change this-->\n";
    echo "<img src=\"http://c2.gostats.com/gogi/count.pl?mn=Raptor13\">\n";
    echo "<!-- End of Gostats.com web hit code -->\n";
    echo "</td>\n";
    echo "<td valign=\"top\">\n";
    echo "<div class=\"center\">\n";
    echo "<h1>Welcome to covertwarfare.tk!</h1>\n";
    echo "<p>\n";
    echo "Welcome to my Covert Warfare site for Rainbow Six 3: Raven Shield-Xbox, Halo: Combat Evolved, and Halo2!<br />\n";
    echo "<br />\n";
    echo "If you like Ghost Recon and Ghost Recon: Island Thunder, then visit my <a href=\"http://www.geocities.com/covert_warfare/index.html\">Ghost Recon</a> site!<br />\n";
    echo "My site though is under construction, but keep visiting and checking for updates!\n";
    echo "<br />\n";
    echo "<br />\n";
    echo "The current release date for Rainbow Six 3: Raven Shield is November 4, 2003.<br />\n";
    echo "The current release date for Grand Theft Auto lll and Grand Theft Auto: Vice City double pack for Xbox  is November 4, 2003!  Cool two great games same day!\n";
    echo "</p>\n";
    echo "</div>\n";
    echo "</td>\n";
    echo "<td valign=\"top\">\n";
    echo "<div id=\"six\">\n";
    echo "<table width=\"146\" border=\"1\" bordercolor=\"#808080\" \"cellspacing=\"0\" cellpadding=\"0\" valign=\"top\">\n";
    echo "<tr>\n";
    echo "<td height=\"20\" bgcolor=\"#2D4B08\">\n";
    echo "Raven Shield</td>\n";
    echo "</tr>\n";
    echo "<tr>\n";
    echo "<td>\n";
    echo "<a href=\"raven_shield.asp\">Rainbow Six</a><br />\n";
    echo "<a href=\"raven_shield.asp\">Raven Shield</a><br />\n";
    echo "<a href=\"tips_raven_shield.asp\">Tips</a><br />\n";
    echo "<a href=\"choosing_the_right_team\".asp\">Choosing the Right Team</a><br />\n";
    echo "<a href=\"suggested_weapons.asp\">Suggested Weapons</a><br />\n";
    echo "<a href=\"raven_shield_links.asp\">Raven Shield Links</a><br />\n";
    echo "</td>\n";
    echo "</tr>\n";
    echo "</table>\n";
    echo "</div>\n";
    echo "<div id=\"halo\">\n";
    echo "<table width=\"146\" border=\"1\" bordercolor=\"#808080\" \"cellspacing=\"0\" cellpadding=\"0\" valign=\"top\">\n";
    echo "<tr>\n";
    echo "<td height=\"20\" bgcolor=\"#2D4B08\">\n";
    echo "Halo</td>\n";
    echo "</tr>\n";
    echo "<tr>\n";
    echo "<td>\n";
    echo "<a href=\"halo.asp\">Halo</a><br />\n";
    echo "<a href=\"weapons.asp\">Weapons</a><br />\n";
    echo "<a href=\"vehicles.asp\">Vehicles</a><br />\n";
    echo "<a href=\"pics.asp\">Pics</a><br />\n";
    echo "<a href=\"halo_links.asp\">Halo Links</a><br />\n";
    echo "</td>\n";
    echo "</tr>\n";
    echo "</table>\n";
    echo "<table width=\"146\" border=\"1\" bordercolor=\"#808080\" \"cellspacing=\"0\" cellpadding=\"0\" valign=\"top\">\n";
    echo "<tr>\n";
    echo "<td height=\"20\" bgcolor=\"#2D4B08\">\n";
    echo "Halo 2</td>\n";
    echo "</tr>\n";
    echo "<tr>\n";
    echo "<td>\n";
    echo "<a href=\"halo2.asp\">Halo 2</a><br />\n";
    echo "<a href=\"release.asp\">Release date News</a><br />\n";
    echo "<a href=\"weapons.asp\">Weapons</a><br />\n";
    echo "<a href=\"vehicles.asp\">Vehicles</a><br />\n";
    echo "<a href=\"halo2_pics.asp\">Pics</a><br />\n";
    echo "<a href=\"halo2_links.asp\">Halo2 Links</a><br />\n";
    echo "</td>\n";
    echo "</tr>\n";
    echo "</table>\n";
    echo "</div>\n";
    echo "</tr>\n";
    echo "</table>\n";
    echo "</body>\n";
    echo "</html>";
    ?>
    If thats not valid I see no point in using it. If it does then I will use it for ASP.

    Thanks!

    Ywun

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    I cannot see the point of that, to be honest.

    Instead of your page having HTML output, instead, PHP is outputting it. Your making your page slower for no reason at all.

    HTML is HTML. PHP is PHP. this script has not 'converted' anything, its just outputting html.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    Ywun's Avatar
    RAPTOR

    Status
    Offline
    Join Date
    May 2003
    Location
    New Jersey
    Posts
    86
    Thats stupid! I'm definitly deleting it!

    Thanks!
    Ywun

  4. #4
    christodd's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2003
    Location
    Tacoma, Washington
    Posts
    20

    Naw, don't delete it

    Quote Originally Posted by Ywun
    Thats stupid! I'm definitly deleting it!

    Thanks!
    Ywun
    You've got the right idea - it's just simpler that that. You can use PHP like Server Side Scripting to include a standard file. I like to put my navigation in a seperate file, so that all the file can include it. Take your existing page in HTML, rename it to index.php, and make some navigation file called nav.php. Then stick this in your page

    PHP Code:
    <?include("nav.php");?>
    The <? ?> tag mean "this is a PHP command". Stick it anywhere you need dynamic content. I have standard header and footer files in my site. Want todays date on your page ?
    PHP Code:
    <?  echo "Today is : " date"F d, Y."time() );?>
    Also, variables are great.

    Here's the code for my Joke of the Day box. Just make a folder called content/jokes and stick a bunch of text files in there. It will display a new one each day.
    PHP Code:
    <h3>Joke of the Day</h3>
    <hr>
    <p>
    <?
     $i
    =0;
     if (
    $handle opendir('content/jokes')) {
        while (
    false !== ($file readdir($handle))) { 
        if (
    substr($file,strlen($file)-3,3)=="txt")
    {        
    $jokes[$i++]=$file;
    }
        }
       
    closedir($handle); 
      
    $today=getdate();
      
       
    srand($today['mday']+$today['month']+$today['year']);
       
    $r=rand(0,$i-1);
       include(
    "content/jokes/".$jokes[$r]);

     }

    ?>
    Learn PHP, it will make your life easier.
    Last edited by HTML; 10-31-2003 at 05:13 PM.



Tags for this Thread