Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. The force is no longer with me. I cannot read the code from here =\
  2. There are experts on this board? Since when ???
  3. Well perhaps why it is redirecting to the root is this problem: action="/<?php echo $_SERVER['PHP_SELF']; ?> Should be: action="<?php echo $_SERVER['PHP_SELF']; ?> I did not look at the rest of the code, so there could be other issues.
  4. You will have to make sure you modify the max post size as well and the limit would be how much disk space your server / computer can hold. I am not sure if downloaded files also get stored in memory, but that could also be a limitation.
  5. Try using two seperate renames, one for the parent folder and one for the sub and see if it works. If it does then yea, your problem is it cannot be done all at once. I would consider this normal behavior.
  6. http://www.garnetchaney.com/htaccess_tips_and_tricks.shtml Search for "Protecting Single File" on that page for examples.
  7. array_search This code snippet came from a user comments: function recursiveArraySearch($haystack, $needle, $index = null) { $aIt = new RecursiveArrayIterator($haystack); $it = new RecursiveIteratorIterator($aIt); while($it->valid()) { if (((isset($index) AND ($it->key() == $index)) OR (!isset($index))) AND ($it->current() == $needle)) { return $aIt->key(); } $it->next(); } return false; } To use with your situation (given that you define the function in your code: $rowIndex = recursiveArraySearch($array, '2', 'patientid'); print_r($array[$rowIndex]); Side note: I have no clue where toon was going at, but yea. I think he missed the point.
  8. $query = "SELECT * FROM adverts WHERE align = 'hor' order by rand() LIMIT 1"; $result = mysql_query($query) or trigger_error("Adverts query failed Error: " mysql_error()); $banner = mysql_fetch_assoc($result) or trigger_error("Unable to fetch Adverts Result"); echo $banner['code']; Should work for random images using MySQL rand() function.
  9. www.mysite.com/<?php str_replace(":", "", wp_title('', true, 'right')); ?> Given that it returns the title and not echos the title. If it echos it, either find a function that returns it, or use output buffering ob_start to grab it by creating your own function for it. Not being a WP Guru, yea.
  10. Oh.. echo str_replace(array("\n", "\r"), "", preg_replace("/Disp(.*)/i","$1_",$string)); Should sort it.
  11. Right, let's use a depreciated, or being depreciated function (IE ereg). Here is the corrected preg equivalent: if (preg_match('~[^A-Z0-9]~i', $text)) { echo "This has non alpha numeric characters"; }
  12. The plus operator tends to concat in javascript. Perhaps try to convert the value to a float before adding, using parseFloat
  13. Why not just do a str_replace on the string before or after to remove the newlines? echo str_replace("\n", "", preg_replace("/Disp(.*)/i","$1_",$string)); Simplistic as that.
  14. Look into the curl_setopt function, particularly: CURLOPT_FOLLOWLOCATION
  15. Well given the error: Warning: file_get_contents(email_addressestxt) I would say you are missing a . in your actual code before the txt.
  16. Ran this: <?php $string = 'Disp "Weight:" Disp X/Y'; echo preg_replace("/Disp(.*)/i","$1_",$string); ?> Got this: "Weight:"_ X/Y_ You need to check your code and make sure you are updating the right file etc.
  17. preg_replace("/Disp(.*)/i","$1_",$string) Should work.
  18. Using that matching expression posted in the preg_replace, use it in preg_match and viola, you have the first url matched. Simple as that.
  19. http://www.phpfreaks.com/forums/index.php?topic=294975.0 Sometimes a search of the forums works wonders. You will also find many other topics in the regex section overing this.
  20. Well, what you are doing can be a major security risk if done improperly. Is yoursite.com your actual site that you are trying to do this on? If so the following would probably work: $_GET['page'] = isset($_GET['page'])?$_GET['page']:'index'; // ternary operator acts as a short if / else $validPages = array('about', 'home', 'members', 'index'); // etc etc if (!in_array($_GET['page'], $validPages)) { $_GET['page'] = "index"; } include('index.php'); Should be a secure way of doing it, if you are in-deed working on the site the URL points to.
  21. If you figured it out, you should post the solution to help others who find this problem via search.
  22. Well, if the jQuery accesses the data via a php script, use ucwords. Or you can use this function: http://phpjs.org/functions/ucwords:569 and it should work.
  23. If you are on 4.3.2 I would go with Cake or CI as ZF I believe only works with php 5.2+. If you can wing it though, ZF is my preferred framework.
  24. $string = 'Hello, my name is otto!'; $string = str_replace("o", '<span style="color: yellow;">o</span>', $string); echo $string;
×
×
  • 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.