Jump to content

steviez

Members
  • Posts

    382
  • Joined

  • Last visited

    Never

Everything posted by steviez

  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"]}
  16. Hi, I have two select boxes on my site like this: Language - Level and the user can keep adding more sets of select boxes. I need the data posted to be JSON encoded like this: {"LANG1":["German","Beginner"],"LANG2":["Polish","Advanced"]} etc How can i make this happen?
  17. not sure if it will solve it but header(Location: index.php?m=undefined&do=".$_GET['do']); Should be header("Location: index.php?m=undefined&do=".$_GET['do']);
  18. its going through a php script
  19. Hi, I have noticed that when a file is downloaded from my site a user cannot access the site until the download has finished... What could cause this? I have tried several ways on file download in php and all cause the same thing. Any idea? Thanks
  20. Hi, I am adding some code to my file host site to allow people to mirror their file to hotfile. So far my cod is: preg_match('http://hotfile.com/dl', $files['file_name'], $result); $dll = $result[0]; With my code above i cant get a link for my uploaded file, the links on hotfiles page are in input tags. What am i doing wrong?
  21. thats the same code as above
  22. hi, thanks for your help. That seems to work as i need it but how would i get this to work in a html table to display data for each month? Thanks
  23. I need it to display all the months that have gone up to the current month, then as we move on a month it adds that too
  24. Hi, I am making a form to track users earning for the current year and need it to display the months gone all the way up to the current month then auto add each month after that I have searched all over google but cant seem to find any help, anyone got any ideas? Thanks
  25. Hi, I am working on a new feature for my download site where users will get a certain ammount of cash per 1000 download of a file how can i make it so that the cash ammount only gets added every 1000 downloads? for example $6 per 1000 downloads So far my code looks like: if($file['file_size'] >= 5242880 && $file['downloads'] >= 1000) { // update database and add earnings mysql_query("UPDATE uploads SET earnings = earnings+".$config['file_earnings_5_50']." WHERE file_id = '".$file['file_id']."'"); } Any help would be great!
×
×
  • 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.