Jump to content

Daukan

Members
  • Posts

    180
  • Joined

  • Last visited

    Never

Everything posted by Daukan

  1. You should be able to set your mail settings in the php.ini file.
  2. You need to use mysql_real_escape_string() on the data before inserting it.
  3. The variable name use in the function argument is $cookloginID, The one use to test it is $cooklogin_ID
  4. You can give an argument in snmpwalk() to limit it to one try manual snmpwalk()
  5. Change this <?php if(isset($_COOKIE["array"]) && $_COOKIE["array"]=="two"){ setcookie("array", "one", time()+60*60*24*180); $get2 = $title2[array_rand($title2)]; $get3 = $img2[array_rand($image2)]; }else{ setcookie("array", "two", time()+60*60*24*180); $get2 = $title1[array_rand($title1)]; $get3 = $img1[array_rand($image1)]; } ?> To this <?php if(isset($_COOKIE["array"]) && $_COOKIE["array"]=="two"){ setcookie("array", "one", time()+60*60*24*180); $image = rand(1,count($image2) ); $get2 = $title2[$image]; $get3 = $img2[$image]; }else{ setcookie("array", "two", time()+60*60*24*180); $image = rand(1,count($image2) ) $get2 = $title2[$image]; $get3 = $img2[$image]; } ?>
  6. In your php.ini file make sure these are set to off. You don't have to anything in the http.conf file ; Magic quotes for incoming GET/POST/Cookie data. magic_quotes_gpc = Off ; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc. magic_quotes_runtime = Off ; Use Sybase-style magic quotes (escape ' with '' instead of \'). magic_quotes_sybase = Off
  7. It should throw a random 'Uninitialized string offset' error. The max value in the rand() function is larger than the amount of values in the $ANC array. It should be 25.
  8. Daukan

    Php Time

    Oops, that code logic won't actually work as is, and my edit time expired...
  9. Daukan

    Php Time

    Yeah if statements would work <?php //convert timepassed to days hours and mins $starttime = 1200213487; $timepassed = time() - $starttime; $days = ($timepassed-($timepassed%86400))/86400; $hours = floor( ($timepassed%86400)/3600 ); $mins = floor( ($timepassed%3600)/60 ); $seconds = $timepassed%60; if($days > 0) echo $days.':'; if($days > 0 && $hours > 0 ) echo $hours.':'; echo $mins.':'.$seconds; ?>
  10. Daukan

    Php Time

    If you only need days hours mins seconds you can do something like this <?php //convert timepassed to days hours and mins $starttime = 1200213497; $timepassed = time() - $starttime; $days = ($timepassed-($timepassed%86400))/86400; $timepassed = $timepassed - $days*86400; $hours = ($timepassed - ($timepassed%3600))/3600; $timepassed = $timepassed - $hours*3600; $mins = ($timepassed - ($timepassed%60))/60; $seconds = $timepassed%60; echo $days.':'.$hours.':'.$mins.':'.$seconds; ?>
  11. This looks like the problem is you didn't escape the quotes in the html echo "<td width="25%">{$row['title']}</td>"; Should be echo "<td width=\"25%\">{$row['title']}</td>"; Edit: Oops it posted for some reason instead of giving the reply warning ...
  12. Are you sure your not recalling GetCartId() after you try emptying the cookie
  13. He is an example, haven't tested it though <?php $hour = date('H');//hour 1-24 $dayofweek = date('N');//numeric day of week 1=mon, 7=sun if($hour < 9 || $hour > 16 || $dayofweek > 5) { echo 'Could not be logged in. Site is closed'; }else { //login code } ?>
  14. An array would do it probably. <?php $user['group'] = 'group2'; $GLOBALS['groups'] = array('group1', 'group2', 'group3', 'group4'); if(in_array($user['group'], $GLOBALS['groups']) ) { echo 'You are in a group'; } ?>
  15. In which case $group would need to be declared and defined prior to the define. Oh I assumed he was seeding $group via database or cookie. Either way that makes for some odd coding.
  16. You can do this <?php define('_GROUP1', $group == "Silver Member" ? "Silver Member" : "Gold Member"); ?>
  17. you cant really use a constant that but you can do this <?php if(defined('_GROUP1') ){ ?> edited: _GROUP1 needed to be wrapped in quotes
  18. setTimeout() only closes windows that were opened by javascript like a pop up. It can also be disabled. In firefox I get a message something like this: This window is trying to close. Do you want it to 'yes' , 'no'
  19. I would say the session id is important. You have to send the second page. With the all the form fields populated most likely.
  20. You can redirect to another page <?php header('Refresh: 5; url=index.html'); ?>
  21. Something like this maybe <?php switch($_GET['section']) { case 'register': $page = 'register.php'; break; case 'login': $page = 'login.php'; break; default: $page = 'main.php'; } ?> <iframe src="<?=$page;?>"></iframe>
  22. nl2br is a built in function in PHP to change new lines to breaks. str_replace should be able to add those <p> tags though. <?php $s = 'hello'."\n".'goodbye'."\n"; $formated_s = '<p class="SoftBreak">'.str_replace("\n", '</p><p class="SoftBreak">'."\n", $s)."</p>"; echo $formated_s; ?>
  23. You need to be absolutely sure there is not a cookie set. If you are using firefox and have 'web developer' tools installed you can see all the cookies set and their contents. IE you could set it to prompt you if a cookie is being set. The values for post need to be run through the function urlencode(), not the entire post string or it will change the ampersands which you don't want changed.
  24. You really need to read the manual on crypt(). Standard DES only uses the first 8 characters of text. If you are using this for passwords it is not good unless you get the salt in the correct format so it uses md5. You might just want to use php md5() function, its a lot simpler. Quoted from a reply found in the php manual for the crypt() function
  25. Here is a non regex way <?php $parts = explode(' ', '24 15/16 x 20 1/2 x 39'); $res = ''; foreach($parts as $k=>$v) { if(strstr($v, '/') ) $res .= ' <sup>'.$v.'</sup> '; else $res .= $v.' '; } echo $res; ?>
×
×
  • 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.