Jump to content

ss32

Members
  • Posts

    86
  • Joined

  • Last visited

    Never

Everything posted by ss32

  1. first check for stupid errors... wrong email addresses etc. then check if the function is completing... add an "or die('mail error');" after the mail function if that fails, check that your IMAP/SMTP/POP server is running (if you cant, contact the administrator to see whats enabled) if it turns out that they wont allow mail... then sorry there isnt much that you can do.
  2. nice dreamweaver login (= the problem is that you arent using a header() redirect, or anything that would be redirecting the page. if you are looking for the output that was causing the problem last time, it is the newline between your main script and that small thing before it. ANY output causes this error... newlines, spaces, characters... be sure your header sending section is at the top and has NOTHING before the <?php ?> tag.
  3. use the colgroup tag; it has the onClick event that you are looking for. it will make things SO much easier than echoing two tables
  4. That will certainly put a block on any queries that need to join user and job tables. Create a separate user_job table containing the userID and jobID. not really... i am able to do this sort of thing all the time with a CSV field... mainly because mysql is able to parse it and turn it into an array that i am able to use as a comparison between the tables. either way though, i think your method is better.
  5. well, a time slot would be denoted by an integer field representing the start time of the volunteer job, and another field representing the duration. That job would have an ID and a maximum participants field as well. User login/registration is a fairly simple topic; i am sure phpclasses.org has ample amounts of user classes. The user would also have a jobs id field, which would be a comma-separated-value list of job ID's. When a user clicks and confirms a task, their jobsID field gets appended with that task. the next part would be a cron job that runs hourly, maybe daily, that will email the user if a query returns true that they have a job within the next 25 hours. as for code... thats a lot of code to provide on a forum post, so i am afraid you will have to figure that one out. the way i outlined it would be the way to do it, though.
  6. or you could try... <?php foreach ($tables[1] as $k => $i) { echo $i; echo $tables[2][$k]; } ?>
  7. as long as all you have to do is press a button, it is pretty much fool proof. unless of course you give him two buttons... then he may get confused.
  8. php loads the image into memory as a bitmap. considering PNG's compression, a 10mb png could easily be a 100mb bitmap- its just that good. my suggestion? use smaller images. the fact, though, that 1.5 -> 143 leads me to beleive that there is another issue or a memory leak going on.
  9. check your WHERE statement... im pretty sure username is a reserve word and needs to be enclosed in back quotes also make sure that you called session_start (=
  10. no, but you could use a series of DESCRIBEs to get the data you would need, and from that use PHP to regenerate a query of all the data within the table. it sounds difficult... and would probably involve some string parsing, but in reality its not really that complicated. just a bunch of nested foreach loops. $sql_show_tables = "show tables"; foreach ($sql_show_tables result as table) { $sql_table_props = "describe " . table; foreach($sql_table_props result as table values) { //build a query that selects all of the data from the database ($sql_get_table_data) //build a table creation query } foreach($sql_get_table_data result as res) { //echo an insert query for every result } }
  11. i think n35 is right. they could also be using a custom PHP function which regenerates a static (or maybe dynamic) menu. either way, though, it is just a table.
  12. that is a pretty important detail. do you think that your query maybe truncated? try a very small, 1 by 1 jpeg image and see if it completes. if not, there is something wrong with your file uploading/retrieval section of the code. if your query looks fine, though, after echoing, then i am afraid the error is beyond me... (i also know that images and any binary data for that matter can contain quotes in it as a result of encoding data... make sure this isnt the case either)
  13. yikes. well, your friend here is going to be the in_array(needle, haystack) function. if you could find a way to dynamically generate those fields, your task would be easy. otherwise what you are looking at is a lot of tedious work. anyway, you are going to need something along the lines of the following in each checkbox (assuming $userprefs is the array from the database) <input type="checkbox" <?php echo (in_array("12", $userprefs)) ? "checked=\"checked\"" : ""; ?> value="12" /> 1.2: blah blah...
  14. This is, unfortunately, the sort of application that people spend years developing and tuning. if you wish to proceed, you are going to need to do a lot of research on this topic- it isnt easy. the good thing, though, is that it has been developed, the only problem is that you will have to do a lot of work to get some source code. http://computer.howstuffworks.com/facial-recognition.htm
  15. the better thing to do would be to merely save a reference of the image to the database, and the actual image is stored in a directory somewhere on the server. i think you are either using the wrong datatype to store the image or your image is failing to upload, causing a blank string (which mysql doesnt like for some reason). also, use sprintf when writing queries, it makes things a lot easier.
  16. funny... im writing a script library that automates this process... anyway, the basic idea is that your 'edit' button has the id 'actionbutton', and a javascript function that swaps the contents of a block of text for the text area. the process is quite simple... given the following txt block. <form id="actionform"> <div id="body"> ...content... </div> <input type="button" onmouseup="cvert('body')" id="actionbutton" /> </form> for the javascript... function cvert(e) { box = document.getElementById(e); ab = document.getElementById("actionbutton"); box.innerHTML = '<textarea name="body_content">' + box.innerHTML + '</textarea>'; ab.onmouseup = 'document.getElementById("actionForm").submit()'; } of course, thats just the rough way to do it, ESPECIALLY if your code is post-formatted. if that is the case, then you will have to go through a ton of AJAX stuff that i am too lazy to post. this should give you a basic idea though. (you may want to change "cvert" to something more readable)
  17. there are java/javascript implementations of the marquee you want to achieve, but the problem with using those is compatibility. I would just stick with the regular HTML marquee- it works.
  18. you could do it using an SQL database, and that would probably be the preferred method considering that you can store more than just the file name as an attribute, and it makes pagination a whole lot easier. anyway, to do thumbnails you will need a php resizer script. fortunately i have one that works for JPEG files only. <?php header("Content-type: image/jpeg"); //process the desired image size //usage: showJpg.php?image=(desiredImage) $image = $_GET['image']; $size = $_GET['size']; $resample = $_GET['res']; $quality = $_GET['qual']; $src = @imagecreatefromjpeg($image); if ($src) { list($width, $height) = getimagesize($image); if ($width > $height) { $factor = ($size / $width); $newW = $size; $newH = $height * $factor; }else { $factor = ($size / $height); $newW = $width * $factor; $newH = $size; } $thumb = imagecreatetruecolor($newW, $newH); if ($resample == false) { imagecopyresized($thumb, $src, 0, 0, 0, 0, $newW, $newH, $width, $height); }else{ imagecopyresampled($thumb, $src, 0, 0, 0, 0, $newW, $newH, $width, $height); } }else{ $thumb = imagecreatetruecolor(128, 128); $clr_grey = imagecolorallocate($thumb, 64,64,64); $clr_red = imagecolorallocate($thumb, 255, 32, 0); imagefilledrectangle($thumb, 10, 10, 115, 90, $clr_grey); imagestring($thumb, 5, 35, 40, "Error_", $clr_red); } imagejpeg($thumb, '', $quality); //destroy the image imagedestroy($thumb); imagedestroy($src); ?> if you want to browse through a directory of images, this loop may help: <?php $dir = opendir("path/to/picture/library"); while (false !== ($file = readdir($dir))) { //TODO: handle files } closedir($dir);
  19. As long as you are using windows you should be fine. the only tough part about this is learning all of the specifications of the COM objects you are manipulating.
  20. a loop is the only way you can echo the data. you are going to have to use one. just make sure that you don't have the loop doing a lot of stuff. a simple echo/if isnt going to hurt anything. as a rule of thumb, the less queries the better. and this really isn't a complex operation... its a simple query-sort-echo thing. that code i gave you should do you well- it leaves the optimized engine to do all of the sorting stuff and merely echoes the information afterwards.. if you really want to be stingy, code all the methods you can think of and benchmark them.
  21. The fact that you can INSERT and not UPDATE is a clear sign that something is wrong with your query. as i said, check your WHERE statement
  22. look what you are doing is GOING to be load-heavy... if you dont want it to be then get a better server. as far as making it better goes, you could try unioning the queries, ordering the queries, or creating subpages where only weapons/shields/etc are viewable (which would probably decrease the load the most). what thorpe said is absolutely correct... and having mysql handle most of the data manipulation is a smart idea because it is optimised for it. it is relatively safe to do a sort in there, or a union if you have to.
  23. $sql = "SELECT * From `Items` Where UserID = $userid ORDER BY Status" $q = mysql_query($sql); $prevStat = 1; while ($row = mysql_fetch_assoc($q)) { if ($prevStat != $row['Status']) { echo $row['Status']; } //echo the rest here $prevStat = $row['Status']; }
  24. if you are sure that the query is executing, first check that the WHERE clause is correct (you may be using an incorrect variable or something while putting the username string in there). reason i ask is that userid is typically a number and it doesnt look like you put one in there
  25. implement an array with one element for christ's sakes. anyway, when you want to get it to save, you are going to have to tell php to dynamically mark the checkbox as checked somehow. by somehow, i mean with a database or sessions or something. if it is a user preference, when the checkbox is posted store that the checkbox is true to the database. when drawing the checkbox, you can do something like this, assuming the user property is "cv_permission"... <input type="checkbox" name="cv_permission" <?php ($row['cv_permission']==true) ? echo "checked" : echo ""; ?> /> btw... in your original code you declared your checkbox as both a checkbox and a submit... not a good idea.
×
×
  • 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.