Jump to content

sasa

Staff Alumni
  • Posts

    2,804
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by sasa

  1. you can put all of your page in function and then imclude it <?php function blah_blah(){ //your page here } blah_blah(); ?>
  2. can you var_export() your variables $group_seg, $events and $provider and post it
  3. <?php if(preg_match("/^[a-z0-9]+$/i", $str)) { //$str is valid } ?>
  4. <?php function my_array_check($in){ foreach ($in as $a) if (trim($a)) return true; return false; } //$_POST['contact_no'] = array('123','',' '); if (my_array_check($_POST['contact_no'])) echo 'some value'; else echo 'nothing'; ?>
  5. Failed opening '/home/rkrause5/public_html/adminpanel/func.php' in path i don't see Script folder
  6. try <?php print "The weather is ".file_get_contents("http://your_domain/toread.php"); ?>
  7. if (preg_match('/[^A-z0-9]/',trim($_POST['username']))) echo 'wrong'; else echo 'OK';
  8. $save = ($num1 % $num2) ? $num2 - ($num1 % $num2) : 0;
  9. try <?php $data ='<!-- Sample Data --> <input type="hidden" name="U2FsdGVkX18goKhw3PNp1hoNW1XtlDrynp2vpujLUk91T-mrCFgp_zPaHUQ0ntTK1qkDcubva4Y" value="test"> <input type="hidden" name="U2FsdGVkX185P0eiDtlWUsO1e5nu-uKU9zRVqCup_wQaMp55L082EJ9d1z8AGEd9bOEQRrJII0U" value="Test"> <input type="hidden" name="test" value="v335d"> <input type="hidden" name="postingKey" value="uLLKc4c9H4h5QZoe"> <input type="hidden" name="U2FsdGVkX1_tQgrdT02gqfhvLU9azdevjvwPNGRYZ1bLpPLQrw6n3Aq4q2uqoUC6" value="C"> <input type="hidden" name="U2FsdGVkX18L31E19JPgAISK-7vJbKFiOvwvOIL0ffYr-vWaUykl9OM7NOqr8cYz" value="Test"> <input type="hidden" name="FromEMail" value="samples@mydomain.net"> <input type="hidden" name="Type" value="B"> <input type="hidden" name="mix" value=""> <input type="hidden" name="contactEmail" value=""> <!-- End Sample Data --> '; preg_match_all('/<input.*?name="([^"]*)".*?value="([^"]*)"/is',$data,$out); $d = array_combine($out[1], $out[2]); print_r($d); ?>
  10. try to custom function function my_unique($array){ $k = array_keys($array); $r = array(); for ($i = 0; $i < count($k) - 1; $i++){ for ($j = $i + 1; $j < count($k); $j++){ if ($array[$k[$i]] == $array[$k[$j]]) $r[] = $j; } } $r = array_unique($r); foreach ($r as $k) unset($array[$k]); return $array; } $actions = my_unique($actions);
  11. just use $example = number_format($_POST['example']/3,2);
  12. mysqli commands isn't case sensitive, but keys of array is
  13. try print_r($row); to see is it formated right
  14. make script that create this part of page "USGS" and save it in local file when you need just include local file in your page
  15. ... while ($property = mysql_fetch_assoc($result)) { $price[]=$property; } print_r($price);
  16. <?php $test = 'Online Store'; if(ereg('^Store$',$test)) { echo 'yes'; } else { echo 'no'; } ?> or just <?php $test = 'Online Store'; if($test == 'Store') { echo 'yes'; } else { echo 'no'; } ?>
  17. <?php $a = 'rgr sasasaa test_param = "[insert wildcard character here] blah xxx"'; $b = 'test_param = "id-12345"'; echo preg_replace('/test_param = "\[.*?\]/', $b, $a); ?>
  18. number of subsets of set with n elements is 2^n (include empty set) no way to be less
  19. you don't set relatin on your tablese
×
×
  • 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.