Jump to content

steviez

Members
  • Posts

    382
  • Joined

  • Last visited

    Never

About steviez

  • Birthday 12/09/1986

Profile Information

  • Gender
    Male
  • Location
    UK

steviez's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Fixed it for some reason I had to do this: if(preg_match('/'.$base.'/i', $url)){ return TRUE; }else{ return FALSE; } Thanks for all your help.
  2. to check im doing this: if(is_base_domain('http://www.mysite.com/') == TRUE){ // do function}
  3. Om using TRUE if the url is found to be the same... this is very strange how it wont work
  4. still no joy, its letting it go ahead
  5. Here is my code: public function is_base_domain($url) { // set base domain $base = $this->CI->core->config['base_url']; // http://www.mysite.com/ // match if(preg_match('/$base/i', $url)){ return TRUE; }else{ return FALSE; } }
  6. Thats the same code cant seem to get that to work.
  7. thats sort of what im looking for although the code you gave me does not work. Basicly if a user is on my site (www.mysite.com) and they try to shorten my sites domain (www.mysite.com) instead of an external site then it will return false. The script will work similar to tinyurl
  8. Hi, I am making a small URL service for my website and want to check if the user is trying to shorten my sites domain name so i can stop this from happening. I am thinking I would need to use PHP's preg_match function but dont quite know how to check for the above. Any help would be great on this. Thanks
  9. Hi, I have built a captcha system that saves the captcha to a temp folder with the file name captcha_CURRENT_TIME_STAMP where CURRENT_TIME_STAMP is the unix time. I want to delete images older than 5mins old by reading the time stamp on the file name. My question is this: How can i loop through the image folder and read the time stamps on the file name and delete all images older than 5mins? Thanks
  10. Hi, I have a site where users can choose languages they speak and they have the option to add more. They are selected from drop down boxes and have a level select box next to each. I am using jquery's clone function to do the job and all works fine apart from the fact that it clones the selected fields of the one above too.. My question is this: is there any way to remove the selected attribute from the cloned field? My code is this: $(document).ready(function() { $("#lang_add").click(function() { $("#lang_fields > p:first-child").clone(true).appendTo("#lang_fields"); return false; }); $("#lang_fields #lang_remove").click(function() { $(this).parent().remove(); }); $("#lang_remove").click(function() { $(this).parent().remove(); }); });
  11. You sir are a life saver! thank you so much
  12. yes it is... except i wanted the results as: {"LANG1":["German","Beginner"],"LANG2":["Polish","Advanced"]} I changed it as i thought it might get more complicated if not
  13. that gives me: {"lang":["german","polish","english","blaaaa"],"level":["2","4","1","3"]} and i need: {"german":"2","polish":"4", "english":"1","blaaaa":"3"}
  14. well at the moment with 4 of each field selected i get: Array ( [lang] => Array ( [0] => german [1] => polish [2] => english [3] => blaaaa ) [level] => Array ( [0] => 2 [1] => 4 [2] => 1 [3] => 3 ) )
  15. Sorry i should have said that i am already using this function but cant get the result i need. My code is this: if(isset($_POST)) { foreach($_POST as $key => $val) { echo json_encode(array($key => array($val['lang'], $val['level']))); } } but it does not output the required: {"LANG1":["German","Beginner"],"LANG2":["Polish","Advanced"]}
×
×
  • 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.