Jump to content

Destramic

Members
  • Posts

    960
  • Joined

  • Last visited

Everything posted by Destramic

  1. can you post your page please?
  2. i had a quick look through and saw that you arew calling a function before it has been set.. put: connectDB(); after: function connectDB() { $db_connection = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD); mysql_select_db (DB_NAME); } same with your getRows function...
  3. i basically want to make a cron where it will dump my tables at midnight every night to my computer not web server!. The cron is not the concern, but how would i get the dump sent to my computer? is this possible? many thanks Ricky
  4. you want to use mysql create a table users ----------------- user_id username password ---------------- login.php <?php $username = $_POST['username']; $password = md5($_POST['password']); $query = "SELECT username, password FROM users WHERE username = '".$username."' AND password = '".$password."'"; $result = mysql_result($query) $count = mysql_num_rows($result); $row = mysql_fetch_array($result); if ($count > 0) { session_start(); $_SESSION['username'] = $row['username']; $_SESSION['password'] = $row['password']; $_SESSION['user_id'] = $row['user_id']; } else { echo "Login details incorrect.<br \>\n"; } ?> logout.php <?php session_start(); unset($_SESSION['username']); unset($_SESSION['password']); unset($_SESSION['user_id']); session_destroy(); ?> index.php <?php if (isset($_SESSION['username']) && isset($_SESSION['password'])) { echo "control panel here!<br />\n"; } ?> this should work...just written it up now...very simple way of doing thinks which can be adapted upon..any problems give me a shout Ricky
  5. try putting it in capitals [code[ <?php define("IMAGE_ROOT", "/web/d2/w/mysite/mysite.com/images/"); $imageurl = IMAGE_ROOT . $myrow['image']; ?>
  6. does anyone know how this is done? im thinking i dont know how to do this.... i dont know what file format to save the file as and where? any pointers?
  7. so this would work? i dont understand where and what file format i should save it as? localhost@21 # cat /etc/crontab SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ 0 0 * * * root mysql_backup.php ricky
  8. basically i want a automated script that on a certian time (00:00) it will send sql tables to my computer so i have a backup? Ricky
  9. bah i thought this could simply be done via date_default_timezone_set($time_zone); have a page which could help me out?
  10. shouldnt that work out the hours? $hours = round(($time / 60) / 60, 2);
  11. i would change the time zone using this function date_default_timezone_set($time_zone); all the timezones would come from the database, i have a colum which tells me the users timezone and then i change the time zone accordingly
  12. basically if $time_zone = "umt" or something different i want the time to show up in that time zone.
  13. im trying to format a timestamp, for instance if date is today then it will return today then [time] and if date is yesterdays date then it will return it...I want it to work in different time zones, but im having a bit of trouble gettin it all together and working...can somone have a look and gove me some pointers? <?php timestamp_format($timestamp, $format = “d/m/Y G: i:s T”, $time_zone = “GMT”) { date_default_timezone_set($time_zone); $timestamp = expload(“ “, date($format, $timestamp)); $yesterdays_date = ; $todays_date = date($format, $timestamp[0]); if ($timestamp[0] == $todays_date) { $date = “Today at ” . $timestamp[1]; } else if () { $date = “Yesterday at ” .$timestamp[1]; } else { $date = $timestamp[0] . $timestamp[1]; } return $date; } ?> thanks ricky
  14. just wondering how to do this....i see done on alot of website? Ricky
  15. im not sure what the best think is to do for what i need? would this work? users ------------------ user_id clan_id username password email icon access 'clan', 'admin' -------------------- and if access = admin then i would leave clan_id blank? can someone give me some id on how this should work?
  16. is there a away i can join both users and admin table and check both tables for a certian user and pass?
  17. but i also want to store information about clan that admin users wont need...?
  18. would i be able to join both tables and select a user ? is that possible?
  19. I’m making a website where there will be an administration panel if having access as an admin and a clan login which will have different options and access’. I want to make an auth in OOP but I’m trying to find the best way of doing it? Both admin and clan users will be created in different tables to make it easier… Eg: Admin table ------------- Administration_id Username Password Email ------------- Users table User_id Clan_id (which will link me to their profile) Username Password What will be the best way of doing this with oop? Ricky
  20. hey im just wondering how to get the session id within the url? example: index.php?session_id=456n45l6j7567l67j5675j7 ... i could simply do it this way but im sure there is a simpler way.. <?php $session_id = session_id(); echo "<a href=/"index.php?session_id=".session_id."/" title=/"Home/">Home</a>"; thanks Ricky
  21. im selecting rows from my database but i want to put it into group/category displaying into a drop down list <select></select> so everything begining with the letter C in one category having a label at the top etc.. C - counter-stike : source c&c 3 D- Delta Forece 2 ... Ricky
  22. sorry...lol i mean, everytime a <div> tag is used i seems to use a <br> straight afterwards....any way of stoping this?
  23. is there anyway of not having a page break automatically with a <div> tag? thanks ricky
×
×
  • 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.