Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. You are never calling the send email method: $text_email = new Text_email($to, $subject, $body, $header); $text_email->sendEmail(); ?>
  2. You did change "table" to your actual table name. The above is a rough example. If this still confuses you, go find a MySQL/PHP Tutorial as suggested earlier, as it shows you have never tried one before.
  3. $sql = mysql_query("SELECT * FROM table WHERE username='$username'"); $fetch = mysql_fetch_assoc($sql); $name = $fetch['name_of_person']; echo $name;
  4. You do realize that the first 1 through 4 will counteract anything else. As nothing else would "mount to true". If $var is between 1 and 4 is not going to be 0 or greater than 750...Basically you only need the greater than 1 and the less than 4.
  5. Well, I am still very confused. Why have multiple arrays like that? Why shuffle like you are shuffleing ??? How about this, given the code you posted above, what do you expect $result and $result2 to be after it has ran.... EDIT: Not sure if this is what you want, but maybe it is: <?php $numbers = array(10, 20, 30, 40, 50, 60); $number = 25; $rounded = ($number / 10); $nearest = ($number - $rounded); $key = array_search($nearest); echo "The nearest to {$number} is {$nearest} which returned a key of {$key} which is the value {$numbers[$key]}."; ?>
  6. Then your table is setup wrong. Post your table structure and note:
  7. <?php $whatever = array(10, 20); $whatever2 = array(30, 40); $number = array_merge($whatever, $whatever2); $tenKey = array_search(10, $number); $thirtyKey = array_search(30, $number); echo "The 10 is at {$tenkey} and returns {$number[$tenKey]}<br />The 30 is at {$thirtyKey} and returns {$number[$tenkey]}"; ?> Without more information, that is what I gather that you want to return. But I am just guessing here as I cannot fully see what you are trying to do.
  8. What exactly are you trying to do? Why are you not group the numbers in the proper arrays?
  9. Why would you want it global? There is no reason, just use it like you have: $password = generatePassword(); That is the point of functions, I would remove the echo $password in the function, as you do not need to echo it.
  10. You could read the manual on it to find out. <?php $whatever = array(10, 20); $whatever2 = array(30, 40); $number = array_merge($whatever, $whatever2); $randomKey = array_rand($number); echo $number[$randomKey]; ?> As far as I can tell, that is what you are ultimately after.
  11. array_rand Is that what you are after?
  12. explode $string = "info@test.com"; list(,$domain) = explode("@", $string);
  13. $sql = "SELECT * FROM cocktails WHERE name LIKE '{$get_letter}%' ORDER BY name "; Try that.
  14. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"> Notice that in the code before it was 100? and now it is 100% that should fix the issue (or change it to what it should be.)
  15. Your not using session_start at the top of your code where you wish to use sessions. This is a requirement on any page sessions are to be used. It must be placed at the top before any output is sent to the browser.
  16. $sql3="INSERT INTO `kf`.`order` (`order_id` ,`cust_id`,`order_date`,`order_status`,`order_total`) VALUES ('','".$cust_id."','".$today."','".$status."','".$order_tot."')"; You have it set to "0" in your sql query. Change it to '' (as seen above) and it should work.
  17. checkdnsrr
  18. No, html is not that strict. It would not validate for xhtml, however with the first one. All you did was change from uppercase to lower and added the / which in no way effects HTML other than making it validate with W3C standards for XHtml.
  19. premiso

    read pdf

    If the pdf is unencrypted and not an image, you should be able to read it like a normal text file. If it is an image, you need to use OCR technology to read it.
  20. Looks like you got it.
  21. mysql_query($query) or die("SQL WAS {$query}<br />Error Was:" . mysql_error()); Replace that line and report back the error (if any).
  22. Correction to Michdd: mysql_query("INSERT INTO featuremini (`id` ,`title` ,`cap` ,`imagename` ,`imagedir`) VALUES ('', '{$_GET['title']}', '{$_GET['cap']}', '$realname', 'featureimage/$imgname')");
  23. Short answer, you cannot. As the session hash is held on their computer. Long answer, you can if you set each user's session id in the DB in a "sessions" table. Once you log someone else out you pull out that record then you would most likely have to manually delete that file from the sessions folder. The other option is, you do the similar thing with the DB, but instead of you pulling it out, set an item in there that is "logout" if that is set to true the next time that user loads a page you check that entry and if it is set, you log them out. Those are the only ways I can think of, the "logout" field in the session table of the DB would probably be the best way to go.
  24. I take it that you are on Linux, but if on windows Alternatively you should be able to use chmod after the directory call to set the mode.
  25. Honestly the credit goes to the preg_match user comments section. I simply copy and pasted.
×
×
  • 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.