Jump to content

QuickOldCar

Staff Alumni
  • Posts

    2,972
  • Joined

  • Last visited

  • Days Won

    28

Everything posted by QuickOldCar

  1. It's more like whoever is your host is very limiting in what you can do, the services you pay for. "as it was causing a high load on the server", so it was using too much cpu and possibly memory in their eyes. All that is shared across the server depending on how many users they are renting to. This is a very common issue, you get what you pay for, and sometimes not even that.
  2. I tried your code and I see both colors, not sure why it wouldn't work for you. Some things you should know: The <font> tag is deprecated in HTML 4, and removed from HTML5. The World Wide Web Consortium (W3C) has removed the <font> tag from its recommendations. In HTML 4, style sheets (CSS) should be used to define the layout and display properties for many HTML elements. You should be using full php tags and not short, use <?php versus <? A few helpful places to start learning css: http://www.w3.org/Style/Examples/011/firstcss.en.html http://www.tizag.com/cssT/ http://www.csstutorial.net/ http://htmlhelp.com/reference/css/ http://www.alistapart.com/topics/code/css/ http://www.cssbasics.com/ http://meyerweb.com/eric/css/ http://www.456bereastreet.com/archive/categories/css/ http://www.htmldog.com/ http://www.barelyfitz.com/screencast/html-training/css/positioning/ http://www.w3schools.com/css/default.asp
  3. http://php.net/manual/en/function.file-exists.php if(file_exists($mysql_image)){ echo "<img src='$mysql_image' />"; } else { echo $mysql_bus_name; }
  4. Pearl crescent is a good free plugin for taking screenshots and resizing for firefox http://pearlcrescent.com/products/pagesaver/ Is options in the plugin. Or to automate it. for instance using psexec must accept eula first time use it psexec -accepteula C:\Program Files\Mozilla Firefox\firefox.exe -savepng http://www.aol.com/ exec("Psexec.exe -i -d C:\Program Files\Mozilla Firefox\firefox.exe -savepng $url -savedelay 3000"); Is a windows app called webshot, also free http://www.websitescreenshots.com/ I prefer to use pearl for taking nice shots, can use adblock and other plugins for nicer ones, the webshot can do single or from a list of urls, but sadly uses ie, so it will throw out some bad sites or white shots sometimes, for the mopst part can do a lot quickly. I've done exec scripts that just open firefox windows and snap them with pearl Is also the com method which can exec ie http://www.php.net/manual/en/function.imagegrabwindow.php or http://www.php.net/manual/en/function.imagegrabscreen.php Whichever methods you pick to get the intial image, you could further manipulate them with gd or imagemagik If you browsed my old posts i have more information and even some better example codes for automating the screenshots. Here is a post with more info for programs and how to make your own thumbnailer snapshots http://www.phpfreaks.com/forums/index.php?topic=352033.msg1662293#msg1662293
  5. Should rename it simple mp3 hosting, it doesn't do other audio types.
  6. I guess it's time to make some snippets on securing forms and user input, then integrate those snippets into your demo's.
  7. well this would get the highest, but you mentioned longest, also i forgot the decimal in the regex, so can add it to the other if the highest is fine for you. anyway, here is to find the longest, just one of many ways. <?php $string = "asdfasd234.987654324567kjljlkjlj34659823423sadfasdadasdfasdfas d3242sdasddsda2"; function longestNumber($string){ $numbers = preg_replace("/[^0-9.]/", ' ',$string); $num_array = explode(" ",trim($numbers)); $longest = ''; foreach($num_array as $number){ if(strlen($number) > strlen($longest)){ $longest = $number; } } return $longest; } echo longestNumber($string); ?>
  8. This works. <?php $string = "asdfasd234kjljlkjlj34659823423sadfasdadasdfasdfas d3242sdasddsda2"; function highestNumber($string){ $numbers = preg_replace("/[^0-9]/", ' ',$string); return max(explode(" ",trim($numbers))); } echo highestNumber($string); ?>
  9. Using javascript on them can control them in many ways. http://www.quirksmode.org/js/popup.html
  10. Have a look at this pagination tutorial and try to integrate it. http://www.phpfreaks.com/tutorial/basic-pagination You are only ever going to get 5 results because you LIMIT them to 5 in the query need the pagination above and limits would be LIMIT $offset, $rowsperpage, the page numbers would then designate where the startrow/offset is and how many rows per page to display
  11. Place this towards top of your script error_reporting(E_ALL); ini_set("display_errors", 1);
  12. You are missing additional mysql functions for displaying the data. $q1 = mysql_query("SELECT * FROM `shop` WHERE `x`='".$x["x"]."' AND `y`='".$x["y"]."' AND `z`='".$x["z"]."' AND `plane`='".$x["plane"]."'") or die("qry failed: ".mysql_error()); while($row = mysql_fetch_array($q1)) { // echo out the contents of each row echo $row['id']."<br />"; echo $row['name']."<br />"; echo $row['x']."<br />"; echo $row['y']."<br />"; echo $row['z']."<br />"; echo $row['plane']."<br />"; }
  13. Try editing your ft_min_word_len=4 to a lower amount in /etc/my.cnf or /etc/mysql/my.cnf After you change this you must repair the indexes on that table REPAIR TABLE table_name QUICK;//edit to your table name
  14. There are some pagination classes out there if look for them. Many of them would query and fetch all the results each time, then just display x amount of them. Thats not a very efficient way to do it, imagine having 2 million records being fetched for every page when only showing around 10 results. If you just get the count of your specific query, and then split those up by x amount, and fetch just those is much faster and efficient. You are better off following the tutorial, but i did make my own pagination, and 2 different types of navigation, if need help understanding how it works. The simple one and can set to any amount per page. http://get.blogdns.com/paginate More advanced with jumping x amount ahead or back, hard set to 10 results per page http://get.blogdns.com/dynaindex/paginate
  15. Just as Teynon said, need a delimiter, http://php.net/manual/en/regexp.reference.delimiters.php preg_match_all( "/(.*)\.com/", $result, $output, PREG_SET_ORDER ); preg_match_all( "@(.*)\.com@", $result, $output, PREG_SET_ORDER ); preg_match_all( "~(.*)\.com~", $result, $output, PREG_SET_ORDER );
  16. This can get you in the right direction. http://www.phpfreaks.com/tutorial/basic-pagination
  17. You are using $_POST for the form and $_GET for the script, I looked at your source. I typed some queries in the address bar for that script and got this. Notice: There was an error. Unknown column 'simages' in 'field list' SQL Was: SELECT simages, sLocation, sNumberofbedrooms, sdescription FROM Properties WHERE `simages` LIKE '%Chapel Allerton%' ORDER BY `sLocation` in /home/a2221438/public_html/insert.php on line 76 Some items I noticed from your form to your script: I see no type of a post or get value coming from your form that you use to check $_GET['search'] In the form your location dropdown is not named location, name="location" Change your form to get, make sure everything in your form has a name and value, I never space my name values for get requests, usually something like Property Location I would make property_location. Be sure those columns and fields are in your database are named the same in the script
  18. If you can display your form for the search that would be great. But going to guess that you are using $_POST for the form, and your script is looking for $_GET http://www.tizag.com/phpT/postget.php
  19. If are doing a coding site with tutorials, maybe should highlight the code. There is php's highlight_file() and highlight_string() but that's only good for php really. There is a pear package called Text_Highlighter which supports : ABAP, C++, CSS, output of diff(1), DTD, HTML, Java, Javascript, MySQL, Perl, PHP, Python, Ruby, sh, SQL, VBScript, XML Then you have GeSHi - Generic Syntax Highlighter which supports around 35 languages, the long list of them are in the sidebar to the left.
  20. It's a cool looking site. Maybe if set the content area all the same size, even if has less content, just center it or something, the floating and very empty page just doesn't look right. The text on your about me page is chopped off at the bottom. I feel this can all be done better with a css stylesheet.
  21. http://dev.mysql.com/doc/refman/5.6/en/fulltext-boolean.html I use Boolean Full-Text Searches, you insert all your search terms together into the query statement. EXACT PHRASE wrapped with double quotes "word" OR just words with spaces word word AND words with a + means must contain +word MUST CONTAIN multiple + words would narrow the search down more to contain just those words +word +word EXCLUDE words with a - would exclude that word word -word or can do combinations "word word" +word -word There are more but these above are the most useful So to your answer, if you did +dragon +roost or even +roost +dragon , that would get you the desired results the same What i do is explode the search terms, if not within quotes....add a + in front of each, but only if there is not already a - or + in front of it. you can try my simple search out http://dynaindex.com/search.php?s=listen+free+music+-gospel If you wanted to get complex, in my full Index I use multiple mysql queries in if/else statements depending on what the user selects in the form, is a default query using must contain if none selected Here is the query I use in my simple search $trimmed_words is my search terms (all get a plus placed before each word, except the dashes) $exlusions is an array of words I never want to see within the results, all use a -word So I just add a string of words and use this as my safe filter if($filter == "off"){ $exlusions = ''; } else { $exlusions = " -sex -sexy -nude -nudity";//and piles more } $result = mysql_query("SELECT * FROM posts WHERE status='publish' AND MATCH (title,post_content) AGAINST ('$trimmed_words$exlusions' IN BOOLEAN MODE) GROUP BY ID ASC Limit $startrow,$posts_per_page"); Be sure to look over the manual about making indexes in mysql, minimum word lengths, stopwords
  22. Make a phpinfo page each site and compare to see what is different. <?php phpinfo();?>
  23. You could wrap the whole thing checking if isset and also not a blank value Would be of no use to run the query with empty values if (isset($_POST['selected_messages']) && $_POST['selected_messages'] !=''){ //execute code here only if is good } else { echo "No Message"; //die("No message"); }
  24. I see, well this particular page is the search script...the place you want to send them to. You would want to place a hyperlink somewhere other than this page, like in your index file, or within your sites main theme If sent your index file, or your themes main page, would be easier to see a good place. But you just need to place a link that looks exactly like this somewhere. if is not within php code <a href="http://catalog.ncpl.lib.oh.us/polaris/search/">Search our Catalog</a> if is within php code echo "<a href='http://catalog.ncpl.lib.oh.us/polaris/search/'>Search our Catalog</a>"; I do see a search link already there that leads to this address just called Search http://catalog.ncpl.lib.oh.us/polaris/search/default.aspx?ctx=3.1033.0.0.3&type=Default I guess would have to be more specific in where you would like the link to be added, because I already see a link there.
  25. Going to try and explain easiest way i can. If is wrapped with double quotes, you must use single quotes within, or escape the double quote " with a backslash \" //same window echo "<a href='http://my-link.com/'>click me</a>"; echo "<br />"; echo "<a href=\"http://my-link.com/\">click me</a>"; echo "<br />"; //new window echo "<a href='http://my-link.com/' target='_blank'>click me</a>"; echo "<br />"; echo "<a href=\"http://my-link.com/\" target=\"_blank\">click me</a>";
×
×
  • 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.