Jump to content

hvandracas

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

About hvandracas

  • Birthday 06/23/1993

Contact Methods

  • Website URL
    http://wabal.hej.lt

Profile Information

  • Gender
    Male
  • Location
    Klaipėda, Lithuania

hvandracas's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Well, it's just a bookmark page for mobiles. The code: session.php (included); <?php ini_set('session.use_cookies', 0); ini_set('session.use_only_cookies', 0); ini_set('session.name', 'sid'); ini_set('session.auto_start', 0); ini_set('session.use_trans_sid', 1); session_start(); ?> The file, that checks variables in url <?php if (isset($_GET['userid'])) { $userid = preg_replace("[^0-9]", "", $_GET['userid']); } else { $userid = '0'; } if (isset($_GET['pass'])) { $password = mysqli_real_escape_string($db, $_GET['pass']); } else { $password = '0'; } if (!mysqli_num_rows(mysqli_query($db, "SELECT vartotojo_vardas FROM vartotojai WHERE userid = '$userid' AND slaptazodis = '$password'"))) { // id and password do not match } ?> ?>
  2. Well, my page contains a URL like file.php?userid=1&pass=passwordhashblablabla. I try to open the page on opera, mozilla, safari, google chrome and so browsers and it works fine. I get the message that id/pw match and user has logged in successfully. However, when I go to THE SAME url on IE, i get message that id/pw do not match. URL is still the same, history is cleaned... Thanks in advance.
  3. Well, if the page in the header is in the same folder as the page you're are being redirected from than it should work, however if it's not, than you should either use full path (http://...) or use other marks to mark the target file (for example ../page.php or folder/files/index.php).
  4. Check your database field where password hash is held. Maybe it is set to contain way less characters than needed.
  5. Well, i'd rather remain on PHP option... Although it's more messy,however, this is completely clear to me.
  6. Well, that's a lot of to do. So, i'll have to learn not only jQuery but JavaScript too.^^
  7. Good morning, I'm creating a content management system for my game. It's RPG style, so it contains many tasks, however, adding them is a bit complicated process and the system isn't simple. Therefore, simple web form is needed, but there are fields that depend on others. For instance, if quest type is k (which means killing task), a field asking how many different kinds of monsters need to be killed, then there should appear x fields with more specific information. To sum up, i need an example, advice or sth that would help me to create this type of html where new fields appear automatically depending on the chosen ones. Thanks in advance, Karolis
  8. "INSERT INTO table_name (field1, field2, ..., fieldn) VALUES ('value1', 'value2', ..., 'valuen')"
  9. 1) the field type is INT(4) 2) I'll try to.
  10. Okey, i have the query: SELECT * FROM inventory LEFT JOIN items ON (inventory.itemid = items.itemid) LEFT JOIN ginklai ON (items.lenta = 'ginklai' AND items.subid = ginklai.weaponid) LEFT JOIN itemdescs ON (itemdescs.descid = items.aprasymas) WHERE inventory.charid = '3' AND inventory.uzdetas = '0' AND ginklai.rusis <= '8' AND ginklai.rusis <> '0' AND ginklai.upgrade <> '0' AND items.lenta = 'ginklai' it evaluates 1 row as it should and everything's fine, BUT if i change the number ... ginklai.rusis <= '8' to ginklai.rusis <= '11' it shows no results.. I cannot understand why because both of them 8 and 11 are higher than ginklai.rusis (which is 2)
  11. I don't think this is correct: echo '<a href='$ts2'>'; it should be: echo '< href="'.$ts2.'">'; but maybe i'm mistaken.
  12. Well, i have another question. Now everything works fine, however, the same session url works on different machines when url is copied/pasted. I assume i have to check some information in order not to let copy/paste sids and login to other users. What are the best things to check? Just ip and browser? As the majority of my page users gonna use mobiles, their ip may be the same, phones too. Any other ideas am i wrong?
  13. I've already tried that. But when I include them, captcha image isn't shown. Found a solution. I had to change my form img element to this: <img id="captcha" src="captcha.php?sid='.session_id().'" /> Thanks a lot.
  14. Sure: $true_captcha = $_SESSION['randomnr2']; by the way, print_r($_SESSION); shows Array ( )
  15. Hello everybody, I am new to these forums and registered due to my problems which has been annoying me all the evening... I've been googling for 3 hours and still haven't found a proper answer. The situation is: I started to use session in my page. <?php ini_set('session.use_cookies', 0); ini_set('session.use_only_cookies', 0); ini_set('session.name', 'sid'); ini_set('session.auto_start', 0); ini_set('session.use_trans_sid', 1); session_start(); ?> these lines are included in, let's say, my register.php file. (please, don't recommend me cookies as i'm developing a site for mobiles) And then, there is a form: <?php echo '<form action="register.php?sid='.session_id().'" method="POST"> Įveskite kodą:<br/> <input class="input" type="text" name="captcha" maxlength="4"/><br/> <img id="captcha" src="captcha.php?sid='.session_id().'" /><br/> <input type="submit" name="submit" value="Registruotis" /><br/> </form>';?> although captcha is shown, when I submit the form and i have to check inputs I get this error: Notice: Undefined index: randomnr2 in C:\Program Files\EasyPHP-5.3.3.1\www\new\register.php on line 144 Well, my captcha.php file: <?php $randomnr = rand(1000, 9999); $_SESSION['randomnr2'] = $randomnr; $im = imagecreatetruecolor(100, 38); $white = imagecolorallocate($im, 255, 255, 255); $grey = imagecolorallocate($im, 150, 150, 150); $black = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 200, 35, $black); //path to font - this is just an example you can use any font you like: $font = dirName(__FILE__).'/font/karate/Karate.ttf'; imagettftext($im, 20, 4, 22, 30, $grey, $font, $randomnr); imagettftext($im, 20, 4, 15, 32, $white, $font, $randomnr); //prevent caching on client side: header("Expires: Wed, 1 Jan 1997 00:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header ("Content-type: image/gif"); imagegif($im); imagedestroy($im); ?> Any ideas? Thanks in advance.
×
×
  • 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.