Welcome to Dream.In.Code
Become a PHP Expert!

Join 137,420 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,985 people online right now. Registration is fast and FREE... Join Now!




Script issue

 
Reply to this topicStart new topic

Script issue, After adding a php script my page goes blank

Frode789
11 Jan, 2008 - 12:04 PM
Post #1

New D.I.C Head
*

Joined: 11 Jan, 2008
Posts: 49


My Contributions
Hi!

My site worked at first, but after adding a script the site goes completely blank.
Original script:
CODE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> Rohan Fansite </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<LINK href="k.css" rel=STYLESHEET type=text/css>
<style type="text/css"></style>
</head>
<BODY style="color: #FFFFFF; background-color: #000000">

<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="50%">
      <form name="form1" method="post" action="">
        Chose a Media:<select name="srcfile">
          <option value=''>
          <?
          include("config.php");
    $fp = fopen("medias.txt", 'r');
    while(!feof($fp))
    {
        $linha = fgets($fp);
        list($item, $url) = split('__', $linha, 3);
        print("<option value='$url'>$item");
    }
?>
       </select>
        <input type=submit value="View File" name="submit">
      </form>
      <script language="JavaScript">
<!--
if ( navigator.appName == "Netscape" )
{


navigator.plug-ins.refresh();



document.write("\x3C" + "applet MAYSCRIPT Code=NPDS.npDSEvtObsProxy.class")
document.writeln(" width=5 height=5 name=appObs\x3E \x3C/applet\x3E")
}
//-->
</script>
      
      
      
      
      <object id="MediaPlayer" classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"  width="<?=$width ?>" height="<?=$height ?>">
        <param name="URL" value="<?=$srcfile ?>">
      </object> </td>
    <td width="50%"valign=top>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" valign="top">
        <tr>
          <td height="16">
            <?php print $item;
            print $news; ?>
          </td>
        </tr>
      </table>
  <tr>
  
  </tr>
  <tr>
    
  </tr>
</table>
<a href="http://windowsmedia.com/download"><img src="WMP.gif" width="88" height="31" border="0"></a>
</BODY>
</HTML>


Result (script added to page):

CODE
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>

<META NAME="Generator" CONTENT="EditPlus">
<LINK href="k.css" rel=STYLESHEET type=text/css>
        <title>Rohan Fansite</title>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<meta name="keywords" content="ROHAN Online, R.O.H.A.N Online, ROHAN, R.O.H.A.N, ROHAN item database, ROHAN forums, ROHAN gallery, ROHAN quest database, ROHAN guides, ROHAN information, ROHAN forums, ROHAN fan site" />
        <meta name="keywords" content="Rohan Online fansite, Rohan Online forum, Rohan Online guide, best Rohan Online fansite" />
<META NAME="Rohan Online fansite" CONTENT="The first and best fansite for Rohan Online ROHAN">
<META NAME="keywords" CONTENT="Rohan, Rohan Online, Rohan fansite, Rohan Online fansite, best Rohan fansite, Rohan forum, Rohan quest database, Rohan item database, Rohan Online database, best Rohan Online fansite">
        <META NAME="description" CONTENT="The first and best fansite for the 3D fantasy MMORPG Rohan Online"><TITLE>
        Rohan Online Fansite</TITLE><META HTTP-EQUIV="English" CONTENT="EN"><META NAME="revisit-after" CONTENT="14 days"><META NAME="Generator" CONTENT=""><META NAME="robots" CONTENT="all"><META NAME="Frode" CONTENT="Frode"><META NAME="Copyright" CONTENT="Frode"><!-- The first and best fansite for the 3D fantasy MMORPG Rohan Online -->
        <script type="text/javascript">

        <script type="text/javascript">


        window.onload = function()
        {
            if(navigator.appName == 'Netscape')
            {
                document.getElementById('css').href = './stylesheet/firefox.css';
            }
            else if(navigator.appName != 'Microsoft Internet Explorer')
            {
                document.getElementById('css').href = './stylesheet/opera.css';
            }
            
            else
            {
                var args = navigator.appVersion.split('; ');

                if(args[1] != 'MSIE 7.0')
                {
                    document.getElementById('css').href = './stylesheet/ie6.css';
                }
            }
        }
        


</script>

        <link rel="stylesheet" href="./stylesheet/style.css" type="text/css" media="all" />

        <link rel="stylesheet" href="" type="text/css" media="all" id="css" />
        
        
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css">
<!--
a:link {
    color: #FFFFFF;
    text-decoration: none;
}
a:visited {
    color: #FFFFFF;
    text-decoration: none;
}
a:hover {
    color: #FFFFFF;
    text-decoration: underline;
}
a:active {
    color: #FFFFFF;
    text-decoration: none;
}
.style2 {
    border-width: 0px;
}
-->
</style></head>
    <body>
    <div id="wrapper">
            <div id="menu">
                <ul>
                    <li>
                        <a href="index.html">HOME</a></li>
                    <li>
                        <a href="/forum">FORUM</a></li>
                    <li>
                        <a href="download.html">DOWNLOAD</a></li>
                    <li>
                        <a href="quests.html">QUESTS</a></li>
                    <li>
                        <a href="items.html">ITEMS</a></li>
                </ul>
            </div>
            <div id="banner"></div>
            <div id="panel">
                <div class="top">
                    Menu</div>
                <ul>
                    <li>
                        <a href="index.html">Home</a></li>
                    <li>
                        <a href="/forum">Forum</a></li>
                    <li>
                        <a href="news.html">News</a></li>
                    <li>
                        <a href="features.html">Guide and Features</a></li>
                    <li>
                        <a href="quests.html">Quests</a></li>
                    <li>
                        <a href="items.html">Items</a></li>
                    <li>
                        <a href="download.html">Download</a></li>
                    <li>
                        <a href="media.html">Media</a></li>
                    <li>
                        <a href="contact.html">Contact </a></li>
                </ul>
                <div class="top">
                    Important Game Dates</div>
                <br />
                Closed Beta date: TBA<br />
                <br />
                Open Beta date: TBA<br />
                <br />
                Game release date: TBA<br />
                <br />
                <a id="ctlogo" href="#1"></a>
            </div>
            <div id="content">
                <div class="top" style="font-size: medium">
                    Media</div>
                <div class="box">
                    <div class="boxbanner">
                        </div>
                    <div class="boxmain">
                        <div class="boxtitle">
                            <div class="left" style="font-size: small">
                                Wallpapers</div>
                            <div class="right">
                            </div>
                        </div>
                        <div class="boxcontent" style="font-size: small">
                            Click on the image for full size<br />
                            <br />
                            <a href="wallpaper/rohan1.jpg">
                            <img alt="" src="images/rohan1.jpg" width="200" height="150" class="style2" /></a>
                            <a href="wallpaper/rohan2.jpg">
                            <img alt="" src="images/rohan2.jpg" width="200" height="150" class="style2" /></a>
                            <a href="wallpaper/rohan3.jpg">
                            <img alt="" src="images/rohan3.jpg" width="200" height="150" class="style2" /></a>
                            <a href="wallpaper/rohan4.jpg">
                            <img alt="" src="images/rohan4.jpg" width="200" height="150" class="style2" /></a>
                            <a href="wallpaper/rohan5.jpg">
                            <img alt="" src="images/rohan5.jpg" width="200" height="150" class="style2" /></a>
                            <a href="wallpaper/rohan6.jpg">
                            <img alt="" src="images/rohan6.jpg" width="200" height="150" class="style2" /></a>
                            <a href="wallpaper/rohan7.jpg">
                            <img alt="" src="images/rohan7.jpg" width="200" height="150" class="style2" /></a>
                            <a href="wallpaper/rohan8.jpg">
                            <img alt="" src="images/rohan8.jpg" width="200" height="150" class="style2" /></a><br />
                        </div>
                    </div>
                </div>
                <div class="box">
                    <div class="boxbanner">
                        </div>
                    <div class="boxmain">
                        <div class="boxtitle">
                            <div class="left" style="font-size: small">
                                 Videos</div>
                            <div class="right">
                            </div>
                            <br />
                            <br />
                            <br />
                            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="50%">
      <form name="form1" method="post" action="">
        Chose a Media:<select name="srcfile">
          <option value=''>
          <?
          include("config.php");
    $fp = fopen("medias.txt", 'r');
    while(!feof($fp))
    {
        $linha = fgets($fp);
        list($item, $url) = split('__', $linha, 3);
        print("<option value='$url'>$item");
    }
?>
       </select>
        <input type=submit value="View File" name="submit">
      </form>
      <script language="JavaScript">
<!--
if ( navigator.appName == "Netscape" )
{


navigator.plug-ins.refresh();



document.write("\x3C" + "applet MAYSCRIPT Code=NPDS.npDSEvtObsProxy.class")
document.writeln(" width=5 height=5 name=appObs\x3E \x3C/applet\x3E")
}
//-->
</script>
      
      
      
      
      <object id="MediaPlayer" classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"  width="<?=$width ?>" height="<?=$height ?>">
        <param name="URL" value="<?=$srcfile ?>">
      </object> </td>
    <td width="50%"valign=top>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" valign="top">
        <tr>
          <td height="16">
            <?php print $item;
            print $news; ?>
          </td>
        </tr>
      </table>
  <tr>
  
  </tr>
  <tr>
    
  </tr>
  </td>
</table>
<a href="http://windowsmedia.com/download"><img src="WMP.gif" width="88" height="31" border="0"></a>
<br />
                            <br />
                        </div>
                    </div>
                </div>
            </div>
            <div id="footer">
                Designed by <a href="http://www.desired-media.com/">Subeleme</a>,
                Coded by <a href="http://www.codename-tgrklanen.net/">
                TerrorKalle</a> � <a href="http://www.clantemplates.com/">
                rohanfansite</a></div>
    </div>
</body>
</html>

Also, if I make a page with only the script on, then it works... So the problem is I cant get it implentet in my page.
What is wrong?

User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Script Issue
11 Jan, 2008 - 12:07 PM
Post #2

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,550



Thanked: 67 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
1.) is the added page called .php?
2.) what happens when you change <? to <?php?
User is offlineProfile CardPM
+Quote Post

Frode789
RE: Script Issue
11 Jan, 2008 - 12:37 PM
Post #3

New D.I.C Head
*

Joined: 11 Jan, 2008
Posts: 49


My Contributions
QUOTE(no2pencil @ 11 Jan, 2008 - 01:07 PM) *

1.) is the added page called .php?
2.) what happens when you change <? to <?php?


1.) Yes the ext. is .php
2.)
CODE
      <?
          include("config.php");
    $fp = fopen("medias.txt", 'r');
    while(!feof($fp))
    {
        $linha = fgets($fp);
        list($item, $url) = split('__', $linha, 3);
        print("<option value='$url'>$item");
    }
?>
Here? If you mean that first "?" mark, then no. <?php in that place did not change anything. The script works (the top one) if its on a page alone. So the script is ok, but when I try to add it to my layout.. well. blank page...

This post has been edited by Frode789: 11 Jan, 2008 - 12:42 PM
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Script Issue
11 Jan, 2008 - 12:41 PM
Post #4

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,260



Thanked: 227 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
Your first line <?xml version="1.0" encoding="utf-8" ?> is being seen as PHP because you are using <? at the start. It then sees "xml" and says in correct string. The reason you are not seeing the error because you probably have error reporting turned off or changed to not show on page.

Try printing out the XML tag at the first line there instead of just putting it in.

CODE

<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"; ?>


That will probably get you up and running assuming everything else is correct. smile.gif
User is offlineProfile CardPM
+Quote Post

Frode789
RE: Script Issue
11 Jan, 2008 - 12:54 PM
Post #5

New D.I.C Head
*

Joined: 11 Jan, 2008
Posts: 49


My Contributions
QUOTE(Martyr2 @ 11 Jan, 2008 - 01:41 PM) *

Your first line <?xml version="1.0" encoding="utf-8" ?> is being seen as PHP because you are using <? at the start. It then sees "xml" and says in correct string. The reason you are not seeing the error because you probably have error reporting turned off or changed to not show on page.

Try printing out the XML tag at the first line there instead of just putting it in.

CODE

<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"; ?>


That will probably get you up and running assuming everything else is correct. smile.gif


Your the man of the day! It worked! =) Thank you.
User is offlineProfile CardPM
+Quote Post

skyhawk133
RE: Script Issue
11 Jan, 2008 - 12:58 PM
Post #6

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 14,974



Thanked: 48 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
Frode789, I'm glad Martyr2's solution fixed your problem!

Welcome to dream.in.code, and remember us in the future if you ever need help or just want a place to hang out!


User is offlineProfile CardPM
+Quote Post

Frode789
RE: Script Issue
11 Jan, 2008 - 01:01 PM
Post #7

New D.I.C Head
*

Joined: 11 Jan, 2008
Posts: 49


My Contributions
QUOTE(skyhawk133 @ 11 Jan, 2008 - 01:58 PM) *

Frode789, I'm glad Martyr2's solution fixed your problem!

Welcome to dream.in.code, and remember us in the future if you ever need help or just want a place to hang out!


I sure will smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/5/08 04:26AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month