Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. It all depends on what they have set in there ini file to how long the session will last. I don't see anything in their post that refers to wanting to log it...
  2. Here is a quick example <?php if (isset($_POST['submit'])){ $cost = 0; foreach ($_POST['chk'] as $val){ $cost = $cost + $val; } echo "Your total is $cost<p>"; } ?> <form method="post"> <input type="checkbox" name="chk[]" value="100">$100<br /> <input type="checkbox" name="chk[]" value="120">$120<br /> <input type="checkbox" name="chk[]" value="300">$300<br /> <input type="submit" name="submit"> </form>
  3. You can do this using sessions. Put this code at the top of your header page so it is executed each time the user clicks. <?php //No session set (first time user visited) if(empty($_SESSION['last_active'])){ //Set the Session $_SESSION['last_active'] = time(); } //Session set, but user not active for more than thirty minutes elseif(!empty($_SESSION['last_active']) && $_SESSION['last_active'] < time()-1800){ print "Your session timed out."; //Destroy the session $_SESSION['last_active'] = ''; exit; } //Session set, and the user has been active for under thirty minutes elseif(!empty($_SESSION['last_active']) && $_SESSION['last_active'] >= time()-1800){ //Update session with current time $_SESSION['last_active'] = time(); } ?>
  4. You need to setup a cron job. You can usually set them up from your hosts control panel. Some hosts don't offer these, so you need to check if they do or not. You can probably find loads of information on google if you search "cron job".
  5. You never really stated the problem. Whats up with this in your query? `TechHours`.`members` What exactly is the tables name? You also have a bunch of backslashes in there that don't need to be there.
  6. You have a few errors <?php $ip = $_SERVER['REMOTE_ADDR'];//variable ? $date = date("Y-m-d"); //variable ? $myFile = "log.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = $ip; fwrite($fh, $stringData); $stringData = $date; fwrite($fh, $stringData); fclose($fh); ?>
  7. Yes, there is a way. Your going to have to know how to get their IP address and the date $ip = $_SERVER['REMOTE_ADDR']; $date = date("Y-m-d"); Now your going to have to know how to write it to a file. http://www.tizag.com/phpT/filewrite.php
  8. I'm not completely sure about this, but you can try it. SELECT p.col1, p.col2 FROM posts p INNER JOIN open_posts o ON o.post_id = p.id
  9. Here are some good articles on it you can read up on to understand more http://www.tizag.com/mysqlTutorial/mysql-php-sql-injection.php http://www.netlobo.com/preventing_mysql_injection.html http://www.securiteam.com/securityreviews/5DP0N1P76E.html
  10. The most important function when it comes to sql injections is mysql_real_escape_string() http://www.php.net/mysql_real_escape_string You need to use that function on ALL variables you are using in any query.
  11. You shouldn't be putting quotes around the variables in your function. Change this $a->add_field('x_card_num', '$_GET[x_card_numx]'); // test successful visa $a->add_field('x_amount', '$_GET[x_amountx]'); $a->add_field('x_exp_date', '$_GET[x_exp_datex]'); // march of 2008 To $a->add_field('x_card_num', $_GET['x_card_numx']); // test successful visa $a->add_field('x_amount', $_GET['x_amountx']); $a->add_field('x_exp_date', $_GET['x_exp_datex']); // march of 2008 See if that does it for you.
  12. Here is a quick example <?php if (isset($_POST['submit'])){ echo $_POST['name']; } ?> <form action="script_name.php" method="post"> <input type="text" name="name"><br> <input type="submit" name="submit"> </form>
  13. Your right, I counted wrong. They do have 46 fields and 46 values...so they match. I'm not going to promise that I counted right the second time either though
  14. You have 45 fields listed here (ID, username, prun, password, firstname, prfn, lastname, prln, middlename, prmin, maidenname, prman, streetaddress1, prsa1, streetaddress2, prsa2, streetaddress3, prsa3, city, prcty, state, prst, country, prctr, zippostalcode, przpc, prefcontact, prpfc, homephone, prph, mobilephone, prpm, businessphone, prpb, email, prem, imc, primc, dateofbirth, prdob, lastvisitdate, statusmpg, validkey, validated, PIN, lastip) And you have 46 values listed here ('', '$username', '$prun', '', '$firstname', '$prfn', '$lastname', '$prln', '$middlename', '$prmin', '$maidenname', '$prman', '$streetaddress1', '$prsa1', '$streetaddress2', '$prsa2', '$streetaddress3', '$prsa3', '$city', '$prcty', '$state' '$prst', '$country', '$prctr', '$zippostalcode', '$przpc', '$prefcontact', '$prpfc', '$homephone', '$prph', '$mobilephone', '$prpm', '$businessphone' '$prpb', '$email', '$prem', '$imc', '$primc', '$dateofbirth', '$prdob', '', '', '', '', '', '') The numbers need to match. Maybe you put one too many null values to the end of the 2nd list? edit - Hah Barand, I sadly gave in and already counted >.>
  15. If you look, you will see the pattern in the query. Whenever you want to add something, just follow whats already there.
  16. I don't know what your field names are called that link the tables, but something like this. SELECT t.topic_id, t.topic_title, t.topic_views, t.topic_replies, u.user_avatar, p.post_time FROM phpbb_topics t LEFT JOIN phpbb_users u ON u.user_id = t.topic_poster LEFT JOIN phpbb_posts p ON p.poster_id = t.topic_poster ORDER BY t.topic_last_post_id DESC LIMIT 10
  17. Oops, sorry...I left that field out. SELECT t.topic_id, t.topic_title, t.topic_views, t.topic_replies, u.user_avatar FROM phpbb_topics t LEFT JOIN phpbb_users u ON u.user_id = t.topic_poster ORDER BY t.topic_last_post_id DESC LIMIT 10
  18. Try SELECT t.topic_id, t.topic_title, t.topic_views, t.topic_replies FROM phpbb_topics t LEFT JOIN phpbb_users u ON u.user_id = t.topic_poster ORDER BY t.topic_last_post_id DESC LIMIT 10
  19. I never see you define any of these variables $image3, $image4, $image5, $image6 Where are you defining them?
  20. It shows up the same for me in both browsers...
  21. Why do you want to remove any part of the ip address? You need the whole thing. You also shouldn't use LIKE in your query, because you want the exact IP. So change that to mysql_query("SELECT * FROM IPBanned WHERE IP = '$IP'");
  22. Try changing this line $arr = explode( $delim , $line); To $arr = explode( "$delim" , $line); I don't know if that will make the difference or not.
×
×
  • 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.