Jump to content

dcro2

Members
  • Posts

    489
  • Joined

  • Last visited

    Never

Everything posted by dcro2

  1. It seems a little strange that you would use the same SQL result for both echoing user info and then looping through ratings. What does the information in this table look like? Is there really more than one row where usr=$member?
  2. Let me google that for you, and that.
  3. 'f_name' is still part of the $row array even if you use it like that, so this would work: $results[$row['f_name']] = $row['user_id'];
  4. And you can get how much free space you have with disk_free_space.
  5. There's probably a more intuitive way but whatever. foreach($test as $name => $arr) { $tmp = array_shift($arr); //get first element of $test[$name], which is always $test[$name]['0'] in your example sort($tmp); $result[$name] = $tmp[0]; } print_r($result); Array ( [abcd] => 10 [efgh] => 3 )
  6. Then start commenting things out until it works. Change those short open tags (<?) to <?php to start.
  7. error_reporting(0); ini_set('display_errors', 1); Put it at the top and try again.
  8. It probably has nothing to do with the version, but with their settings. Like if short_open_tag is enabled for instance.
  9. Couldn't you just make a column `confirmed` you could set to 1 instead of having two tables? That's more like what this forum does.
  10. Have you tried running the query directly on the server, with phpmyadmin for example? SELECT * FROM usr_test WHERE usr = 'username' AND pass = MD5('password') Have you done any debugging to find out if the username and password are what you expect at the end? Have you checked for any mysql_errors if the query fails in your PHP script?
  11. You were supposed to put in your own table and column names there, I don't know what they are...
  12. No, you have to put it outside the function. Just make a new line before the end tag (?>) and insert it there.
  13. I just realized what's going on with the two selects on that page haha. Let's say we were going to insert these values into the database. You would store all the values in variables and then insert it into the query which inserts a row in the database. The fields in your first code don't match up here so I'm making this up. This goes in submit_add_tenant.php: $forename = mysql_real_escape_string($_POST['tenForename']); $surname = mysql_real_escape_string($_POST['tenSurname']); $tenSuitablePostcodes = mysql_real_escape_string(implode(',', $_POST['tenSuitablePostcodes'])); $sql = "INSERT INTO table (`tenForename`, `tenSurname`, `tenSuitablePostcodes`) VALUES ('$forename', '$surname', '$tenSuitablePostcodes')"; $res = mysql_query($sql); Your second select would need to be renamed into <select id="box2View" multiple="multiple" size="3" name="tenSuitablePostcodes[]">
  14. A simple way could be to add if(!empty($_GET['p']) && !empty($menu[$_GET['p']])) $title = $menu[$_GET['p']]; anywhere before the title gets echoed, like at the bottom of menu.php.
  15. Same principle, just name the <select> "box1View[]" and $_POST['box1View'] will be an array. <select name="box1View[]" id="box1View" multiple="multiple" size="3"> EDIT: $box1View = implode(',', $_POST['box1View']);
  16. You'll have to adapt the PHP file to just display all records. Without the code it's hard to do.
  17. Where is $totalxp being set? PS: this: while(list($points)=mysql_fetch_row($playerspoints)) { $userpoints = $points; } can be simplified to: $userpoints = mysql_result($playerspoints, 0);
  18. If you name your checkboxes "tenCode[]" like an array, then $_POST['tenCode'] will also be an array containing the values of the checkboxes that were selected. For example, <input type="checkbox" name="tenCode[]" value="pare1"> <input type="checkbox" name="tenCode[]" value="pare2"> <input type="checkbox" name="tenCode[]" value="pare3"> <input type="checkbox" name="tenCode[]" value="pare4"> <input type="checkbox" name="tenCode[]" value="pare5"> results in $_POST = Array ( [tenCode] => Array ( [0] => pare1 [1] => pare3 ) ) How you choose to store that is up to you. You could for example store them separated by a comma or semicolon using implode. $tenCode = implode(';', $_POST['tenCode']);
  19. I would change my email password if I were you.
  20. $unread = imap_search($mbox, 'UNSEEN'); $unreadNum = count($unread); Lots of tutorials out there about PHP and IMAP.
  21. Works for me. $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; .NET4.0E; .NET CLR 1.1.4322)"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_PROXY, "202.182.124.12:3128"); // curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txtt"); curl_setopt($ch, CURLOPT_URL, "https://www.google.com"); $page = curl_exec($ch); echo $page; echo curl_error($ch); What error do you get now?
  22. Andy-H, go make an account at powrhost.com and see for yourself. They have port 993 blocked. I ran this and got a timeout: <?php error_reporting(-1); fsockopen("imap.gmail.com", 993, $errorno, $errstr); echo "$errorno $errstr"; ?>
  23. Like I said before, take out this line: curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); This proxy doesn't need it.
  24. Don't set CURLOPT_HTTPPROXYTUNNEL. Take out that line.
×
×
  • 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.