Jump to content

birdie

Members
  • Posts

    65
  • Joined

  • Last visited

    Never

Everything posted by birdie

  1. birdie

    while

    Thanks! very helpful :)
  2. birdie

    while

    Thanks that helps. Actually, i am aiming to make a "Did you mean.." part for my search engine. Basically, it also checks for spelling mistakes. It would do this by .. while(num rows are more than 1) { ++ the value for $amount substr($word, 0, $amount) until there are no more rows } Hard to explain.
  3. birdie

    while

    [code] $amount = "0"; while($numrows > '0') { $amount++; $prefix4 = substr($word, 0, $amount); $sql = "SELECT * FROM ctrade_alpha WHERE phrase LIKE '$prefix4' ORDER BY times DESC LIMIT 1"; $query = mysql_query($sql); $numrows = mysql_num_rows($query); } [/code] Hi, i dont usually do while() like this so this is a new one. Any idea why this wont work? Ive saw loops that have code in the while() but i'm not sure how it exactly works? Thanks alot.
  4. Thanks that helps alot, i like the idea of "Did you mean.." because well i am a bit slim on content. I'll definitely overlook the <font>. Thanks again.
  5. Hey, domain is not codetraders.com yet, just need to change my current domain,etc. Anyway.. [url=http://88.104.222.165/beta/codetraders]http://88.104.222.165/beta/codetraders[/url] A search engine that enables users to share scripts/codes. Feel free to register on the test site and just have a little browse around. Points system to help prevent users that just take scripts/codes without giving anything. Points ++ for an upload which is downloaded. Points -- for a download. ps. search "php" or anything like that for my test result. Thanks for reading  :).
  6. oh wow thanks. I should have looked into that more. Sorry.
  7. oh i'm sorry if you miss understood this. I meant any html tags. Div was just an example $var could be.. <table> <div> <br> etc etc.
  8. i'm sorry, i meant var (variable)
  9. hi, i need desperate help because i have never done anything like this in php. My aim is to get rid of html tags from a var. $var = "<div align=center>hell</div>"; i found out that you could use regular expressions but dont know how to use them. I found <([A-Z][A-Z0-9]*)\b[^>]*>(.*?)</\1> which should work (probably). How do i use it exactly in preg_replace or anything else? Thanks  :)
  10. wow, its a good thing php code cannot be inserted into my database then..
  11. hi, i have a problem with using a database to store php information within html text. I would like to know whether there is an easier way than treating it like bbcode. Here is one example.. [code] $sql = "SELECT * FROM table"; $query = mysql_query($sql); $object = mysql_fetch_object($query); echo $object->field; [/code] Say this field had something like this in it.. [code] <html><p>Hello my name is <? echo "Birdie"; ?></p></html> [/code] Any way of echo'ing the information so that "hello my name is Birdie" is displayed instead of an exact copy of the example above? Thanks, i've never figured this out before.
  12. wow thanks for the quick posts, i'll try them all out :-)
  13. Hi, i know $_SERVER['http_user_agent'] provides 'browser' detection but it just doesnt work simply. Is there any way you can basically but this variable or another 1 which can do a relatively similiar action. Example of the script [code] $browser = $_SERVER['http_user_agent']; if(eregi('Firefox', $browser)) { $sql = "UPDATE sitestats_browser SET firefox='$firefox'"; } elseif(eregi('MSIE', $browser)) { $sql = "UPDATE sitestats_browser SET ie='$internetexplorer'"; } else { $sql = "UPDATE sitestats_browser SET other='$other'"; } [/code] Well this doesnt work because there are different versions of firefox. Any help please?
  14. Also, a file may have been included..
  15. you could probably get a few ideas off http://phpmailer.sourceforge.net/extending.html It has advanced attachment functions but relies on a sql server..
  16. Do you host your own files? is the php.ini data correct? Are you allowed to mail? Hope these questions help  ;D
  17. All info like that are stored in the $_SERVER variable. $_SERVER[HTTP_USER_AGENT] == users browser Hope that helped ;D
  18. i usually do, use a mainfile or include instead of just inputting it.. You could also probably verify its info by checking its original IP (from a db or whatever) and with the IP its using right now. For example... [code] $object = mysql_fetch_object($query); $dbip = $object->ip; if($dbip == $_SERVER['remote_addr']) { } else { exit("Not authorised.."); } [/code] maybe something like that?
  19. Its most probably a script which uploads the news to a database. Web editing to that amount, every day, would have to have 1 error in it. I dont think Yahoo would like having their site having errors all over it just because of one dodgey news post  :)
  20. http://www.php.net/fopen ? fputs? fwrite?
  21. wow ice age  :D. [code] <?PHP $B1 = $_POST['B1']; //var  =  a post var IF ($B1) {  // new add on since you last tryed?   echo "yes"; } ELSE {   echo "no"; } ?> [/code] Notice the { } to get the var $B1, you need to specify where it comes from as shown above
  22. SELECT * FROM table ORDER BY date DESC ?
  23. make a cron job, export the tables every year or so. Also, you could make it so that the script creates a new table if there are to many rows in the current one? easy job right?
  24. why dont u make a system on where.. User Clicks a location which is at 1st basically in order of which the locations were added or whatever. Once clicked, it updates and puts that location up on top. SELECT * FROM.. ORDER BY locationcount DESC locationcount could be an int where each time a location is selected.. [code] $sql = "SELECT * FROM tabe WHERE location='$location'"; $query = mysql_query($sql); $object = mysql_fetch_object($query); $currcount = $object->locationcount; $currcount++; $sql2 = "UPDATE table SET locationcount='$currcount' WHERE location='$location'"; mysql_query($sql2); //wow i really should stop doing code for no reason [/code] Hope that helps ;D
×
×
  • 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.