Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by roger01

  1. Hello, I'm trying to have a web page accessible only from inside an android app. I can make the app to provide a custom user agent. For example Mozilla/5.0 (MyAPP) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/ Mobile Safari/537.36 I need to edit the .htaccess file to deny all visitors, except the one with the "MyAPP" string in its user agent. I've tried using this: RewriteCond %{HTTP_USER_AGENT} ^.*MyAPP*$ RewriteRule .* - [L] RewriteRule .* http://mydomain.com/error.html [R,L] but i get all traffic sent to error.html, including the one from my app. What am I mi
  2. thank you. using ' would display (), but it worked with " " thank you again been struggling with this for a few hours now
  3. Hello So i have 0 knowledge in php, i just need to implement this captcha: i have a webserver php file which contains: $content .= "<some html code>"; i have the captcha code which looks like this: if (!class_exists('KeyCAPTCHA_CLASS')) { include('keycaptcha.php'); } $kc_o = new KeyCAPTCHA_CLASS(); echo $kc_o->render_js(); so far, the only way i've managed to make it display the captcha on the page is by doing this: $content .= "<first part of html code>"; if (!class_exists('KeyCAPTCHA_CLASS')) { include('keycaptcha.php'); } $kc_o = new KeyCAPTCHA_CLASS(); ech
  4. Hello I currently have this code: $timeBetweenClaims = 1800; $timeQuery = mysqli_query($conn, "SELECT * FROM users WHERE addy = '$userAddy'"); $timeResult = mysqli_fetch_assoc($timeQuery); $timeDif = $time - $timeResult['time']; $timeLeft = gmdate("i:s", $timeBetweenClaims - $timeDif); if($timeDif < $timeBetweenClaims){ $message = "Wait 30 minutes before posting. Timeleft: $timeLeft"; } how to make $timeLeft auto countdown til 0 so users don't have to refresh the page every few minutes to see the progress on timeleft? thank you!
  5. if i understand this correctly, this is for reading the columns, right? i've managed to gather something up to insert into the table by using this in insert.php: $ipaddy = mysqli_real_escape_string($link, $_SERVER['REMOTE_ADDR']); $btcaddy = mysqli_real_escape_string($link, $_POST['message']); $sql = "INSERT INTO contest_submissions (btc_address, ip_address) VALUES ('$ipaddy', '$btcaddy')"; if(mysqli_query($link, $sql)){ echo "Records added successfully."; } else{ echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); and <form actio
  6. yes, but i only used two columns: SELECT * FROM `contest_submissions` ; +-----------------------+------------------------------------+---------------+ | contest_submission_id | btc_address | ip_address | +-----------------------+------------------------------------+---------------+ | 1 | 1KZsSb1ZsQrB1FXzFdnhFL2GuPGTjUKLhi | | +-----------------------+------------------------------------+---------------+ 1 row in set (0.00 sec) oh, and i made botw btc_address and ip_aadress unique, i hope there won't be problems
  7. i know you are right. my php knowledge is next to 0 and i was trying to avoid the sql method because i have no idea how to do it and couldn't allow myself to ask here 'hey can someone write up a whole script for me?' so that's why i dogged that answer, not because i don't want to do. thank you for your answer, i've managed to get something really medieval working, getting the btc addresses in a txt and running a crontab every 5 minutes with uniq and awk that txt
  8. thank you for your answers! meanwhile, i got a lot of weird POST submissions so i came up with this (i found the code, actually): <?php session_start(); if (isset($_POST['message'])) { if (isset($_SESSION['token']) && $_POST['token'] == $_SESSION['token']) { $message = htmlentities($_POST['message']); $ipaddy = $_SERVER['REMOTE_ADDR']; $fp = fopen('./btcs.txt', 'a'); fwrite($fp, "$ipaddy $message <br /> \n"); fclose($fp); } } $token = md5(uniqid(rand(), true)); $_SESSION['token'] = $token; ?> <form metho
  9. Hello I want to run a contest on my website and i am asking visitors to post their names and BTC addresses and i'll use random.org's list randomizer to pick one from the list what i did so far: <?php if ($_POST) { $name = $_POST['commentName']; $txt = $_POST['commentBTC']; $handle = fopen("comments.html","a"); fwrite($handle, "<b>" . $name . "</b> : " . $txt . "<br/>"); fclose($handle); } ?> and ] <form action="" method="POST" onsubmit="return checkform(this);"> Some Name:
  • 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.