Jump to content

jdavidbakr

Members
  • Posts

    271
  • Joined

  • Last visited

Everything posted by jdavidbakr

  1. A-ha, I knew there had to be that function, just couldn't find it
  2. Just looked more closely at your code - you're opening the $revreply assignment with a double-quote, and then putting single-quotes around the variable. The double-quote aren't terminated by the single quotes. Try this: $revreply = "<br><br> Review can be responded <a href='http://www.twcslibrary.com/user.php?action=revres&reviewid=$revid'>by clicking here</a>";
  3. Try this: reset($counter); $nextimage = null; do { if (current($counter) == $_GET['imageid']) { if (next($counter)) { $nextimage = current($counter); } else { // At the end of the array } break; } } while (next($counter)); if ($nextimage) { // We found the next image } else { // Either the image we received isn't in the array or we're at the end of the array }
  4. It's not in the table with the quote, is it?
  5. I've used http://swfupload/ quite a bit - if you're needing this to be something that you'll do on a regular basis and want to have some automation in the processing, or if and end-user will be doing these uploads, I'd recommend it. It allows you to upload multiple images at a time, gives you the ability to display a progress bar as they are uploading, and delivers them one at a time to your PHP script. You need to work with the javascript but you technically can use the sample codes to get a pretty decent uploader.
  6. What if the calculation itself changes? What if now they want to multiply all costs by 2? Or instead of the number of 2x4 being equal to the length of the building, now the quantity will be something like (length * 2) / 3? Heh, well, that's the fun part - you get to figure out everything that the user will want to change and give them some access to it in an interface that you build. Turning all those constants into variables is the easy part - building an interface for the user that makes it easy for them to change is why you get paid the big bucks
  7. Not what I was looking for. I need something like <?php if ('My IP Adress") { do not redirect } else (Any other IP){ redirect }; ?> I just don't know how to implement that into my current code Um ... I think it is if ($_SERVER['REMOTE_ADDR'] == '123.456.789') { do not redirect } else { redirect }; (I actually typed the variable wrong the first time, it should be just 'REMOTE_ADDR')
  8. Test $_SERVER['HTTP_REMOTE_ADDR']
  9. Instead of hard-coding your constants for your calculations, build a database that your php code uses to pull those values. Then you can create an interface so that the end user can modify those values which in turn will change the results of your calculations. You can alternatively have an interface that sets those values in session variables, if you don't need them to persist beyond the current session. Have your code start by checking for the existence of the session variables and setting them to default values if they are not set, then update those session variables when the user changes the values through your interface.
  10. You may need to contact the author you bought the template from and find out what the variables are being posted as.
  11. You still need the .'s: Sent By: ".$_POST['input0']." not Sent By: "$_POST['input0']"
  12. Is that the entirety of the script? It may be assuming that register_globals is turned on, which if you're on a current version of PHP it should be turned off as it's a security problem. Try changing your variables in the code to $_POST['inputX'] instead of $inputX and see if you get anything differently. If that doesn't work it may be sending the variables via GET, try $_GET['inputX']. I think you need to lower-case "print" also, "Print" isn't a PHP function. That could be why your flash app isn't responding correctly.
  13. You mentioned that you have 4 tables and list three - but you have more than 4 representations of XXXid in your schema you mentioned. Do you have a probe table? Add this: $result = mysql_query("SHOW COLUMNS FROM $class where Field != \"id\""); if (mysql_error()) { echo mysql_error(); } Also, change your $data .= into echos so you can see exactly when those error messages are occurring, and since you're running this from the command line.
  14. Your "return" is still bailing out of the loop
  15. Where is the "newclass = " line? Put it right after the preg_replace, and output $child_col_name[0] right before it too.
  16. So does it never work or does it work to a certain depth?
  17. If you don't want to mess with AJAX (I'd suggest looking into a framework if you want to do AJAX, I use mootools and love it, I know others love jQuery), you can do it via a form. Have the output of the PHP script look something like this: <form method="post" action="delete_selected.php"> <table> <tr> <td>Item 1</td> <td><input type="checkbox" name="delete[1]"> Delete</td> </tr> <tr> <td>Item 2</td> <td><input type="checkbox" name="delete[2]"> Delete</td> </tr> <tr> <td>Item 3</td> <td><input type="checkbox" name="delete[3]"> Delete</td> </tr> </table> <input type="submit"> </form> then your php code would be something like: if (is_array($_POST['delete'])) { foreach($_POST['delete'] as $id) { $statement = "delete from table where id = '".mysql_real_escape_string($id)."'"; mysql_query($statement); } } Of course you'll want to put in appropriate restrictions to make sure that items don't get deleted that shouldn't, but that's a basic non-ajax way to do it.
  18. Try echoing or error_logging your variables right before the recursive call. Make sure $newclass is indeed what you expect it to be at each iteration. Nothing jumps out at me as to why it wouldn't be working.
  19. Make sure you user is thering_thering@localhost and not thering_thering@%
  20. I believe the problem is that you are returning from the function when you find the first column, so once you find locusid it will exit the function and not continue on to probeid.
  21. Check $_SERVER['HTTP_USER_AGENT'] - I think that should tell you.
  22. Do you have access to the apache error logs? That'd be the first place I'd look.
  23. Perhaps: $newdate = date("Y-m-d H:i:s",strtotime($date));
  24. I don't normally do it that way, but can't you create the query as a variable still? $statement = "SELECT * FROM table WHERE (name = :name)"; if ($city) { $statement .= " AND (city = :city)"; } $this->stmt = $this->_dbh->prepare($statement);
×
×
  • 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.