|
-
May 16th, 2007, 12:50 PM
#1
Thread Starter
New Member
Error Execute PHP
Hi
I follow this tutorial. http://www.jimmyr.com/blog/PHP_Jukeb...l_195_2006.php I have set up to play song on my pages. But I get erro. The fcodes are below
PHP Code:
<?
while(true){
for ($i=0;$i<20;$i++){
echo "rn";
}
echo "CTRL+C is the dos escape sequencernrn";
sleep(5);
$sheets=Array();
$dir = "C:\php\test";
$dh = opendir($dir) or die ("could not open dir");
while ( !(($file = readdir($dh)) === false) ){
if ($file == "." || $file == "..") continue;
if (eregi(".mp3",$file)){
$sheets[] .= $file;
}
}
/* close the directory */
closedir($dh);
$foo=$sheets[array_rand($sheets)];
echo "Now playing $foo";
for ($i=0;$i<3;$i++){
echo "rn";
}
exec("$_GET[CMD] C:\php\test\WAV.EXE C:\php\test\".$foo." /Q");
for ($i=0;$i<15;$i++){
echo "rn";
}
}
echo
</head><body>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" src="/js/whatis.js"></script><script language="JavaScript" type="text/javascript"></script><script type="text/javascript" src="/dojo/dojo.js"></script><script type="text/javascript">dojo.setModulePrefix("ITtoolbox", "../widgets");dojo.require("ITtoolbox.UserBadge");dojo.require("ITtoolbox.InviteBadge");</script>
Error;pos=vertlarge;tile=2;ord=66150102?"></Script></div>
</td>
<td width="10"><img src="http://images.ittoolbox.com//spacer.gif" width=10 height=1 border=0 alt=""></td>
<td class=KBgroups_contentCell valign=top>
<table width=100% cellpadding=0 cellspacing=0 border=0 ID="Table2" style="margin-top:-5px">
<tr>
<!-- Add your stuff-->
<td nowrap style="padding-top:2px; padding-bottom:2px"><h1 class=KBgroups_h1>informatica-l
<td align=right><nobr><form class=KBgroups_searchBoxDefault method="get" action="http://search.ittoolbox.com/technical-groups"><input type="text" size="20" name="r" class="KBgroups_searchInput" value="Search Groups" onClick="javascript:this.value=''"> <select class="KBgroups_selectbox" name=list><option value="infor=small>Technical & Functional</a> > <a href="/groups/technical-functional/informatica-l" class=small>informatica-l <!--grfGetGroupVitals(strGroupName)-->
?>
?>
Last edited by penagate; May 16th, 2007 at 01:00 PM.
-
May 16th, 2007, 01:01 PM
#2
Re: Error Execute PHP
Please don't make duplicate posts, thanks.
I added the [php] tags for you.
-
May 18th, 2007, 10:57 AM
#3
Re: Error Execute PHP
this piece of code will not run:
PHP Code:
exec("$_GET[CMD] C:\php\test\WAV.EXE C:\php\test\".$foo." /Q");
you have a black slash before a double quote, and PHP interprets a single backslash as being used for escaping a character. you need to escape that back slash, like so:
PHP Code:
exec("$_GET[CMD] C:\php\test\WAV.EXE C:\php\test\\".$foo." /Q");
by the way, all of those "rn" that you have -- they're supposed to be "\r\n", not just "rn". it represents a proper line break.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|