Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. Is there supposed to be a variable assigned to this URL? For example: /code.php?message=Good%20Afternoon%20CMJ Anyway, however you grab this string you have to decode it, explode it (as premiso mentioned) and assign a variable to the last piece of the array (assuming the last piece is going to always be the one you need). With a little tweaking, it should look something like: $string = urldecode("Good%20Afternoon%20CMJ"); $pieces = explode(" ", $string); foeach($pieces as $key => $value) { echo "key => " . $key . " value => " . $value; $name = $value; } ?>
  2. It is better practice to use a foreach for arrays because it's slightly faster and is pretty much the standard way of iterating through an array. Actually an array is the only thin you can use for a foreach. Anyway, even with the foreach ILMV, if it doesn't match the last name the $response will always be "not okay".
  3. Add a break in after you find a match and it will exit the loop: if ($a[$i] == $q) { $response = "Okay"; break;
  4. The best way to do this would be to just have one resource directory to store the images in. In MySQL you should just have path references to these files. Does this answer your question?
  5. What doesn't work? Does it not update? Does the page load? Are there errors? I'm getting confused. First you said you wanted links that pass the ID to the update page to process the information. Here are a couple of things that could/are wrong: 1) You never assign $memberID = $_GET['memberID']; 2) Your query could be wrong, I would suggest something such as: (so you can debug) $query = "UPDATE members SET memberID='$memberID',firstName='$firstName', lastName='$lastName',firstName2='$firstName2', lastName2='$lastName2',address='$address', city='$city',state='$state', zip='$zip', telephone='$telephone', email='$email',expiration='$expiration', type='$type', childName='$childName',interests='$interests', dateAdded='$dateAdded', updated='$updated', additionalNotes='$additionalNotes' WHERE memberID = ".NumValidate($memberID).""; echo $query; mysql_query($query) or die(mysql_error()); 3) I also have no clue where the POSTs are coming from. Maybe you could post the form as well, make sure to label each page. 4) Are you sure you don't want: (notice the extra dot) ../update2.php rather than ./update2.php
  6. Considering he has already done this with the other "'s around attribute values. It's weird making the quote symbol plural...
  7. I've never had that problem or even heard about that problem before...
  8. Maq

    New

    Okay.... -That has nothing to do with PHP. -It's most likely (99%) not right, especially if you're asking us. -Use tags. -Format your code properly. -That code doesn't even make sense, at least to me, and isn't valid.
  9. What you described about your code isn't very helpful. It all depends on your design and how you optimize your code. Here's a quick list of little things you can do to speed things up: 63 + Best practices. I only skimmed through, but it seems pretty accurate. You should also read about proper design models and optimizations for OOP. There are plenty of tutorials.
  10. I thought you said they were echoing correctly...? You may want to ask this in the Regex section, since this is what your thread has become.
  11. That's why I wanted to know what data type you were storing them as. This isn't Java or C++, this is PHP... It's so loosely typed it doesn't matter as long as the data has real numbers.
  12. If you don't mind, could you post all the relevant code...?
  13. I did this, and it echoed "72.6". $x = 968.00; $y = .15; $total = ($x * $y) / 2; echo $total; ?> It's probably because 'y' should be '$y'. If that's not the case, then your variables aren't holding what you said they were, try echoing them out individually to ensure they have correct values.
  14. Can you tell us what exact command you're running and what kind of server apache is located on?
  15. The link should be similar to: *Not tested* Then when you grab it on the next page (your_page.php), use the GET method: $memberID = $_GET['memberID']; $query = "SELECT * FROM members WHERE memberID = '$memberID'"; //blah blah blah
  16. It's pretty apparent when his post is in, "PHP Applications, Frameworks and Libraries" and is using the Zend API...
  17. Yes, even the file that creates them...
  18. You need session_start() on every page you want to use sessions on...
  19. But that dosn't work accross the files (at least not for me) Like, if that gets set in checklogin.php, i cant read it in index.php You should be able to read it anywhere on your site that has session_start(); Maybe you're destroying the session somewhere and it's not retaining the name.
  20. I think it's saying that line 9 of can't find: but then again I always get confused with includes and paths.
  21. Well it's not in your original code, so why don't you post the correct code...?
  22. Maybe it's the wrong MIME type being server, try putting this at the top: Your code works for me...
  23. Needs major overhaul! zanus said it best:
  24. What exactly displays? Are there errors? Is everything on that page (processorder2.php)?
  25. Yeah sorry, didn't compensate for the 'AND'. Use this: $type= ($_GET['type']=="") ? "" : "type = '{$_GET['type']}' AND"; and: $result = mysql_query("SELECT * from properties WHERE $type bedrooms >= '$bedrooms' AND maxprice
×
×
  • 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.