Jump to content

didgydont

Members
  • Posts

    115
  • Joined

  • Last visited

Everything posted by didgydont

  1. opp and this <?php $id = how ever you get you id ; echo " <fieldset style='padding: 10px;'> <legend>Delete Account: " . $_SESSION['username'] . "</legend> <form action='daccount.php' method='POST'> <input type='radio' name='yes' value='Delete Account'/>Yes<br/> <input type='radio' name='no' value='No'/>No<br/> <input type='hidden' name='id' value='$userid'/> <input type='submit' value='Submit' name='Submit'/> </form> </fieldset> "; include "db.php"; if($_POST['yes']=="Delete Account" ){ mysql_query("DELETE FROM users WHERE id='$_POST[id]' AND username='$_SESSION[username]' "); echo " Hope you enjoyed MythScape. Sorry you un-registered."; echo "<a href=\"index.php\"> Click here </a> to Go Home"; } else{ echo "Not deleted!"; } ?>
  2. because the ancor is at the bottom of the page until the table loads
  3. create a test php file to an account you can delete enter vaules in manualy for now obviosly change 1 and johndoe <?php include("db.php"); mysql_query("DELETE FROM users WHERE id='1' AND username='johndoe' "); ?>
  4. <?php $id = how ever you get you id ; echo " <fieldset style='padding: 10px;'> <legend>Delete Account: " . $_SESSION['username'] . "</legend> <form action='daccount.php' method='get'> <input type='radio' name='yes' value='Delete Account'/>Yes<br/> <input type='radio' name='no' value='No'/>No<br/> <input type='hidden' name='id' value='$userid'/> <input type='submit' value='Submit' name='Submit'/> </form> </fieldset> "; include "db.php"; if($_POST['yes']=="Delete Account" ){ mysql_query("DELETE FROM users WHERE id='$_POST[id]' AND username='$_SESSION[username]' "); echo " Hope you enjoyed MythScape. Sorry you un-registered."; echo "<a href=\"index.php\"> Click here </a> to Go Home"; } else{ echo "Not deleted!"; } ?>
  5. <?php include "db.php"; if($_POST['yes']=="Delete Account" ){ mysql_query("DELETE FROM users WHERE id='$_POST[id]' AND username='$_SESSION[username]' "); echo " Hope you enjoyed MythScape. Sorry you un-registered."; echo "<a href=\"index.php\"> Click here </a> to Go Home"; } else{ echo "Not deleted!"; } ?> but you need to add the id as a hidden input to the form <input type="hidden" name="id" value="theidhere"/>
  6. i have tried that but it doesnt work because the table changes on every link click then i wanted it to jump but the jump happens before it loads http://360.kingla.com/?group=&sort=&type=#list yet if go to address bar and press enter it works
  7. hi all i am normal able to jump to on a webpage but in this instance the page loads before the table and doesnt work though if i press enter in the loaded pages address bar it does are there anyways around this ?
  8. thank you very much i will book mark this for next time i ended up making a function to do the lot though function topposters($display){ $usersresult = mysql_query("SELECT * FROM Users"); $array = array(); //$result3 = mysql_query("SELECT * FROM Xbox360"); while($row = mysql_fetch_array($usersresult)){ $user = $row['username']; $result3 = mysql_query("SELECT * FROM Xbox360 WHERE User='$user'"); $count = mysql_num_rows($result3); //$array[] = "Count => $count User => $user"; $array["$user"] = $count ; } arsort($array); //$topposters = print_r($array); //return "$topposters"; $i = 0; Echo "<br><br><br><SPAN class='kinglahead'>Top $display Posters</SPAN><br>"; foreach($array as $key => $value) {$i++; if ($i<=$display){echo "$key(<a href='index.php?poster=$key'>$value</a>) ";} } }
  9. that returned "Invalid use of group function" i started to make a function to try to do it but that method would be heaps easier if i could get it working
  10. i have a site that i want to display the top 5 posters but i have no idea how or where to start this is what i have to count a user post but i cant figure out how to display or sort $result3 = mysql_query("SELECT * FROM Xbox360 WHERE User='$user'") $count = mysql_num_rows($result3); i tried this but i dont think im even close $query = "SELECT *, COUNT(Game) AS Game FROM Xbox360 GROUP BY User ORDER BY User DESC"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ //echo $row['User'].": ".$row['COUNT(name)']."<br />"; echo $row['User'].": ".$row['COUNT(Game)'] ; } thank you for your time
  11. thank you im not real familiar with java script so will give it a miss for now and do a bit of reasearch on java script
  12. hi all lets says i have a table <table> <tr style='background-color: yellow;'><td>col1box1</td><td>col1box2</td><td>col1box3</td></tr> <tr style='background-color: purple;'><td>col2box1</td><td>col2box2</td><td>col2box3</td></tr> <tr style='background-color: yellow;'><td>col3box1</td><td>col3box2</td><td>col3box3</td></tr> </table> is it possible to make it if you move the mouse over say col2box2 the tr goes red but if you move it over col2box3 it goes green or can you only change the td colour thank you for your time
  13. thank you very much
  14. thanx guys all possible formats are like so "900am", "915am", "930am", "945am", "1000am", "1015am", "1030am", "1045am", "1100am", "1115am", "1130am", "1145am", "1200pm", "1215pm" and so on thats why i had if(ereg("^[a-z0-9]{5}$", $b4apptime)) and if(ereg("^[a-z0-9]{6}$", $b4apptime)) i used your help to do this an example $str = "1245pm"; if(ereg("^[a-z0-9]{5}$", $str)){ preg_match('/([0-9]{1})([0-9]{2})(am|pm)/', $str, $matches);} if(ereg("^[a-z0-9]{6}$", $str)){ preg_match('/([0-9]{2})([0-9]{2})(am|pm)/', $str, $matches);} print_r($matches); answer = Array ( [0] => 1245pm [1] => 12 [2] => 45 [3] => pm ) wich will shrink the codes lots but i dont under stand why the array put in the original value ?
  15. make this smaller trying to convert this 530pm to $1 = 5 $2= 30 $3=pm this works for now but i want to make it tiny function b4ampm($b4apptime){ if(ereg("^[a-z0-9]{5}$", $b4apptime)){ $b4a = preg_split('//', $b4apptime, -1, PREG_SPLIT_NO_EMPTY); return $b4a[3] . $b4a[4] ;} if(ereg("^[a-z0-9]{6}$", $b4apptime)) { $b4a = preg_split('//', $b4apptime, -1, PREG_SPLIT_NO_EMPTY); return $b4a[4] . $b4a[5] ;} } function b4mins($b4apptime){ if(ereg("^[a-z0-9]{5}$", $b4apptime)){ $b4a = preg_split('//', $b4apptime, -1, PREG_SPLIT_NO_EMPTY); return $b4a[1] . $b4a[2] ;} if(ereg("^[a-z0-9]{6}$", $b4apptime)) { $b4a = preg_split('//', $b4apptime, -1, PREG_SPLIT_NO_EMPTY); return $b4a[2] . $b4a[3] ;} } function b4hour($b4apptime){ if(ereg("^[a-z0-9]{5}$", $b4apptime)){ $b4a = preg_split('//', $b4apptime, -1, PREG_SPLIT_NO_EMPTY); return $b4a[0] ; } if(ereg("^[a-z0-9]{6}$", $b4apptime)) { $b4a = preg_split('//', $b4apptime, -1, PREG_SPLIT_NO_EMPTY); return $b4a[0] . $b4a[1] ; } }
  16. is it possible to do some thing like this ? $chars = preg_split("/([a-z0-9]{3})([a-z0-9]{2})/", $str); i found this but it gets to messy for what i want to do $v = array(); for($x=0;$x<strlen($str);$x++){ $v[] = $str[$x];}
  17. this worked $result = mysql_query("SELECT * FROM CGSLappointments WHERE appdate='$currentdate'"); while($row = mysql_fetch_array($result)) { $appdate = $row['appdate']; $apptime = $row['apptime']; $rep = $row['rep']; $customer = $row['customer']; $job = "$rep$apptime"; $$job = "$customer"; }
  18. hi all im trying to make a time table with 4 fields im trying to make the result like below so i dont have to type a lot of code $result = mysql_query("SELECT * FROM CGSLappointments WHERE appdate='$currentdate'"); while($row = mysql_fetch_array($result)) { $appdate = $row['appdate']; $apptime = $row['apptime']; $rep = $row['rep']; $customer = $row['customer']; $$rep$apptime = "$customer"; <------ this is what doesnt work } im trying to make in the time table like this <tr><td>12:00pm</td><td>$john1200pm</td><td>$Sue1200pm</td></tr> any ideas ?
  19. like this http://bellmedia.com/index.php?page=bellhd-presenters&flv=djshowreel.flv&play=yes&align=bottomleft
  20. hi all i have noticed websites that have a real speaking person on them and have found companys that will put them on a site but i would like to know if anyone knows how i could record someone i know and add them myself to a website ? thank you
  21. thank you
  22. is it possible to download a file then redirect ??? i have tried this readfile("$software"); header("Location: http://www.sample.com/");
×
×
  • 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.