Jump to content

S4C

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

S4C's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. :-\ thank  you! I forgot to look at the manual :|
  2. Well, i know how to use sockets: ) but i need to know how to send data: ) how it should be formated? In other words HOW BROWSER SENDS REQUEST TO SUBMIT FORM : ) My imagination  ;D example: [code]socket_write($socket, "SUBMIT whateverform POST[username]=whatever POST[password]");[/code] SUBMIT whateverform POST[username]=whatever POST[password] <- how should this look like ?
  3. :-[ So. I am trying to creat automatic www.baldonesis.lt shop item discription. the main idea: 1. My script connects thru socket to www.baldonesis.lt/shop/admin/ and automaticly logins.(im just an administrator, i have no premissions to servers php files : ( ) 2.If the session is created my "bot" checks all shop items and fills the describtion form: exaple: SHOP ITEM: ID blablabla Then i check my data file (whatever.txt) analyze it for blablabla and if its there i take its description adn submit it. then "bot" checks another shop item and try to do the same: ) I dont know if it was clear to understand. The main idea is that i dont know how to automaticly submit forms(login or whatever) thruu socket. Tanks for help. P.S Sorry for my english.
  4. Thanks a lot guys.  ;)
  5. Hmm how to be sure that my $_GET['page'] is really integer..? Thanks
  6. Hmm I think i know where the problem is! :O Could it be.. [code]<?php         // login.php include ("temp/constants.php"); function user_login($username, $pass) { $db = mysql_connect("localhost",DB_USER, DB_PASS) or die("Sorry news data base is not working.."); mysql_select_db(DB_NAME, $db) or die("Ooops.. DB is not working!"); $rec = mysql_query("SELECT * FROM `users` WHERE username='$username' AND pass='$pass'", $db); if (mysql_num_rows($rec) > 0) { $date =  date('Y-m-d H:i:s'); mysql_query("UPDATE users SET active='$date' WHERE username='$username'", $db); session_start(); $_SESSION['user'] = mysql_fetch_object($rec); $_SESSION['loged']= true; }; mysql_close(); };     if (isset($_POST['username']) && isset($_POST['pass']) ){ $username = $_POST['username']; $pass = $_POST['pass']; if ($pass != "") && ($username != "")) user_login ($username,$pass); }; if (isset($_SESSION['user'])) { $id = $_SESSION['user']->id; header ("location: index.php?cat=profile&user=$id"); // <---to his/her profile page } else header("location: index.php"); ?> [/code] [code]<?php   //patikriname ar vartotojas prisijunges if (!isset($_SESSION['loged'])) { print "<p align='center' class='Stil5'>Privalote prisijungti prie sistemos.</p>"; exit(); }; if (isset($_GET['user'])) { $user = user_info($_GET['user']); // Maby $user is the same as $_SESSION['user'] ? o_O } else exit();                 ..... ?> [/code] // Maby $user is the same as $_SESSION['user'] ? o_O if it is.. So if other user is 'loged' and im looking at his profile page i become $user = user_info($_GET['user']); MR JOHN :D 
  7. Hmm the code seems to be very similar to this: http://php.codenewbie.com/articles/php/1482/Login_With_Sessions-Page_1.html
  8. So i have one problem. Im developing web system for IRC community.. (ahh whatever :) ) problem: If lets say "John" and "Peter" is using my website at the same time.. Why does sessions variables exchanges.. I  mean John's $_SESSION['user'](object) becomes Peter's :| etc. :\ so wtf? What im doing  wrong? What I should do? Thanks a lot  ::)
×
×
  • 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.