Jump to content

void

Members
  • Posts

    76
  • Joined

  • Last visited

Everything posted by void

  1. should probably be like that: $day3 = date('Y-m-d H:i:s', strtotime('+3 day', time()));
  2. If there was a proper "date" or "datetime" field in your table (instead of just varchar "Monday"), then I would use DATE_FORMAT to get a 1-7 integer representing the day of the week. If there isn't one, FIND_IN_SET would probably sort this out, something like ORDER BY FIND_IN_SET(Day, 'Monday,Tuesday,Wednesday.........') ASC
  3. "xxxxxx", "a3165211_Forum"); i think it isn't that difficult to trace an error like that, especially when you have a line number.
  4. Other than the query issues, code like that makes baby Jesus cry. I suggest discovering arrays.
  5. because there's no value attribute on the <input>?
  6. why are you using colons in your date() function then? wouldn't date("Y-m-d") do the trick?
  7. well i suspect there's whitespaces left after you use explode(). try $city = trim($split[0]); $state = trim($split[1]); $country = trim($split[2]); and why would you use 'LIKE'? it's useless if you don't use wildcard (%).
  8. could you explain more thoroughly about why you need this? I have a feeling it doesn't make a lot of sense
  9. $time = strtotime($pds); echo date("Y-m-d H:i:s", $time);
  10. $headers = "From: $myemail\r\n"; $headers .= "Reply-To: $email_address\r\n";
  11. mysqli_query($connection,"SELECT * FROM students ORDER BY tutor") not too sure about mysqli, bet for mysql_query the first argument is query and the second one is conn link.
  12. echo '<a href="?thumb=' . ($_GET['thumb']-1) . '">Previous</a>'; echo '<a href="?thumb=' . ($_GET['thumb']+1) . '">Next</a>';
  13. $thumb_selected = (isset($_GET['thumb']) ? $_GET['thumb']:''); if ($thumb_selected !==""){ $dirName = substr($thumb_selected,0,strpos($thumb_selected,basename($thumb_selected))); $thumbName = basename($thumb_selected); $thumbFile = $dirName.$thumbName; $large = str_replace('_th.jpg','.jpg',$thumbFile); } Wait, isn't this what should do it in the first place?
  14. not sure what that list() does there at all, but .. "SELECT * FROM toplist WHERE premium='1' && activated='1' && ban='0' && staff='0' ORDER BY (SELECT COUNT(*) FROM votes WHERE votes.serverId = toplist.id) DESC"
  15. in the loop which prints the images, add an incremental integer, for instance ++$i; then add an 'id' variable to the url. so it would read as /gallery.php?id=2 and by default it's 1. the idea is that left arrow points to ?id=($_GET['id'] -1); and right arrow points to ?id=($_GET['id'] +1); back to the loop -- add a condition: if($i == $_GET['id']) echo 'big image'; else echo 'thumbnail'; hope this makes sense
  16. put .htaccess with deny from all in the image directory. then use a php file to retrieve images: <?php // image.php $name = str_replace(array('/', '\\'), "", $_GET['name']); $image = file_get_contents('images/' . $name); header("Content-type: image/jpg"); echo $image; exit(); ?> And then, in HTML: <img src="image.php?name=some_image.jpg" />
  17. UPDATE table SET field1= CONCAT(field1, ',20');
  18. for starters, $visitors_comments = $_POST[ 'VisitorComments';
  19. how do you want it to show up? it's value is not equal to it's content. what you are after is probably document.getElementById('show').innerHTML = 'aaa';
  20. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> this is echoed before the session_start(), that's why you are getting this error. put all the html after the php.
  21. It did! Absolutely what i was looking for. Thanks Adam!
  22. That's all you need to understand. The problem is with the text in the alert box - it does not correspond to the field in the array. It will always alert the last message in the array, because each element's onclick action is binded with alert(ar[ i ]), which is variable, and not alert("text for field*id*"), which is a simple string and which is what i want.
  23. Yes. Okay, to give you more understanding of what I'm doing, here's the code: // I have an array with field id as a key and simple text as a value var ar = new Array(); ar['field1'] = "text for field1"; ar['field2'] = "text for field2"; ar['field3'] = "text for field3"; // now i have a loop which assigns the text to be alerted for each of the fields in array, when you click on it. for(var i in ar) { document.getElementById(i).onclick = function() { alert(ar[i]); } } and so this is where it all screws up. it doesn't assign the function alert("text for field1") for field1, instead it assigns alert(ar[ i ]), which is not what i want. maybe what i'm doing doesn't make much sense and someone can tell me a better way to achieve what i want. insults and mockery are welcome :-)
  24. use getimagesize(); will do the work, if the server configuration will permit remote files.
×
×
  • 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.