Jump to content

alecks

Members
  • Posts

    80
  • Joined

  • Last visited

    Never

Everything posted by alecks

  1. HA turns out it is valid xhtml, it just cannot be camel case! xD
  2. I know some basic javascript, but I'm pretty much a newbie to it. What I want to do I think is pretty simple, but I cannot find any guidance on it. Please help I have a couple of links like <a href="" id="about">about</a> and a header <h1 id="description">description</h1>. When the links are hovered over, I want to change 'description' to be a description of the link. I can do this with onMouseOver, but that is not xhtml valid and I would like it to be, if possible. How do I do this? Thanks
  3. alecks

    Mambo Problem

    this looks more like a styling issue, mess with the css sheets
  4. http://geany.uvena.de/ Incredibly light weight but the syntax highlighter is super customizable; tell it to highlight a certain file extension a certain way and it will, no questions. Not limited to just PHP either...
  5. $date = strtotime(05-02-08); $date = date('Ydm'); i think should do it, play with the format...
  6. Use single quotes in the query and wrapping the new values in brackets {} isnt really necessary. Table and row names should be wrapped in `s $SeUs = $_SESSION['user']; $PoUS = $_POST['atkuser']; mysql_query ("UPDATE `characters` SET `temphealth` = '$currentHealthYou' WHERE `user` = '$SeUs'"); mysql_query ("UPDATE `characters` SET `temphealth` = '$currentHealthEnemy' WHERE `user` = '$PoUs'"); Test the queries in phpmyadmin or something... we cannot really help if we do not know what the table's structure is or what the values of $SeUs and $PoUs are supposed to be
  7. use sessions or cookies 1. start_session() on each page 2. if he goes to a url like ?style=1, set $_SESSION['style'] to 1 3. on each page check $_SESSION['style']; if it is 1, load style1.css, if it is 2, load style2.css
  8. depending on the operating system line breaks are either saved as \n (unix) or \r\n (i think, for windows) EDIT: yeah, http://us3.php.net/manual/en/function.fopen.php
  9. if you made a script as a separate file, and in the header put a meta refresh, then had that script embedded in an iframe on the page you wanted it to show, you could make a fake dynamic javascript countdown. countdown.php <META HTTP-EQUIV="refresh" CONTENT="2"> <?php $mins = 10*ceil(floatval(date("i")/10)); $hour = date("G"); if($mins >60){ $mins = $mins-60; $hour++; } echo "The Time is : ".$hours.":".$mins; ?> index.html <iframe src="countdown.php" width="300" height="100" /> It'll refresh every 2 seconds... if you want to change it just set the content in the meta tag.
  10. It doesn't work, even if the url is a valid youtube link. It discloses the full path, too http://www2.winmastergames.com:82/youdownload/download.php.?url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Db0l4QAkzkl4&site=youtube
  11. what did the original array look like? array_unique doesn't remove duplicate keys (because that is impossible anyway...), it removes duplicate values
  12. well first off you can simply log in as '', no username or password
  13. Check out http://keithdevens.com/software/php_calendar A nice (albeit a little bit messy) calendar generating function.
  14. I don't mean that at all, because that wouldn't help :/ I want strtotime to assume that any date strings given to it are in a certain format, for example m-d-yyyy. I want this because sometimes when a date is given to it it will think that it is in a different format, d-m-yyyy for example. For example, if I gave it the m-d-yyyy date 1-8-2008, it will give me back a timestamp for 8-1-2008, which is not what I want.
  15. just a quick question: the function strtotime converts strings formatted like dates into unix timestamps. This is great, but how do I tell it to only expect one format? for example: the date 1-08-2008 could be interpreted as January 8th, 2008, or August 1st, 2008. I want it mm-dd-yyyy. thanks
  16. functions like mysql_real_escape_string in php simply return the escaped string, they don't assign it to certain variables like more object oriented languages do... you have to do that yourself for example: while ($row = mysql_fetch_row($seriesresult)){ $seriesID = $row[0]; $date = mysql_real_escape_string($_POST['date']); // ... mysql_query("INSERT INTO race_table (raceDate, hostName, factor, boatsInRace, seriesID) VALUES ($date" //... }
  17. Having this problem, could someone offer a way to do this please The situation: function test1(){ global $b; echo $b; } function test(){ $b = "foo"; test1(); } test(); // nadda thanks
  18. you could do $random = rand(1,2); switch ($random) { case 1: $random = "DESC"; break; case 2: $random = "ASC"; break; } And then the query would be "SELECT * FROM table ORDER BY `id` ".$random."" (assuming there is an id column) You could of course expand the random range and add more options or actually $random = rand(0,1); $options = array("DESC","ASC"); "SELECT * FROM table ORDER BY `id` ".$options[$random].""
  19. Hashing algorithms such as md5, sha1, are one way operations. They are used in password databases because if a hacker were to gain access to a database of hashed passwords, be couldn't do anything with it because theoretically there is no way he could get the base strings (un-hashed passwords) for those hashes. However, programs such as Ophcrack use precompiled tables of hash values, called 'rainbow tables,' to try and get the base string. These rainbow tables can become insanely huge, 15gb+ in most cases. There are some online databases, but they are often incomplete :/, ex. http://md5.rednoize.com/
  20. btw how did you install mysql, what is your server's set up? try just using 'root' as your username and nothing for your password
  21. I don't have any experience with that, but my guess is that it is pretty complicated to use just PHP. One option is to install catdoc (google) onto your server, http://lists.nyphp.org/pipermail/talk/2006-November/020101.html.
  22. while ($k > 0){ $newk += ($k % 2) * $m; $k = (int) $k / 2; $m = $m / 2; } wont it hang here because $k can never, mathematically, reach 0?
×
×
  • 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.