Jump to content

XeNoMoRpH1030

Members
  • Posts

    72
  • Joined

  • Last visited

    Never

Everything posted by XeNoMoRpH1030

  1. I guess I didn't understand what you were asking and potentially still do not. The people who are checking the Alumni scholarship are people who are applying for it? If that's the case, I assume that would have been recorded in the database. Without seeing the structure, it would be difficult to come up with a specific solution, but a basic query would be like SELECT * FROM scholarships WHERE AlumniScholaryship = 1 ORDER BY datex DESC That is extremely basic and without a doubt won't work, but like I said, without knowing column names and such, it would be difficult to figure out the query. Is an HTML form being used to access this information?
  2. Oops, also forgot. Try using imagecreatetruecolor() instead of imagecreate()
  3. Almost. Strtotime just converts a date/time. What you need to do is add the time you are adding (which is done by hours I believe) outside of it like below. $start = date('Y-m-d', strtotime('2010-02-24')); $sevendaystime = date('Y-m-d', strtotime('2010-02-24') + 7 * 86400); $fourteendaystime = date('Y-m-d', strtotime('2010-02-24') + 14 * 86400 ); $twentyeightdaystime = date('Y-m-d', strtotime('2010-02-24') +28 * 86400 ); So, that gets you somewhat closer. I think you don't want to use "Y-m-d", but "U" which would give you the number of seconds. That way, you are comparing integers instead of strings.
  4. Try using imagecopyresampled() instead of imagecopyresized(). Also, with imagejpeg(), you can specify the quality. The default is 75. Just do imagejpeg($dst,NULL,100); for the best quality, or whatever you prefer.
  5. If I understand you correctly, you have a form with several checkboxes which are all the scholarships. You check the specific ones you want to be included in the query? If you are retrieving them by an ID and the checkbox values correspond to those, it will be really easy, assuming the checkboxes are named the same in the HTML. PHP creates an array when input field names are the same. What you can do is $scholarships = (is_array($_POST['checkbox'])?implode(",",$_POST['checkbox']):$_POST['checkbox']); $result = mysql_query("SELECT * FROM scholarships WHERE id IN ($scholarships) ORDER BY datex DESC"); Of course, if nothing is checked, the query would fail. What it does it checks to see if $_POST['checkbox'] is an array. If so, it uses implode() which, in this case, makes a comma delimited string using the array. If it's not an array, just use the single value that was hopefully passed. The idea is that the IN clause would be either IN (2) if it's not an array, and IN (2,3,4,5,6) if it was. Hopefully, that is enough to get you in the right direction.
  6. Well, if you are using PHP, you can just do two queries. The first to insert it into the "work" table. You'd then do $insertid = mysql_insert_id(); and use that ID for your "workimages" table. I think you can also use LAST_INSERT_ID() with MySQL, which is exacelt what the PHP command I showed above uses I imagine. It should be pretty reliable as well because it bases it off the connection.
  7. There are plenty of free APIs out there. You can do grab http://api.hostip.info/get_html.php?ip=12.215.42.19 with PHP and it will return something like this Country: UNITED STATES (US) City: Sugar Grove, IL IP: 12.215.42.19 You can check out http://www.hostip.info/use.html for more information. One problem is the GeoIP stuff isn't always accurate.
  8. You should be able to center it by using: .menu ul { margin: 0 auto; padding: 8px 0; list-style: none; } Which you could have found in the link haku posted.
  9. If that is the case, something like this would work: $text = preg_replace('/\[font\=(.*?)\](.*?)\[\/font\]/is', '<span style="font: $1;">$2</span>', $text); Your example would work, but also [font=15px arial,sans-serif]Test[/font] would work. For the URL, you can get really specific, but one I use is $text = preg_replace('/\[url\=(.*?)\](.*?)\[\/url\]/is','<a href="$1">$2</a>',$text);
  10. I think you can only embed .swf files for the most part. What you generally do is create (or find) a SWF file where you pass it a parameter to play a FLV.
  11. Actually, that might not be so bad. I'd recommend adding a forward slash like below. $id = 101; $query = "SELECT * FROM TABLE WHERE column LIKE '%/$id'"; That way if you were searching for id 1, you wouldn't get 11, 101, etc.
  12. As mjdamato said, the difference between JavaScript and PHP is that PHP is server side while JS is client side. It's definitely do-able with JavaScript, but won't necessarily be reliable in the instance a user has disabled JavaScript on their browser. I'd say your best bet would be to use Ajax because it would be "behind the scenes". If you use MooTools like I mentioned earlier (or similar), it should be relatively easy. If you add some more details, I should be able to come up with something, such as what else would be passed along (session id, username, etc.) to the page being called via Ajax?
  13. My guess would be that IE is caching. Hopefully, you can just add a random URL variable with your request, like a timestamp, and that will fix it.
  14. Well, if the portion in front is literally "path/" then it wouldn't be a problem and you could just use CONCAT. My guess is it would differentiate between rows, so RegExp might be the way to go.
  15. It's not bad at all, especially if you get a JavaScript library like MooTools or similar. Why kind of record would be added to the textarea?
  16. MySQL only allows so many connections to the database. That error implies that the max has been reached, so MySQL rejects the connection. If you are on shared hosting, there isn't much you can do. You could always try mysql_pconnect() which creates a persistent connection, but that could also end up with the same error. Do you use mysql_close() at the end of any of your pages? There shouldn't be a need as it's supposed to automatically close after the script execution, but you never know. I just read somewhere another person was able to stop the same connection error you are getting by implementing that.
  17. Can you post some of the relevant structures for Customfieldview, product, soitem, and so? With that, I'm sure it would be easier to figure out.
  18. 1) Of course you can 2) But, since it is deprecated, I guess you wouldn't be using it anyway 3) Agreed But, there are ways. Check out here.
  19. That, or you can do it from CSS body { font-family: Tahoma,georgia,garamond,serif; }
  20. The easiest way would be to use a JavaScript library such as MooTools. There are then plugins that you can find that will do exactly what you want. That will potentially add more overhead though as that library is capable of doing much more then just that. One quick suggestion though if you haven't already, if a field is required, you shouldn't wait for the user to click "Send", but already show that it is a required field by using an asterisk and of course saying "* Required Field"
  21. You should be able to access it by using something like the following: var CurrentUrl = top.getElementById('link_frame').location.href; In the one case I had to do something like that, I did top.frameName.location.href; I assume when you use document, it considers the current frame (or document) to be that, so hopefully top will do the trick. And I just noticed this is "Solved", so nvm
×
×
  • 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.