Jump to content

AyKay47

Members
  • Posts

    3,281
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by AyKay47

  1. hmm, my guess is that they don't match, but if you say that they do...what field types are these two? Can you post the code that surrounds this query please...perhaps something there is causing this to fail
  2. the query itself is working, but the id that you have is not matching any id's that are in your database field "Child", the next step would be to double check these values
  3. Have you tried seeing if your mysql query is actually grabbing any rows? $result= mysql_query($sql); print mysql_num_rows($result); if(mysql_num_rows($result) > 0){ while ($row = mysql_fetch_array($result)) { echo $row['Parent']; } }
  4. perhaps this could be a file path issue? Let's try to debug this a little $pid = mysql_insert_id(); $newfile = $pid; $old_file = "/members/{$_SESSION[id]}/123abc123.jpg"; $new_file = "/members/{$_SESSION[id]}/{$newfile}.jpg"; if(is_dir($old_file)){ $rename = rename($old_file, $new_file); if(!$rename){ print "something funky is going on"; } }else{ print "$old_file is not a valid directory"; }
  5. you would need a dynamic variable in your title tag.. Showing your code would be helpful...
  6. implementing thorpe's or my code, instead of using the die function and mysql_error(), if your query fails, simply output a custom error message to the user(s)
  7. well webstyles beat me to it 1. your arguments need to be wrapped in quotes, single or double 2. if that does not work, which it should, what is the error you receive besides "file does not exist"? 3. Are you running a windows or linux server?
  8. without seeing code it's hard to tell what will suit your needs here, but you will probably want something like this... $query = mysql_query($sql); if(!$sql){ die("There was a Mysql Error:<br />".mysql_error()); }else{ // run normal code }
  9. From what you said, you don't want the keys in alphabetical order here? My thoughts were to use ksort here and store the key into an array...not sure what exactly you are trying to do here. $myArray = array('Test' => 120, 'Tust' => 394, 'Lap' => 439493); ksort($myArray,SORT_REGULAR); foreach($myArray as $key => $value){ $arr[$key] = $value; }
  10. yes I'm not really sure at all what you are trying to accomplish with this code that you posted? Perhaps give a little more information on the matter..
  11. Everyone likes a little chafing, right?
  12. good point, didn't think to use pathinfo(), which would be a much better, cleaner solution here, thanks for that
  13. Free Corn Jobs to the first 100 customers..!
  14. you are setting the $filename variable to an empty string, then trying to use substr() to find the extension of the empty string. How do you expect this to work? You will want to utilize something like this instead.. <?php $upload_dir = 'upload/'; // Directory for file storing $preview_url = 'upload/'; $p_id = $_COOKIE["fn"]; $result = 'ERROR'; $result_msg = ''; $allowed_image = array ('image/png','image/gif', 'image/jpeg', 'image/jpg', 'image/pjpeg'); define('PICTURE_SIZE_ALLOWED', 2242880); // bytes if (isset($_FILES['picture'])) // file was send from browser { if ($_FILES['picture']['error'] == UPLOAD_ERR_OK) // no error { if (in_array($_FILES['picture']['type'], $allowed_image)) { if(filesize($_FILES['picture']['tmp_name']) <= PICTURE_SIZE_ALLOWED) // bytes { $prefile = md5($p_id); $file_name = $_FILES['picture']['name']; $explode = explode(".",$file_name); $ext = $explode[1]; $filename= $prefile"."$ext; move_uploaded_file($_FILES['picture']['tmp_name'], $upload_dir.$filename);
  15. do you receive any parse errors? In your functions, you are using ereg() which is deprecated and should no longer be used, user preg_match instead. Also, i would debug your query(s) using mysql_error()
  16. it is a ternary operator that doesn't seem to be necessary here, basically it checks if the variable $callback equates to TRUE, if it does, it will return $callback($i), if not, it will return $i.
  17. Do you have any code at all for this? You will most likely start this off but creating an HTML form for the users to fill out the necessary information that you require. Then you will want to use PHP to validate the user information, make sure that all of the necessary information is filled out, and if you so desire, store the information in a database for later use. I am not sure of your programming skills, thus I am not sure how you know about how to tackle what I have just stated, if you need further assistance, let us know.
  18. refer to the edit of my last post..
  19. I would recommend using empty instead of isset here, isset will return TRUE even if the variable is empty. Edit: going off of what Maq posted, somewhere in your code, where this array is generated is where you will want to look, your code should allow an empty array to even be created
  20. you will need to make sure that $rs_frd is an array
  21. has to do with joomla caching, this here might assist you
  22. depends on whether or not you have your custom function set to handle bool responses as an argument.... without seeing your custom function code, we can't know what's causing it not to work Edit: triple response here guys...
  23. no problem
  24. try adding these headers at the top of your page, these should prevent the page from caching your image, header("Expires: Mon, 17 Jul 2000 05:00:00 GMT"); header("Cache-Control: no-cache"); header("Pragma: no-cache");]
  25. note that this isn't a warning and will not affect your code, this notice is simply telling you that the index of user_id does not exist, and according to the function that you have, will return false.
×
×
  • 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.