Jump to content

Roman Fedorov

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Everything posted by Roman Fedorov

  1. ahah actually you are right will keep that in mind, thanks!
  2. Hi all guys, i've made a website witch is a service to share your personal data (e.g. the email) in secure way on the web, in summary you insert the data, choose the captcha type, and the site gives you to code to share (text code, forum code, html code) where a user will get your data only after passing the captcha. This allow you to share you email for example on the forum without getting is scraped and spammed by bots. http://notbot.org/ What do you think about the site, and about the idea itself, usefull? Regards, Roman
  3. If you want to get titles of the objects containing both tags i can suggest you two ways: 1) you make a query that makes the INTERSECTION between the selection of titles of one keyword and the selection of titles of second keyword 2) use the query you are using, but group the query by title, and then put a condition count(*)=2 (the number of keywords)
  4. Hi, making the $friend['online'] = $online[friendname]; you overwrite always the same variable, so the only friend that you will return will be the last one. you should do $friend[] = $online[friendname]; and to print them use foreach statement in this case the function will return the array of the names
  5. Hi, probably because the parameters $die are supposed to start counting from 1. In php the arrays starts from 0, so the first element is [0 ], the second is [1] etc.. So if you pass the argument 2 meaning "the 2th element" you should do $array[2-1]
  6. What you can make is execute the sql query ordered by alfabetical order. Then start writing towns keeping in memory the first letter, when you see that the first letter changes - write it
  7. Hi, First of all your code is wrong because first you replace <, > chars with "&....;" and then you replace the "&" char, so it will replace also & that you put for < and > chars. And anyway i think that this function is what you are looking for: http://php.net/manual/en/function.htmlentities.php
  8. Use http://php.net/manual/en/function.mysql-num-rows.php to know how much rows you are going to write, then keep a counter variable, when it is 1 then write the "first" when it is the rows number write "last"
  9. Hi, the relative address changes on which folder you are in, "./" means THIS folder, "../" means one folder up So if you are in the same folder of index.php you can just write "./index.php" or simply "index.php" if the file is inside some other folder you should go up to the root folder, e.g. "../../index.php"
  10. Hi, you can do it as writing to any text file: http://php.net/manual/en/function.fwrite.php
  11. Hi, <? function table_exists ($table, $db) { $tables = mysql_list_tables ($db); while (list ($temp) = mysql_fetch_array ($tables)) { if ($temp == $table) { return TRUE; } } return FALSE; } /** How to use it **/ if (table_exists(test_table, my_database)) { echo"Yes the table is there."; } ?>
  12. $str = "Animal Kids Basic Hoody Blue"; if ( (strstr($str, "Kids") != false) && (strstr($str, "Hoody") != false) ) { //do something }
  13. The email can be classified as junk for a lot of reasons, starting with mail server being in the black list and finishing by the configuration of particular client anti-spam program.. For sure there are things you can do to decrease the probability of going your letters to spam, but you can never totally avoid it.. You should search some articles on this argument. I am not very informed in this argument, but as basic things i would advise to: - using a mail server, and not php mail() function - send emails in text mode and not html - avoid to sent attachments
  14. keep a counter with the number of images you have wrote. Once you finished writing database images, continue writing default images until the counter is 36
  15. Hi chrisran, you should just use an array, using $thiscode as the key, and incrementin the value: $query = "SELECT codes, status FROM table"; $codes = Array(); while ($row = mysql_fetch_assoc($result)) { $thiscodestring = $row[codes]; // looks like "a1 c2 d3 10 15 1 a1 a1"; $singlecodes = explode(" ", $thiscodestring); foreach($singlecodes as $thiscode) { $codes[$thiscode]++; } print_r($codes); }
  16. I guess your second code is not working cos you have added a foreach cycle, so the "continue;" function ends the iteration of new small foreach, and not the big one. Try with continue 2;
  17. Ehm.. the $rslt you are using i guess is not a string, thats why you cant process it with str_replace, it is a double array, and the print_r function you use prints the array structure. If you need to get the $ value you can just use $price = $rslt[0]['EARNINGS'];
  18. Hi, the pattern you wrote will search exactly the string "0-9", if you wanted to specify digits from 0 to 9 you should write "[0-9]" Anyway in your case try with $words = preg_replace("/\\(\\d.\\)/", "", $words);
  19. First of all, Hello all! I have this problem: I want to create an image sized perfectly to contain a specific text, so i use imagettfbbox function to find the width of the image, and then use imagettf starting from x=0 to draw the text. So for example something like print_r(imagettfbbox(50, 0, "./comic.ttf", "Hello")); On my server it returns So i consider the width of the text 149+1= 150, the problem is that 150 is actually the width of the text but only if you consider it from most left colored pixel to most right colored pixel. Cos when i make imagettftext starting from x=0 there is anyway a small offset to the right of some pixels before text starting, so the width i calculated is not enough, and it "cust out" my text. I tried the same line of code on other server and it gives me So in this case the width is 159-2=157 and this is exactly the width neccessary to contain my whole text, ofsets included! Any ideas on what my server is doing wrong, and how to fix it? (Font files are the same) Thank you Here is some info if you need it: My server (working wrong i suppose): And the other server (working cool):
×
×
  • 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.