Jump to content

QuickOldCar

Staff Alumni
  • Posts

    2,972
  • Joined

  • Last visited

  • Days Won

    28

Everything posted by QuickOldCar

  1. Jquery is a combination of javascript and ajax supposedly to make everything easier. As can see it's not, I'm not a jquery person myself, loads a huge library to do simple functions, buggy and unreliable.
  2. You can display any image a certain size by just setting the width or height to auto, then set a desired max-width or max-height and will fit there. If you actually want a smaller sized image would need to make a resize script keeping the image to the same scale and save the images. http://code.tutsplus.com/tutorials/image-resizing-made-easy-with-php--net-10362 https://github.com/JamesHeinrich/phpThumb
  3. I really hate ads, popups, spam and commercials

  4. http://php.net/manual/en/reserved.variables.get.php
  5. Could do with two if's and actually use the variable are setting, then echo after if($xcatname) { $query = "SELECT catdesc FROM `$t_cats` WHERE `catname` = '".$xcatname."'"; if ($resa = mysql_query($query)) { while($rowa = mysql_fetch_assoc($resa)){ $desc_msg = $rowa['catdesc']; } } } if($xsubcatname) { $query = "SELECT subdesc FROM `$t_subcats` WHERE `subcatname` = '".$xsubcatname."'"; if ($resa = mysql_query($query)) { while($rowa = mysql_fetch_assoc($resa)){ $desc_msg = $rowa['subdesc']; } } } if($desc_msg){ echo '<div id="showad-textbox">'.$desc_msg.'</div><br>'; } Shouldn't use the outdated mysql_ functions and use mysqli_ or pdo Should also escape or use prepared statements for anything inserted into queries. Another thing is that when you fetch an array it returns both the numerical index and associative array, double the data. If you do not need the numerical array use mysqli_fetch_assoc There are example codes there can look over. Any reason are using LIKE? I would assume your categories are specific since not doing a while loop, in that case can just use an = versus LIKE If using LIKE for searching... Firstly would be using a while loop for multiple results. % are for wildcards If did have categories with similar words would want to place a % in front and after the term so can find any similar that at least contains the term. "SELECT catdesc FROM `$t_cats` WHERE `catname` LIKE '%".$xcatname."%'" "SELECT subdesc FROM `$t_subcats` WHERE `subcatname`LIKE '%".$xsubcatname."%'" I personally like using full-text search in boolean mode, When you get to using multiple where/and , then also multiple columns, full-text simplifies the queries and additionally makes for very specific searches.
  6. Start using css and not tables. Create a wrapper for each row that can dynamically change via content within. Create dividers within those that can also dynamically change.
  7. An easy way to do it is double quotes outside and all singles within, at concatenation use double quotes and a decimal point. Or you can go through using backslashed double quotes. echo "<td width='100'><div align='center'><a href='Part_Color.php?PartID=".$row['PartID']."&Color_ID=" . $row['ColorID'] ."' style='text-decoration:none;'>".$row['PartID']."<br />";
  8. Additionally you should be doing the logic above and html below. You can't use header() if is any output on the page. Also $_SESSION['user'] could be undefined because does not always exist. Check for a session and if $_SESSION['user'] is actually set Not sure why are using js to log out, use the default session handler settings to expire or unset the users session
  9. Welcome to the forum samowns
  10. You should know is not very good for bookmarking or search engines. Unless you absolutely need to load dynamic content should not do this, instead use a paginated number system and single reference pages. Is a lot of people that disable js, don't rely on it. My biggest gripe is trying to see beyond a pile of content already seen using the "infinite" type loaders. You can just go to say page 20 of wanted to. Some sites you go to are loading a pile images for each one, by the time you click a pile of times now have one extremely large page using lots of bandwidth and memory. Reminds me of old single page blogger sites.
  11. Why are you manually installing apache when is amp stacks or native packages linux?
  12. Can use empty() and make sure nothing was added to the array. if(empty($error)){ //do something } else { //show errors }
  13. Are trying to use a variable that isn't set. php logic first and html display later check for if the $_POST['submit'] is set do mysql queries within the check for $_POST['submit'] and only if meets your requirements check if particular POST values are set, filter/sanitize/escape as needed never trust user input directly into queries, escape them first define variables outside the check for $_POST['submit'] if to reuse them back into form mysql_* functions are deprecated, should use mysqli_* and mysqli_real_escape_string or pdo and prepared statements
  14. They still use it but can improve it by also adding open graph data as well
  15. It's usually best to save a date of birth versus an age.
  16. Basically they do this so people can't copy their source files, should ask them permission and they give you some sort of access. Nobody here should assist in taking others content.
  17. You should look into a migration service to go from miva to opencart. cart2cart Not sure what are asking for in php, php isn't used in htaccess file, need to change some items in the script itself? As for htaccess rules, you can return the values of the parameters back as a variable back something like this RewriteRule /catalog/Screen/(.*)/Store_Code/(.*)/Product_Code/(.*) ?Screen=$1&Store_Code=$2&Product_Code=$3 [QSA]
  18. They use javascript to load player and also inject the video source. PHP does not parse javascript. You can manually get them using dom inspector though. <script> jwplayer("player-embed").setup({ height: '506', width: 'auto', sources: [ { file: "http://vtsstr4.sctv.vn/f1betalive2/c043_mb.smil/playlist.m3u8?t=c990873dd900fa5da3b30fb01bbd2f545d4648acf339e3a8eb18a487717a6a7b&e=1446519291" } ], autostart: 'true' }); </script>
  19. Going to give you the best advice. http://php.net/manual/en/pdo.prepared-statements.php
  20. $xml = simplexml_load_file($svgimage); $data = $xml->attributes(); printf("%s x %s", $data->width, $data->height);
  21. If you view the source of svg would see is an xml type file. <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1173.875px" height="594.142px" viewBox="0 0 1173.875 594.142" enable-background="new 0 0 1173.875 594.142" xml:space="preserve"> <path fill="#FFFFFF" stroke="#000000" stroke-width="2" stroke-miterlimit="10" d="M1147.098,198.556l-306-190c0,0-20-17-42,0 c-9.743,13.504-33.631,23.733-60.85,31.352l-1.056-11.608c-0.344-3.804-4.48-6.536-9.237-6.104L163.552,73.509 c-4.755,0.432-8.33,3.865-7.984,7.67l2.159,23.756c-60.039,5.679-103.227,9.563-109.629,9.621c-24.18,0.221-22.928,4.32-38,32 c-4.287,7.939-18.131,12.617,0,21c18.131,8.383,556,375,556,375s43.5,33,107,35c64.5,13.5,83.2,8,156,15s118-51,118-51 s180.5-203,213-261C1195.098,232.056,1147.098,198.556,1147.098,198.556z M285.098,195.056c-41,15-75.5,19.5-113,22 c-29.5,6-24-20-24-20s2.5-28.5,6-47s18-15,18-15s81-6.5,110,0C331.098,137.556,329.598,184.056,285.098,195.056z M631.598,255.056 c-14.359,0-26-11.641-26-26c0-14.359,11.641-26,26-26c14.359,0,26,11.641,26,26C657.598,243.415,645.957,255.056,631.598,255.056z" /> </svg> using simplexml be the best bet or can try using file_get_contents/curl and preg_match the svg tags content.
  22. So it is, is correct on profile page but not at posts.
  23. What is the value of $shopConfig['url'], it should be a local url
  24. People are the first computers.
×
×
  • 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.