Jump to content

Twango

Members
  • Posts

    174
  • Joined

  • Last visited

Posts posted by Twango

  1. Ok, so I REALLY want to make an internet radio thing. I want there to be like a MySQL table with the file names for each audio file, and PHP echos the SRC of an HTML5 Audio Tag to that file. I have NO idea how to do that.The only thing I could think, would be like a table like follows:id: SRC: length:1 audio.mp3 30 And then another table that has the current song, like follows: currentsong: SRC: timestart: length:1 audio.mp3 14:25:20 30 And then a Cron Job that runs a file like CheckUpdate.php, that basically checks to see if the time is equal to the length + timestart, and if it is, set the currentsong to the next?For the Cycling on the webpage, I know I could use Dynamic Ajax, but would this work for the cycling? Thanks.If you have any other ideas, please tell me!

  2. Hey, I need this program in the Ubuntu terminal to connect to MySQL.When I use $this->writeOutput("Connecting too MySQL database...", "INFO"); $this->mysql->connect("-----", "-----", "----"); $this->writeOutput("PAUSE"); $this->writeOutput("PAUSE"); $this->writeOutput("PAUSE"); It doesn't work, it echos "Connecting too MySQL database..." and then nothing else, it just goes back to wanting me to enter a command.Any ideas?Using XAMPP (LAMPP)

  3. This keeps generating a 504 error. while ($row = mysql_fetch_array(mysql_query("SELECT * FROM classes WHERE toclassid = '$classid'"))){echo "Yes";}The table "classes" has 8 columns, toclassid postbyuser postdate numstars reviewstructure unid isan teacherid It always gives the error: Gateway Time-outThe gateway did not receive a timely response from the upstream server or application.Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. With that code, but when I remove it, it works fine. I can't figure out for the life of me why this isn't working. Thanks a bunch

  4. And the parent thing didn't work, when I'm using it asdocument.getElementById('parent.document.bindex').rows="*,%20";I tried changing it to CSS3... with 2 second transition on rows, still not working.It says that document.getElementById('parent.document.bindex') is null.

  5. So far I have the following, as well as a button.<script type="text/javascript" src="jquery.js"></script><script type="text/javascript">$(document).ready(function(){$(".flip").click(function(){ $("parent.document.body.rows").slideToggle("slow"); });});</script>Still not working...

  6. I have a page with a frameset, let's say its frameholder.php, It has a frameset with Row1 at %100 and Row2 at %0.I want the frame at Row1 to have a button on it, that when you click it, in the parent, it slides frame 2 up to %50.I can't get this to work for the life of me. Please help!

  7. I want to have 2 buttons (One would be better, truthfully)One that turns on song 1, the other song 2. The code I have now:

    <embed id="musics" src="music.swf?auid=2" width="0px" height="0px"/><script type="text/javascript">function chagemusic(){document.getElementById('musics').src="music.swf?auid=2";}function chagemusic2(){document.getElementById('musics').src="music.swf?auid=3";}</script> <input type="button" value="Song 1" onclick="changemusic()"/><input type="button" value="Song 2" onclick="changemusic2()"/>

    It's not the swf, that's working fine.

  8. this is typically done using the modulos operater (%)
    $nums = array("0","1","2","3","4","5","6","7","8","9");$table = '';$breakPoint = 5; $table .= '<table><tr>';for($i = 0, $l = count($nums); $i < $l; $i++){  $table .= '<td>' . $nums[$i] . '</td>';  if($i % $breakPoint === 0){	$table .= '</tr><tr>';  };};$table .= '</tr></table>';

    I have absoloutely no Idea what you mean. can't get it to work. please help. :3
  9. Hi, I want to make a script that has raining "Leaves" (Or any image...), but randomly it's a Special leave.When you click on that leaf it takes you to a URL. I want it to be like 1 in 100 leaves or so.I can't figure this out;Here's the script I have; I want to modify it to work.

    <h1>How to play?  Look for a special Green leave, then click on it!</h1><!--Copy and Paste into <BODY>  	 Just above the </BODY> tag. --><script type="text/javascript" language="JavaScript1.2"> //Pre-loads your images below//Configure below - change URL path to your imagesgrphcs=new Array(8)Image0=new Image();Image0.src=grphcs[0]="alv.gif";Image1=new Image();Image1.src=grphcs[1]="clv.gif"Image2=new Image();Image2.src=grphcs[2]="dlv.gif"Image3=new Image();Image3.src=grphcs[3]="elv.gif"Image4=new Image();Image4.src=grphcs[4]="oak1.gif"Image5=new Image();Image5.src=grphcs[5]="oak2.gif"Image6=new Image();Image6.src=grphcs[6]="oak4.gif"Image7=new Image();Image7.src=grphcs[7]="oak6.gif"Spec= new Image();Spec.src="specleave.gif"//Smoothness depends on image file size,//the smaller the size the more you can use!// Configure below - change number of images to renderAmount=15;Ypos=new Array();Xpos=new Array();Speed=new Array();Step=new Array();Cstep=new Array();ns=(document.layers)?1:0;ns6=(document.getElementById&&!document.all)?1:0;var Stop = false;if (ns){for (i = 0; i < Amount; i++){var sbsu=Math.floor(Math.random()*2);var P=Math.floor(Math.random()*grphcs.length);rndPic=grphcs[P];document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0><img src="+rndPic+"></LAYER>");}}else{document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');for (i = 0; i < Amount; i++){var P=Math.floor(Math.random()*grphcs.length);rndPic=grphcs[P];document.write('<img id="si'+i+'" src="'+rndPic+'" style="position:absolute;top:0px;left:0px">');}document.write('</div></div>');}WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;for (i=0; i < Amount; i++){Ypos[i] = Math.round(Math.random()*WinHeight);Xpos[i] = Math.round(Math.random()*WinWidth);Speed[i]= Math.random()*5+3;Cstep[i]=0;Step[i]=Math.random()*0.1+0.05;}function fall(){if (Stop) { clearLeaves(); return; }var WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop;var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft;for (i=0; i < Amount; i++){sy = Speed[i]*Math.sin(90*Math.PI/180);sx = Speed[i]*Math.cos(Cstep[i]);Ypos[i]+=sy;Xpos[i]+=sx;if (Ypos[i] > WinHeight){Ypos[i]=-60;Xpos[i]=Math.round(Math.random()*WinWidth);Speed[i]=Math.random()*5+3;}if (ns){document.layers['sn'+i].left=Xpos[i];document.layers['sn'+i].top=Ypos[i]+hscrll;}else if (ns6){document.getElementById("si"+i).style.left=Math.min(WinWidth,Xpos[i]);document.getElementById("si"+i).style.top=Ypos[i]+hscrll;}else{eval("document.all.si"+i).style.left=Xpos[i];eval("document.all.si"+i).style.top=Ypos[i]+hscrll;}Cstep[i]+=Step[i];}setTimeout('fall()',120);}window.onload=fall;//  *****  Delay FUNCTION HERE  *****setTimeout("Stop=false", 20000);  //  *****  Delay 1000 = 1 second  *****function clearLeaves(){for (i=0; i < Amount; i++){if (ns){document.layers['sn'+i].display='none';}else if (ns6){document.getElementById("si"+i).style.display='none';}else{eval("document.all.si"+i).style.display='none';}}}//--></SCRIPT>

    • Like 1
  10. Hi, I want to have something that basically generates 5 items in a table, then closes the TR and re-opens.Here's what I have:

    $cxnms = 1;function addtd($inc){if ($cxnms == 1){echo "<tr>";$cxnms++;}if ($cxnms > 1 && $cxnms < 5){$cxnms++;}echo "<td><b class='lt'>" . $inc['name'] . "</b><br/><div class='bgi'><img src=" . $inc['tnloc'] . " width='90px' height='90px'/></div><br/><p><a href=game.php?gid=" . $inc['gid'] . ">" . $inc['sdesc'] . "</a></p></td>";if ($cxnms == 5){echo "</tr>";$cxnms = 1;}

    It just puts it all on one line.Help?

  11. Ok, I've been working on this for ever, I can't get it to work.I've successfully created an IPN, that once it gets the payment, it does a MySQL query. My problem is, I need to store the username.So the way I did this, is on the page button.html, I have a small Ajax script that submits to addSession.php,addSession.php's source:

     <?phpsession_start();$_SESSION['valus'] = $_REQUEST['uid'];echo "Username currently set to <b>" . $_SESSION['valus'] . "</b>.<br/><br/>";?>

    AJAX Code:

    <script type="text/javascript">function showHint(){var xmlhttp;var str = document.getElementById('txt1').value;if (str.length==0)  {   }if (window.XMLHttpRequest)  {// code for IE7+, Firefox, Chrome, Opera, Safari  xmlhttp=new XMLHttpRequest();  }else  {// code for IE6, IE5  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");  }xmlhttp.onreadystatechange=function()  {  if (xmlhttp.readyState==4 && xmlhttp.status==200)    {    document.getElementById('txtHint').innerHTML=xmlhttp.responseText;    }  }xmlhttp.open("GET","addSession.php?uid="+str,true);xmlhttp.send();}</script>

    and finally, a simple code I used to test to see if the value is set:

    <?phpsession_start();$bmx = $_SESSION['valus'];echo $bmx;?>

    It returns the session data just fine, but when I submit it to MySQL thru the IPN Auto-Script:

    session_start();$bmx = $_SESSION['valus'];mysql_query("INSERT INTO members (descr, usr) VALUES ('Good MTX','$bmx')");

    It simply shows up in the database as Good MTX and then blank for usr.Help!

    • Like 1
  12. function hasP($idx, $u){$dhas = mysql_query("SELECT * FROM hpowerups WHERE id = '$idx'");$dhas = mysql_fetch_array($dhas);$dhas = $dhas['has'];if ($dhas == "yes"){return $dhas;}else{return "no";}} Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/appattac/public_html/aadimensions/homepage.php on line 21

  13. the code require("attacklib.php?uta=" . $uta . "&lvl=" . $myudat['level'] . "&hgl=" . $myudat['gold']);is returning Warning: require(attacklib.php?uta=King Shadower&lvl=100&hgl=250) [function.require]: failed to open stream: No such file or directory in /home/appattac/public_html/aadimensions/attackmenu.php on line 19Fatal error: require() [function.require]: Failed opening required 'attacklib.php?uta=King Shadower&lvl=100&hgl=250' (include_path='.:/usr/lib/php:/usr/local/lib/php') in/home/appattac/public_html/aadimensions/attackmenu.php on line 19 help!

  14. Hi, the code$result = mysql_query("SELECT usr, xp, hp, level, faction FROM aad WHERE usr LIKE %$rcu%");$row = mysql_fetch_array($result);returnsWarning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/appattac/public_html/aadimensions/rsq.php on line 15Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/appattac/public_html/aadimensions/rsq.php on line 27Help!

  15. I want a Simple user search for my game.So far I have:$result = mysql_query("SELECT usr, hp, xp FROM aad WHERE usr LIKE '%$rcu%'");then I use W3school's echo to table.So I have two users, both starting with "King"but it only returns one.And when i search the full user, neither do.Help!

×
×
  • Create New...