Jump to content

ILYAS415

Members
  • Posts

    292
  • Joined

  • Last visited

Everything posted by ILYAS415

  1. I think javascript is absolutely great. You can hide website elements with single clicks (user interface). Use ajax for fast applications. Move widgets and other stuff around (example i saw was a php messenger where they used js to move the window conversations around, "minimize" them and even close them). Where would we be without javascript?
  2. Well I use coding style 2 since i find it takes up less space and makes the code seem less confusing. if((hours < 24) && (minutes < 60) && (seconds < 60)){ return true; }else{ return false; } Oh yes and also I only indent when im using dreamweaver (thats about 95% of the time). Before i started using actionscript i wouldn't indent my php at all!
  3. Answer is very simple... Instead of using a hidden form why don't you just create a variable in flash like.... var receiver:String = "example@example.com"; //then use it when emailing ur form?
  4. instead of doing smoething like... gotoAndPlay('variablehere'); try using.... gotoAndPlay(variablehere); Notice i got rid of the semi quotations.
  5. What you could do is change your text file by making it something like... | Line 1 Test | Line 2 Test | Line 3 Test | Line 4 Test | Line 5 Test basically each line is seperated by '|'. Okay then in php you can do this... <?php $file= file_get_contents("file.txt"); //puts all the text/code from file.txt into one string; $string= explode("|", $file); //seperates the line by looking for the | seperator. for($i=0; $i < sizeof($string); $i++){ echo "• $string[$i] <br />"; //your string structure. } ?>
  6. umm user unset($sessionvar); or something like taht?
  7. instead of $update = mysql_query("UPDATE `pages` SET `hits` = '" . $hits . "' WHERE `id` = '$home[id]'"); try using... $update = mysql_query("UPDATE `pages` SET `hits`='$hits' WHERE `id` = '$home[id]'");
  8. Have you got a demo of the script available?
  9. wat do u mean it takes away the php's function?
  10. You can only kill sessions on your server/site.
  11. after you require your script do this instead of header... echo "<meta http-equiv='refresh' content='2; url=http://www.google.com'>";
  12. try changing... function incomplete_field() to incomplete_field() your trying to create a function in the above one. wat u relally want to do is run an existing function it seems.
  13. There is no best way... well you cant actually create a countdown timer with php i think. You can use cron jobs. Or you can use javascript. I would actually recommend javascript... something like... setInterval("func()", 10000); //run javascript func() function every 10 seconds
  14. try htmlentities($string) or mysql_real_escape_string($string);
  15. It does work all it does it when you put your mouse over the arrow images it scrolls up or down.
  16. Dnt want u to leave the game nah jus kiddin Logout works for me both on ie and firefox. Should work for you.
  17. known errors When registering as something like... Jon' Jacob. Heres how it displays at the top of the page... Hey Jon\' Jacob! Also i tried logging in as //jon' and i got a message saying username didnt exist. i went back a page and hers wat error i got... Warning: file_get_contents(http://www.frozenoven.com/accounts///jon\'clss) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/blufish/public_html/index.php on line 15 Hey //jon\'! Inbox - Home Anyway enuff of the errors... suggested improvements[/]b Definately the layout. I would say include more of a variety of colours, not jus the shades of a specific colour. Also make it seem more techno or frozen like by adding in pics/layout components associated with ice. Also add games and hurry. you dont wanna lose visitors too quickly. I didnt even bother lookin at the jokes section for too long. i think you should put the jokes on sepearte pages. eg. on page 1 theres 10 jokes. on page 2 theres another 10 jokes etc... at the moment you got too many jokes on one page. Average rating: Content: Not very good so 4/10 Design: Same... 4/10 Functionality: Better than previous two... 7/10 Need for improvement: Definately space for improvement... 9/10 Overall i would say i wouldnt stay on your website too long at the moment. maximum five minutes no offense Hopefully you'll improve it and it'll become better.
  18. PHP will do the opposite of the first statement on the else... so php would do... if (30 >= $sent_mail && $time_diff < 1) { // go to this page } elseif (30 < $sent_mail && $time_diff >= 1) { // page the code is held on }
  19. I cant find any vunerabilities (but i also can say that im not an experrt) however i found a mistake towards the end... if(pm_count == '50') according to your comments it shud be... if(pm_count >= '50')
  20. Sorry above one doesnt seem to work... <script language='javascript'> function ilyas(value, valuee){ if (value == "" || valuee == ""){ alert("No values found"); }else{ document.form1.submit(); } } </script> <form name='form1'> <input type='text' name='FirstName' /> <input type='text' name='LastName' /> <a onclick='ilyas(document.form1.FirstName.value, document.form1.LastName.value);'>Submit</a> </form> I made the above one using text inputs. Seems to work fine. Change as appropriate.
  21. Okay didnt manage to make the laert work in the below script but it does submit the form IF there are values in the form. The code may actually need some editing. Dont worry js is really easy. Its just like php. <script language='javascript'> function ilyas(value, valuee){ if (empty(value) || empty(valuee)){ alert("No values found"); }else{ document.form1.submit(); } } </script> <form name='form1'> <input type='hidden' name='FirstName' value='<?php echo $fname ?>'/> <input type='hidden' name='LastName' value='<?php echo $lname ?>'/> <a onclick='ilyas(document.form1.FirstName.value, document.form1.LastName.value);'>Submit</a> </form>
  22. 1 second im gunna experiment with my js to see if i can figure out a way...
  23. Okay thanks i think its fixed. I change the do loop to a while loop and theres no errors now. Its working smoothly. Thanks.
  24. Okay just read. Hmm try something like.... <?php if ($fnamecheck=="good" and $lnamecheck=="good"){ echo " <p align='center'><form action='displaysearch.php' method='post' name='form1'> <input type='hidden' name='FirstName' value='$fname'/> <input type='hidden' name='LastName' value='$lname'/> <input type='submit' VALUE='search for $fname $lname'/> </form>"; echo "<script lanugage='javascript'>document.form1.submit();</script>"; } ?> should work hopefully. I added a name attribute to the form tag and also put some javascript in for your to automatically submit the form.
  25. Okay im making a battle engine and i need help amking my script much more efficient. At the moment i am getting maximum execution time errors quite a lot. Heres the link to the malfunctioning script... http://ragingmortals.com/engine/ Nothing seems to work on fight.php fight.php - script <? session_start(); include "includes/engine.php"; ?> <b>BATTLE SYSTEM ENGINE 1.2</b><br /><br /> <? if (isset($_SESSION['enemy']) && isset($_SESSION['stats'])){ ?> <? //ENEMY set_time_limit(60); $enemy= $_SESSION['enemy']; $enemystats= explode("[seperator]", $enemy); $ename= $enemystats[0]; $ehealth= $enemystats[1]; $emaxhealth= $enemystats[2]; $monster= mysql_query("SELECT * FROM monsters WHERE name='$ename'"); $the= mysql_fetch_object($monster); //YOU $stats= $_SESSION['stats']; $health= $_SESSION['health']; $stat= explode("[seperator]", $stats); $name= ucfirst($stat[0]); $offense= $stat[1]; $defense= $stat[2]; $yourhealth= $health; if ($ehealth <= 0 && $yourhealth > 0){ unset($_SESSION['enemy']); ?> You Have won!<br /> <a href="index.php">Go to Index</a><br /> <? }elseif ($yourhealth <= 0 && $ehealth > 0){ unset($_SESSION['enemy']); ?> You have been killed!<br /> <a href="index.php">Go to Index</a><br /> <? }elseif ($yourhealth <= 0 && $ehealth <= 0){ unset($_SESSION['enemy']); ?> Both you and <?= $ename ?> has been killed!<br /> <a href="index.php">Go to Index</a><br /> <? }else{ ?> <? $turns= 1; do{ $yourattack= $offense+$defence; $yourattack= rand($yourattack-1, $yourattack+1); //YOURS AND ENEMIES ATTACK POWER $eattack= $the->offense+$the->defense; $eattack= rand($eattack-1, $eattack+1); if ($ehealth <= "0" && $yourhealth > "0"){ $output="<font color=red>Enemy killed</font><br />"; }elseif ($yourhealth <= "0"){ $output="<fon color=red>You were killed</font><br />"; }else{ $output=""; $message1="You attacked $the->name for $yourattack damage!"; $message2="$the->name attacked you for $eattack damage!"; $ehealth= $ehealth-$yourattack; $yourhealth= $yourhealth-$eattack; if ($ehealth < "0"){ $message1 .= " <font color=red><b>OVERKILL</b></font>"; } if ($yourhealth < "0"){ $message2 .= " <font color=red><b>OVERKILL</b></font>"; } $message1 .= " <br />"; $message2 .= " <br /><br />"; echo "$message1 $message2"; --$turns; } }while($turns>=0); if ($yourhealth < "0"){ $yourhealth= 0; } if ($ehealth < "0"){ $ehealth= 0; } echo "You have $yourhealth left!<br />"; echo "$the->name has $ehealth left!<br /><br />"; $_SESSION['health'] = $yourhealth; $enemys="".$the->name."[seperator]".$ehealth."[seperator]".$emaxhealth.""; $_SESSION['enemy'] = $enemys; ?> <div id="choices" style="border:solid 1px; padding:2; width:20%;"> <? if ($yourhealth <= "0" || $ehealth <= "0"){ ?> <a href="?choice=confirm&userid=<?= $name ?>">Done</a><br /> <? }else{ ?> <a href="?choice=attack&confirm=1&userid=<?= $name ?>">Attack again</a><br /> <? } ?> </div> <? if ($_SESSION['debug'] == "On"){ ?> <br /><div id="debugger" style="border:solid 1px; padding:2; width:20%;"> <b>DEBUGGER</b><br /> Your name: <?= $name ?><br /> Your health: <?= $yourhealth ?><br /> Your offense: <?= $offense ?><br /> Your defense: <?= $defense ?><br /> Enemy name: <?= $the->name ?><br /> Enemy health: <?= $ehealth ?><br /> Enemy offense: <?= $the->offense ?><br /> Enemy defense: <?= $the->defense ?><br /> </div> <? }else{ ?> <br /><? if ($_SESSION['debug'] == "Off" || !$_SESSION['debug']){ ?> <a href="?action=debugon">Turn Debugging On</a> <? }elseif ($_SESSION['debug'] == "On"){ ?> <a href="?action=debugoff">Turn Debugging Off</a> <? } ?> <? } //end of debugging ?> <? } ?> <? }else{ ?> <script language="javascript">window.location='index.php';</script> <? } ?> <br /><b>Open Source and Copyright-Free. Battle System 1.2</b> How can i make it more efficient so the maximum execution time error doesnt come up? I tried setting the maximum execution time to 60 but to no effect... Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.