Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. in that case your need to check where your getting $file from as its $file = "spreadsheet"; not $file = "spreadsheet.xls";
  2. sprintf EG <?php $R = range(2,10); $folder = array(); foreach ($R as $V) { $V= sprintf("%02s",$V); //add the 0 for the 1to9 if(is_dir($V)) { $folder[] = $V; echo "FOUND: $V<br>"; }else{ echo "NOT FOUND: $V<br>"; } } echo "<pre>"; print_r($folder) ?> EDIT: missed a / on the comment
  3. does the downloaded file have the extension .xls ? if so then its a problem on the client (downloaders) PC ie office not installed
  4. htmlspecialchars encode html you want to decode html try html_entity_decode() ie echo html_entity_decode("&#1587;&#1604;&#1575;&#1605;");
  5. even if the folders are missing ? what do you mean by "get directories" i assumed to meant get the names of all existing directories within a range
  6. benjamin_1 please create a New Thread in the PHP Help Section. Also please use the Code tag (# button) also redirect to where ?
  7. So if for example, if you have folder 1 2 5 6 9 10 11 and done dirrange(2,10) you want it to return 2 5 6 9 10 right ? if so you could try something like this <?php $R = range(2,10); $folder = array(); $Path = "path/to/folders/"; foreach ($R as $V) { if(is_dir($Path.$V)) $folder[] = $V; } echo "<pre>"; print_r($folder) ?>
  8. Okay the Idea behind my madness method is for every title the user gets a new record so when you get the users details (including UserdefinedDetails) your will get more than 1 record. example <?php //Normal stuff $UserID = 10; $query = "SELECT * FROM users WHERE ID = $UserID"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); echo $row['Name']; //Now UserdefinedDetails $query = "SELECT * FROM UserdefinedDetails WHERE UserID = $UserID"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { echo $row['uTitle']." - ".$row['uValue']."<br>"; } ?> for the user to add a title just INSERT into `UserdefinedDetails` making sure you also set the UserID
  9. I did want to help, but not anymore good luck
  10. thats because you are doing 2 queries.. put them into one and it will be fine I would really need to see a little more code but assume the fetch from the catalogue query goes to $row.. ie <?php $rowsPerPage = 6; $pageNum = 1; if(isset($_GET['page'])) { $pageNum = $_GET['page']; } $offset = ($pageNum - 1) * $rowsPerPage; $self = $_SERVER['PHP_SELF']; $catalogue_query = "SELECT COUNT(Product_ID) AS numrows, Product_ID, Genus, Division FROM products"; if (isset($_GET['Genus'])) { $catalogue_query .=" WHERE Genus = '" .mysql_real_escape_string($_GET['Genus']). "'"; } if (isset($_GET['Division'])) { $catalogue_query .=" AND Division = '" .mysql_real_escape_string($_GET['Division']). "'"; } $catalogue_query .= " ORDER BY Product_ID DESC LIMIT $offset, $rowsPerPage"; $result = mysql_query($catalogue_query) or die('Error, query failed'); $row = mysql_fetch_array($result, MYSQL_ASSOC); $numrows = $row['numrows']; $maxPage = ceil($numrows/$rowsPerPage); echo " Showing page $pageNum of $maxPage pages "; ?>
  11. center the table in the page or center the contents of the table ? Also this is a HTML problem not PHP, please you the correct section
  12. Thanks for letting us know.. but theirs no question.. so why post that in PHP Help ?
  13. update if ($player['skype'] == "n/a") { to if ($player['skype'] == "n/a" || empty($player['skype'])) { and check the results but without more info/code it hard for us to say
  14. <?php ob_start(); $cookieCheck = setcookie("BoardTest","cookie",time()+3600); include("header.php"); $u = $_POST['u']; $p = $_POST['p']; $check = mysql_num_rows(mysql_query("SELECT * FROM `members` WHERE `username`='$u' AND `password`='$p'")); if($check==1) { if($cookieCheck) { ob_end_clean(); setcookie("BoardW",$u,time()+3600); Header("Location: index.php"); } else { print "Cant set cookie!"; } } else { print "User/Pass mismatch!"; } include("footer.php"); ?>
  15. try this.. if possible post a short encrypted and decrypted file from silverlight for testing. <?php $plaintext = aes_128_decrypt($data, $key); function aes_128_decrypt($encrypted_text,$password) { $size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); $iv = mcrypt_create_iv($size, MCRYPT_DEV_RANDOM); preg_match('/([\x20-\x7E]*)/',mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $password, pack("H*", $encrypted_text), MCRYPT_MODE_ECB, $iv), $a); return $a[0]; } ?>
  16. try this <?php include_once("../config.php"); $u = $_POST['u']; $p = $_POST['p']; $check = mysql_num_rows(mysql_query("SELECT * FROM `members` WHERE `username`='$u' AND `password`='$p'")); if($check==1) { if(setcookie("BoardW",$u,time()+3600)) { Header("Location: index.php"); } else { $msg ="Cant set cookie!"; } } else { $msg ="User/Pass mismatch!"; } include("header.php"); echo $msg; include("footer.php"); ?>
  17. I don't think their is a solution.. due to the fact you are creating a conflict! tracking anonymous users.. if you can identify them then they are not anonymous ! personally i think you are going to need them to register an email or allow only 1 vote per IP but even then that can be spoofed (as with creating multiple emails).. I guess you could add some image verfications to make it a longer process..
  18. also check ./paths.php for output..
  19. Well their is nothing wrong with the if statement but if you was planning to extend it you could use an array or something instead ie <?php $discounts = array( 100=>15, 10=>5, 50=>10 ); asort($discounts); $allproducts = $tireqty + $oilqty + $sparkqty; foreach($discounts as $Q => $D) { if($allproducts>=$Q) { $discount = $D; continue; } } echo $discount; ?> So if you wanted to add 20% discount for 500 or over you only have to add 500=>20 to the array ie $discounts = array( 500=>20, 100=>15, 10=>5, 50=>10 ); But as i said it is fine as it is
  20. correct Referrer will be blank
  21. and they can't just have a hash of nothing due to the if($hash != '') to unsolve a post click solved again ??? Happy 1000 post ratcateme
  22. referrer isn't much good really but the logs on the site to are re-directing people to will appear as if they the people entred the site directly (via the address bar) NOTE: I have not done my own testing on this (so i am not 100% sure) but it should be as described, of course if someone tell them they was directed from your site then theirs not much you can do lol
  23. I think your missing the call option "?call" $skypepic = "<a href='skype:$skypename?call'><img border='1' src='images/skype.gif' align='absmiddle' alt='skypename' /></a>"; also hover other the link and check the url is correct ie skype:MadTechi?call if you don't see the number then we probablt need more code
  24. if you don't normally use header then you may want to create a redirect page, as you can't have any thing displayed before the header ie <?php header("location: {$_GET['url']}"); ?>
  25. Will work but theirs probably a better way $HTTP_HOST = preg_replace('/^www\./i', '', $_SERVER['HTTP_HOST']); echo $HTTP_HOST;
×
×
  • 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.