Jump to content

apol

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male

apol's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi list, I have installed libssh2 on my apache2 server. I have written this script: <?php $connection = ssh2_connect('10.0.0.10', 22); if (ssh2_auth_password($connection, 'admin', 'apolyxrono')) { echo "Authentication Successful!\n"; } else { die('Authentication Failed...'); } if(!($stream=ssh2_exec($connection, 'configure'))) echo "<br>configure-false"; ?> end always it prints: Authentication Successful! configure-false' ....What am i doing wrong? I don 't know a lot from ssh thanks a lot
  2. Hi everyone , I want to poll some network devices (AccessPoints) and retrieve some values. But i want to do periodicaly(every 2 min) from a php script. Then after a period i want to display this values on a graph in the same script. How can i do this? Does php5 support SNMPV3 or SNMPV2 ? Which is the best library to use for creating graphs with php? I Know JpGraph and gd . Does anyone know a better library to use for graphs? thanks
  3. 1.User fill in and submit sign_in_form.php 2. sign_in_check.php check if submited form is valid (userName & passwd)     if (form is valid)           redirect user to the index.php page     else           echo 'not valid inputs...'; How can i do the redirection? thanks
  4. [quote author=Gruzin link=topic=111180.msg450386#msg450386 date=1160563711] ok, try to check if the session is set, something like this: [code]<?php session_start(); if(isset($_SESSION['userPass'])){ ?> ...some code.. <?php } else{ header ('Location: index.php'); // check if session is not set redirect to login page } ?> </body> </html>[/code] [/quote] I changed it to that : <?php session_start(); if(isset($_SESSION['adminPass'])&&$_SESSION['adminPass']!='go'){ header("Location: http://localhost/project/forms/display/sign_in_form.php"); exit(); } ?> and if click one time the Back button it inserts me in the system index page....I am confused....
  5. [quote author=Gruzin link=topic=111180.msg450380#msg450380 date=1160562599] Can I see the code of that page which sets the session again? [/quote] Sorry this is the page...: <?php session_start(); if($_SESSION['adminPass']!="go"){ /* if (isset($_COOKIE[session_name()])) {   setcookie(session_name(), '', 0, '/'); } session_destroy(); */ header("Location: http://localhost/project/forms/display/sign_in_form.php"); exit(); } ?> some html followes thanks
  6. [quote author=Gruzin link=topic=111180.msg450374#msg450374 date=1160561962] As I understand you need to make a log out function, correct? you don't need to check if(isset), just wrtite something like this and it will delete the last session: [code]<?php session_start(); session_destroy(); header("Location: http://localhost/project/forms/display/sign_in_form.php"); ?>[/code] [/quote] I did it but the problem remains. I checked the session it has deleted when i press sig_out link but when i press 2 times browsers (IE) Back button it creates the session again...I can't understand why this is happening.
  7. 1. User submit a from with his "userName" and his "password". 2. "sign_in_check.php" checks if user exist in the data base and if exist then set : $_SESSION['userPass']="go"; 3. When user want to sign out the sign_out.php file executed when user click on sign_out link, follows the sign_out.php: <?php     session_start();     $_SESSION[]=array();     if (isset($_COOKIE[session_name()])) {               setcookie(session_name(), '', 0, '/');     }     session_unset();     session_destroy();     header("Location: http://localhost/project/forms/display/sign_in_form.php");     exit(); ?> Is this logic will work ? Because when i am sign_in in my system with a valid userName & passwd and after i sign_out from the system if i press 2 times Back button in the IE browser it creates  the session again and displayes me the system index page again. I am using to send form fields the $_GET variable and wamp5. Does anyone have any idea? thanks
  8. [quote author=Hi I Am Timbo link=topic=110511.msg446839#msg446839 date=1159990506] how are you checking to see if they are logged in? if you browse to a page in a fresh browser window after a restart, does it let you in? [/quote] About the first question: // Create and execute sql query $sql = "select * from users  where userName = '$_POST[usrName]' and passwd = '$_POST[passwd]'"; $this->result = mysql_query($sql,$link) or die(mysql_error()); // Find out how many rows returned from the query $num_result = mysql_num_rows ($this->result); if($num_result == 1){ " Valid user..." } else{                                  " Not valid user..."                 } About the 2nd question : If i browse from a fresh browser window it doesn't let me in. Thanks for your time....any idea will be usefull.
  9. [quote author=Hi I Am Timbo link=topic=110511.msg446829#msg446829 date=1159989596] Is the previous page just the login page?  If you hit refresh, it likely reposts the form you submited, relogging you in.  If you login, browse a couple of pages, logout, then it back, I bet it won't be logged in. [/quote] I try it byt the problem still exist!!! thanks
  10. Hi, I have a problem with sessions which i describe below: 1) I have a form (form.php) with 2 fields 1-->userName 2--->passwd. 2) User fill in the form and submit it. 3) The form_check.php file starts a session and proccess the requested form, if the form fields are valid then i set this $_SESSION['userPass']="go"; 4) When user decides to log-out  press log_out link and the log_out.php is executed. 5) Here is the log_out.php: <?php session_start(); $_SESSION[]=array(); if (isset($_COOKIE[session_name()])) {   setcookie(session_name(), '', 0, '/'); } session_unset(); session_destroy(); ?> and some html follows... I have checked the session and it has destroyed. But when i press Back button of Internet Explorer it saids me that if i press F5 or Refresh i could see the page i requested. And i am doing that, and the page appears, i also ckecked the session and it has created again. Why is that happening? How could i avoid it? I am confused... Thanks a lot Adreas
  11. [quote author=ProjectFear link=topic=110461.msg446558#msg446558 date=1159955797] are you red-directing the user after they logout. i suggest you re-direct them to a confirmation page for the logout or something. [/quote] I try to redirect( with headers() function right? ) the user to the log_in page but the problem still exists?
  12. [quote author=ponsho link=topic=110461.msg446559#msg446559 date=1159956118] Maybe the problem is that when you press back you are trying to go to the page where you have just login so you are creating the session again. [/quote] Yes that is the main problem but how could i avoid it?
  13. Hi, I have a problem with sessions or browser which i describe below: 1) I have a form (form.php) with 2 text fields 1-->userName 2--->passwd. 2) User fill in the form and submit it. 3) The form_check.php file starts a session and proccess the requested form, if the form fields are valid then i set this $_SESSION['userPass']="go"; 4) When user decides to log-out  press log_out link and the log_out.php is executed. 5) Here is the log_out.php: <?php session_start(); $_SESSION[]=array(); if (isset($_COOKIE[session_name()])) {   setcookie(session_name(), '', 0, '/'); } session_unset(); session_destroy(); ?> and some html follows... ----------------------------------------- I checked the session(after user log_out) and it has destroyed. But when i press Back button of Internet Explorer it saids me that if i press F5 or Refresh button i could see the requsting page. And i am doing that, and the page appears, i also ckecked the session and it has created again. Why is that happening? How could i avoid it? I am confused... Thanks a lot Adreas
×
×
  • 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.