QuickOldCar
Staff Alumni-
Posts
2,972 -
Joined
-
Last visited
-
Days Won
28
Everything posted by QuickOldCar
-
You can do a var dump to see what the array is and how to handle it http://www.php.net/manual/en/function.var-dump.php or print_r the array to see what it contains http://php.net/manual/en/function.print-r.php
-
You are best off taking a look here at a pagination tutorial. http://www.phpfreaks.com/tutorial/basic-pagination Since you only are doing a 1 result per page, I'm sure you can just create href links designating your page number, and adding substracting that page number by 1. Although this isn't the best way to do it.
-
easiest way I could come up with <?php $string = "DOLddmmyy.pdf"; $string_day = substr($string, 3, 2); $string_month = substr($string, 5, 2); $string_year = substr($string, 7, 2); $combine_strings = "$string_day/$string_month/$string_year"; echo $combine_strings; ?>
-
I totally agree with russel. You are looking for your own custom cms/content management system, along with some other advanced features incorporated into it. That's a very large complex project. Your html/css that you did would do little good for the project and buying a template is just for looks the same. My guess would be in the 8,000 to 10,000+ range depending on their skill level and completion time, or how desperate they need money and may be able to haggle a deal. And when I say + that could be in the range of 30,000+ for a large professional company doing it. I give this price thinking you will get a single developer or a very small team just trying to survive in this economy. I feel if you get any estimates for under 5,000 or so, either the developer seriously underestimated the job, never completed such a job, or maybe they already created a similar cms and can just add the features you require to it. Look into their profiles and see their work and references, most decent developers usually have their own websites. I myself would not take on such a project due to my time, but there are quite a few trusting and knowledgable developers that post in this forum.
-
http://php.net/manual/en/function.stripslashes.php
-
Use sessions. At the top of every page you start the session and check for logged in user. If are already logged in do nothing. If not a logged in user can then redirect them to a registration page. After registration redirect them back to either a login page, or the main page that contains a login.
-
All you have to do is a simple mysql select to retrieve all the labels for that comment. The result would already be an array, now apply this function to it.
-
Made this simple function up for you. If needs any more checking you can incorporate this. If your word results are not an array... explode them by it's delimiter and make it an array. <?php $words = array("awesome","boring","boring","awesome","awesome","boring","awesome","boring","awesome","worthless"); function topLabel($words){ if(is_array($words)){ $unique_count = array_count_values($words); arsort($unique_count); while (list ($word, $value) = each ($unique_count)) { $counted_array[] = $word; // $value } return $counted_array[0]; } else { return $words; } } //sample usage echo topLabel($words); ?> results: awesome
-
Both links work for me in firefox Use a 301 redirect through your .htaccess if would like to use just one. http://www.scriptalicious.com/blog/2009/04/redirecting-www-to-non-www-using-htaccess/
-
Gd and imagemagic could easily take an image of html. The hardest part is rendering it the same as a browser does. I use both firefox and Internet Explorer to take snapshots. For Firefox I use this free plugin http://pearlcrescent.com/products/pagesaver/ For IE I use a simple COM method http://php.net/manual/en/function.imagegrabwindow.php is quite a few ways and scripts made for doing this, I've found these 2 above work the best and most useful. What you are looking for is website snapshot, or thumbnail snapshot, something similar. Then resize/crop to what you need. some other similar ones webthumb http://www.boutell.com/webthumb/ iesnap - trial http://www.tonec.com/products/iesnap/index.html cutycapt http://cutycapt.sourceforge.net/ html snapshot - trial http://html-snapshot.en.softonic.com/ thumbs from websites and uses iecapt - no linux, windows only http://www.zubrag.com/scripts/website-thumbnail-generator.php is many others, and also online sites that can snap html images for you. here is the basics for doing it in linux Create a headless X server with something like Xvfb and virtual buffer. Open some sort of browser on that in-memory X window. for windows use com or printsceen fullscreen browser with no toolbars Screenshot the contents of that browser. Render that screenshot content out to some image format, I stick with png images. Save images with unique names using timestamp, or use md5 and keep track of the image names, I use a discovery method finding multiple common website urls, but thats just for what I do. If image doesn't then exist I snap one. Resize and crop image if needed
-
how to get the default checked value of a radio button using php
QuickOldCar replied to liomon41's topic in PHP Coding Help
You don't get the values of the checked POST until you send it in the form. Why not just use the value of $goal for what you need to do until they select something in the form. echo $goal; -
Is it possible to create a form using only PHP
QuickOldCar replied to Matt Ridge's topic in PHP Coding Help
Agree with Pikachu2000. You can display it however you would like, but even echoed it would still be html code...just wrapped in quotes and within php.. Can use html with breaking in and out of php easier. -
You render the final html any way you like and using w/e methods, then snapshot that as an image. should be able to render the menus as html, take a snapshot of them, and include the image to the clients site for display.
-
This will always be best done manually. Although there are some very complex image programs out there that may be able to do this, I don't believe is a free or usage effective script out there for this. I have seen ways of detecting the most used colors and if is an outer color can crop that, but a computer does not know which part of the image is the most important to you. While I see it may be possible using outlining of objects and group then as the alltogether center image, then use that as a base for center, this is well beyond simple programming. Here are some useful imagemagic scripts you may find useful though. http://www.fmwconcepts.com/imagemagick/innercrop/index.php
-
Tried out the code, although I have no use for phonetic matched ranks, maybe one day I will. Somewhere here I made a pile of similarity functions in ways that scored them , using metaphone, soundex, repitition of same words, and others to find similar occurances or to use for suggestions. Looks useful, thanks for the class. Ever try this with thousands or more of results?
-
try using localhost instead $con = mysql_connect('localhost','root','password'); or even $con = mysql_connect('example.com:3306','root','password'); or $con = mysql_connect('127.0.0.1:3306','root','password');
-
I guess you are looking for a "featured" article. If not you could always display just one of each category, and select by latest id or date.
-
If want a more advanced search I suggest using mysql fulltext search. http://dev.mysql.com/doc/refman/5.6/en/fulltext-search.html Be sure to read all about it. To use more words as search terms, you would explode the POST or GET array. In your case that would be $sub. You should also sanitize/escape any user input before it gets to your query. If would like to search in specific areas, use a form to select that area, and use a variable to dynamically change the column name in your query. example: instead of looking within title, look in description. If would like to use more advanced search techniques, use a multiple query in an if/elseif/else loop. Meaning exact phrase, at least one word, must contain, begins with, etc. I still recommend using the fulltext search but here is a way you can do it similar to what you are doing. $sub = $_GET['article']; $searchTerms = explode(' ', $sub); $searchWords = array(); foreach ($searchTerms as $searchwords) { $searchwords = trim($searchwords); if (!empty($searchwords)) { $searchWord[] = "title LIKE '%$searchwords%'"; } } $query2 = mysql_query("SELECT * FROM blog WHERE ".implode(' OR ', $searchWord).");
-
Follow this tutorial on pagination. http://www.phpfreaks.com/tutorial/basic-pagination
-
Either you are not making a connection to mysql database first, or it can not reconnect to it.
-
You can enable the multi manually, but they even make a plugin for this as well. http://wordpress.org/extend/plugins/wordpress-multi-site-enabler-plugin-v10/
-
All the features are built right into it off the start. Is an admin area with a wealth of options. Might as well mention the buddypress plugin for a more social type website. http://buddypress.org/
-
You can use wordpress and enable the multi blogs function, is a wealth of plugins to help you even do more with it. http://wordpress.org/
-
Here is an example select using as what ManiacDan suggested $result = mysql_query("SELECT * FROM table_name WHERE MATCH (column_name) AGAINST ('$trimmed_escaped_search_words' IN BOOLEAN MODE) ORDER BY ID DESC Limit $startrow,$posts_per_page"); Create an index an any columns used in the WHERE clause You could simply set the LIMIT to 100, you would not want all of them if many results, you should paginate the results. Can also lower the minimum word length for search results. http://dev.mysql.com/doc/refman/5.6/en/fulltext-fine-tuning.html Located in my.ini for MYSQL [mysqld] ft_min_word_len=3 then repair the tables after restart of the server REPAIR TABLE tbl_name QUICK; As for the $trimmed_escaped_search_words directly before each search word can be operators + stands for AND - stands for NOT [no operator] implies OR There are others, but the above are the most beneficial. http://dev.mysql.com/doc/refman/5.6/en/fulltext-boolean.html for reference on fulltext mysql search http://dev.mysql.com/doc/refman/5.6/en/fulltext-search.html
-
Can anyone tell me what encoding this is please?
QuickOldCar replied to n1kko's topic in PHP Coding Help
appears to be base64