Jump to content

Carterhost

Members
  • Posts

    60
  • Joined

  • Last visited

    Never

Everything posted by Carterhost

  1. Just an FYI - The site looks clearer and cleaner (even without the CSS3 stuff) in IE6 than it does in chrome.
  2. Try using Quotes? $timedate[0] = "00,00,00,05,20,2003"; $timedate[20] = "00,00,00,11,03,2004";
  3. I would probably use FTP_BINARY as the mode, unless the only thing you're uploading is Text files. Text files can be uploaded in binary mode no problem. Binary files (including JPGs) will not transfer correctly in FTP-ASCII Mode.
  4. Create a new file: phpinfo.php Put this inside it: <?php echo phpinfo(); ?> View that in a browser, then look through that for these: upload_max_filesize post_max_size max_input_time max_execution_time memory_limit
  5. You still haven't asked a question really, though?
  6. In answer to the second question: yes. $Result= mysql_query("SELECT * FROM $Table WHERE Username='$_POST['Username']' AND Gender='$_POST['Gender']'") Or: $Result= mysql_query("SELECT * FROM $Table WHERE Username='$_POST['Username']' OR Gender='$_POST['Gender']'")
  7. Yeah, Couldn't even find matching commands in the php manual. ???? what the commands is inside the class Eek, My Bad. Edit... it's too late for me. Roll on 1am when I can finish work!
  8. Yeah, Couldn't even find matching commands in the php manual.
  9. use this instead: $sql = "SELECT * FROM ipsr_garage WHERE userid = $userid"; $result = $db->sql_query($sql); $num_rows = mysql_num_rows($result); if ($numrows == 0) { echo "You currently have no cars in your garage."; }else { while ($row = $db->sql_fetchrow($result)) { $year = $row['year']; $make = $row['make']; $model = $row['model']; echo "$year $make $model"; } } It counts the number of results, instead of pulling the first result for the test.
  10. Example from php.net which could be useful: <?php $lastthurs=strtotime("last Thursday",mktime(0,0,0,date("n")+1,1)); ?> Returns the last thursday of this month. <?php $firstthurs=strtotime("next Thursday",mktime(0,0,0,date("n"),1)); ?> Returns the first thursday of this month. So if I didn't need more coffee to stay awake, I'd work out the code for you. 1. Test whether you're past the first thursday of the month 2. If yes, get the date of the last thursday. If no, get the date of the first. 3. Convert it to a nice format 4. Echo it
  11. Quick and Dirrty: redirect.php: <?php $year = $_GET['year']; $month = $_GET['month']; $url = "http://invincible.comics-database.com/database/comicsByReleaseDate/".$month."-".$year; header('Location:'.$url); ?> Use this as the whole page. You should expand on it to do some input checking on your $_GET variables, but this should basically be it. Remember, no spaces or HTML before this code or you'll get the dreaded "Headers already sent" Error.
  12. It's not foolproof, but if you just specify the height in the image tag (i.e. no width) then the aspect ratio is usually kept...
  13. Thanks, I'll try that. It seems that this only occurs when it's edited on a mac. PC's are fine (Vista, XP and Kubuntu all tested okay) Anyone know why??
  14. Hi. I want to be able to store HTML input from a text field, and I wanted to encode it when it went in, so that it didn't break the PHP as it was assigning it to the variable. so I used URLEncode and URLdecode, but thenin text, "you'll" ends up as "you�ll", which is not what I want. Is there something else I could use? I've looked at a few functions in the man pages, but I don't think they're what I need. Cheers muchly.
  15. while($res = mysql_fetch_array($result)) { if($res['rank'] != "Guest" || $res['rank'] != "Administrator") echo "<option value='"$res['rank']"'.>".$res['rank']."</option>"; } That will populate your $_POST['rank'] with the rank, as long as it's not Guest or Administrator.
  16. Yeah, it works first time, no refresh required. I say this too much at work but.... Have you tried clearing your local cache and cookies and trying again?
  17. Same here. Clanstyles, we can't install FF either. Get the portable version from http://portableapps.com. No installation needed.
  18. I just checked it on IE6, and it looks fine from here...
  19. You could try something like: <?php if (!$_FILES['image']['name']=="") { PROCESS IMAGE } else{ DO SOMETHING ELSE } ?> I used this just the other day and it worked
  20. $query = "SELECT * FROM sports s, categories c, sport_catog sc WHERE s.SportId = sc.SportId AND c.CategId = sc.CategId AND c.CategId = ".$_GET['catog'] . " ORDER By s.SportTitle ASC"; If Someone entered 1 OR 2 = 2 into the catog parameter, what would that make your SQL statement? This: WHERE s.SportId = sc.SportId AND c.CategId = sc.CategId AND c.CategId = 1 OR 2 = 2 ORDER By s.SportTitle ASC"; Which would nicely return every row in your database, because 2 will always equal 2....? Just check that your $_GET['catog'] is what you want it to be before you start pumping it into SQL statements
  21. $news = mysql_fetch_array(mysql_query("SELECT * FROM news WHERE id='$id' ")) or die(mysql_error());
  22. Okay, do you have any other SQL Queries in your code?
  23. Not sure how valid this is, but you could try: <?php mysql_query("DELETE FROM comments WHERE id = '$com' LIMIT 1") or die(mysql_error()); ?> That looks more right to me. Does it give the same error?
  24. Try: <?php $time = time() + (4*3600); ?> This adds 4 hours to the current time. To add 4 hours to the time you specify in mktime(): <?php $time = mktime($hour+4, $minute, $second, $month, $day, $year); ?>
×
×
  • 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.